LIN STACK S32K118 TX/RX

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LIN STACK S32K118 TX/RX

860 Views
riglesias2021
Contributor III

Hi, I am using the LIN stack contained in the S32 SDK for s32k118 and i need to know how the LIN driver works internally. I´m trying to understand how the driver manages to send/TX multiple bytes inside the same Interrupt handler (LIN_LPUART1_RxTx_IRQHandler)

riglesias2021_0-1624008628638.png

From my understanding, a LIN response can contain multiple data bytes, so if the interrupt is triggered because the driver have received 1 byte, the driver should be able to respond with multiple data bytes as described in the Figure 2.3. However, inspecting the code

                if (LPUART_GetStatusFlag(base, LPUART_RX_DATA_REG_FULL))
                {
                    /* Get data from Data Register & Clear LPUART_RX_DATA_REG_FULL flag */
                    LPUART_Getchar(base, &tmpByte);

                    /* Process data in Data Register while receive, send data */
                    LIN_LPUART_DRV_ProcessFrame(instancetmpByte);
                }
I see that only one call of LPUART_PutChar() is made every LPUART_RX_DATA_REG_FULL interrupt is triggered, so i think that only only one byte is transmitted for each byte received. Could anybody clarify this? Thanks

 

Labels (1)
Tags (1)
0 Kudos
1 Reply

839 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes byte by byte process is done. For each byte received LIN_LPUART_DRV_ProcessFrame is called and upon driver state new byte will be received or send. 

BR, Petr

0 Kudos