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

Function LEUART_FreezeEnable

bsp/efm32/Libraries/emlib/src/em_leuart.c:393–415  ·  view source on GitHub ↗

/ * @brief * LEUART register synchronization freeze control. * * @details * Some LEUART registers require synchronization into the low frequency (LF) * domain. The freeze feature allows for several such registers to be * modified before passing them to the LF domain simultaneously (which * takes place when the freeze mode is disabled). * * @note * When enabling freeze mode, t

Source from the content-addressed store, hash-verified

391 * domain
392 ******************************************************************************/
393void LEUART_FreezeEnable(LEUART_TypeDef *leuart, bool enable)
394{
395 if (enable)
396 {
397 /*
398 * Wait for any ongoing LF synchronization to complete. This is just to
399 * protect against the rare case when a user
400 * - modifies a register requiring LF sync
401 * - then enables freeze before LF sync completed
402 * - then modifies the same register again
403 * since modifying a register while it is in sync progress should be
404 * avoided.
405 */
406 while (leuart->SYNCBUSY)
407 ;
408
409 leuart->FREEZE = LEUART_FREEZE_REGFREEZE;
410 }
411 else
412 {
413 leuart->FREEZE = 0;
414 }
415}
416
417
418/***************************************************************************//**

Callers 2

LEUART_InitFunction · 0.85
LEUART_ResetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected