/ * @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.
| 485 | * Select status for receiver/transmitter. |
| 486 | ******************************************************************************/ |
| 487 | void 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 | /***************************************************************************//** |
no outgoing calls
no test coverage detected