Go to the documentation of this file.
16 #ifndef FSL_COMPONENT_ID
17 #define FSL_COMPONENT_ID "platform.drivers.lpuart"
80 #if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ
81 static const IRQn_Type s_lpuartRxIRQ[] = LPUART_RX_IRQS;
82 static const IRQn_Type s_lpuartTxIRQ[] = LPUART_TX_IRQS;
86 #if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
90 #if defined(LPUART_PERIPH_CLOCKS)
92 static const clock_ip_name_t s_lpuartPeriphClocks[] = LPUART_PERIPH_CLOCKS;
98 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
139 assert(
NULL != handle);
146 if (tmpRxRingBufferTail > tmpRxRingBufferHead)
148 size = ((size_t)tmpRxRingBufferHead + tmpRxRingBufferSize - (
size_t)tmpRxRingBufferTail);
152 size = ((size_t)tmpRxRingBufferHead - (
size_t)tmpRxRingBufferTail);
160 assert(
NULL != handle);
177 assert(
NULL != data);
183 for (i = 0; i < length; i++)
185 base->
DATA = data[i];
191 assert(
NULL != data);
194 #if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT
195 uint32_t ctrl = base->
CTRL;
202 for (i = 0; i < length; i++)
204 #if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT
207 data[i] = (uint8_t)(base->
DATA & 0x7FU);
211 data[i] = (uint8_t)base->
DATA;
214 data[i] = (uint8_t)(base->
DATA);
246 assert(0U < config->baudRate_Bps);
247 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
254 uint16_t sbr, sbrTemp;
255 uint8_t osr, osrTemp;
256 uint32_t tempDiff, calculatedBaud, baudDiff;
264 baudDiff =
config->baudRate_Bps;
267 for (osrTemp = 4U; osrTemp <= 32U; osrTemp++)
270 sbrTemp = (uint16_t)((srcClock_Hz * 10U / (
config->baudRate_Bps * (uint32_t)osrTemp) + 5U) / 10U);
277 calculatedBaud = (srcClock_Hz / ((uint32_t)osrTemp * (uint32_t)sbrTemp));
278 tempDiff = calculatedBaud >
config->baudRate_Bps ? (calculatedBaud -
config->baudRate_Bps) :
279 (
config->baudRate_Bps - calculatedBaud);
281 if (tempDiff <= baudDiff)
291 if (baudDiff > ((
config->baudRate_Bps / 100U) * 3U))
298 #if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
304 #if defined(LPUART_PERIPH_CLOCKS)
310 #if defined(FSL_FEATURE_LPUART_HAS_GLOBAL) && FSL_FEATURE_LPUART_HAS_GLOBAL
312 LPUART_SoftwareReset(base);
322 if ((osr > 3U) && (osr < 8U))
344 #if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT
345 if (kLPUART_SevenDataBits ==
config->dataBitsCount)
367 #if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT
373 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
383 base->
WATER = (((uint32_t)(
config->rxFifoWatermark) << 16U) |
config->txFifoWatermark);
396 #if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT
400 #if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING
404 #if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT
407 if (
true ==
config->enableRxRTS)
412 if (
true ==
config->enableTxCTS)
420 if (
true ==
config->isMsb)
433 if (
true ==
config->enableTx)
438 if (
true ==
config->enableRx)
459 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
474 #if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT
478 #if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING
487 #if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
493 #if defined(LPUART_PERIPH_CLOCKS)
526 config->baudRate_Bps = 115200U;
530 #if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT
533 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
534 config->txFifoWatermark = 0U;
535 config->rxFifoWatermark = 0U;
537 #if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT
538 config->enableRxRTS =
false;
539 config->enableTxCTS =
false;
540 config->txCtsConfig = kLPUART_CtsSampleAtStart;
541 config->txCtsSource = kLPUART_CtsSourcePin;
566 assert(0U < baudRate_Bps);
569 uint32_t temp, oldCtrl;
570 uint16_t sbr, sbrTemp;
571 uint8_t osr, osrTemp;
572 uint32_t tempDiff, calculatedBaud, baudDiff;
580 baudDiff = baudRate_Bps;
583 for (osrTemp = 4U; osrTemp <= 32U; osrTemp++)
586 sbrTemp = (uint16_t)((srcClock_Hz * 10U / (baudRate_Bps * (uint32_t)osrTemp) + 5U) / 10U);
593 calculatedBaud = srcClock_Hz / ((uint32_t)osrTemp * (uint32_t)sbrTemp);
595 tempDiff = calculatedBaud > baudRate_Bps ? (calculatedBaud - baudRate_Bps) : (baudRate_Bps - calculatedBaud);
597 if (tempDiff <= baudDiff)
607 if (baudDiff < (uint32_t)((baudRate_Bps / 100U) * 3U))
610 oldCtrl = base->
CTRL;
619 if ((osr > 3U) && (osr < 8U))
633 base->
CTRL = oldCtrl;
660 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
684 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
716 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
719 temp |= (uint32_t)(base->
CTRL & 0xFF0C000u);
745 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
746 temp |= (base->
FIFO &
776 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
777 temp = (uint32_t)base->
FIFO;
782 temp = (uint32_t)base->
STAT;
791 #if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING
827 assert(
NULL != data);
829 const uint8_t *dataAddress = data;
830 size_t transferSize = length;
836 while (0U != transferSize)
852 base->
DATA = *(dataAddress);
892 assert(
NULL != data);
896 uint8_t *dataAddress = data;
898 #if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT
899 uint32_t ctrl = base->
CTRL;
908 while (0U != (length--))
913 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
920 if (0U == --waitTimes)
966 #if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT
969 *(dataAddress) = (uint8_t)(base->
DATA & 0x7FU);
974 *(dataAddress) = (uint8_t)base->
DATA;
978 *(dataAddress) = (uint8_t)base->
DATA;
1014 assert(
NULL != handle);
1018 #if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT
1019 uint32_t ctrl = base->
CTRL;
1035 #if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT
1037 handle->isSevenDataBits = isSevenDataBits;
1049 #if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ
1050 (void)
EnableIRQ(s_lpuartRxIRQ[instance]);
1051 (void)
EnableIRQ(s_lpuartTxIRQ[instance]);
1076 uint8_t *ringBuffer,
1077 size_t ringBufferSize)
1079 assert(
NULL != handle);
1080 assert(
NULL != ringBuffer);
1103 assert(
NULL != handle);
1138 assert(
NULL != handle);
1139 assert(
NULL != xfer);
1177 assert(
NULL != handle);
1200 assert(
NULL != handle);
1212 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
1259 size_t *receivedBytes)
1261 assert(
NULL != handle);
1262 assert(
NULL != xfer);
1269 size_t bytesToCopy = 0U;
1271 size_t bytesToReceive;
1273 size_t bytesCurrentReceived;
1292 bytesCurrentReceived = 0;
1303 if (0U != bytesToCopy)
1305 bytesToCopy =
MIN(bytesToReceive, bytesToCopy);
1307 bytesToReceive -= bytesToCopy;
1310 for (i = 0U; i < bytesToCopy; i++)
1313 bytesCurrentReceived++;
1328 if (0U != bytesToReceive)
1331 handle->
rxData = xfer->
data + bytesCurrentReceived;
1340 if (0U == bytesToReceive)
1351 handle->
rxData = xfer->
data + bytesCurrentReceived;
1363 if (
NULL != receivedBytes)
1365 *receivedBytes = bytesCurrentReceived;
1385 assert(
NULL != handle);
1414 assert(
NULL != handle);
1442 assert(
NULL != handle);
1448 uint16_t tpmRxRingBufferHead;
1468 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
1477 handle->
rxData += tempCount;
1514 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
1523 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
1531 handle->
rxData += tempCount;
1550 while (0U !=
count--)
1577 tpmData = base->
DATA;
1578 #if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT
1579 if (handle->isSevenDataBits)
1581 handle->
rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)(tpmData & 0x7FU);
1585 handle->
rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)tpmData;
1588 handle->
rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)tpmData;
1618 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
1627 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
1635 handle->
txData += tempCount;
1679 #if defined(FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) && FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1
1680 #if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ
1681 void LPUART0_LPUART1_RX_DriverIRQHandler(
void)
1688 stat = LPUART0->STAT;
1689 ctrl = LPUART0->CTRL;
1706 void LPUART0_LPUART1_TX_DriverIRQHandler(
void)
1713 stat = LPUART0->STAT;
1714 ctrl = LPUART0->CTRL;
1732 void LPUART0_LPUART1_DriverIRQHandler(
void)
1739 stat = LPUART0->STAT;
1740 ctrl = LPUART0->CTRL;
1764 #if defined(LPUART0)
1765 #if !(defined(FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) && FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1)
1766 #if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ
1767 void LPUART0_TX_DriverIRQHandler(
void)
1772 void LPUART0_RX_DriverIRQHandler(
void)
1778 void LPUART0_DriverIRQHandler(
void)
1787 #if defined(LPUART1)
1788 #if !(defined(FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) && FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1)
1789 #if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ
1790 void LPUART1_TX_DriverIRQHandler(
void)
1795 void LPUART1_RX_DriverIRQHandler(
void)
1801 void LPUART1_DriverIRQHandler(
void)
1810 #if defined(LPUART2)
1811 #if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ
1812 void LPUART2_TX_DriverIRQHandler(
void)
1817 void LPUART2_RX_DriverIRQHandler(
void)
1823 void LPUART2_DriverIRQHandler(
void)
1831 #if defined(LPUART3)
1832 #if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ
1833 void LPUART3_TX_DriverIRQHandler(
void)
1838 void LPUART3_RX_DriverIRQHandler(
void)
1844 void LPUART3_DriverIRQHandler(
void)
1852 #if defined(LPUART4)
1853 #if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ
1854 void LPUART4_TX_DriverIRQHandler(
void)
1859 void LPUART4_RX_DriverIRQHandler(
void)
1865 void LPUART4_DriverIRQHandler(
void)
1873 #if defined(LPUART5)
1874 #if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ
1875 void LPUART5_TX_DriverIRQHandler(
void)
1880 void LPUART5_RX_DriverIRQHandler(
void)
1886 void LPUART5_DriverIRQHandler(
void)
1894 #if defined(LPUART6)
1895 #if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ
1896 void LPUART6_TX_DriverIRQHandler(
void)
1901 void LPUART6_RX_DriverIRQHandler(
void)
1907 void LPUART6_DriverIRQHandler(
void)
1915 #if defined(LPUART7)
1916 #if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ
1917 void LPUART7_TX_DriverIRQHandler(
void)
1922 void LPUART7_RX_DriverIRQHandler(
void)
1928 void LPUART7_DriverIRQHandler(
void)
1936 #if defined(LPUART8)
1937 #if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ
1938 void LPUART8_TX_DriverIRQHandler(
void)
1943 void LPUART8_RX_DriverIRQHandler(
void)
1949 void LPUART8_DriverIRQHandler(
void)
1957 #if defined(CM4_0__LPUART)
1958 void M4_0_LPUART_DriverIRQHandler(
void)
1965 #if defined(CM4_1__LPUART)
1966 void M4_1_LPUART_DriverIRQHandler(
void)
1973 #if defined(CM4__LPUART)
1974 void M4_LPUART_DriverIRQHandler(
void)
1981 #if defined(DMA__LPUART0)
1982 void DMA_UART0_INT_DriverIRQHandler(
void)
1989 #if defined(DMA__LPUART1)
1990 void DMA_UART1_INT_DriverIRQHandler(
void)
1997 #if defined(DMA__LPUART2)
1998 void DMA_UART2_INT_DriverIRQHandler(
void)
2005 #if defined(DMA__LPUART3)
2006 void DMA_UART3_INT_DriverIRQHandler(
void)
2013 #if defined(DMA__LPUART4)
2014 void DMA_UART4_INT_DriverIRQHandler(
void)
2021 #if defined(ADMA__LPUART0)
2022 void ADMA_UART0_INT_DriverIRQHandler(
void)
2029 #if defined(ADMA__LPUART1)
2030 void ADMA_UART1_INT_DriverIRQHandler(
void)
2037 #if defined(ADMA__LPUART2)
2038 void ADMA_UART2_INT_DriverIRQHandler(
void)
2045 #if defined(ADMA__LPUART3)
2046 void ADMA_UART3_INT_DriverIRQHandler(
void)
size_t LPUART_TransferGetRxRingBufferLength(LPUART_Type *base, lpuart_handle_t *handle)
Get the length of received data in RX ring buffer.
@ kLPUART_TransmissionCompleteInterruptEnable
@ kStatus_LPUART_FramingError
@ kStatus_LPUART_NoiseError
#define LPUART_BAUD_LBKDIE_MASK
#define LPUART_CTRL_IDLECFG(x)
static const clock_ip_name_t s_lpuartClock[]
void LPUART_TransferHandleIRQ(LPUART_Type *base, lpuart_handle_t *handle)
LPUART IRQ handle function.
uint32_t LPUART_GetInstance(LPUART_Type *base)
Get the LPUART instance from peripheral base address.
#define UART_RETRY_TIMES
Retry times for waiting flag.
static bool LPUART_TransferIsRxRingBufferFull(LPUART_Type *base, lpuart_handle_t *handle)
Check whether the RX ring buffer is full.
#define LPUART_STAT_OR_MASK
status_t LPUART_SetBaudRate(LPUART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz)
Sets the LPUART instance baudrate.
static lpuart_handle_t * s_lpuartHandle[ARRAY_SIZE(s_lpuartBases)]
#define LPUART_MODIR_TXCTSE_MASK
#define LPUART_CTRL_RIE_MASK
#define LPUART_FIFO_TXFE_MASK
#define LPUART_CTRL_PE_MASK
volatile uint16_t rxRingBufferTail
status_t LPUART_TransferReceiveNonBlocking(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer, size_t *receivedBytes)
Receives a buffer of data using the interrupt method.
@ kStatus_NoTransferInProgress
@ kLPUART_TxDataRegEmptyFlag
#define LPUART_CTRL_TIE_MASK
#define FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT
LPUART transfer structure.
void LPUART_EnableInterrupts(LPUART_Type *base, uint32_t mask)
Enables LPUART interrupts according to a provided mask.
#define LPUART_CTRL_ILT_MASK
void LPUART_TransferStopRingBuffer(LPUART_Type *base, lpuart_handle_t *handle)
Aborts the background transfer and uninstalls the ring buffer.
#define LPUART_BAUD_SBR(x)
void LPUART_TransferAbortReceive(LPUART_Type *base, lpuart_handle_t *handle)
Aborts the interrupt-driven data receiving.
static LPUART_Type *const s_lpuartBases[]
#define LPUART_STAT_LBKDIF_MASK
status_t LPUART_ReadBlocking(LPUART_Type *base, uint8_t *data, size_t length)
Reads the receiver data register using a blocking method.
#define FSL_FEATURE_LPUART_FIFO_SIZEn(x)
@ kLPUART_IdleTypeStartBit
void LPUART_DisableInterrupts(LPUART_Type *base, uint32_t mask)
Disables LPUART interrupts according to a provided mask.
#define LPUART_CTRL_IDLECFG_MASK
@ kLPUART_ParityErrorFlag
void LPUART_GetDefaultConfig(lpuart_config_t *config)
Gets the default configuration structure.
#define LPUART_STAT_IDLE_MASK
#define LPUART_CTRL_ILT(x)
void(* lpuart_isr_t)(LPUART_Type *base, lpuart_handle_t *handle)
void(* lpuart_transfer_callback_t)(LPUART_Type *base, lpuart_handle_t *handle, status_t status, void *userData)
LPUART transfer callback function.
#define LPUART_MODIR_TXCTSC(x)
#define LPUART_WATER_RXCOUNT_MASK
#define LPUART_FIFO_TXOFE_MASK
lpuart_transfer_callback_t callback
void LPUART_TransferHandleErrorIRQ(LPUART_Type *base, lpuart_handle_t *handle)
LPUART Error IRQ handle function.
#define LPUART_STAT_FE_MASK
#define LPUART_CLOCKS
Clock ip name array for LPUART.
#define LPUART_WATER_RXCOUNT_SHIFT
#define SDK_ISR_EXIT_BARRIER
@ kLPUART_TxDataRegEmptyInterruptEnable
status_t LPUART_TransferGetSendCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count)
Gets the number of bytes that have been sent out to bus.
#define LPUART_STAT_MSBF_MASK
@ kStatus_LPUART_RxHardwareOverrun
#define LPUART_STAT_TDRE_MASK
#define LPUART_CTRL_RE_MASK
#define LPUART_BAUD_SBNS_MASK
#define ARRAY_SIZE(x)
Computes the number of elements in an array.
#define LPUART_CTRL_TE_MASK
#define LPUART_BAUD_OSR(x)
IRQn_Type
STM32F4XX Interrupt Number Definition, according to the selected device in Library_configuration_sect...
#define LPUART_FIFO_RXUFE_MASK
#define LPUART_STAT_TC_MASK
void LPUART_TransferStartRingBuffer(LPUART_Type *base, lpuart_handle_t *handle, uint8_t *ringBuffer, size_t ringBufferSize)
Sets up the RX ring buffer.
#define LPUART_STAT_PF_MASK
#define LPUART_BAUD_BOTHEDGE_MASK
uint32_t LPUART_GetEnabledInterrupts(LPUART_Type *base)
Gets enabled LPUART interrupts.
#define LPUART_FIFO_RXEMPT_MASK
#define LPUART_MODIR_RXRTSE_MASK
volatile size_t rxDataSize
static void CLOCK_EnableClock(clock_ip_name_t name)
Enable the clock for specific IP.
static void LPUART_ReadNonBlocking(LPUART_Type *base, uint8_t *data, size_t length)
Read RX register using non-blocking method.
#define LPUART_WATER_TXCOUNT_MASK
#define LPUART_CTRL_M7_MASK
status_t LPUART_WriteBlocking(LPUART_Type *base, const uint8_t *data, size_t length)
Writes to the transmitter register using a blocking method.
@ kLPUART_RxDataRegFullFlag
LPUART configuration structure.
#define LPUART_BAUD_OSR_MASK
@ kStatus_LPUART_ParityError
#define LPUART_FIFO_TXFLUSH_MASK
status_t LPUART_Init(LPUART_Type *base, const lpuart_config_t *config, uint32_t srcClock_Hz)
Initializes an LPUART instance with the user configuration structure and the peripheral clock.
#define LPUART_BAUD_M10_MASK
#define LPUART_STAT_NF_MASK
status_t LPUART_TransferSendNonBlocking(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer)
Transmits a buffer of data using the interrupt method.
@ kLPUART_RxOverrunInterruptEnable
@ kStatus_LPUART_RxRingBufferOverrun
@ kLPUART_FramingErrorFlag
#define LPUART_FIFO_RXUF_MASK
static status_t EnableIRQ(IRQn_Type interrupt)
Enable specific interrupt.
#define LPUART_STAT_MA2F_MASK
@ kStatus_LPUART_BaudrateNotSupport
#define LPUART_FIFO_RXFE_MASK
#define LPUART_CTRL_PT_MASK
status_t LPUART_ClearStatusFlags(LPUART_Type *base, uint32_t mask)
Clears status flags with a provided mask.
#define LPUART_CTRL_M_MASK
static void CLOCK_DisableClock(clock_ip_name_t name)
Disable the clock for specific IP.
#define LPUART_FIFO_RXFLUSH_MASK
#define LPUART_STAT_MA1F_MASK
#define LPUART_FIFO_TXEMPT_MASK
@ kStatus_LPUART_IdleLineDetected
#define LPUART_MODIR_TXCTSSRC(x)
#define LPUART_FIFO_TXOF_MASK
#define LPUART_WATER_TXWATER_SHIFT
volatile uint16_t rxRingBufferHead
static lpuart_isr_t s_lpuartIsr
static sai_transceiver_t config
enum _clock_ip_name clock_ip_name_t
CCM CCGR gate control for each module independently.
status_t LPUART_TransferGetReceiveCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count)
Gets the number of bytes that have been received.
uint32_t LPUART_GetStatusFlags(LPUART_Type *base)
Gets LPUART status flags.
@ kStatus_LPUART_FlagCannotClearManually
@ kLPUART_TransmissionCompleteFlag
#define LPUART_BAUD_SBNS(x)
#define LPUART_STAT_RXEDGIF_MASK
volatile size_t txDataSize
static const IRQn_Type s_lpuartIRQ[]
int32_t status_t
Type used for all status and error return values.
#define LPUART_WATER_TXCOUNT_SHIFT
void LPUART_TransferCreateHandle(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_callback_t callback, void *userData)
Initializes the LPUART handle.
void LPUART_TransferAbortSend(LPUART_Type *base, lpuart_handle_t *handle)
Aborts the interrupt-driven data transmit.
static void LPUART_WriteNonBlocking(LPUART_Type *base, const uint8_t *data, size_t length)
Write to TX register using non-blocking method.
#define LPUART_RX_TX_IRQS
@ kLPUART_RxDataRegFullInterruptEnable
@ kLPUART_IdleLineInterruptEnable
void LPUART_Deinit(LPUART_Type *base)
Deinitializes a LPUART instance.
#define LPUART_BAUD_RXEDGIE_MASK
#define LPUART_STAT_RDRF_MASK
#define LPUART_BAUD_SBR_MASK