0% found this document useful (0 votes)
28 views1 page

LIN Maestro

This document outlines the state machine process for LIN (Local Interconnect Network) message transmission and reception. It defines several states including IDLE, transmitting sync, ID, checksum and receiving data and checksum. It describes the events and actions taken within each state, such as enabling/disabling interrupts, sending data/ID symbols, calculating and comparing checksums, and calling callbacks on completion or error conditions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views1 page

LIN Maestro

This document outlines the state machine process for LIN (Local Interconnect Network) message transmission and reception. It defines several states including IDLE, transmitting sync, ID, checksum and receiving data and checksum. It describes the events and actions taken within each state, such as enabling/disabling interrupts, sending data/ID symbols, calculating and comparing checksums, and calling callbacks on completion or error conditions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

LINMSTR_IDLE

LINMSTR_TX_SYNCH
LINMSTR_TX_ID
LINMSTR_TX_CHKSUM
LINMSTR_RX_DATA
LINMSTR_RX_CHKSUM
Event==LIN_EV_TX_START
/ COPY_MSG_DATA_TO_INTERNAL_BUFFER()
SEND_BREAK_SYMBOL()
ENABLE_TX_INTERRUPTS()
Event==LIN_EV_TX_OK
/ SEND_SYNCH_SYMBOL()
Event==LIN_EV_TX_OK
AND msgDir==TX
AND msgDataLength>0
/ SEND_DATA_BYTE(0)
X=1
LINMSTR_TX_DATA
Event==LIN_EV_TX_OK
AND msgDataLength>X
/ SEND_DATA_BYTE(X)
X = X+1
Event==LIN_EV_TX_OK
AND msgDataLength<=X
/ CALCULATE_CHECKSUM()
SEND_CHECKSUM()
Event==LIN_EV_TX_OK
/ SET_MSG_TRANSMISSION_FLAG()
CALL_MSG_TRANSMISSION_CALLBACK()
DISABLE_TX_INTERRUPTS()
Event==LIN_EV_TX_OK
AND msgDir==RX
AND msgDataLength>0
/ X=1
DISABLE_TX_INTERRUPTS()
ENABLE_RX_INTERRUPTS()
START_TIMEOUT_TIMER()
Event==LIN_EV_RX_OK
AND msgDataLength>X
/ GET_DATA_BYTE(X)
X=X+1
LINMSTR_END_OF_HEADER
Event==LIN_EV_TX_OK
/ SEND_ID_SYMBOL()
Event==LIN_EV_TX_OK
AND msgDir==TX
AND msgDataLength==0
/ CALCULATE_CHECKSUM()
SEND_CHECKSUM()
/ DISABLE_TX_INTERRUPTS()
DISABLE_RX_INTERRUPTS()
Event==LIN_EV_RX_OK
AND msgDataLength<=X
/ GET_DATA_BYTE(X)
Event==LIN_EV_TX_OK
AND msgDir==RX
AND msgDataLength==0
/ X=1
DISABLE_TX_INTERRUPTS()
ENABLE_RX_INTERRUPTS()
START_TIMEOUT_TIMER()
Event==LIN_EV_RX_OK
/ GET_CHECKSUM_BYTE(X)
CALCULATE_CHECKSUM()
IF ( CHEKSUM_MATCH() ) THEN
COPY_INTERNAL_BUFFER_TO_MSG_DATA()
SET_MSG_RECEPTION_FLAG()
CALL_MSG_RECEPTION_CALLBACK()
ELSE
CALL_CHKSUM_ERROR_CALLBACK()
END IF
DISABLE_RX_INTERRUPTS()
T
Event==LIN_EV_TIMEOUT
/ CALL_TIMEOUT_ERROR_CALLBACK()
DISABLE_TX_INTERRUPTS()
DISABLE_RX_INTERRUPTS()
T
T
T
T
T
T T

You might also like