drv_irq.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. * Copyright (c) 2022, Xiaohua Semiconductor Co., Ltd.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0
  6. *
  7. * Change Logs:
  8. * Date Author Notes
  9. * 2022-04-28 CDT first version
  10. */
  11. #ifndef __DRV_IRQ_H__
  12. #define __DRV_IRQ_H__
  13. /*******************************************************************************
  14. * Include files
  15. ******************************************************************************/
  16. #include <rtdef.h>
  17. #include "hc32_ll.h"
  18. /* C binding of definitions if building with C++ compiler */
  19. #ifdef __cplusplus
  20. extern "C"
  21. {
  22. #endif
  23. /*******************************************************************************
  24. * Global type definitions ('typedef')
  25. ******************************************************************************/
  26. struct hc32_irq_config
  27. {
  28. IRQn_Type irq_num;
  29. uint32_t irq_prio;
  30. en_int_src_t int_src;
  31. };
  32. /*******************************************************************************
  33. * Global pre-processor symbols/macros ('#define')
  34. ******************************************************************************/
  35. /*******************************************************************************
  36. * Global variable definitions ('extern')
  37. ******************************************************************************/
  38. /*******************************************************************************
  39. * Global function prototypes (definition in C source)
  40. ******************************************************************************/
  41. rt_err_t hc32_install_irq_handler(struct hc32_irq_config *irq_config,
  42. void (*irq_hdr)(void),
  43. rt_bool_t irq_enable);
  44. #ifdef __cplusplus
  45. }
  46. #endif
  47. #endif /* __DRV_IRQ_H__ */
  48. /*******************************************************************************
  49. * EOF (not truncated)
  50. ******************************************************************************/