Lines Matching refs:timer
64 struct efm32_timer_device_t *timer; in rt_hs_timer_init() local
66 timer = (struct efm32_timer_device_t *)(dev->user_data); in rt_hs_timer_init()
68 timer->hook.cbFunc = RT_NULL; in rt_hs_timer_init()
69 timer->hook.userPtr = RT_NULL; in rt_hs_timer_init()
101 struct efm32_timer_device_t *timer; in rt_hs_timer_control() local
103 timer = (struct efm32_timer_device_t *)(dev->user_data); in rt_hs_timer_control()
110 TIMER_Enable(timer->timer_device, false); in rt_hs_timer_control()
116 TIMER_Enable(timer->timer_device, true); in rt_hs_timer_control()
126 running = timer->timer_device->STATUS & 0x00000001; in rt_hs_timer_control()
128 TIMER_Enable(timer->timer_device, false); in rt_hs_timer_control()
129 timer->timer_device->CNT = _TIMER_CNT_RESETVALUE; in rt_hs_timer_control()
130 TIMER_TopSet(timer->timer_device, TIMER_TopCalculate(control->period)); in rt_hs_timer_control()
131 timer->hook.cbFunc = control->hook.cbFunc; in rt_hs_timer_control()
132 timer->hook.userPtr = control->hook.userPtr; in rt_hs_timer_control()
135 TIMER_Enable(timer->timer_device, true); in rt_hs_timer_control()
171 struct efm32_timer_device_t *timer) in rt_hw_timer_register() argument
184 device->user_data = timer; in rt_hw_timer_register()
202 struct efm32_timer_device_t *timer; in rt_hw_timer_isr() local
204 timer = (struct efm32_timer_device_t *)(dev->user_data); in rt_hw_timer_isr()
206 if (timer->hook.cbFunc != RT_NULL) in rt_hw_timer_isr()
208 (timer->hook.cbFunc)(timer->hook.userPtr); in rt_hw_timer_isr()
234 struct efm32_timer_device_t *timer; in rt_hw_timer_unit_init() local
243 timer = rt_malloc(sizeof(struct efm32_timer_device_t)); in rt_hw_timer_unit_init()
244 if (timer == RT_NULL) in rt_hw_timer_unit_init()
258 timer->timer_device = TIMER0; in rt_hw_timer_unit_init()
264 timer->timer_device = TIMER1; in rt_hw_timer_unit_init()
270 timer->timer_device = TIMER2; in rt_hw_timer_unit_init()
283 TIMER_Reset(timer->timer_device); in rt_hw_timer_unit_init()
297 TIMER_Init(timer->timer_device, &init); in rt_hw_timer_unit_init()
307 TIMER_IntEnable(timer->timer_device, TIMER_IF_OF); in rt_hw_timer_unit_init()
308 TIMER_IntClear(timer->timer_device, TIMER_IF_OF); in rt_hw_timer_unit_init()
315 return timer; in rt_hw_timer_unit_init()
318 if (timer) in rt_hw_timer_unit_init()
320 rt_free(timer); in rt_hw_timer_unit_init()
337 struct efm32_timer_device_t *timer; in rt_hw_timer_init() local
340 if ((timer = rt_hw_timer_unit_init(&timer0_device, 0, RT_USING_TIMER0)) \ in rt_hw_timer_init()
343 rt_hw_timer_register(&timer0_device, RT_TIMER0_NAME, 0, timer); in rt_hw_timer_init()
349 if ((timer = rt_hw_timer_unit_init(&timer1_device, 1, RT_USING_TIMER1)) \ in rt_hw_timer_init()
352 rt_hw_timer_register(&timer1_device, RT_TIMER1_NAME, 0, timer); in rt_hw_timer_init()
357 if ((timer = rt_hw_timer_unit_init(&timer2_device, 2, RT_USING_TIMER2)) \ in rt_hw_timer_init()
360 rt_hw_timer_register(&timer2_device, RT_TIMER2_NAME, 0, timer); in rt_hw_timer_init()