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

Function rt_hw_driver_init

bsp/efm32/board.c:312–405  ·  view source on GitHub ↗

/ * @brief * Initialize the hardware drivers. * * @details * * @note * ******************************************************************************/

Source from the content-addressed store, hash-verified

310 *
311 ******************************************************************************/
312void rt_hw_driver_init(void)
313{
314 /* Initialize DMA */
315 rt_hw_dma_init();
316
317 /* Select LFXO for specified module (and wait for it to stabilize) */
318#if (!defined(EFM32_USING_LFXO) && defined(RT_USING_RTC))
319#error "Low frequency clock source is needed for using RTC"
320#endif
321
322#if (!defined(EFM32_USING_LFXO )&& \
323 (defined(RT_USING_LEUART0) || defined(RT_USING_LEUART1)))
324#error "Low frequency clock source is needed for using LEUART"
325#endif
326
327 /* Initialize USART */
328#if (defined(RT_USING_USART0) || defined(RT_USING_USART1) || \
329 defined(RT_USING_USART2) || defined(RT_USING_UART0) || \
330 defined(RT_USING_UART1))
331 rt_hw_usart_init();
332#endif
333
334 /* Initialize LEUART */
335#if (defined(RT_USING_LEUART0) || defined(RT_USING_LEUART1))
336 rt_hw_leuart_init();
337#endif
338
339 /* Setup Console */
340#if defined(EFM32_GXXX_DK)
341 DVK_enablePeripheral(DVK_RS232A);
342 DVK_enablePeripheral(DVK_SPI);
343#elif defined(EFM32GG_DK3750)
344 #if (RT_CONSOLE_DEVICE == EFM_UART1)
345 DVK_enablePeripheral(DVK_RS232_UART);
346 #elif (RT_CONSOLE_DEVICE == EFM_LEUART1)
347 DVK_enablePeripheral(DVK_RS232_LEUART);
348 #endif
349#endif
350 rt_console_set_device(CONSOLE_DEVICE);
351
352 /* Initialize Timer */
353#if (defined(RT_USING_TIMER0) || defined(RT_USING_TIMER1) || defined(RT_USING_TIMER2))
354 rt_hw_timer_init();
355#endif
356
357 /* Initialize ADC */
358#if defined(RT_USING_ADC0)
359 rt_hw_adc_init();
360#endif
361
362 /* Initialize ACMP */
363#if (defined(RT_USING_ACMP0) || defined(RT_USING_ACMP1))
364 rt_hw_acmp_init();
365#endif
366
367 /* Initialize IIC */
368#if (defined(RT_USING_IIC0) || defined(RT_USING_IIC1))
369 rt_hw_iic_init();

Callers 1

rtthread_startupFunction · 0.85

Calls 13

rt_hw_dma_initFunction · 0.85
rt_hw_leuart_initFunction · 0.85
DVK_enablePeripheralFunction · 0.85
rt_console_set_deviceFunction · 0.85
rt_hw_acmp_initFunction · 0.85
DVK_writeRegisterFunction · 0.85
efm32_spiLcd_initFunction · 0.85
efm32_hw_keys_initFunction · 0.85
rt_hw_usart_initFunction · 0.70
rt_hw_timer_initFunction · 0.70
rt_hw_adc_initFunction · 0.70
rt_hw_iic_initFunction · 0.70

Tested by

no test coverage detected