drv_hwtimer.h 700 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-10-19 Nations first version
  9. */
  10. #ifndef __DRV_HWTIMER__
  11. #define __DRV_HWTIMER__
  12. #include <rtthread.h>
  13. #include <rtdevice.h>
  14. #include <rthw.h>
  15. #include <board.h>
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /* n32 config class */
  20. struct n32_hwtimer_config
  21. {
  22. const char *name;
  23. TIM_Module* timer_periph;
  24. IRQn_Type irqn;
  25. };
  26. struct n32_hwtimer
  27. {
  28. rt_hwtimer_t time_device;
  29. struct n32_hwtimer_config *config;
  30. };
  31. int rt_hwtimer_init(void);
  32. #ifdef __cplusplus
  33. }
  34. #endif
  35. #endif /* __DRV_HWTIMER__ */