1 /*
2  * Copyright  2016-2019 NXP
3  * All rights reserved.
4  *
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 
9 #ifndef FSL_LIN_LPUART_H_
10 #define FSL_LIN_LPUART_H_
11 
12 /*******************************************************************************
13  * Includes
14  ******************************************************************************/
15 #include "fsl_common.h"
16 
17 #if defined(FSL_SDK_LIN_STACK_ENABLE) && (FSL_SDK_LIN_STACK_ENABLE)
18 #include "lin.h"
19 #else
20 #include "fsl_lin.h"
21 #endif
22 
23 /*!
24  * @addtogroup lin_lpuart_driver
25  * @{
26  */
27 
28 /*******************************************************************************
29  * Definitions
30  ******************************************************************************/
31 
32 typedef enum _lin_lpuart_stop_bit_count
33 {
34     kLPUART_OneStopBit = 0U, /*!< One stop bit */
35     kLPUART_TwoStopBit = 1U, /*!< Two stop bits */
36 } lin_lpuart_stop_bit_count_t;
37 
38 enum _lin_lpuart_flags
39 {
40     kLPUART_TxDataRegEmptyFlag =
41         (LPUART_STAT_TDRE_MASK), /*!< Transmit data register empty flag, sets when transmit buffer is empty */
42     kLPUART_TransmissionCompleteFlag =
43         (LPUART_STAT_TC_MASK), /*!< Transmission complete flag, sets when transmission activity complete */
44     kLPUART_RxDataRegFullFlag =
45         (LPUART_STAT_RDRF_MASK), /*!< Receive data register full flag, sets when the receive data buffer is full */
46     kLPUART_IdleLineFlag  = (LPUART_STAT_IDLE_MASK), /*!< Idle line detect flag, sets when idle line detected */
47     kLPUART_RxOverrunFlag = (LPUART_STAT_OR_MASK),   /*!< Receive Overrun, sets when new data is received before data is
48                                                         read from receive register */
49     kLPUART_NoiseErrorFlag = (LPUART_STAT_NF_MASK),  /*!< Receive takes 3 samples of each received bit.  If any of these
50                                                         samples differ, noise flag sets */
51     kLPUART_FramingErrorFlag =
52         (LPUART_STAT_FE_MASK), /*!< Frame error flag, sets if logic 0 was detected where stop bit expected */
53     kLPUART_ParityErrorFlag = (LPUART_STAT_PF_MASK), /*!< If parity enabled, sets upon parity error detection */
54 #if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT
55     kLPUART_LinBreakFlag = (int)(LPUART_STAT_LBKDIF_MASK), /*!< LIN break detect interrupt flag, sets when LIN break
56                                                          char detected and LIN circuit enabled */
57 #endif
58     kLPUART_RxActiveEdgeFlag =
59         (LPUART_STAT_RXEDGIF_MASK), /*!< Receive pin active edge interrupt flag, sets when active edge detected */
60     kLPUART_RxActiveFlag =
61         (LPUART_STAT_RAF_MASK), /*!< Receiver Active Flag (RAF), sets at beginning of valid start bit */
62 #if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING
63     kLPUART_DataMatch1Flag = LPUART_STAT_MA1F_MASK, /*!< The next character to be read from LPUART_DATA matches MA1*/
64     kLPUART_DataMatch2Flag = LPUART_STAT_MA2F_MASK, /*!< The next character to be read from LPUART_DATA matches MA2*/
65 #endif
66 #if defined(FSL_FEATURE_LPUART_HAS_EXTENDED_DATA_REGISTER_FLAGS) && FSL_FEATURE_LPUART_HAS_EXTENDED_DATA_REGISTER_FLAGS
67     kLPUART_NoiseErrorInRxDataRegFlag =
68         (LPUART_DATA_NOISY_MASK >> 10), /*!< NOISY bit, sets if noise detected in current data word */
69     kLPUART_ParityErrorInRxDataRegFlag =
70         (LPUART_DATA_PARITYE_MASK >> 10), /*!< PARITY bit, sets if noise detected in current data word */
71 #endif
72 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
73     kLPUART_TxFifoEmptyFlag = (LPUART_FIFO_TXEMPT_MASK >> 16), /*!< TXEMPT bit, sets if transmit buffer is empty */
74     kLPUART_RxFifoEmptyFlag = (LPUART_FIFO_RXEMPT_MASK >> 16), /*!< RXEMPT bit, sets if receive buffer is empty */
75     kLPUART_TxFifoOverflowFlag =
76         (LPUART_FIFO_TXOF_MASK >> 16), /*!< TXOF bit, sets if transmit buffer overflow occurred */
77     kLPUART_RxFifoUnderflowFlag =
78         (LPUART_FIFO_RXUF_MASK >> 16), /*!< RXUF bit, sets if receive buffer underflow occurred */
79 #endif
80 };
81 
82 enum _lin_lpuart_interrupt_enable
83 {
84 #if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT
85     kLPUART_LinBreakInterruptEnable = (LPUART_BAUD_LBKDIE_MASK >> 8), /*!< LIN break detect. */
86 #endif
87     kLPUART_RxActiveEdgeInterruptEnable         = (LPUART_BAUD_RXEDGIE_MASK >> 8), /*!< Receive Active Edge. */
88     kLPUART_TxDataRegEmptyInterruptEnable       = (LPUART_CTRL_TIE_MASK),          /*!< Transmit data register empty. */
89     kLPUART_TransmissionCompleteInterruptEnable = (LPUART_CTRL_TCIE_MASK),         /*!< Transmission complete. */
90     kLPUART_RxDataRegFullInterruptEnable        = (LPUART_CTRL_RIE_MASK),          /*!< Receiver data register full. */
91     kLPUART_IdleLineInterruptEnable             = (LPUART_CTRL_ILIE_MASK),         /*!< Idle line. */
92     kLPUART_RxOverrunInterruptEnable            = (LPUART_CTRL_ORIE_MASK),         /*!< Receiver Overrun. */
93     kLPUART_NoiseErrorInterruptEnable           = (LPUART_CTRL_NEIE_MASK),         /*!< Noise error flag. */
94     kLPUART_FramingErrorInterruptEnable         = (LPUART_CTRL_FEIE_MASK),         /*!< Framing error flag. */
95     kLPUART_ParityErrorInterruptEnable          = (LPUART_CTRL_PEIE_MASK),         /*!< Parity error flag. */
96 #if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
97     kLPUART_TxFifoOverflowInterruptEnable  = (LPUART_FIFO_TXOFE_MASK >> 8), /*!< Transmit FIFO Overflow. */
98     kLPUART_RxFifoUnderflowInterruptEnable = (LPUART_FIFO_RXUFE_MASK >> 8), /*!< Receive FIFO Underflow. */
99 #endif
100 };
101 
102 enum _lin_lpuart_status
103 {
104     kStatus_LPUART_TxBusy                  = MAKE_STATUS(kStatusGroup_LPUART, 0), /*!< TX busy */
105     kStatus_LPUART_RxBusy                  = MAKE_STATUS(kStatusGroup_LPUART, 1), /*!< RX busy */
106     kStatus_LPUART_TxIdle                  = MAKE_STATUS(kStatusGroup_LPUART, 2), /*!< LPUART transmitter is idle. */
107     kStatus_LPUART_RxIdle                  = MAKE_STATUS(kStatusGroup_LPUART, 3), /*!< LPUART receiver is idle. */
108     kStatus_LPUART_TxWatermarkTooLarge     = MAKE_STATUS(kStatusGroup_LPUART, 4), /*!< TX FIFO watermark too large  */
109     kStatus_LPUART_RxWatermarkTooLarge     = MAKE_STATUS(kStatusGroup_LPUART, 5), /*!< RX FIFO watermark too large  */
110     kStatus_LPUART_FlagCannotClearManually = MAKE_STATUS(kStatusGroup_LPUART, 6), /*!< Some flag can't manually clear */
111     kStatus_LPUART_Error                   = MAKE_STATUS(kStatusGroup_LPUART, 7), /*!< Error happens on LPUART. */
112     kStatus_LPUART_RxRingBufferOverrun =
113         MAKE_STATUS(kStatusGroup_LPUART, 8), /*!< LPUART RX software ring buffer overrun. */
114     kStatus_LPUART_RxHardwareOverrun = MAKE_STATUS(kStatusGroup_LPUART, 9),  /*!< LPUART RX receiver overrun. */
115     kStatus_LPUART_NoiseError        = MAKE_STATUS(kStatusGroup_LPUART, 10), /*!< LPUART noise error. */
116     kStatus_LPUART_FramingError      = MAKE_STATUS(kStatusGroup_LPUART, 11), /*!< LPUART framing error. */
117     kStatus_LPUART_ParityError       = MAKE_STATUS(kStatusGroup_LPUART, 12), /*!< LPUART parity error. */
118 };
119 
120 typedef enum
121 {
122     LPUART_8_BITS_PER_CHAR  = 0x0U, /*!< 8-bit data characters */
123     LPUART_9_BITS_PER_CHAR  = 0x1U, /*!< 9-bit data characters */
124     LPUART_10_BITS_PER_CHAR = 0x2U  /*!< 10-bit data characters */
125 } lin_lpuart_bit_count_per_char_t;
126 
127 /*******************************************************************************
128  * Definitions
129  ******************************************************************************/
130 
131 /* Accept Master baudrate deviation from the slave baudrate to be 2% */
132 #define AUTOBAUD_BAUDRATE_TOLERANCE (uint32_t)2U
133 #define BIT_RATE_TOLERANCE_UNSYNC   (uint32_t)14U
134 /* calculate range of one bit time with baudrate 19200 by formula {1000000/19200*(100 +
135  * AUTOBAUD_BAUDRATE_TOLERANCE))/100} */
136 #define BIT_DURATION_MAX_19200 (uint32_t)(100000U * (100U + AUTOBAUD_BAUDRATE_TOLERANCE) / 192U)
137 #define BIT_DURATION_MIN_19200 (uint32_t)(100000U * (100U - AUTOBAUD_BAUDRATE_TOLERANCE) / 192U)
138 /* calculate range of one bit time with baudrate 14400 by formula {1000000/19200*(100 +
139  * AUTOBAUD_BAUDRATE_TOLERANCE))/100} */
140 #define BIT_DURATION_MAX_14400 (uint32_t)(100000U * (100U + AUTOBAUD_BAUDRATE_TOLERANCE) / 144U)
141 #define BIT_DURATION_MIN_14400 (uint32_t)(100000U * (100U - AUTOBAUD_BAUDRATE_TOLERANCE) / 144U)
142 /* calculate range of one bit time with baudrate 9600 by formula {1000000/19200*(100 +
143  * AUTOBAUD_BAUDRATE_TOLERANCE))/100} */
144 #define BIT_DURATION_MAX_9600 (uint32_t)(100000U * (100U + AUTOBAUD_BAUDRATE_TOLERANCE) / 96U)
145 #define BIT_DURATION_MIN_9600 (uint32_t)(100000U * (100U - AUTOBAUD_BAUDRATE_TOLERANCE) / 96U)
146 /* calculate range of one bit time with baudrate 4800 by formula {1000000/19200*(100 +
147  * AUTOBAUD_BAUDRATE_TOLERANCE))/100} */
148 #define BIT_DURATION_MAX_4800 (uint32_t)(100000U * (100U + AUTOBAUD_BAUDRATE_TOLERANCE) / 48U)
149 #define BIT_DURATION_MIN_4800 (uint32_t)(100000U * (100U - AUTOBAUD_BAUDRATE_TOLERANCE) / 48U)
150 /* calculate range of one bit time with baudrate 2400 by formula {1000000/19200*(100 +
151  * AUTOBAUD_BAUDRATE_TOLERANCE))/100} */
152 #define BIT_DURATION_MAX_2400 (uint32_t)(100000U * (100U + AUTOBAUD_BAUDRATE_TOLERANCE) / 24U)
153 #define BIT_DURATION_MIN_2400 (uint32_t)(100000U * (100U - AUTOBAUD_BAUDRATE_TOLERANCE) / 24U)
154 
155 /* calculate range of two bit time with baudrate 19200 */
156 #define TWO_BIT_DURATION_MAX_19200 (2U * BIT_DURATION_MAX_19200)
157 #define TWO_BIT_DURATION_MIN_19200 (2U * BIT_DURATION_MIN_19200)
158 /* calculate range of two bit time with baudrate 14400 */
159 #define TWO_BIT_DURATION_MAX_14400 (2U * BIT_DURATION_MAX_14400)
160 #define TWO_BIT_DURATION_MIN_14400 (2U * BIT_DURATION_MIN_14400)
161 /* calculate range of two bit time with baudrate 9600 */
162 #define TWO_BIT_DURATION_MAX_9600 (2U * BIT_DURATION_MAX_9600)
163 #define TWO_BIT_DURATION_MIN_9600 (2U * BIT_DURATION_MIN_9600)
164 /* calculate range of two bit time with baudrate 4800 */
165 #define TWO_BIT_DURATION_MAX_4800 (2U * BIT_DURATION_MAX_4800)
166 #define TWO_BIT_DURATION_MIN_4800 (2U * BIT_DURATION_MIN_4800)
167 /* calculate range of two bit time with baudrate 2400 */
168 #define TWO_BIT_DURATION_MAX_2400 (2U * BIT_DURATION_MAX_2400)
169 #define TWO_BIT_DURATION_MIN_2400 (2U * BIT_DURATION_MIN_2400)
170 
171 /* calculate range of 13 bit time minimum with baudrate 19200 for autobaud feature */
172 #define AUTOBAUD_BREAK_TIME_MIN (13U * BIT_DURATION_MIN_19200)
173 /*******************************************************************************
174  * API
175  ******************************************************************************/
176 #if defined(__cplusplus)
177 extern "C" {
178 #endif
179 
LIN_LPUART_GetRxDataPolarity(const LPUART_Type * base)180 static inline bool LIN_LPUART_GetRxDataPolarity(const LPUART_Type *base)
181 {
182     return (((base->STAT >> LPUART_STAT_RXINV_SHIFT) & 1U) > 0U);
183 }
184 
LIN_LPUART_SetRxDataPolarity(LPUART_Type * base,bool polarity)185 static inline void LIN_LPUART_SetRxDataPolarity(LPUART_Type *base, bool polarity)
186 {
187     base->STAT = (base->STAT & ~LPUART_STAT_RXINV_MASK) | ((polarity ? 1UL : 0UL) << LPUART_STAT_RXINV_SHIFT);
188 }
189 
LIN_LPUART_WriteByte(LPUART_Type * base,uint8_t data)190 static inline void LIN_LPUART_WriteByte(LPUART_Type *base, uint8_t data)
191 {
192     volatile uint8_t *dataRegBytes = (volatile uint8_t *)(&(base->DATA));
193     dataRegBytes[0]                = data;
194 }
195 
LIN_LPUART_ReadByte(const LPUART_Type * base,uint8_t * readData)196 static inline void LIN_LPUART_ReadByte(const LPUART_Type *base, uint8_t *readData)
197 {
198     *readData = (uint8_t)base->DATA;
199 }
200 
201 /*!
202  * @brief Calculates the best osr and sbr value for configured baudrate
203  *
204  * @param base LPUART peripheral base address
205  * @param baudRate_Bps user configuration structure of type #lin_user_config_t
206  * @param srcClock_Hz pointer to the LIN_LPUART driver state structure
207  * @param osr pointer to osr value
208  * @param sbr pointer to sbr value
209  * @return An error code or lin_status_t
210  */
211 status_t LIN_LPUART_CalculateBaudRate(
212     LPUART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz, uint32_t *osr, uint16_t *sbr);
213 
214 /*!
215  * @brief Configure baudrate according to osr and sbr value
216  *
217  * @param base LPUART peripheral base address
218  * @param osr pointer to osr value
219  * @param sbr pointer to sbr value
220  */
221 void LIN_LPUART_SetBaudRate(LPUART_Type *base, uint32_t *osr, uint16_t *sbr);
222 
223 /*!
224  * @brief Initializes an LIN_LPUART instance for LIN Network.
225  *
226  * The caller provides memory for the driver state structures during initialization.
227  * The user must select the LIN_LPUART clock source in the application to initialize the LIN_LPUART.
228  * This function initializes a LPUART instance for operation.
229  * This function will initialize the run-time state structure to keep track of
230  * the on-going transfers, initialize the module to user defined settings and
231  * default settings, set break field length to be 13 bit times minimum, enable
232  * the break detect interrupt, Rx complete interrupt, frame error detect interrupt,
233  * and enable the LPUART module transmitter and receiver
234  *
235  * @param base LPUART peripheral base address
236  * @param linUserConfig user configuration structure of type #lin_user_config_t
237  * @param linCurrentState pointer to the LIN_LPUART driver state structure
238  * @return An error code or lin_status_t
239  */
240 lin_status_t LIN_LPUART_Init(LPUART_Type *base,
241                              lin_user_config_t *linUserConfig,
242                              lin_state_t *linCurrentState,
243                              uint32_t linSourceClockFreq);
244 
245 /*!
246  * @brief Shuts down the LIN_LPUART by disabling interrupts and transmitter/receiver.
247  *
248  * @param base LPUART peripheral base address
249  * @return An error code or lin_status_t
250  */
251 lin_status_t LIN_LPUART_Deinit(LPUART_Type *base);
252 
253 /*!
254  * @brief Sends Frame data out through the LIN_LPUART module using blocking method.
255  *  This function will calculate the checksum byte and send it with the frame data.
256  *  Blocking means that the function does not return until the transmission is complete.
257  *
258  * @param base LPUART peripheral base address
259  * @param txBuff  source buffer containing 8-bit data chars to send
260  * @param txSize the number of bytes to send
261  * @param timeoutMSec timeout value in milli seconds
262  * @return An error code or lin_status_t
263  */
264 lin_status_t LIN_LPUART_SendFrameDataBlocking(LPUART_Type *base,
265                                               const uint8_t *txBuff,
266                                               uint8_t txSize,
267                                               uint32_t timeoutMSec);
268 
269 /*!
270  * @brief Sends frame data out through the LIN_LPUART module using non-blocking method.
271  *  This enables an a-sync method for transmitting data.
272  *  Non-blocking  means that the function returns immediately.
273  *  The application has to get the transmit status to know when the transmit is complete.
274  *  This function will calculate the checksum byte and send it with the frame data.
275  *
276  * @param base LPUART peripheral base address
277  * @param txBuff  source buffer containing 8-bit data chars to send
278  * @param txSize  the number of bytes to send
279  * @return An error code or lin_status_t
280  */
281 lin_status_t LIN_LPUART_SendFrameData(LPUART_Type *base, const uint8_t *txBuff, uint8_t txSize);
282 
283 /*!
284  * @brief Get status of an on-going non-blocking transmission
285  *  While sending frame data using non-blocking method, users can
286  *  use this function to get status of that transmission.
287  *  This function return LIN_TX_BUSY while sending, or LIN_TIMEOUT
288  *  if timeout has occurred, or return LIN_SUCCESS when the transmission is complete.
289  *  The bytesRemaining shows number of bytes that still needed to transmit.
290  *
291  * @param base LPUART peripheral base address
292  * @param bytesRemaining  Number of bytes still needed to transmit
293  * @return lin_status_t LIN_TX_BUSY, LIN_SUCCESS or LIN_TIMEOUT
294  */
295 lin_status_t LIN_LPUART_GetTransmitStatus(LPUART_Type *base, uint8_t *bytesRemaining);
296 
297 /*!
298  * @brief Receives frame data through the LIN_LPUART module using blocking method.
299  *  This function will check the checksum byte. If the checksum is correct, it
300  *  will receive the frame data. Blocking means that the function does
301  *  not return until the reception is complete.
302  *
303  * @param base LPUART peripheral base address
304  * @param rxBuff  buffer containing 8-bit received data
305  * @param rxSize the number of bytes to receive
306  * @param timeoutMSec timeout value in milli seconds
307  * @return An error code or lin_status_t
308  */
309 lin_status_t LIN_LPUART_RecvFrmDataBlocking(LPUART_Type *base, uint8_t *rxBuff, uint8_t rxSize, uint32_t timeoutMSec);
310 
311 /*!
312  * @brief Receives frame data through the LIN_LPUART module using non-blocking method.
313  *  This function will check the checksum byte. If the checksum is correct, it will receive it with the frame data.
314  *  Non-blocking  means that the function returns immediately.
315  *  The application has to get the receive status to know when the reception is complete.
316  *
317  * @param base LPUART peripheral base address
318  * @param rxBuff  buffer containing 8-bit received data
319  * @param rxSize the number of bytes to receive
320  * @return An error code or lin_status_t
321  */
322 lin_status_t LIN_LPUART_RecvFrmData(LPUART_Type *base, uint8_t *rxBuff, uint8_t rxSize);
323 
324 /*!
325  * @brief Aborts an on-going non-blocking transmission/reception.
326  *  While performing a non-blocking transferring data, users can call this function
327  *  to terminate immediately the transferring.
328  *
329  * @param base LPUART peripheral base address
330  * @return An error code or lin_status_t
331  */
332 lin_status_t LIN_LPUART_AbortTransferData(LPUART_Type *base);
333 
334 /*!
335  * @brief Get status of an on-going non-blocking reception
336  *  While receiving frame data using non-blocking method, users can
337  *  use this function to get status of that receiving.
338  *  This function return the current event ID, LIN_RX_BUSY while receiving
339  *  and return LIN_SUCCESS, or timeout (LIN_TIMEOUT) when the reception is complete.
340  *  The bytesRemaining shows number of bytes that still needed to receive.
341  *
342  * @param base LPUART peripheral base address
343  * @param bytesRemaining  Number of bytes still needed to receive
344  * @return lin_status_t LIN_RX_BUSY, LIN_TIMEOUT or LIN_SUCCESS
345  */
346 lin_status_t LIN_LPUART_GetReceiveStatus(LPUART_Type *base, uint8_t *bytesRemaining);
347 
348 /*!
349  * @brief This function puts current node to sleep mode
350  * This function changes current node state to LIN_NODE_STATE_SLEEP_MODE
351  *
352  * @param base LPUART peripheral base address
353  * @return An error code or lin_status_t
354  */
355 lin_status_t LIN_LPUART_GoToSleepMode(LPUART_Type *base);
356 
357 /*!
358  * @brief Puts current LIN node to Idle state
359  * This function changes current node state to LIN_NODE_STATE_IDLE
360  *
361  * @param base LPUART peripheral base address
362  * @return An error code or lin_status_t
363  */
364 lin_status_t LIN_LPUART_GotoIdleState(LPUART_Type *base);
365 
366 /*!
367  * @brief Sends a wakeup signal through the LIN_LPUART interface
368  *
369  * @param base LPUART peripheral base address
370  * @return An error code or lin_status_t
371  */
372 lin_status_t LIN_LPUART_SendWakeupSignal(LPUART_Type *base);
373 
374 /*!
375  * @brief Sends frame header out through the LIN_LPUART module using a non-blocking method.
376  *  This function sends LIN Break field, sync field then the ID with
377  *  correct parity.
378  *
379  * @param base LPUART peripheral base address
380  * @param id  Frame Identifier
381  * @return An error code or lin_status_t
382  */
383 lin_status_t LIN_LPUART_MasterSendHeader(LPUART_Type *base, uint8_t id);
384 
385 /*!
386  * @brief Enables LIN_LPUART hardware interrupts.
387  *
388  * @param base LPUART peripheral base address
389  * @return An error code or lin_status_t
390  */
391 lin_status_t LIN_LPUART_EnableIRQ(LPUART_Type *base);
392 
393 /*!
394  * @brief Disables LIN_LPUART hardware interrupts.
395  *
396  * @param base LPUART peripheral base address
397  * @return An error code or lin_status_t
398  */
399 lin_status_t LIN_LPUART_DisableIRQ(LPUART_Type *base);
400 
401 /*!
402  * @brief This function capture bits time to detect break char, calculate
403  * baudrate from sync bits and enable transceiver if autobaud successful.
404  * This function should only be used in Slave.
405  * The timer should be in mode input capture of both rising and falling edges.
406  * The timer input capture pin should be externally connected to RXD pin.
407  *
408  * @param instance LPUART instance
409  * @return lin_status_t
410  */
411 lin_status_t LIN_LPUART_AutoBaudCapture(uint32_t instance);
412 /*!
413  * @brief LIN_LPUART RX TX interrupt handler
414  *
415  * @param base LPUART peripheral base address
416  * @return void
417  */
418 void LIN_LPUART_IRQHandler(LPUART_Type *base);
419 
420 #if defined(__cplusplus)
421 }
422 #endif
423 
424 #endif /* FSL_LIN_LPUART_H_ */
425