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

Function USART_Enable

bsp/efm32/Libraries/emlib/src/em_usart.c:487–501  ·  view source on GitHub ↗

/ * @brief * Enable/disable USART/UART 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). * * @param[in] usart * Pointer to USART/UART peripheral register block. * * @param[in] enable * Select status for receiver/transmitter.

Source from the content-addressed store, hash-verified

485 * Select status for receiver/transmitter.
486 ******************************************************************************/
487void USART_Enable(USART_TypeDef *usart, USART_Enable_TypeDef enable)
488{
489 uint32_t tmp;
490
491 /* Make sure the module exists on the selected chip */
492 EFM_ASSERT(USART_REF_VALID(usart)||(UART_REF_VALID(usart)));
493
494 /* Disable as specified */
495 tmp = ~((uint32_t)(enable));
496 tmp &= _USART_CMD_RXEN_MASK | _USART_CMD_TXEN_MASK;
497 usart->CMD = tmp << 1;
498
499 /* Enable as specified */
500 usart->CMD = (uint32_t)(enable);
501}
502
503
504/***************************************************************************//**

Callers 3

USART_InitI2sFunction · 0.70
rt_usart_initFunction · 0.50
rt_usart_controlFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected