hdl_interrupt.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /******************************************************************//**
  2. * @file hdl_interrupt.h
  3. * @brief USART driver of RT-Thread RTOS for EFM32
  4. * COPYRIGHT (C) 2011, RT-Thread Development Team
  5. * @author onelife
  6. * @version 0.4 beta
  7. **********************************************************************
  8. * @section License
  9. * The license and distribution terms for this file may be found in the file LICENSE in this
  10. * distribution or at http://www.rt-thread.org/license/LICENSE
  11. **********************************************************************
  12. * @section Change Logs
  13. * Date Author Notes
  14. * 2010-12-29 onelife Initial creation for EFM32
  15. *********************************************************************/
  16. #ifndef __HDL_INTERRUPT_H__
  17. #define __HDL_INTERRUPT_H__
  18. /* Includes ------------------------------------------------------------------*/
  19. /* Exported types ------------------------------------------------------------*/
  20. enum efm32_irq_hook_type_t
  21. {
  22. efm32_irq_type_dma = 0,
  23. efm32_irq_type_rtc,
  24. efm32_irq_type_timer,
  25. efm32_irq_type_gpio,
  26. efm32_irq_type_acmp,
  27. efm32_irq_type_usart
  28. };
  29. typedef void (*efm32_irq_callback_t)(rt_device_t device);
  30. typedef struct
  31. {
  32. enum efm32_irq_hook_type_t type;
  33. rt_uint8_t unit;
  34. efm32_irq_callback_t cbFunc;
  35. void *userPtr;
  36. } efm32_irq_hook_init_t;
  37. typedef struct
  38. {
  39. efm32_irq_callback_t cbFunc;
  40. void *userPtr;
  41. } efm32_irq_hook_t;
  42. /* Exported constants --------------------------------------------------------*/
  43. /* Exported macro ------------------------------------------------------------*/
  44. /* Exported functions ------------------------------------------------------- */
  45. //void NMI_Handler(void);
  46. //void MemManage_Handler(void);
  47. //void BusFault_Handler(void);
  48. //void UsageFault_Handler(void);
  49. //void SVC_Handler(void);
  50. //void DebugMon_Handler(void);
  51. void DMA_IRQHandler_All(unsigned int channel, bool primary, void *user);
  52. rt_err_t efm32_irq_hook_register(efm32_irq_hook_init_t *hook);
  53. #endif /* __HDL_INTERRUPT_H__ */