/ * @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
| 343 | * Select status for receiver/transmitter. |
| 344 | ******************************************************************************/ |
| 345 | void 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 | /***************************************************************************//** |
no test coverage detected