Questions about S32K1xx DEMO:lin_master_baremetal

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Questions about S32K1xx DEMO:lin_master_baremetal

860件の閲覧回数
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 返信

734件の閲覧回数
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 件の賞賛