drv_irq.h 1.9 KB

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