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

Function rt_hw_board_init

bsp/efm32/board.c:252–301  ·  view source on GitHub ↗

/ * @brief * Initialize the board. * * @details * * @note * ******************************************************************************/

Source from the content-addressed store, hash-verified

250 *
251 ******************************************************************************/
252void rt_hw_board_init(void)
253{
254 /* Chip errata */
255 CHIP_Init();
256
257 /* Initialize DVK board register access */
258#if defined(EFM32_GXXX_DK)
259 DVK_init();
260#elif defined(EFM32GG_DK3750)
261 DVK_init(DVK_Init_EBI);
262
263 /* Disable all DVK interrupts */
264 DVK_disableInterrupt(BC_INTEN_MASK);
265 DVK_clearInterruptFlags(BC_INTFLAG_MASK);
266#endif
267
268 /* config NVIC Configuration */
269 NVIC_Configuration();
270
271#if defined(EFM32_USING_HFXO)
272 /* Configure external oscillator */
273 SystemHFXOClockSet(EFM32_HFXO_FREQUENCY);
274
275 /* Switching the CPU clock source to HFXO */
276 CMU_ClockSelectSet(cmuClock_HF, cmuSelect_HFXO);
277
278 /* Turning off the high frequency RC Oscillator (HFRCO) */
279 CMU_OscillatorEnable(cmuOsc_HFRCO, false, false);
280#endif
281
282#if defined(EFM32_USING_LFXO)
283 CMU_ClockSelectSet(cmuClock_LFA,cmuSelect_LFXO);
284 CMU_ClockSelectSet(cmuClock_LFB, cmuSelect_LFXO);
285#endif
286
287#if defined(EFM32_SWO_ENABLE)
288 /* Enable SWO */
289 Swo_Configuration();
290#endif
291
292 /* Enable high frequency peripheral clock */
293 CMU_ClockEnable(cmuClock_HFPER, true);
294 /* Enabling clock to the interface of the low energy modules */
295 CMU_ClockEnable(cmuClock_CORELE, true);
296 /* Enable GPIO clock */
297 CMU_ClockEnable(cmuClock_GPIO, true);
298
299 /* Configure the SysTick */
300 SysTick_Configuration();
301}
302
303/***************************************************************************//**
304 * @brief

Callers 3

rtthread_startupFunction · 0.70
rtthread_startupFunction · 0.50
rtthread_startupFunction · 0.50

Calls 11

CHIP_InitFunction · 0.85
CMU_ClockSelectSetFunction · 0.85
CMU_OscillatorEnableFunction · 0.85
Swo_ConfigurationFunction · 0.85
CMU_ClockEnableFunction · 0.85
NVIC_ConfigurationFunction · 0.70
SysTick_ConfigurationFunction · 0.70
DVK_initFunction · 0.50
DVK_disableInterruptFunction · 0.50
DVK_clearInterruptFlagsFunction · 0.50
SystemHFXOClockSetFunction · 0.50

Tested by

no test coverage detected