6 File Documentation
Information on the LIN Responder Library APIs grouped per file.
6.1 source/lin_app.h File Reference
#include "lin_config.h"
6.1.1 Functions
l_bool l_bool_rd_Frame1_BoolSignal (void)
Reads and returns the current value of 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.
6.1.2 Macros
#define l_sys_init LINRESP_Initialize
6.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)
6.1.4 Detailed Description
LIN Application Header File
6.2 source/lin_config.h File Reference
#include "lin_responder.h"
6.2.1 Data structures
6.2.2 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.
6.2.3 Macros
#define LIN_CHECKSUM_TYPE "Enhanced"
#define LIN_PROTOCOL "2.0"
#define LIN_CONFIG_NAD "0xFF"
#define LIN_PRODUCT_ID "0x0,0x0,255"
#define SCHED_TABLE_LENGTH (3U)
Defines the total number of frames in the schedule table.
6.2.4 Frame Data Length Macros
#define FRAME1_BYTES (6U)
#define FRAME2_BYTES (6U)
#define FRAME3_BYTES (1U)
6.2.5 Frame Response Timeout Macros
#define FRAME1_TIMEOUT_MS (10U)
#define FRAME2_TIMEOUT_MS (10U)
#define FRAME3_TIMEOUT_MS (3U)
6.2.6 Typedefs
6.2.6.1 Data Type Definitions
6.2.7 Enumerations
6.2.8 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.
6.2.9 Detailed Description
LIN Configuration Header File
6.2.10 Macro Definition Documentation
6.2.10.1 LIN_CHECKSUM_TYPE
#define LIN_CHECKSUM_TYPE "Enhanced"
6.2.10.2 LIN_CONFIG_NAD
#define LIN_CONFIG_NAD "0xFF"
6.2.10.3 LIN_PRODUCT_ID
#define LIN_PRODUCT_ID "0x0,0x0,255"
6.2.10.4 LIN_PROTOCOL
#define LIN_PROTOCOL "2.0"
6.3 source/lin_hal.h File Reference
#include "lin_uart_interface.h" #include "lin_timer_interface.h"
6.3.1 Variables
struct LIN_UART_INTERFACE LIN_UART
struct LIN_TIMER_INTERFACE LIN_TIMER
6.3.2 Detailed Description
LIN Hardware Abstraction Layer (HAL) Header File
6.3.3 Variable Documentation
6.3.3.1 LIN_TIMER
struct LIN_TIMER_INTERFACE LIN_TIMER
6.3.3.2 LIN_UART
struct LIN_UART_INTERFACE LIN_UART
6.4 source/lin_responder.h File Reference
#include <stdint.h> #include <stdbool.h> #include <string.h>
6.4.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).
6.4.2 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.
6.4.3 Macros
#define MAX_DATA_LENGTH (8U)
Defines the maximum data length in bytes.
6.4.4 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.
6.4.5 Detailed Description
LIN Responder Header File
6.5 source/lin_signals.h File Reference
This file contains macros for the LIN signals.
6.5.1 Macros
6.5.1.1 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)
6.5.2 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)
6.5.3 Detailed Description
This file contains macros for the LIN signals.
LIN Signals Header File
6.6 source/lin_timer.h File Reference
This file contains the prototypes for the LIN Responder’s Timer functions.
#include <stdint.h> #include <stdbool.h>
6.6.1 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.
6.6.2 Detailed Description
This file contains the prototypes for the LIN Responder’s Timer functions.
LIN Timer Header File
6.7 source/lin_timer_interface.h File Reference
#include <stdint.h> #include <stdbool.h>
6.7.1 Data structures
struct LIN_TIMER_INTERFACE
Structure of function pointers for the LIN Responder’s Timer functions.
6.7.2 Detailed Description
LIN Timer Interface Header File
6.8 source/lin_uart.h File Reference
This file contains the prototypes for the LIN Responder’s Universal Asynchronous Receiver and Transmitter (UART) functions.
#include <stdint.h> #include <stdbool.h>
6.8.1 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.
6.8.2 Detailed Description
This file contains the prototypes for the LIN Responder’s Universal Asynchronous Receiver and Transmitter (UART) functions.
LIN UART Header File
6.9 source/lin_uart_interface.h File Reference
#include <stdint.h> #include <stdbool.h>
6.9.1 Data structures
struct LIN_UART_INTERFACE
Structure of function pointers for the LIN Responder’s UART functions.
6.9.2 Detailed Description
LIN UART Interface Header File
6.10 source/misra_pages/misra_project_deviations.txt File Reference
6.11 source/misra_pages/misra_supported_rules.txt File Reference
6.12 source/src/lin_app.c File Reference
This file contains the implementation of the LIN application APIs.
#include "../lin_app.h" #include "../lin_signals.h"
6.12.1 Functions
l_bool l_bool_rd_Frame1_BoolSignal (void)
Reads and returns the current value of 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.
6.12.2 Detailed Description
This file contains the implementation of the LIN application APIs.
LIN Application Source File
6.13 source/src/lin_config.c File Reference
This file contains the implementation of LIN Responder configurations.
#include "../lin_config.h"
6.13.1 Functions
static void LINRESP_RespErrorSet (void)
Sets the node's response_error signal.
static void LINRESP_RespErrorClr (void)
Clears the node's response_error signal.
static void FRAME1_DefaultCallback (void)
static void FRAME2_DefaultCallback (void)
static void FRAME3_DefaultCallback (void)
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.
6.13.2 Variables
-
Declaration of the Frame1 data.
-
Declaration of the Frame2 data.
-
Declaration of the Frame3 data.
-
Declaration of the schedule table.
l_u8 schedTableSize = (sizeof (schedTable) / sizeof (lin_rx_cmd_t))
Declaration of the number of frames in a schedule table.
static void(* FRAME1_AppHandler )(void) = FRAME1_DefaultCallback
static void(* FRAME2_AppHandler )(void) = FRAME2_DefaultCallback
static void(* FRAME3_AppHandler )(void) = FRAME3_DefaultCallback
6.13.3 Detailed Description
This file contains the implementation of LIN Responder configurations.
LIN Configuration Source File
6.13.4 Function Documentation
6.13.4.1 FRAME1_DefaultCallback()
void FRAME1_DefaultCallback (void )[static]
6.13.4.2 FRAME2_DefaultCallback()
void FRAME2_DefaultCallback (void )[static]
6.13.4.3 FRAME3_DefaultCallback()
void FRAME3_DefaultCallback (void )[static]
6.13.5 Variable Documentation
6.13.5.1 FRAME1_AppHandler
void(* FRAME1_AppHandler) (void) = FRAME1_DefaultCallback[static]
6.13.5.2 FRAME2_AppHandler
void(* FRAME2_AppHandler) (void) = FRAME2_DefaultCallback[static]
6.13.5.3 FRAME3_AppHandler
void(* FRAME3_AppHandler) (void) = FRAME3_DefaultCallback[static]
6.14 source/src/lin_hal.c File Reference
This file contains the implementation of the LIN Responder HAL interfaces.
#include <stddef.h> #include "../lin_hal.h" #include "../lin_uart.h" #include "../lin_timer.h"
6.14.1 Variables
struct LIN_UART_INTERFACE LIN_UART
struct LIN_TIMER_INTERFACE LIN_TIMER
6.14.2 Detailed Description
This file contains the implementation of the LIN Responder HAL interfaces.
LIN Hardware Abstraction Layer (HAL) Source File
6.14.3 Variable Documentation
6.14.3.1 LIN_TIMER
struct LIN_TIMER_INTERFACE LIN_TIMER
Initial value:
= { .TimerInitialize = LINRESP_TimerInitialize, .TimerDeinitialize = LINRESP_TimerDeinitialize, .TimerStart = LINRESP_TimerStart, .TimerStop = LINRESP_TimerStop, .IsTimerRunning = LINRESP_IsTimerRunning, .TimeoutCallbackRegister = LINRESP_TimeoutCallbackRegister }
6.14.3.2 LIN_UART
struct LIN_UART_INTERFACE LIN_UART
Initial value:
= { .Read = LINRESP_Read, .IsRxReady = LINRESP_IsRxReady, .Write = LINRESP_Write, .RxInitialize = LINRESP_RxInitialize, .RxDeinitialize = LINRESP_RxDeinitialize, .TxInterruptEnable = LINRESP_TxInterruptEnable, .TxInterruptDisable = LINRESP_TxInterruptDisable, .IsFramingError = LINRESP_IsFramingError, .IsBreakReceived = LINRESP_IsBreakReceived, .IsSyncValid = LINRESP_IsSyncValid, .RxCompleteCallbackRegister = LINRESP_RxCompleteCallbackRegister, .TxCompleteCallbackRegister = LINRESP_TxCompleteCallbackRegister, .FramingErrorCallbackRegister = LINRESP_FramingErrorCallbackRegister }
6.15 source/src/lin_responder.c File Reference
This file contains the API implementation for the LIN Responder.
#include "../lin_responder.h" #include "../lin_hal.h"
6.15.1 Functions
static void LINRESP_TimeoutCheck (void)
static void LINRESP_TimeoutCallback (void)
static void LINRESP_FramingErrCallback (void)
static void LINRESP_BreakReceive (void)
static void LINRESP_SyncReceive (void)
static void LINRESP_PidReceive (void)
static void LINRESP_DataByteReceive (void)
static void LINRESP_ChecksumReceive (void)
static void LINRESP_DataByteTransmit (void)
static void LINRESP_ChecksumTransmit (void)
static void LINRESP_DataReadback (void)
static void LINRESP_ChecksumReadback (void)
static void LINRESP_DataByteTxRx (void)
static void LINRESP_ChecksumTxRx (void)
static void LINRESP_GeneralErrHandler (lin_rx_status_t error)
static void LINRESP_StateReset (void)
static bool LINRESP_PidCheck (uint8_t pid)
static uint8_t LINRESP_ParityCalculate (uint8_t cmd)
static uint8_t LINRESP_SchedTableDataGet (uint8_t cmd, lin_sched_param_t param)
static bool LINRESP_SchedTableDataUpdate (uint8_t cmd)
static uint8_t LINRESP_PacketGet (uint8_t *data)
static void LINRESP_PacketQueue (uint8_t cmd)
static uint8_t LINRESP_ChecksumGet (uint8_t length, uint8_t pid, const uint8_t *data)
static lin_rx_status_t LINRESP_PidErrStatusGet (void)
static lin_rx_status_t LINRESP_ChecksumErrStatusGet (void)
static void LINRESP_BrkErrDefaultCallback (void)
static void LINRESP_SyncErrDefaultCallback (void)
static void LINRESP_PidErrDefaultCallback (void)
static void LINRESP_ChecksumErrDefaultCallback (void)
static void LINRESP_ReadbackErrDefaultCallback (void)
static void LINRESP_FramingErrDefaultCallback (void)
static void LINRESP_ShortRespErrDefaultCallback (void)
static void LINRESP_NoRespErrDefaultCallback (void)
static void LINRESP_ErrorSetDefaultCallback (void)
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.
6.15.2 Macros
#define CLEAR_PARITY_BITS (0x3FU)
Defines the mask value to clear the PID parity bits.
6.15.3 Variables
static lin_rx_status_t linErrorState = LIN_NO_ERROR
static lin_rx_state_t linState = LIN_RX_IDLE
static lin_packet_t linPacket
static lin_rx_cmd_t * linRxCommand
static uint8_t linRxCommandLength
static lin_checksum_t linChecksumType = ENHANCED
static bool linRespInProgress = false
static uint8_t txDataIndex = 0
static uint8_t rxDataIndex = 0
static void(* LINRESP_BrkErrHandler )(void) = NULL
static void(* LINRESP_SyncErrHandler )(void) = NULL
static void(* LINRESP_PidErrHandler )(void) = NULL
static void(* LINRESP_ChecksumErrHandler )(void) = NULL
static void(* LINRESP_ReadbackErrHandler )(void) = NULL
static void(* LINRESP_FramingErrHandler )(void) = NULL
static void(* LINRESP_ShortRespErrHandler )(void) = NULL
static void(* LINRESP_NoRespErrHandler )(void) = NULL
static void(* LINRESP_ErrorSetHandler )(void) = NULL
static void(* LINRESP_RxTxDataProcess )(void) = NULL
6.15.4 Detailed Description
This file contains the API implementation for the LIN Responder.
LIN Responder Source File
6.15.5 Function Documentation
6.15.5.1 LINRESP_BreakReceive()
void LINRESP_BreakReceive (void )[static]
6.15.5.2 LINRESP_BrkErrDefaultCallback()
void LINRESP_BrkErrDefaultCallback (void )[static]
6.15.5.3 LINRESP_ChecksumErrDefaultCallback()
void LINRESP_ChecksumErrDefaultCallback (void )[static]
6.15.5.4 LINRESP_ChecksumErrStatusGet()
lin_rx_status_t LINRESP_ChecksumErrStatusGet (void )[static]
6.15.5.5 LINRESP_ChecksumGet()
uint8_t LINRESP_ChecksumGet (uint8_t length, uint8_t pid, const uint8_t * data)[static]
6.15.5.6 LINRESP_ChecksumReadback()
void LINRESP_ChecksumReadback (void )[static]
6.15.5.7 LINRESP_ChecksumReceive()
void LINRESP_ChecksumReceive (void )[static]
6.15.5.8 LINRESP_ChecksumTransmit()
void LINRESP_ChecksumTransmit (void )[static]
6.15.5.9 LINRESP_ChecksumTxRx()
void LINRESP_ChecksumTxRx (void )[static]
6.15.5.10 LINRESP_DataByteReceive()
void LINRESP_DataByteReceive (void )[static]
6.15.5.11 LINRESP_DataByteTransmit()
void LINRESP_DataByteTransmit (void )[static]
6.15.5.12 LINRESP_DataByteTxRx()
void LINRESP_DataByteTxRx (void )[static]
6.15.5.13 LINRESP_DataReadback()
void LINRESP_DataReadback (void )[static]
6.15.5.14 LINRESP_ErrorSetDefaultCallback()
void LINRESP_ErrorSetDefaultCallback (void )[static]
6.15.5.15 LINRESP_FramingErrCallback()
void LINRESP_FramingErrCallback (void )[static]
6.15.5.16 LINRESP_FramingErrDefaultCallback()
void LINRESP_FramingErrDefaultCallback (void )[static]
6.15.5.17 LINRESP_GeneralErrHandler()
void LINRESP_GeneralErrHandler (lin_rx_status_t error)[static]
6.15.5.18 LINRESP_NoRespErrDefaultCallback()
void LINRESP_NoRespErrDefaultCallback (void )[static]
6.15.5.19 LINRESP_PacketGet()
uint8_t LINRESP_PacketGet (uint8_t * data)[static]
6.15.5.20 LINRESP_PacketQueue()
void LINRESP_PacketQueue (uint8_t cmd)[static]
6.15.5.21 LINRESP_ParityCalculate()
uint8_t LINRESP_ParityCalculate (uint8_t cmd)[static]
6.15.5.22 LINRESP_PidCheck()
bool LINRESP_PidCheck (uint8_t pid)[static]
6.15.5.23 LINRESP_PidErrDefaultCallback()
void LINRESP_PidErrDefaultCallback (void )[static]
6.15.5.24 LINRESP_PidErrStatusGet()
lin_rx_status_t LINRESP_PidErrStatusGet (void )[static]
6.15.5.25 LINRESP_PidReceive()
void LINRESP_PidReceive (void )[static]
6.15.5.26 LINRESP_ReadbackErrDefaultCallback()
void LINRESP_ReadbackErrDefaultCallback (void )[static]
6.15.5.27 LINRESP_SchedTableDataGet()
uint8_t LINRESP_SchedTableDataGet (uint8_t cmd, lin_sched_param_t param)[static]
6.15.5.28 LINRESP_SchedTableDataUpdate()
bool LINRESP_SchedTableDataUpdate (uint8_t cmd)[static]
6.15.5.29 LINRESP_ShortRespErrDefaultCallback()
void LINRESP_ShortRespErrDefaultCallback (void )[static]
6.15.5.30 LINRESP_StateReset()
void LINRESP_StateReset (void )[static]
6.15.5.31 LINRESP_SyncErrDefaultCallback()
void LINRESP_SyncErrDefaultCallback (void )[static]
6.15.5.32 LINRESP_SyncReceive()
void LINRESP_SyncReceive (void )[static]
6.15.5.33 LINRESP_TimeoutCallback()
void LINRESP_TimeoutCallback (void )[static]
6.15.5.34 LINRESP_TimeoutCheck()
void LINRESP_TimeoutCheck (void )[static]
Section: Local Function Declarations
Section: Local Function Definitions
6.15.6 Variable Documentation
6.15.6.1 linChecksumType
lin_checksum_t linChecksumType = ENHANCED[static]
6.15.6.2 linErrorState
lin_rx_status_t linErrorState = LIN_NO_ERROR[static]
6.15.6.3 linPacket
lin_packet_t linPacket[static]
6.15.6.4 LINRESP_BrkErrHandler
void(* LINRESP_BrkErrHandler) (void) = NULL[static]
6.15.6.5 LINRESP_ChecksumErrHandler
void(* LINRESP_ChecksumErrHandler) (void) = NULL[static]
6.15.6.6 LINRESP_ErrorSetHandler
void(* LINRESP_ErrorSetHandler) (void) = NULL[static]
6.15.6.7 LINRESP_FramingErrHandler
void(* LINRESP_FramingErrHandler) (void) = NULL[static]
6.15.6.8 LINRESP_NoRespErrHandler
void(* LINRESP_NoRespErrHandler) (void) = NULL[static]
6.15.6.9 LINRESP_PidErrHandler
void(* LINRESP_PidErrHandler) (void) = NULL[static]
6.15.6.10 LINRESP_ReadbackErrHandler
void(* LINRESP_ReadbackErrHandler) (void) = NULL[static]
6.15.6.11 LINRESP_RxTxDataProcess
void(* LINRESP_RxTxDataProcess) (void) = NULL[static]
6.15.6.12 LINRESP_ShortRespErrHandler
void(* LINRESP_ShortRespErrHandler) (void) = NULL[static]
6.15.6.13 LINRESP_SyncErrHandler
void(* LINRESP_SyncErrHandler) (void) = NULL[static]
6.15.6.14 linRespInProgress
bool linRespInProgress = false[static]
6.15.6.15 linRxCommand
lin_rx_cmd_t* linRxCommand[static]
6.15.6.16 linRxCommandLength
uint8_t linRxCommandLength[static]
6.15.6.17 linState
lin_rx_state_t linState = LIN_RX_IDLE[static]
6.15.6.18 rxDataIndex
uint8_t rxDataIndex = 0[static]
6.15.6.19 txDataIndex
uint8_t txDataIndex = 0[static]
6.16 source/src/lin_timer.c File Reference
This file contains the implementation for the LIN Responder Timer functions.
#include "../lin_timer.h" #include "../../../mcc_generated_files/timer/tmr0.h"
6.16.1 Functions
void LINRESP_TimerCallback (void)
Executes on every LIN timer interrupt event.
void LINRESP_TimeoutDefaultCallback (void)
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.
6.16.2 Variables
static uint8_t linTimeout = 10
static bool linTimerRunning = false
static volatile uint8_t countCallback = 0
void(* LINRESP_TimeoutHandler )(void) = NULL
6.16.3 Detailed Description
This file contains the implementation for the LIN Responder Timer functions.
LIN Timer Source File
6.16.4 Function Documentation
6.16.4.1 LINRESP_TimeoutDefaultCallback()
void LINRESP_TimeoutDefaultCallback (void )
6.16.5 Variable Documentation
6.16.5.1 countCallback
volatile uint8_t countCallback = 0[static]
6.16.5.2 LINRESP_TimeoutHandler
void(* LINRESP_TimeoutHandler) (void) = NULL
6.16.5.3 linTimeout
uint8_t linTimeout = 10[static]
6.16.5.4 linTimerRunning
bool linTimerRunning = false[static]
6.17 source/src/lin_uart.c File Reference
This file contains the implementation for the LIN Responder UART functions.
#include "../lin_uart.h" #include "../../../mcc_generated_files/uart/eusart1.h"
6.17.1 Functions
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.
static void LINRESP_FramingErrorDefaultCallback (void)
static void LINRESP_RxCompleteIntDefaultCallback (void)
static void LINRESP_TxCompleteDefaultCallback (void)
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.
6.17.2 Macros
#define BREAK_VALUE 0x00U
#define SYNC_VALUE 0x55U
6.17.3 Variables
static volatile uint8_t rxData = 0
static bool frameError = false
static void(* LINRESP_FramingErrorHandler )(void) = NULL
static void(* LINRESP_RxCompleteInterruptHandler )(void) = NULL
6.17.4 Detailed Description
This file contains the implementation for the LIN Responder UART functions.
LIN UART Source File
6.17.5 Function Documentation
6.17.5.1 LINRESP_FramingErrorDefaultCallback()
void LINRESP_FramingErrorDefaultCallback (void )[static]
6.17.5.2 LINRESP_RxCompleteIntDefaultCallback()
void LINRESP_RxCompleteIntDefaultCallback (void )[static]
6.17.5.3 LINRESP_TxCompleteDefaultCallback()
void LINRESP_TxCompleteDefaultCallback (void )[static]
6.17.6 Macro Definition Documentation
6.17.6.1 BREAK_VALUE
#define BREAK_VALUE 0x00U
6.17.6.2 SYNC_VALUE
#define SYNC_VALUE 0x55U
6.17.7 Variable Documentation
6.17.7.1 frameError
bool frameError = false[static]
6.17.7.2 LINRESP_FramingErrorHandler
void(* LINRESP_FramingErrorHandler) (void) = NULL[static]
6.17.7.3 LINRESP_RxCompleteInterruptHandler
void(* LINRESP_RxCompleteInterruptHandler) (void) = NULL[static]
6.17.7.4 rxData
volatile uint8_t rxData = 0[static]