4 Module Documentation
Detailed information on the LIN Responder Library APIs
4.1 LIN Application
This file contains macros and prototypes for the LIN application APIs.
The APIs depend on the signals defined by the user in the Melody UI. Refer to Figure 7-1 in LIN Responder Use Case examples for the frames and signals used in this section.
4.1.1 Module description
This file contains macros and prototypes for the LIN application APIs.
4.1.1.1 Definitions
#define l_sys_init LINRESP_Initialize
4.1.1.2 Functions
l_bool l_bool_rd_Frame1_BoolSignal (void)
Reads and returns the current value of the Frame1_BoolSignal.
void l_bool_wr_Frame1_BoolSignal (l_bool v)
Sets the current value of Frame1_BoolSignal.
l_u8 l_u8_rd_Frame1_Scalar4Signal (void)
Reads and returns the current value of Frame1_Scalar4Signal.
void l_u8_wr_Frame1_Scalar4Signal (l_u8 v)
Sets the current value of Frame1_Scalar4Signal.
l_u16 l_u16_rd_Frame1_Scalar16Signal (void)
Reads and returns the current value of Frame1_Scalar16Signal.
void l_u16_wr_Frame1_Scalar16Signal (l_u16 v)
Sets the current value of Frame1_Scalar16Signal.
void l_bytes_rd_Frame1_ArraySignal (l_u8 start, l_u8 count, l_u8 *const data)
Reads and returns the current values of the selected bytes in Frame1_ArraySignal.
void l_bytes_wr_Frame1_ArraySignal (l_u8 start, l_u8 count, const l_u8 *const data)
Sets the current value of the selected bytes in Frame1_ArraySignal.
l_bool l_bool_rd_Frame2_BoolSignal (void)
Reads and returns the current value of Frame2_BoolSignal.
void l_bool_wr_Frame2_BoolSignal (l_bool v)
Sets the current value of Frame2_BoolSignal.
l_u8 l_u8_rd_Frame2_Scalar4Signal (void)
Reads and returns the current value of Frame2_Scalar4Signal.
void l_u8_wr_Frame2_Scalar4Signal (l_u8 v)
Sets the current value of Frame2_Scalar4Signal.
l_u16 l_u16_rd_Frame2_Scalar16Signal (void)
Reads and returns the current value of Frame2_Scalar16Signal.
void l_u16_wr_Frame2_Scalar16Signal (l_u16 v)
Sets the current value of Frame2_Scalar16Signal.
void l_bytes_rd_Frame2_ArraySignal (l_u8 start, l_u8 count, l_u8 *const data)
Reads and returns the current values of the selected bytes in Frame2_ArraySignal.
void l_bytes_wr_Frame2_ArraySignal (l_u8 start, l_u8 count, const l_u8 *const data)
Sets the current value of the selected bytes in Frame2_ArraySignal.
l_bool l_bool_rd_Frame3_ErrorSignal (void)
Reads and returns the current value of Frame3_ErrorSignal.
void l_bool_wr_Frame3_ErrorSignal (l_bool v)
Sets the current value of Frame3_ErrorSignal.
4.1.1.3 Initial Signal Value Macros
#define FRAME1_BOOLSIGNAL_INIT (0U)
#define FRAME1_SCALAR4SIGNAL_INIT (0U)
#define FRAME1_SCALAR16SIGNAL_INIT (0U)
#define FRAME1_ARRAYSIGNAL_INIT {1,2,3}
#define FRAME2_BOOLSIGNAL_INIT (0U)
#define FRAME2_SCALAR4SIGNAL_INIT (0U)
#define FRAME2_SCALAR16SIGNAL_INIT (0U)
#define FRAME2_ARRAYSIGNAL_INIT {1,2,3}
#define FRAME3_ERRORSIGNAL_INIT (0U)
4.1.2 Definition Documentation
4.1.2.1 FRAME1_ARRAYSIGNAL_INIT
#define FRAME1_ARRAYSIGNAL_INIT {1,2,3}
4.1.2.2 FRAME1_BOOLSIGNAL_INIT
#define FRAME1_BOOLSIGNAL_INIT (0U)
4.1.2.3 FRAME1_SCALAR16SIGNAL_INIT
#define FRAME1_SCALAR16SIGNAL_INIT (0U)
4.1.2.4 FRAME1_SCALAR4SIGNAL_INIT
#define FRAME1_SCALAR4SIGNAL_INIT (0U)
4.1.2.5 FRAME2_ARRAYSIGNAL_INIT
#define FRAME2_ARRAYSIGNAL_INIT {1,2,3}
4.1.2.6 FRAME2_BOOLSIGNAL_INIT
#define FRAME2_BOOLSIGNAL_INIT (0U)
4.1.2.7 FRAME2_SCALAR16SIGNAL_INIT
#define FRAME2_SCALAR16SIGNAL_INIT (0U)
4.1.2.8 FRAME2_SCALAR4SIGNAL_INIT
#define FRAME2_SCALAR4SIGNAL_INIT (0U)
4.1.2.9 FRAME3_ERRORSIGNAL_INIT
#define FRAME3_ERRORSIGNAL_INIT (0U)
4.1.2.10 l_sys_init
#define l_sys_init LINRESP_Initialize
Function macro for initializing the LIN system.
4.1.3 Function Documentation
4.1.3.1 l_bool_rd_Frame1_BoolSignal()
l_bool l_bool_rd_Frame1_BoolSignal (void )
Reads and returns the current value of Frame1_BoolSignal.
None. |
Read data |
4.1.3.2 l_bool_rd_Frame2_BoolSignal()
l_bool l_bool_rd_Frame2_BoolSignal (void )
Reads and returns the current value of Frame2_BoolSignal.
None. |
Read data |
4.1.3.3 l_bool_rd_Frame3_ErrorSignal()
l_bool l_bool_rd_Frame3_ErrorSignal (void )
Reads and returns the current value of Frame3_ErrorSignal.
None. |
Read data |
4.1.3.4 l_bool_wr_Frame1_BoolSignal()
void l_bool_wr_Frame1_BoolSignal (l_bool v)
Sets the current value of Frame1_BoolSignal.
l_bool v |
Write data |
None. |
4.1.3.5 l_bool_wr_Frame2_BoolSignal()
void l_bool_wr_Frame2_BoolSignal (l_bool v)
Sets the current value of Frame2_BoolSignal.
l_bool v | Write data |
None. |
4.1.3.6 l_bool_wr_Frame3_ErrorSignal()
void l_bool_wr_Frame3_ErrorSignal (l_bool v)
Sets the current value of Frame3_ErrorSignal.
l_bool |
v - Write data |
None. |
4.1.3.7 l_bytes_rd_Frame1_ArraySignal()
void l_bytes_rd_Frame1_ArraySignal (l_u8 start, l_u8 count, l_u8 *const data)
Reads and returns the current values of the selected bytes in Frame1_ArraySignal.
l_u8 start |
Index of the first byte to read from |
l_u8 count |
Number of bytes to read |
l_u8* data |
Target address where data will be written |
None. |
4.1.3.8 l_bytes_rd_Frame2_ArraySignal()
void l_bytes_rd_Frame2_ArraySignal (l_u8 start, l_u8 count, l_u8 *const data)
Reads and returns the current values of the selected bytes in Frame2_ArraySignal.
l_u8 start |
Index of the first byte to read from |
l_u8 count |
Number of bytes to read |
l_u8* data |
Target address where data will be written |
None. |
4.1.3.9 l_bytes_wr_Frame1_ArraySignal()
void l_bytes_wr_Frame1_ArraySignal (l_u8 start, l_u8 count, const l_u8 *const data)
Sets the current value of the selected bytes in Frame1_ArraySignal.
l_u8 start | Index of the first byte to write to |
l_u8 count | Number of bytes to write |
l_u8* data | Source address where data is read from |
None. |
4.1.3.10 l_bytes_wr_Frame2_ArraySignal()
void l_bytes_wr_Frame2_ArraySignal (l_u8 start, l_u8 count, const l_u8 *const data)
Sets the current value of the selected bytes in Frame2_ArraySignal.
l_u8 start |
Index of the first byte to write to |
l_u8 count |
Number of bytes to write |
l_u8* data |
Source address where data is read from |
None. |
4.1.3.11 l_u16_rd_Frame1_Scalar16Signal()
l_u16 l_u16_rd_Frame1_Scalar16Signal (void )
Reads and returns the current value of Frame1_Scalar16Signal.
None. |
Read data |
4.1.3.12 l_u16_rd_Frame2_Scalar16Signal()
l_u16 l_u16_rd_Frame2_Scalar16Signal (void )
Reads and returns the current value of Frame2_Scalar16Signal.
None. |
Read data |
4.1.3.13 l_u16_wr_Frame1_Scalar16Signal()
void l_u16_wr_Frame1_Scalar16Signal (l_u16 v)
Sets the current value of Frame1_Scalar16Signal.
l_u16 v |
Write data |
None. |
4.1.3.14 l_u16_wr_Frame2_Scalar16Signal()
void l_u16_wr_Frame2_Scalar16Signal (l_u16 v)
Sets the current value of Frame2_Scalar16Signal.
l_u16 v |
Write data |
None. |
4.1.3.15 l_u8_rd_Frame1_Scalar4Signal()
l_u8 l_u8_rd_Frame1_Scalar4Signal (void )
Reads and returns the current value of Frame1_Scalar4Signal.
None. |
Read data |
4.1.3.16 l_u8_rd_Frame2_Scalar4Signal()
l_u8 l_u8_rd_Frame2_Scalar4Signal (void )
Reads and returns the current value of Frame2_Scalar4Signal.
None. |
Read data |
4.1.3.17 l_u8_wr_Frame1_Scalar4Signal()
void l_u8_wr_Frame1_Scalar4Signal (l_u8 v)
Sets the current value of Frame1_Scalar4Signal.
l_u8 |
v - Write data |
None. |
4.1.3.18 l_u8_wr_Frame2_Scalar4Signal()
void l_u8_wr_Frame2_Scalar4Signal (l_u8 v)
Sets the current value of Frame2_Scalar4Signal.
l_u8 |
v - Write data |
None. |
4.2 LIN Configuration
This file contains data types and prototypes for the LIN Responder configurations.
The APIs depend on the frames defined by the user in the Melody UI. Refer to Figure 7-1 in LIN Responder Use Case Examples for the frames and signals used in this section.
4.2.1 Module description
This file contains data types and prototypes for the LIN Responder configurations.
4.2.1.1 Data structures
4.2.1.2 Definitions
#define SCHED_TABLE_LENGTH (3U)
Defines the total number of frames in the schedule table.
4.2.1.3 Enumerations
4.2.1.4 Functions
bool LINRESP_Initialize (void)
Sets up the necessary configurations and initializes the LIN Responder module.
void LINRESP_Deinitialize (void)
Deinitializes the LIN Responder module.
void LINRESP_DataProcess (void)
Processes the received or transmitted data.
void FRAME1_AppCallbackRegister (void(*callback)(void))
Registers a callback function for a Frame1 receive/transmit event.
void FRAME2_AppCallbackRegister (void(*callback)(void))
Registers a callback function for a Frame2 receive/transmit event.
void FRAME3_AppCallbackRegister (void(*callback)(void))
Registers a callback function for a Frame3 receive/transmit event.
static void LINRESP_RespErrorSet (void)
Sets the node's response_error signal.
static void LINRESP_RespErrorClr (void)
Clears the node's response_error signal.
4.2.1.5 Variables
lin_rx_cmd_t schedTable [SCHED_TABLE_LENGTH]
Declaration of the schedule table.
-
Declaration of the number of frames in a schedule table.
-
Declaration of the Frame1 data.
-
Declaration of the Frame2 data.
-
Declaration of the Frame3 data.
4.2.1.6 Frame Data Length Macros
#define FRAME1_BYTES (6U)
#define FRAME2_BYTES (6U)
#define FRAME3_BYTES (1U)
4.2.1.7 Frame Response Timeout Macros
#define FRAME1_TIMEOUT_MS (10U)
#define FRAME2_TIMEOUT_MS (10U)
#define FRAME3_TIMEOUT_MS (3U)
4.2.1.8 Data Type Definitions
4.2.1.9 Signal Data Length Macros
#define FRAME1_BOOLSIGNAL_BITS (1U)
#define FRAME1_SCALAR4SIGNAL_BITS (4U)
#define FRAME1_SCALAR16SIGNALH_BITS (8U)
#define FRAME1_SCALAR16SIGNALL_BITS (8U)
#define FRAME1_ARRAYSIGNAL_BYTES (3U)
#define FRAME2_BOOLSIGNAL_BITS (1U)
#define FRAME2_SCALAR4SIGNAL_BITS (4U)
#define FRAME2_SCALAR16SIGNALH_BITS (8U)
#define FRAME2_SCALAR16SIGNALL_BITS (8U)
#define FRAME2_ARRAYSIGNAL_BYTES (3U)
#define FRAME3_ERRORSIGNAL_BITS (1U)
4.2.1.10 Signal Bit Mask Macros
#define FRAME1_BOOLSIGNAL_BITMASK (0x01U)
#define FRAME1_SCALAR4SIGNAL_BITMASK (0x0FU)
#define FRAME1_SCALAR16SIGNALH_BITMASK (0xFFU)
#define FRAME1_SCALAR16SIGNALL_BITMASK (0xFFU)
#define FRAME2_BOOLSIGNAL_BITMASK (0x01U)
#define FRAME2_SCALAR4SIGNAL_BITMASK (0x0FU)
#define FRAME2_SCALAR16SIGNALH_BITMASK (0xFFU)
#define FRAME2_SCALAR16SIGNALL_BITMASK (0xFFU)
#define FRAME3_ERRORSIGNAL_BITMASK (0x01U)
4.2.2 Definition Documentation
4.2.2.1 FRAME1_ARRAYSIGNAL_BYTES
#define FRAME1_ARRAYSIGNAL_BYTES (3U)
4.2.2.2 FRAME1_BOOLSIGNAL_BITMASK
#define FRAME1_BOOLSIGNAL_BITMASK (0x01U)
4.2.2.3 FRAME1_BOOLSIGNAL_BITS
#define FRAME1_BOOLSIGNAL_BITS (1U)
4.2.2.4 FRAME1_BYTES
#define FRAME1_BYTES (6U)
4.2.2.5 FRAME1_SCALAR16SIGNALH_BITMASK
#define FRAME1_SCALAR16SIGNALH_BITMASK (0xFFU)
4.2.2.6 FRAME1_SCALAR16SIGNALH_BITS
#define FRAME1_SCALAR16SIGNALH_BITS (8U)
4.2.2.7 FRAME1_SCALAR16SIGNALL_BITMASK
#define FRAME1_SCALAR16SIGNALL_BITMASK (0xFFU)
4.2.2.8 FRAME1_SCALAR16SIGNALL_BITS
#define FRAME1_SCALAR16SIGNALL_BITS (8U)
4.2.2.9 FRAME1_SCALAR4SIGNAL_BITMASK
#define FRAME1_SCALAR4SIGNAL_BITMASK (0x0FU)
4.2.2.10 FRAME1_SCALAR4SIGNAL_BITS
#define FRAME1_SCALAR4SIGNAL_BITS (4U)
4.2.2.11 FRAME1_TIMEOUT_MS
#define FRAME1_TIMEOUT_MS (10U)
4.2.2.12 FRAME2_ARRAYSIGNAL_BYTES
#define FRAME2_ARRAYSIGNAL_BYTES (3U)
4.2.2.13 FRAME2_BOOLSIGNAL_BITMASK
#define FRAME2_BOOLSIGNAL_BITMASK (0x01U)
4.2.2.14 FRAME2_BOOLSIGNAL_BITS
#define FRAME2_BOOLSIGNAL_BITS (1U)
4.2.2.15 FRAME2_BYTES
#define FRAME2_BYTES (6U)
4.2.2.16 FRAME2_SCALAR16SIGNALH_BITMASK
#define FRAME2_SCALAR16SIGNALH_BITMASK (0xFFU)
4.2.2.17 FRAME2_SCALAR16SIGNALH_BITS
#define FRAME2_SCALAR16SIGNALH_BITS (8U)
4.2.2.18 FRAME2_SCALAR16SIGNALL_BITMASK
#define FRAME2_SCALAR16SIGNALL_BITMASK (0xFFU)
4.2.2.19 FRAME2_SCALAR16SIGNALL_BITS
#define FRAME2_SCALAR16SIGNALL_BITS (8U)
4.2.2.20 FRAME2_SCALAR4SIGNAL_BITMASK
#define FRAME2_SCALAR4SIGNAL_BITMASK (0x0FU)
4.2.2.21 FRAME2_SCALAR4SIGNAL_BITS
#define FRAME2_SCALAR4SIGNAL_BITS (4U)
4.2.2.22 FRAME2_TIMEOUT_MS
#define FRAME2_TIMEOUT_MS (10U)
4.2.2.23 FRAME3_BYTES
#define FRAME3_BYTES (1U)
4.2.2.24 FRAME3_ERRORSIGNAL_BITMASK
#define FRAME3_ERRORSIGNAL_BITMASK (0x01U)
4.2.2.25 FRAME3_ERRORSIGNAL_BITS
#define FRAME3_ERRORSIGNAL_BITS (1U)
4.2.2.26 FRAME3_TIMEOUT_MS
#define FRAME3_TIMEOUT_MS (3U)
4.2.2.27 SCHED_TABLE_LENGTH
#define SCHED_TABLE_LENGTH (3U)
Defines the total number of frames in the schedule table.
4.2.3 Typedef Documentation
4.2.3.1 l_bool
typedef bool l_bool
4.2.3.2 l_u16
typedef uint16_t l_u16
4.2.3.3 l_u8
typedef uint8_t l_u8
4.2.4 Function Documentation
4.2.4.1 FRAME1_AppCallbackRegister()
void FRAME1_AppCallbackRegister (void (*callback) void)
Registers a callback function for a Frame1 receive/transmit event.
*callback |
- A pointer to the callback function to be registered |
None. |
4.2.4.2 FRAME2_AppCallbackRegister()
void FRAME2_AppCallbackRegister (void (*callback) void)
Registers a callback function for a Frame2 receive/transmit event.
*callback |
- A pointer to the callback function to be registered |
None. |
4.2.4.3 FRAME3_AppCallbackRegister()
void FRAME3_AppCallbackRegister (void (*callback) void)
Registers a callback function for a Frame3 receive/transmit event.
*callback |
- A pointer to the callback function to be registered |
None. |
4.2.4.4 LINRESP_DataProcess()
void LINRESP_DataProcess (void )
Processes the received or transmitted data.
None. |
None. |
4.2.4.5 LINRESP_Deinitialize()
void LINRESP_Deinitialize (void )
Deinitializes the LIN Responder module.
None. |
None. |
4.2.4.6 LINRESP_Initialize()
bool LINRESP_Initialize (void )
Sets up the necessary configurations and initializes the LIN Responder module.
None. |
True |
- Initialization is successful |
False |
- Initialization is not successful |
Section: Global Function Definitions
4.2.4.7 LINRESP_RespErrorClr()
void LINRESP_RespErrorClr (void )[static]
Clears the node's response_error signal.
None. |
None. |
4.2.4.8 LINRESP_RespErrorSet()
void LINRESP_RespErrorSet (void )[static]
Sets the node's response_error signal.
Section: Local Function Declarations
None. |
None. |
Section: Local Function Definitions
4.2.5 Enumeration Type Documentation
4.2.5.1 lin_cmd_t
enum lin_cmd_t
Enumeration for the frames and their command identifiers.
FRAME1 | |
FRAME2 | |
FRAME3 |
4.2.6 Variable Documentation
4.2.6.1 Frame1
frame1_t Frame1
Declaration of the Frame1 data.
4.2.6.2 Frame2
frame2_t Frame2
Declaration of the Frame2 data.
4.2.6.3 Frame3
frame3_t Frame3
Declaration of the Frame3 data.
4.2.6.4 schedTable
lin_rx_cmd_t schedTable[SCHED_TABLE_LENGTH]
Declaration of the schedule table.
4.2.6.5 schedTableSize
l_u8 schedTableSize
Declaration of the number of frames in a schedule table.
4.3 LIN HAL
This file contains the HAL interfaces for the LIN Responder hardware functions.
4.3.1 Module description
This file contains the HAL interfaces for the LIN Responder hardware functions.
4.3.1.1 Data structures
4.4 LIN Responder
This file contains data types and prototypes for the LIN Responder functions.
4.4.1 Module description
This file contains data types and prototypes for the LIN Responder functions.
4.4.1.1 Data structures
struct lin_rx_cmd_t
Structure for a received LIN command.
struct lin_packet_t
Structure for a LIN packet.
struct lin_pid_t
Structure for the LIN Protected Identifier (PID).
4.4.1.2 Definitions
#define MAX_DATA_LENGTH (8U)
Defines the maximum data length in bytes.
#define CLEAR_PARITY_BITS (0x3FU)
Defines the mask value to clear the PID parity bits.
4.4.1.3 Enumerations
enum lin_checksum_t { CLASSIC, ENHANCED }
Enumeration for the LIN checksum types.
enum lin_packet_type_t { LIN_ERROR, LIN_TRANSMIT, LIN_RECEIVE }
Enumeration for the LIN packet types.
enum lin_rx_state_t { LIN_RX_IDLE, LIN_RX_ACTIVE, LIN_RX_BRK, LIN_RX_SYNC, LIN_RX_PID, LIN_RX_DATA, LIN_RX_CHECKSUM, LIN_TX_RX_DATA, LIN_TX_RX_CHECKSUM, LIN_RX_READY, LIN_RX_ERROR, LIN_RX_RESET }
Enumeration for the LIN Responder states.
enum lin_rx_status_t { LIN_BRK_ERROR, LIN_SYNC_ERROR, LIN_PID_ERROR, LIN_CHECKSUM_ERROR, LIN_READBACK_ERROR, LIN_FRAMING_ERROR, LIN_RESP_TOOSHORT, LIN_NO_RESPONSE, LIN_NO_ERROR }
Enumeration for the LIN Responder status.
enum lin_sched_param_t { CMD, TYPE, LENGTH, TIMEOUT }
Enumeration for the scheduling table parameters.
4.4.1.4 Functions
void LINRESP_ConfigInit (uint8_t tableSize, lin_rx_cmd_t *command, void(*dataProcess)(void))
Initializes the LIN Responder configuration.
void LINRESP_ConfigDeinit (void)
Deinitializes the LIN Responder configuration.
lin_rx_state_t LINRESP_Handler (void)
Handles the LIN Responder state machine.
uint8_t LINRESP_IdGet (void)
Gets the ID of the active packet.
bool LINRESP_IsIdle (void)
Checks if the frame processor is in idle state.
void LINRESP_BrkErrCallbackRegister (void(*callback)(void))
Registers a callback function for Break error condition.
void LINRESP_SyncErrCallbackRegister (void(*callback)(void))
Registers a callback function for the Sync error condition.
void LINRESP_PidErrCallbackRegister (void(*callback)(void))
Registers a callback function for the PID error condition.
void LINRESP_ChecksumErrCallbackRegister (void(*callback)(void))
Registers a callback function for the Checksum error condition.
void LINRESP_ReadbackErrCallbackRegister (void(*callback)(void))
Registers a callback function for readback error condition.
void LINRESP_FramingErrCallbackRegister (void(*callback)(void))
Registers a callback function for framing error condition.
void LINRESP_ShortRespErrCallbackRegister (void(*callback)(void))
Registers a callback function for frame response too short error condition.
void LINRESP_NoRespErrCallbackRegister (void(*callback)(void))
Registers a callback function for no response received error condition.
void LINRESP_ErrorSetCallbackRegister (void(*callback)(void))
Registers a callback function for an error set condition.
4.4.2 Definition Documentation
4.4.2.1 CLEAR_PARITY_BITS
#define CLEAR_PARITY_BITS (0x3FU)
Defines the mask value to clear the PID parity bits.
4.4.2.2 MAX_DATA_LENGTH
#define MAX_DATA_LENGTH (8U)
Defines the maximum data length in bytes.
4.4.3 Function Documentation
4.4.3.1 LINRESP_BrkErrCallbackRegister()
void LINRESP_BrkErrCallbackRegister (void (*callback) void)
Registers a callback function for Break error condition.
*callback |
- Pointer to the Break error callback function |
None. |
4.4.3.2 LINRESP_ChecksumErrCallbackRegister()
void LINRESP_ChecksumErrCallbackRegister (void (*callback) void)
Registers a callback function for the Checksum error condition.
*callback |
- Pointer to the Checksum error callback function |
None. |
4.4.3.3 LINRESP_ConfigDeinit()
void LINRESP_ConfigDeinit (void )
Deinitializes the LIN Responder configuration.
None. |
None. |
4.4.3.4 LINRESP_ConfigInit()
void LINRESP_ConfigInit (uint8_t tableSize, lin_rx_cmd_t * command, void(*dataProcess)(void)
Initializes the LIN Responder configuration.
tableSize |
- Size of the schedule table |
command |
- Pointer to the schedule table |
dataProcess |
- Function pointer to the data processing function |
None. |
Section: Global Function Definitions
4.4.3.5 LINRESP_ErrorSetCallbackRegister()
void LINRESP_ErrorSetCallbackRegister (void (*callback) void)
Registers a callback function for an error set condition.
*callback |
- Pointer to the error set callback function |
None. |
4.4.3.6 LINRESP_FramingErrCallbackRegister()
void LINRESP_FramingErrCallbackRegister (void (*callback) void)
Registers a callback function for framing error condition.
*callback |
- Pointer to the framing error callback function |
None. |
4.4.3.7 LINRESP_Handler()
lin_rx_state_t LINRESP_Handler (void )
Handles the LIN Responder state machine.
None. |
linRxState - Current state of the LIN Responder |
4.4.3.8 LINRESP_IdGet()
uint8_t LINRESP_IdGet (void )
Gets the ID of the active packet.
None. |
cmd - Command identifier |
4.4.3.9 LINRESP_IsIdle()
bool LINRESP_IsIdle (void )
Checks if the frame processor is in idle state.
None. |
True |
- The frame processor is idle |
False |
- The frame processor is active |
4.4.3.10 LINRESP_NoRespErrCallbackRegister()
void LINRESP_NoRespErrCallbackRegister (void (*callback) void)
Registers a callback function for no response received error condition.
*callback |
- Pointer to the no response received callback function |
None. |
4.4.3.11 LINRESP_PidErrCallbackRegister()
void LINRESP_PidErrCallbackRegister (void (*callback) void)
Registers a callback function for the PID error condition.
*callback |
- Pointer to the PID error callback function |
None. |
4.4.3.12 LINRESP_ReadbackErrCallbackRegister()
void LINRESP_ReadbackErrCallbackRegister (void (*callback) void)
Registers a callback function for readback error condition.
*callback |
- Pointer to the readback error callback function |
None. |
4.4.3.13 LINRESP_ShortRespErrCallbackRegister()
void LINRESP_ShortRespErrCallbackRegister (void (*callback) void)
Registers a callback function for frame response too short error condition.
*callback |
- Pointer to the frame response too short callback function |
None. |
4.4.3.14 LINRESP_SyncErrCallbackRegister()
void LINRESP_SyncErrCallbackRegister (void (*callback) void)
Registers a callback function for the Sync error condition.
*callback |
- Pointer to the Sync error callback function |
None. |
4.4.4 Enumeration Type Documentation
4.4.4.1 lin_checksum_t
enum lin_checksum_t
Enumeration for the LIN checksum types.
CLASSIC | |
ENHANCED |
4.4.4.2 lin_packet_type_t
enum lin_packet_type_t
Enumeration for the LIN packet types.
LIN_ERROR | |
LIN_TRANSMIT | |
LIN_RECEIVE |
4.4.4.3 lin_rx_state_t
enum lin_rx_state_t
Enumeration for the LIN Responder states.
LIN_RX_IDLE | |
LIN_RX_ACTIVE | |
LIN_RX_BRK | |
LIN_RX_SYNC | |
LIN_RX_PID | |
LIN_RX_DATA | |
LIN_RX_CHECKSUM | |
LIN_TX_RX_DATA | |
LIN_TX_RX_CHECKSUM | |
LIN_RX_READY | |
LIN_RX_ERROR | |
LIN_RX_RESET |
4.4.4.4 lin_rx_status_t
enum lin_rx_status_t
Enumeration for the LIN Responder status.
LIN_BRK_ERROR | |
LIN_SYNC_ERROR | |
LIN_PID_ERROR | |
LIN_CHECKSUM_ERROR | |
LIN_READBACK_ERROR | |
LIN_FRAMING_ERROR | |
LIN_RESP_TOOSHORT | |
LIN_NO_RESPONSE | |
LIN_NO_ERROR |
4.4.4.5 lin_sched_param_t
enum lin_sched_param_t
Enumeration for the scheduling table parameters.
CMD | |
TYPE | |
LENGTH | |
TIMEOUT |
4.5 LIN Timer
This file contains the structure for the LIN Responder’s Timer functions.
4.5.1 Module description
This file contains the structure for the LIN Responder’s Timer functions.
4.5.1.1 Data structures
struct LIN_TIMER_INTERFACE
Structure of function pointers for the LIN Responder’s Timer functions.
4.5.1.2 Functions
void LINRESP_TimerInitialize (void)
Initializes the timer.
void LINRESP_TimerDeinitialize (void)
Deinitializes the timer.
void LINRESP_TimerStart (uint8_t timeout)
Starts the LIN timer with a specified time-out value.
void LINRESP_TimerStop (void)
Stops the LIN timer.
bool LINRESP_IsTimerRunning (void)
Checks if the LIN timer is currently running.
void LINRESP_TimeoutCallbackRegister (void(*callback)(void))
Registers a callback function for a LIN timeout.
void LINRESP_TimerCallback (void)
Executes on every LIN timer interrupt event.
4.5.2 Function Documentation
4.5.2.1 LINRESP_IsTimerRunning()
bool LINRESP_IsTimerRunning (void )
Checks if the LIN timer is currently running.
None. |
True |
- The timer is running |
False |
- The timer is not running |
4.5.2.2 LINRESP_TimeoutCallbackRegister()
void LINRESP_TimeoutCallbackRegister (void(*)(void) callback)
Registers a callback function for a LIN timeout.
*callback |
- A pointer to the LIN timeout callback function |
None. |
4.5.2.3 LINRESP_TimerCallback()
void LINRESP_TimerCallback (void )
Executes on every LIN timer interrupt event.
Section: Local Function Declarations
None. |
None. |
Section: Local Function Definitions
4.5.2.4 LINRESP_TimerDeinitialize()
void LINRESP_TimerDeinitialize (void )
Deinitializes the timer.
None. |
None. |
4.5.2.5 LINRESP_TimerInitialize()
void LINRESP_TimerInitialize (void )
Initializes the timer.
None. |
None. |
Section: Global Function Definitions
4.5.2.6 LINRESP_TimerStart()
void LINRESP_TimerStart (uint8_t timeout)
Starts the LIN timer with a specified time-out value.
timeout |
- Response time-out value in milliseconds |
None. |
4.5.2.7 LINRESP_TimerStop()
void LINRESP_TimerStop (void )
Stops the LIN timer.
None. |
None. |
4.6 LIN UART
This file contains the structure for the LIN Responder’s Universal Asynchronous Receiver and Transmitter (UART) functions.
4.6.1 Module description
This file contains the structure for the LIN Responder’s Universal Asynchronous Receiver and Transmitter (UART) functions.
4.6.1.1 Data structures
struct LIN_UART_INTERFACE
Structure of function pointers for the LIN Responder’s UART functions.
4.6.1.2 Functions
uint8_t LINRESP_Read (void)
Reads a data byte from the UART receive buffer.
bool LINRESP_IsRxReady (void)
Checks if there is available data in the UART receive buffer.
void LINRESP_Write (uint8_t txData)
Writes a byte of data to the UART transmit buffer.
void LINRESP_RxInitialize (void)
Initializes LIN receive operation.
void LINRESP_RxDeinitialize (void)
Deinitializes the UART receiver.
void LINRESP_TxInterruptEnable (void)
Enables the UART transmit interrupt.
void LINRESP_TxInterruptDisable (void)
Disables the UART transmit interrupt.
bool LINRESP_IsFramingError (void)
Checks if there is a framing error.
bool LINRESP_IsBreakReceived (void)
Checks if a LIN Break character has been received.
bool LINRESP_IsSyncValid (void)
Checks if the Sync character is valid.
void LINRESP_FramingErrorCallbackRegister (void(*callback)(void))
Registers a callback function for framing error detection.
void LINRESP_RxCompleteCallbackRegister (void(*callback)(void))
Registers a callback function for byte receive completion.
void LINRESP_TxCompleteCallbackRegister (void(*callback)(void))
Registers a callback function for byte transmit completion.
static void LINRESP_ReceiveISR (void)
Custom interrupt service routine for UART byte reception.
static void LINRESP_AutobaudEnable (void)
Checks and enables the autobaud detection mechanism if autobaud is enabled.
static void LINRESP_AutobaudReset (void)
Resets the autobaud detection mechanism.
4.6.2 Function Documentation
4.6.2.1 LINRESP_AutobaudEnable()
void LINRESP_AutobaudEnable (void )[static]
Checks and enables the autobaud detection mechanism if autobaud is enabled.
None. |
None. |
4.6.2.2 LINRESP_AutobaudReset()
void LINRESP_AutobaudReset (void )[static]
Resets the autobaud detection mechanism.
None. |
None. |
4.6.2.3 LINRESP_FramingErrorCallbackRegister()
void LINRESP_FramingErrorCallbackRegister (void (*callback) void)
Registers a callback function for framing error detection.
*callback |
- A pointer to the framing error detection callback function |
None. |
4.6.2.4 LINRESP_IsBreakReceived()
bool LINRESP_IsBreakReceived (void )
Checks if a LIN Break character has been received.
None. |
True |
- Break character was received |
False |
- No Break character was received |
4.6.2.5 LINRESP_IsFramingError()
bool LINRESP_IsFramingError (void )
Checks if there is a framing error.
None. |
true |
- A framing error was detected |
false |
- A framing error was not detected |
4.6.2.6 LINRESP_IsRxReady()
bool LINRESP_IsRxReady (void )
Checks if there is available data in the UART receive buffer.
None. |
True |
- Data is available |
False |
- Data is not available |
4.6.2.7 LINRESP_IsSyncValid()
bool LINRESP_IsSyncValid (void )
Checks if the Sync character is valid.
None. |
True |
- Sync character is valid |
False |
- Sync character is not valid |
4.6.2.8 LINRESP_Read()
uint8_t LINRESP_Read (void )
Reads a data byte from the UART receive buffer.
None. |
UART read data |
Section: Global Function Definitions
4.6.2.9 LINRESP_ReceiveISR()
void LINRESP_ReceiveISR (void )[static]
Custom interrupt service routine for UART byte reception.
Section: Local Function Declarations
None. |
None. |
Section: Local Function Definitions
4.6.2.10 LINRESP_RxCompleteCallbackRegister()
void LINRESP_RxCompleteCallbackRegister (void (*callback) void)
Registers a callback function for byte receive completion.
*callback |
- A pointer to the byte receive completion callback function |
None. |
4.6.2.11 LINRESP_RxDeinitialize()
void LINRESP_RxDeinitialize (void )
Deinitializes the UART receiver.
None. |
None. |
4.6.2.12 LINRESP_RxInitialize()
void LINRESP_RxInitialize (void )
Initializes LIN receive operation.
None. |
None. |
4.6.2.13 LINRESP_TxCompleteCallbackRegister()
void LINRESP_TxCompleteCallbackRegister (void (*callback) void)
Registers a callback function for byte transmit completion.
*callback |
- A pointer to the byte transmit completion callback function |
None. |
4.6.2.14 LINRESP_TxInterruptDisable()
void LINRESP_TxInterruptDisable (void )
Disables the UART transmit interrupt.
None. |
None. |
4.6.2.15 LINRESP_TxInterruptEnable()
void LINRESP_TxInterruptEnable (void )
Enables the UART transmit interrupt.
None. |
None. |
4.6.2.16 LINRESP_Write()
void LINRESP_Write (uint8_t txData)
Writes a byte of data to the UART transmit buffer.
txData |
- Data byte for transmission |
None. |