/ * @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
| 391 | * domain |
| 392 | ******************************************************************************/ |
| 393 | void 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 | /***************************************************************************//** |
no outgoing calls
no test coverage detected