51 #if (SUPPORT_MASTER_MODE == 1U)
95 l_u32 lin_hardware_instance;
100 static l_u8 lin_lld_response_buffer[LIN_NUM_OF_IFCS][10];
113 for (index = 1U; index < 9U; index++)
123 for (index = 1U; index < 9U; index++)
146 return (ret_val !=
LIN_LLD_OK) ?
true :
false;
161 l_u32 lin_hardware_instance;
184 l_u32 lin_hardware_instance;
208 l_u32 lin_hardware_instance;
240 l_u32 lin_hardware_instance;
268 l_u32 lin_hardware_instance;
291 l_u32 lin_hardware_instance;
314 l_u32 lin_hardware_instance;
337 l_u32 lin_hardware_instance;
357 l_u8 response_length)
361 l_u32 lin_hardware_instance;
366 if ((response_length <= 8U) && (response_length != 0U))
398 l_u8 response_length)
402 l_u32 lin_hardware_instance;
409 if ((response_length <= 8U) && (response_length != 0U))
442 #if (SUPPORT_PROTOCOL_21 == 1U)
466 for (index = 1U; index < 9U; index++)
521 l_u8 bytesRemaining = 0U;
525 #if (SUPPORT_MASTER_MODE == 1U)
563 #if (SUPPORT_PROTOCOL_J2602 == 1U)
580 #if (SUPPORT_MASTER_MODE == 1U)
592 if (linCurrentState->
rxSize > bytesRemaining)
const l_ifc_handle g_lin_hardware_ifc[HARDWARE_INSTANCE_COUNT]
volatile bool timeoutCounterFlag
static l_u16 lin_calc_max_res_timeout_cnt(l_u32 baudRate, l_u8 size)
Computes the maximum response timeout.
status_t LIN_DRV_Init(uint32_t instance, lin_user_config_t *linUserConfig, lin_state_t *linCurrentState)
Initializes an instance LIN Hardware Interface for LIN Network.
l_ifc_master_handle master_ifc_handle
l_u8 lin_process_parity(l_u8 pid, l_u8 typeAction)
Makes or checks parity bits. If action is checking parity, the function returns ID value if parity bi...
volatile lin_event_id_t currentEventId
lin_protocol_state_t g_lin_protocol_state_array[LIN_NUM_OF_IFCS]
lin_master_data_t g_lin_master_data_array[LIN_NUM_OF_MASTER_IFCS]
#define LIN_TL_CALLBACK_HANDLER(iii, tl_event_id, id)
status_t LIN_DRV_ReceiveFrameData(uint32_t instance, uint8_t *rxBuff, uint8_t rxSize)
Receives frame data through the LIN Hardware Interface using non-blocking method. This function will ...
status_t LIN_DRV_SendWakeupSignal(uint32_t instance)
Sends a wakeup signal through the LIN Hardware Interface.
status_t LIN_DRV_Deinit(uint32_t instance)
Shuts down the LIN Hardware Interface by disabling interrupts and transmitter/receiver.
l_u8 lin_lld_tx_header(l_ifc_handle iii, l_u8 id)
This function sends frame header for the input PID.
l_diagnostic_mode_t diagnostic_mode
static void CallbackHandler(uint32_t instance, void *linState)
status_t LIN_DRV_DisableIRQ(uint32_t instance)
Disables LIN hardware interrupts.
static l_bool s_baudrate_adjusted_flg[LIN_NUM_OF_IFCS]
LIN master configuration structure Implements : lin_master_data_t_Class.
unsigned long l_u32
Unsigned 32 bit integer Implements : l_u32_Class.
l_u8 previous_schedule_id
volatile lin_node_state_t currentNodeState
void LIN_DRV_SetTimeoutCounter(uint32_t instance, uint32_t timeoutValue)
Set Value for Timeout Counter that is used in LIN_DRV_TimeoutService.
l_u8 lin_lld_set_response(l_ifc_handle iii, l_u8 response_length)
This function sends frame data that is contained in LIN_lld_response_buffer[iii]. ...
lin_tl_descriptor_t g_lin_tl_descriptor_array[LIN_NUM_OF_IFCS]
l_u8 lin_lld_set_low_power_mode(l_ifc_handle iii)
Let the low level driver go to low power mode.
l_u8 lin_lld_int_disable(l_ifc_handle iii)
Disable the interrupt related to the interface.
l_bool lin_lld_init(l_ifc_handle iii)
This function initializes a LIN hardware instance for operation. This function will initialize the ru...
Configuration structure Implements : lin_protocol_user_config_t_Class.
status_t LIN_DRV_MasterSendHeader(uint32_t instance, uint8_t id)
Sends frame header out through the LIN Hardware Interface using a non-blocking method. This function sends LIN Break field, sync field then the ID with correct parity. This function checks if the interface is Master, if not, it will return STATUS_ERROR.This function checks if id is in range from 0 to 0x3F, if not it will return STATUS_ERROR.
lin_callback_t LIN_DRV_InstallCallback(uint32_t instance, lin_callback_t function)
Installs callback function that is used for LIN_DRV_IRQHandler.
#define CALLBACK_HANDLER(iii, event_id, id)
CALLBACK_HANDLER.
l_u8 * response_buffer_ptr
void lin_lld_timeout_service(l_ifc_handle iii)
Callback function for Timer Interrupt Handler In timer IRQ handler, call this function. Used to check if frame timeout has occurred during frame data transmission and reception, to check for N_As and N_Cr timeout for LIN 2.1 and above. This function also check if there is no LIN bus communication (no headers and no frame data transferring) for Idle timeout (s), then put LIN node to Sleep mode. Users may initialize a timer (for example FTM)with period of Timeout unit (default: 500 micro seconds) to call lin_lld_timeout_service(). For an interface iii, Idle timeout (s) = max_idle_timeout_cnt * Timeout unit (us) frame timeout (us) = frame_timeout_cnt * Timeout unit (us) N_As timeout (us) = N_As_timeout * Timeout unit (us) N_Cr timeout (us) = N_Cr_timeout * Timeout unit (us)
static l_u16 lin_calc_max_header_timeout_cnt(l_u32 baudRate)
Computes maximum header timeout.
l_u8 lin_lld_tx_wake_up(l_ifc_handle iii)
This function send a wakeup signal.
LIN protocol status structure Implements : lin_protocol_state_t_Class.
uint8_t LIN_DRV_ProcessParity(uint8_t PID, uint8_t typeAction)
Makes or checks parity bits. If action is checking parity, the function returns ID value if parity bi...
status_t LIN_DRV_AbortTransferData(uint32_t instance)
Aborts an on-going non-blocking transmission/reception. While performing a non-blocking transferring ...
const lin_protocol_user_config_t g_lin_protocol_user_cfg_array[LIN_NUM_OF_IFCS]
void LIN_DRV_TimeoutService(uint32_t instance)
Callback function for Timer Interrupt Handler Users may use (optional, not required) LIN_DRV_TimeoutS...
lin_node_state_t LIN_DRV_GetCurrentNodeState(uint32_t instance)
Get the current LIN node state.
status_t LIN_DRV_GetReceiveStatus(uint32_t instance, uint8_t *bytesRemaining)
Get status of an on-going non-blocking reception. This function returns whether the data reception is...
unsigned char l_u8
Unsigned 8 bit integer Implements : l_u8_Class.
Runtime state of the LIN driver.
status_t LIN_DRV_SendFrameData(uint32_t instance, const uint8_t *txBuff, uint8_t txSize)
Sends frame data out through the LIN Hardware Interface using non-blocking method. This enables an a-sync method for transmitting data. Non-blocking means that the function returns immediately. The application has to get the transmit status to know when the transmit is complete. This function will calculate the checksum byte and send it with the frame data. The function will return immediately after calling this function. If txSize is equal to 0 or greater than 8 or node's current state is in SLEEP mode then the function will return STATUS_ERROR. If isBusBusy is currently true then the function will return LIN_BUS_BUSY.
lin_user_config_t * lin_user_config_ptr
l_u16 max_idle_timeout_cnt
l_u8 lin_lld_deinit(l_ifc_handle iii)
This function disconnect the node from the cluster and free all hardware used.
l_u8 lin_lld_int_enable(l_ifc_handle iii)
Enable the interrupt related to the interface.
status_t LIN_DRV_GoToSleepMode(uint32_t instance)
Puts current LIN node to sleep mode This function changes current node state to LIN_NODE_STATE_SLEEP_...
lin_protocol_handle_t protocol_version
bool l_bool
0 is false, and non-zero (>0) is true Implements : l_bool_Class
const l_u32 g_lin_virtual_ifc[LIN_NUM_OF_IFCS]
l_u8 lin_lld_ignore_response(l_ifc_handle iii)
This function terminates an on-going data transmission/reception.
static lin_state_t s_lin_state_array[LIN_NUM_OF_IFCS]
l_u8 lin_lld_get_state(l_ifc_handle iii)
This function gets current state of an interface.
status_t LIN_DRV_GotoIdleState(uint32_t instance)
Puts current LIN node to Idle state This function changes current node state to LIN_NODE_STATE_IDLE.
l_u8 lin_lld_rx_response(l_ifc_handle iii, l_u8 response_length)
This function receives frame data into the LIN_lld_response_buffer[iii] buffer.
lin_lld_event_id_t
Event id Implements : lin_lld_event_id_t_Class.
l_u8 * schedule_start_entry_ptr
unsigned short int l_u16
Unsigned 16 bit integer Implements : l_u16_Class.
status_t LIN_DRV_EnableIRQ(uint32_t instance)
Enables LIN hardware interrupts.
Transport layer description Implements : lin_tl_descriptor_t_Class.
static volatile l_u16 s_lin_max_header_timeout[LIN_NUM_OF_IFCS]
static l_u16 s_lin_max_frame_res_timeout_val[LIN_NUM_OF_IFCS][8]