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

Function LEUART_Enable

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

/ * @brief * Enable/disable LEUART receiver and/or transmitter. * * @details * Notice that this function does not do any configuration. Enabling should * normally be done after initialization is done (if not enabled as part * of init). * * @note * Enabling/disabling requires synchronization into the low frequency domain. * If the same register is modified before a previous up

Source from the content-addressed store, hash-verified

343 * Select status for receiver/transmitter.
344 ******************************************************************************/
345void LEUART_Enable(LEUART_TypeDef *leuart, LEUART_Enable_TypeDef enable)
346{
347 uint32_t tmp;
348
349 /* Make sure the module exists on the selected chip */
350 EFM_ASSERT(LEUART_REF_VALID(leuart));
351
352 /* Disable as specified */
353 tmp = ~((uint32_t)(enable));
354 tmp &= (_LEUART_CMD_RXEN_MASK | _LEUART_CMD_TXEN_MASK);
355 tmp <<= 1;
356 /* Enable as specified */
357 tmp |= (uint32_t)(enable);
358
359 /* LF register about to be modified require sync. busy check */
360 LEUART_Sync(leuart, LEUART_SYNCBUSY_CMD);
361
362 leuart->CMD = tmp;
363}
364
365
366/***************************************************************************//**

Callers 2

rt_leuart_initFunction · 0.85
rt_leuart_controlFunction · 0.85

Calls 1

LEUART_SyncFunction · 0.85

Tested by

no test coverage detected