api-hal-interrupt.h 909 B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include <stm32wbxx_ll_tim.h>
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /** Timer ISR */
  7. typedef void (*ApiHalInterruptISR)();
  8. /** Initialize interrupt subsystem */
  9. void api_hal_interrupt_init();
  10. /** Set DMA Channel ISR
  11. * We don't clear interrupt flags for you, do it by your self.
  12. * @param dma - DMA instance
  13. * @param channel - DMA channel
  14. * @param isr - your interrupt service routine or use NULL to clear
  15. */
  16. void api_hal_interrupt_set_dma_channel_isr(DMA_TypeDef* dma, uint32_t channel, ApiHalInterruptISR isr);
  17. /** Set Timer ISR
  18. * By default ISR is serviced by ST HAL. Use this function to override it.
  19. * We don't clear interrupt flags for you, do it by your self.
  20. * @param timer - timer instance
  21. * @param isr - your interrupt service routine or use NULL to clear
  22. */
  23. void api_hal_interrupt_set_timer_isr(TIM_TypeDef *timer, ApiHalInterruptISR isr);
  24. #ifdef __cplusplus
  25. }
  26. #endif