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

Function LEUART_Reset

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

/ * @brief * Reset LEUART to same state as after a HW reset. * * @param[in] leuart * Pointer to LEUART peripheral register block. ******************************************************************************/

Source from the content-addressed store, hash-verified

486 * Pointer to LEUART peripheral register block.
487 ******************************************************************************/
488void LEUART_Reset(LEUART_TypeDef *leuart)
489{
490 /* Make sure the module exists on the selected chip */
491 EFM_ASSERT(LEUART_REF_VALID(leuart));
492
493 /* Freeze registers to avoid stalling for LF synchronization */
494 LEUART_FreezeEnable(leuart, true);
495
496 /* Make sure disabled first, before resetting other registers */
497 leuart->CMD = LEUART_CMD_RXDIS | LEUART_CMD_TXDIS | LEUART_CMD_RXBLOCKDIS |
498 LEUART_CMD_CLEARTX | LEUART_CMD_CLEARRX;
499 leuart->CTRL = _LEUART_CTRL_RESETVALUE;
500 leuart->CLKDIV = _LEUART_CLKDIV_RESETVALUE;
501 leuart->STARTFRAME = _LEUART_STARTFRAME_RESETVALUE;
502 leuart->SIGFRAME = _LEUART_SIGFRAME_RESETVALUE;
503 leuart->IEN = _LEUART_IEN_RESETVALUE;
504 leuart->IFC = _LEUART_IFC_MASK;
505 leuart->PULSECTRL = _LEUART_PULSECTRL_RESETVALUE;
506 leuart->ROUTE = _LEUART_ROUTE_RESETVALUE;
507 /* Do not reset route register, setting should be done independently */
508
509 /* Unfreeze registers, pass new settings on to LEUART */
510 LEUART_FreezeEnable(leuart, false);
511}
512
513
514/***************************************************************************//**

Callers

nothing calls this directly

Calls 1

LEUART_FreezeEnableFunction · 0.85

Tested by

no test coverage detected