/ * @brief * Get current baudrate for LEUART. * * @details * This function returns the actual baudrate (not considering oscillator * inaccuracies) used by a LEUART peripheral. * * @param[in] leuart * Pointer to LEUART peripheral register block. * * @return * Current baudrate. ******************************************************************************/
| 204 | * Current baudrate. |
| 205 | ******************************************************************************/ |
| 206 | uint32_t LEUART_BaudrateGet(LEUART_TypeDef *leuart) |
| 207 | { |
| 208 | uint32_t freq; |
| 209 | CMU_Clock_TypeDef clock; |
| 210 | |
| 211 | /* Get current frequency */ |
| 212 | if (leuart == LEUART0) |
| 213 | { |
| 214 | clock = cmuClock_LEUART0; |
| 215 | } |
| 216 | #if (LEUART_COUNT > 1) |
| 217 | else if (leuart == LEUART1) |
| 218 | { |
| 219 | clock = cmuClock_LEUART1; |
| 220 | } |
| 221 | #endif |
| 222 | else |
| 223 | { |
| 224 | EFM_ASSERT(0); |
| 225 | return 0; |
| 226 | } |
| 227 | |
| 228 | freq = CMU_ClockFreqGet(clock); |
| 229 | |
| 230 | return LEUART_BaudrateCalc(freq, leuart->CLKDIV); |
| 231 | } |
| 232 | |
| 233 | |
| 234 | /***************************************************************************//** |
nothing calls this directly
no test coverage detected