Questions about S32K1xx DEMO:lin_master_baremetal

cancel
Showing results for 
Search instead for 
Did you mean: 

Questions about S32K1xx DEMO:lin_master_baremetal

594 Views
grandy_liao
Contributor I

I want to know S32K1xx LIN Send Header,  the principle of send PID? 

I found below function will sent PID: LIN_LPUART_DRV_ProcessFrameHeader(**) which local in function LIN_LPUART_DRV_ProcessFrame(***)  ,this function is only called in LIN IRQ function:LIN_LPUART_DRV_IRQHandler(***),detail code is:

else
            {
                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(instance, tmpByte);
                }
            }

if (***statement is true only if the LPUART_RX_DATA_REG_FULL flag is set,  but why this flag can be set when Master sent  sync field  successed . Did the Slave send data to the master at this time(Master sent  sync field  successed)? otherwise,I think LPUART_RX_DATA_REG_FULL  can not be set  automatically。

Labels (1)
0 Kudos
1 Reply

468 Views
hungnguyenphi
NXP Employee
NXP Employee

Hello  longsheng liao,

Because the LPUART_TX/RX connect to LIN transceiver, every signal send in TX pin will be appear in RX pin. So LPUART_RX_DATA_REG_FULL  will be set after master send SYNC.

Best regards,

Hung.

0 Kudos