Questions about S32K1xx DEMO:lin_master_baremetal

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Questions about S32K1xx DEMO:lin_master_baremetal

869 次查看
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。

标签 (1)
0 项奖励
1 回复

743 次查看
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 项奖励