LIN Controller (LINFlex) RM0046
522/936 Doc ID 16912 Rev 5
the BOF bit in the LINESR. Which message is lost depends on the buffer lock function
control bit RBLM.
â—Ź If the buffer lock function control bit is cleared (LINCR1[RBLM] = 0) the old message in
the buffer is overwritten by the most recent message.
â—Ź If buffer lock function control bit is set (LINCR1[RBLM] = 1) the most recent message is
discarded, and the oldest message is available in the buffer.
Slave mode
In Slave mode the application uses the message buffer to handle the LIN messages. Slave
mode is selected when LINCR1[MME] = 0.
Data transmission (transceiver as publisher)
When LINFlex receives the identifier, the LINSR[HRF] is set and, if LINIER[HRIE] = 1, an
RX interrupt is generated. The software must read the received identifier in the BIDR, fill the
BDR registers, specify the data field length using the BIDR[DFL] and trigger the data
transmission by setting the LINCR2[DTRQ] bit.
One or several identifier filters can be configured for transmission by setting the IFCRx[DIR]
bit and activated by setting one or several bits in the IFER.
When at least one identifier filter is configured in transmission and activated, and if the
received identifier matches the filter, a specific TX interrupt (instead of an RX interrupt) is
generated.
Typically, the application has to copy the data from SRAM locations to the BDR. To copy the
data to the right location, the application has to identify the data by means of the identifier.
To avoid this and to ease the access to the SRAM locations, the LINFlex controller provides
a Filter Match Index. This index value is the number of the filter that matched the received
identifier.
The software can use the index in the IFMI register to directly access the pointer that points
to the right data array in the SRAM area and copy this data to the BDR (see Figure 259).
Using a filter avoids the software having to configure the direction, the data field length and
the checksum type in the BIDR. The software fills the BDR and triggers the data
transmission by programming LINCR2[DTRQ] = 1.
If LINFlex cannot provide enough TX identifier filters to handle all identifiers the software has
to transmit data for, then a filter can be configured in mask mode (see Section , Slave mode
with identifier filtering) in order to manage several identifiers with one filter only.
Data reception (transceiver as subscriber)
When LINFlex receives the identifier, the LINSR[HRF] bit is set and, if LINIER[HRIE] = 1, an
RX interrupt is generated. The software must read the received identifier in the BIDR and
specify the data field length using the BIDR[DFL] field before receiving the stop bit of the
first byte of data field.
When the checksum reception is completed, an RX interrupt is generated to allow the
software to read the received data in the BDR registers.
One or several identifier filters can be configured for reception by programming
IFCRx[DIR] = 0 and activated by setting one or several bits in the IFER.
When at least one identifier filter is configured in reception and activated, and if the received
identifier matches the filter, an RX interrupt is generated after the checksum reception only.