drv_timer.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. * 2011-01-18 onelife Initial creation for EFM32
  9. */
  10. #ifndef __DRV_TIMER_H__
  11. #define __DRV_TIMER_H__
  12. /* Includes ------------------------------------------------------------------*/
  13. #include "hdl_interrupt.h"
  14. /* Exported types ------------------------------------------------------------*/
  15. struct efm32_timer_device_t
  16. {
  17. TIMER_TypeDef *timer_device;
  18. efm32_irq_hook_t hook;
  19. };
  20. struct efm32_timer_control_t
  21. {
  22. rt_uint32_t period;
  23. efm32_irq_hook_t hook;
  24. };
  25. /* Exported constants --------------------------------------------------------*/
  26. /* Exported macro ------------------------------------------------------------*/
  27. #define TMR_MODE_ONESHOT (true)
  28. #define TMR_MODE_CONTINUOUS (false)
  29. #define TMR_CFG_PRESCALER timerPrescale1024
  30. /* Exported functions ------------------------------------------------------- */
  31. void rt_hw_timer_init(void);
  32. #endif /*__DRV_TIMER_H__ */