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 
11 #ifndef __DRV_TIMER_H__
12 #define __DRV_TIMER_H__
13 
14 /* Includes ------------------------------------------------------------------*/
15 #include "hdl_interrupt.h"
16 
17 /* Exported types ------------------------------------------------------------*/
18 struct efm32_timer_device_t
19 {
20     TIMER_TypeDef       *timer_device;
21     efm32_irq_hook_t    hook;
22 };
23 
24 struct efm32_timer_control_t
25 {
26     rt_uint32_t         period;
27     efm32_irq_hook_t    hook;
28 };
29 
30 /* Exported constants --------------------------------------------------------*/
31 /* Exported macro ------------------------------------------------------------*/
32 #define TMR_MODE_ONESHOT            (true)
33 #define TMR_MODE_CONTINUOUS         (false)
34 
35 #define TMR_CFG_PRESCALER           timerPrescale1024
36 
37 /* Exported functions ------------------------------------------------------- */
38 void rt_hw_timer_init(void);
39 
40 #endif /*__DRV_TIMER_H__ */
41