MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_hw_timer_init

Function rt_hw_timer_init

bsp/efm32/drv_timer.c:335–363  ·  view source on GitHub ↗

/ * @brief * Initialize all Timer module related hardware and register Timer device to * kernel * * @details * * @note ******************************************************************************/

Source from the content-addressed store, hash-verified

333 * @note
334 ******************************************************************************/
335void rt_hw_timer_init(void)
336{
337 struct efm32_timer_device_t *timer;
338
339#ifdef RT_USING_TIMER0
340 if ((timer = rt_hw_timer_unit_init(&timer0_device, 0, RT_USING_TIMER0)) \
341 != RT_NULL)
342 {
343 rt_hw_timer_register(&timer0_device, RT_TIMER0_NAME, 0, timer);
344 }
345#endif
346
347
348#ifdef RT_USING_TIMER1
349 if ((timer = rt_hw_timer_unit_init(&timer1_device, 1, RT_USING_TIMER1)) \
350 != RT_NULL)
351 {
352 rt_hw_timer_register(&timer1_device, RT_TIMER1_NAME, 0, timer);
353 }
354#endif
355
356#ifdef RT_USING_TIMER2
357 if ((timer = rt_hw_timer_unit_init(&timer2_device, 2, RT_USING_TIMER2)) \
358 != RT_NULL)
359 {
360 rt_hw_timer_register(&timer2_device, RT_TIMER2_NAME, 0, timer);
361 }
362#endif
363}
364
365#endif
366/***************************************************************************//**

Callers 1

rt_hw_driver_initFunction · 0.70

Calls 2

rt_hw_timer_unit_initFunction · 0.85
rt_hw_timer_registerFunction · 0.85

Tested by

no test coverage detected