LIN Driver (Lin)
Controls hardware LIN controllers on the ECU.
Funktionen — Übersicht
void Lin_Init (const Lin_ConfigType* Config);Initializes the LIN module.Std_ReturnType Lin_CheckWakeup (uint8 Channel);This function checks if a wakeup has occurred on the addressed LIN channel.void Lin_GetVersionInfo (Std_VersionInfoType* versioninfo);Returns the version information of this module.Std_ReturnType Lin_SendFrame (uint8 Channel, const Lin_PduType* PduInfoPtr);Sends a LIN header and a LIN response, if necessary.Std_ReturnType Lin_GoToSleep (uint8 Channel);The service instructs the driver to transmit a go - to - sleep - command on the addressed LIN channel.Std_ReturnType Lin_GoToSleepInternal (uint8 Channel);Sets the channel state to LIN_ CH_ SLEEP, enables the wake - up detection and optionally sets the LIN hardware unit to reduced...Std_ReturnType Lin_Wakeup (uint8 Channel);Generates a wake up pulse and sets the channel state to LIN_ CH_ OPERATIONAL.Std_ReturnType Lin_WakeupInternal (uint8 Channel);Sets the channel state to LIN_ CH_ OPERATIONAL without generating a wake up pulse.Lin_StatusType Lin_GetStatus (uint8 Channel, const uint8* * Lin_SduPtr);Service Lin_GetStatus.
Typen — Übersicht
struct Lin_ConfigTypeThis is the type of the external data structure containing the overall initialization data for the LIN driver and the SFR...Lin_FramePidTypeRepresents all valid protected identifier used by Lin_ Send Frame().Lin_FrameCsModelTypeThis type is used to specify the Checksum model to be used for the LIN Frame.Lin_FrameResponseTypeThi s type is used to specify whether the frame processor is required to transmit the response part of the LIN frame.Lin_FrameDlTypeThis type is used to specify the number of SDU data bytes to copy.Lin_PduTypeThis Type is used to provide PID, checksum model, data length and SDU pointer from the LIN Interface to the LIN driver.enum Lin_StatusTypeLIN operation states for a LIN channel or frame, as returned by the API service Lin_ Get Status().enum Lin_SlaveErrorTypeThis type represents the slave error types that are detected during header reception and response transmission / reception.
Funktionen & Typen — Detailansicht
function Lin_Init [SWS_Lin_00006] 📄 PDF
void Lin_Init (const Lin_ConfigType* Config);
Initializes the LIN module.
The synchronous function Lin_Init serves to initialize the LIN driver module of the AUTOSAR Classic Platform according to specification [SWS_Lin_00006]. The interface is provided via header Lin.h and is addressed internally via service ID 0x00 [SWS_Lin_00006].
The following parameter and interface conditions apply to the usage and calling of the function:
- Input parameters:
Configis expected as the only input parameter [SWS_Lin_00006]. This is a pointer to the configuration data set of the LIN driver of typeconst Lin_ConfigType*[SWS_Lin_00006]. Neither input/output parameters nor pure output parameters are intended for this interface [SWS_Lin_00006]. - Return value: The function returns no return value (
void) [SWS_Lin_00006]. - Execution semantics: The processing takes place completely synchronously (
Synchronous), so that the initialization steps of the driver are processed directly during the function call [SWS_Lin_00006].
Regarding the call context and concurrency, it is defined that Lin_Init is non-reentrant (Non Reentrant) [SWS_Lin_00006]. Interpretation: Since the function fundamentally initializes the LIN driver module and is designed to be non-reentrant, it is likely to be called typically during the startup phase of the overall system before other services of the LIN driver are used. Question Q-d535602a0d4708ce (open) Simultaneous or multiple calls from different execution contexts are presumably impermissible in this case.
This text was generated by an AI based on the AUTOSAR R20-11 specification.
Implementer's Guide to follow (complexity I1)
function Lin_CheckWakeup [SWS_Lin_00160] 📄 PDF
Std_ReturnType Lin_CheckWakeup (uint8 Channel);
This function checks if a wakeup has occurred on the addressed LIN channel.
The synchronous function Lin_CheckWakeup serves to check whether a wakeup event has occurred on an addressed LIN channel [SWS_Lin_00160]. The interface is available via header file Lin.h and has the service ID 0x0a [SWS_Lin_00160]. To identify the channel, the function accepts parameter Channel of data type uint8 [SWS_Lin_00160]. Further input or output parameters are not intended for this interface [SWS_Lin_00160].
The result of execution is reported back synchronously via the return type Std_ReturnType [SWS_Lin_00160]. The status value E_OK indicates that no error occurred during execution of the API call [SWS_Lin_00160]. If, on the other hand, an error occurs during execution, the service provides the return value E_NOT_OK [SWS_Lin_00160]. Specific error codes as well as notifications to DET or DEM are not specified for this element in the sources.
Regarding concurrency behavior, Lin_CheckWakeup is defined as non-reentrant (Non Reentrant) [SWS_Lin_00160]. Callers must therefore ensure that calls take place sequentially and no simultaneous execution occurs. Since the exact call context is not defined in more detail in the specification, the call is presumably likely to be initiated by higher-level layers such as Wakeup Management or the ECU State Manager. Question Q-40221056a2e2c042 (open)
This text was created by an AI; all statements originate from the requirements of the AUTOSAR standard.
function Lin_GetVersionInfo [SWS_Lin_00161] 📄 PDF
void Lin_GetVersionInfo (Std_VersionInfoType* versioninfo);
Returns the version information of this module.
function Lin_SendFrame [SWS_Lin_00191] 📄 PDF
Std_ReturnType Lin_SendFrame (uint8 Channel, const Lin_PduType* PduInfoPtr);
Sends a LIN header and a LIN response, if necessary. The direction of the frame response (master response, slave response, slave - to - slave communication) is provided by the Pdu Info Ptr. Only used for LIN master nodes.
The function Lin_SendFrame serves to send a LIN header and, if required, the associated LIN response and is exclusively intended for LIN master nodes [SWS_Lin_00191]. Via the pointer PduInfoPtr, the transmission direction of the frame response is defined, which can represent a master response, a slave response, or a slave-to-slave communication [SWS_Lin_00191].
Call and parameters: Execution of the function is performed asynchronously [SWS_Lin_00191]. Upon calling, the following input parameters are passed:
Channel: Determines the LIN channel to be addressed asuint8[SWS_Lin_00191].PduInfoPtr: Pointer to a structure of typeLin_PduType, which contains the protected identifier (PID), the checksum model, the response type, the data length (Dl), as well as the data pointer to the SDU [SWS_Lin_00191].
Return values and error behavior: The function provides the return type Std_ReturnType [SWS_Lin_00191]:
E_OK: The transmit request was successfully accepted and acknowledged for asynchronous execution [SWS_Lin_00191].E_NOT_OK: The transmit request was rejected because a development error or a production error is present [SWS_Lin_00191].
Concurrency and integration: The interface is specified as non-reentrant (Non Reentrant), which is why parallel calls on the same channel must be avoided [SWS_Lin_00191]. The function has the service ID 0x04 and is included via header file Lin.h [SWS_Lin_00191].
This usage note was generated automatically based on the AUTOSAR R20-11 specification.
function Lin_GoToSleep [SWS_Lin_00166] 📄 PDF
Std_ReturnType Lin_GoToSleep (uint8 Channel);
The service instructs the driver to transmit a go - to - sleep - command on the addressed LIN channel. Only used for LIN master nodes.
Function and Call Context
The function Lin_GoToSleep instructs the LIN driver to send a go-to-sleep command on the addressed LIN channel [SWS_Lin_00166]. This driver service has the Service ID 0x06 and is provided via the header file Lin.h [SWS_Lin_00166]. Execution of the service is asynchronous for the caller [SWS_Lin_00166]. The function declaration is Std_ReturnType Lin_GoToSleep (uint8 Channel) [SWS_Lin_00166].
Parameters and Return Values
Channel of type uint8 is passed as the only input parameter, which identifies the LIN channel to be addressed [SWS_Lin_00166]. Additional input or output parameters do not exist [SWS_Lin_00166].
The return value of type Std_ReturnType provides information about the acceptance of the request [SWS_Lin_00166]:
E_OK: The go-to-sleep command was successfully accepted by the driver [SWS_Lin_00166].E_NOT_OK: The command was not accepted because a development error or a production error occurred [SWS_Lin_00166].
Restrictions and Concurrency
Regarding concurrency, the function is declared as non-reentrant (Non Reentrant) [SWS_Lin_00166]. As an essential functional restriction, Lin_GoToSleep is intended exclusively for LIN master nodes [SWS_Lin_00166].
This usage note was generated automatically based on the AUTOSAR specification R20-11.
function Lin_GoToSleepInternal [SWS_Lin_00167] 📄 PDF
Std_ReturnType Lin_GoToSleepInternal (uint8 Channel);
Sets the channel state to LIN_ CH_ SLEEP, enables the wake - up detection and optionally sets the LIN hardware unit to reduced power operation mode (if supported by HW).
The synchronous function Lin_GoToSleepInternal sets the state of the addressed LIN channel to LIN_CH_SLEEP, activates wake-up detection, and optionally places the LIN hardware unit into a reduced power saving mode, provided this is supported by the hardware [SWS_Lin_00167]. Addressing of the desired LIN channel is performed via input parameter Channel of type uint8, while no further input or output parameters exist [SWS_Lin_00167].
The result of the execution is signaled synchronously via the return value of type Std_ReturnType [SWS_Lin_00167]:
E_OK: The command to set into sleep mode was successfully accepted [SWS_Lin_00167].E_NOT_OK: The command was rejected because a development or a production error occurred [SWS_Lin_00167].
Regarding concurrency and call context, Lin_GoToSleepInternal is specified as non-reentrant (Non Reentrant) [SWS_Lin_00167]. Calling software units must therefore ensure that calls occur sequentially and are not superimposed concurrently. The function is defined under Service ID 0x09 and is available via the header file Lin.h [SWS_Lin_00167].
This usage note was generated automatically based on the specification.
Implementer's Guide to follow (complexity I1)
function Lin_Wakeup [SWS_Lin_00169] 📄 PDF
Std_ReturnType Lin_Wakeup (uint8 Channel);
Generates a wake up pulse and sets the channel state to LIN_ CH_ OPERATIONAL.
Usage and Call Context
The function Lin_Wakeup belongs to the driver module Lin of the AUTOSAR Classic Platform [SWS_Lin_00169]. Its purpose is to generate a wake-up pulse on the addressed bus channel and immediately transition the channel state to LIN_CH_OPERATIONAL [SWS_Lin_00169]. The interface is provided via the header file Lin.h with Service ID 0x07 and signature Std_ReturnType Lin_Wakeup (uint8 Channel) [SWS_Lin_00169].
As an input parameter, the function accepts Channel of type uint8, specifying the LIN channel to be addressed [SWS_Lin_00169]. Input/output parameters or pure output parameters do not exist [SWS_Lin_00169]. The execution behavior is asynchronous; return from the function thus merely confirms acceptance of the job, while the physical wake-up pulse is subsequently generated on the bus [SWS_Lin_00169].
Return Values and Error Handling
The result of the job acceptance is reported via the return type Std_ReturnType [SWS_Lin_00169]:
E_OK: The wake-up request was accepted by the LIN driver and will be processed [SWS_Lin_00169].E_NOT_OK: The request was rejected because a development or production error occurred [SWS_Lin_00169].
Concurrency and Limitations
According to the specification, the function is classified as non-reentrant (Non Reentrant) [SWS_Lin_00169]. Calls must therefore not occur interruptingly or concurrently from different execution contexts for the same driver instance. Calling components must ensure appropriate synchronization.
This usage note was generated automatically based on the AUTOSAR Classic R20-11 specification.
Implementer's Guide to follow (complexity I1)
function Lin_WakeupInternal [SWS_Lin_00256] 📄 PDF
Std_ReturnType Lin_WakeupInternal (uint8 Channel);
Sets the channel state to LIN_ CH_ OPERATIONAL without generating a wake up pulse.
The function Lin_WakeupInternal provided via header Lin.h transitions a LIN channel asynchronously into the operational state LIN_CH_OPERATIONAL without outputting a wakeup pulse to the physical LIN bus [SWS_Lin_00256]. It processes internal wakeup requests of the higher-level LIN interface in which no bus wake-up signal may be sent [SWS_Lin_00262]. The call takes place via parameter Channel of type uint8. The function returns E_OK if the wakeup request was accepted, or E_NOT_OK if the request was rejected or a development or production error is present [SWS_Lin_00256].
Regarding call context and concurrency, Lin_WakeupInternal is non-reentrant (Non Reentrant) [SWS_Lin_00256]. As a strict ordering condition, the state machine of the addressed channel must be in the sleep state LIN_CH_SLEEP at the time of calling [SWS_Lin_00260].
When development error detection is enabled, the module monitors the following error conditions and reports corresponding development errors:
LIN_E_UNINIT: Call of the function before initialization of the LIN driver module [SWS_Lin_00258].LIN_E_INVALID_CHANNEL: The passed channel parameter is invalid or the addressed channel is inactive [SWS_Lin_00259].LIN_E_STATE_TRANSITION: An invalid state transition has occurred because the LIN channel is not in stateLIN_CH_SLEEP[SWS_Lin_00260].
This usage note was generated automatically based on the specification requirements.
Implementer's Guide to follow (complexity I1)
function Lin_GetStatus [SWS_Lin_00168] 📄 PDF
Lin_StatusType Lin_GetStatus (uint8 Channel, const uint8* * Lin_SduPtr);
Service Lin_GetStatus.
type Lin_ConfigType [SWS_Lin_00227] 📄 PDF
This is the type of the external data structure containing the overall initialization data for the LIN driver and the SFR settings affecting the LIN channels. A pointe r to such a structure is provided to the LIN driver initialization routine for configuration of the driver, LIN hardware unit and LIN hardware channels.
type Lin_FramePidType [SWS_Lin_00228] 📄 PDF
Represents all valid protected identifier used by Lin_ Send Frame().
type Lin_FrameCsModelType [SWS_Lin_00229] 📄 PDF
This type is used to specify the Checksum model to be used for the LIN Frame.
The enumeration type Lin_FrameCsModelType serves according to [SWS_Lin_00229] to define the checksum model that is used for an individual LIN frame. The type definition is available as standard via header Lin_GeneralTypes.h [SWS_Lin_00229].
According to [SWS_Lin_00229], two values are available for the configuration:
LIN_ENHANCED_CS: Selects the enhanced checksum model [SWS_Lin_00229].LIN_CLASSIC_CS: Selects the classic checksum model [SWS_Lin_00229].
As a pure data type, Lin_FrameCsModelType does not define any function interfaces, return values, or DET/DEM error messages itself [SWS_Lin_00229]. Its use is likely to primarily take place as a parameter or element within configuration and frame descriptors in module Lin (interpretation), to inform the driver which algorithm is used to verify the frame checksum upon transmission or reception. Question Q-6d3354059d0641df (open) Error handling for invalid values must therefore presumably be caught at the level of the processing driver APIs or module configuration (interpretation). Question Q-06e26f4bcff1e520 (open)
This text was generated by an AI based on the AUTOSAR specification R20-11.
Implementer's Guide to follow (complexity I1)
type Lin_FrameResponseType [SWS_Lin_00230] 📄 PDF
Thi s type is used to specify whether the frame processor is required to transmit the response part of the LIN frame.
type Lin_FrameDlType [SWS_Lin_00231] 📄 PDF
This type is used to specify the number of SDU data bytes to copy.
type Lin_PduType [SWS_Lin_00232] 📄 PDF
This Type is used to provide PID, checksum model, data length and SDU pointer from the LIN Interface to the LIN driver.
type Lin_StatusType [SWS_Lin_00233] 📄 PDF
LIN operation states for a LIN channel or frame, as returned by the API service Lin_ Get Status().
The enumeration type Lin_StatusType is provided via Lin_GeneralTypes.h and defines the operational and transmission states for LIN channels and LIN frames that are reported as the return value of the API service Lin_GetStatus() [SWS_Lin_00233].
The state values are divided into channel states and frame operation values [SWS_Lin_00233]:
- Channel status:
LIN_OPERATIONALrepresents normal operation, in which the LIN channel is ready to transmit the next header and no data of a previous frame is present (e.g. after initialization). In contrast,LIN_CH_SLEEPrepresents the sleep state of the channel, in which wake-up detection for slave nodes is enabled [SWS_Lin_00233]. - Ongoing transmissions:
LIN_TX_BUSYindicates an ongoing transmission of header or response.LIN_RX_BUSYsignals an ongoing reception process in which at least one response byte, but not yet the final checksum byte, has arrived [SWS_Lin_00233]. - Successful completion:
LIN_TX_OKconfirms the successful transmission, whileLIN_RX_OKindicates the error-free reception of a complete response [SWS_Lin_00233]. - Error states and timeouts:
LIN_NOT_OKindicates development or production errors. For transmission operations, the type distinguishes betweenLIN_TX_HEADER_ERROR(error during header transmission due to data mismatch, identifier parity errors, or physical bus errors) andLIN_TX_ERROR(error during response transmission due to data mismatch or bus errors). On the reception side,LIN_RX_ERRORdesignates reception errors such as framing, overrun, checksum errors, or incomplete responses;LIN_RX_NO_RESPONSEreports the complete absence of response bytes [SWS_Lin_00233].
This usage note was generated automatically based on the specification AUTOSAR CP R20-11.
Implementer's Guide to follow (complexity I1)
type Lin_SlaveErrorType [SWS_Lin_91140] 📄 PDF
This type represents the slave error types that are detected during header reception and response transmission / reception.
The enumeration type Lin_SlaveErrorType represents the specific error types of a LIN slave that are detected during reception of the header as well as during transmission or reception of the response [SWS_Lin_91140]. The type definition is made available via the header file Lin_GeneralTypes.h [SWS_Lin_91140].
Error States and Value Range
The enumeration covers errors during the various phases of LIN communication [SWS_Lin_91140]:
LIN_ERR_HEADER: Signals an error during reception of the LIN header [SWS_Lin_91140].LIN_ERR_RESP_STOPBIT: Indicates a framing error or stop bit error in the response [SWS_Lin_91140].LIN_ERR_RESP_CHKSUM: Designates a checksum error of the received response [SWS_Lin_91140].LIN_ERR_RESP_DATABIT: Reports a bit monitoring error of a transmitted data bit in the response [SWS_Lin_91140].LIN_ERR_NO_RESP: Indicates that no response to the header was received [SWS_Lin_91140].LIN_ERR_INC_RESP: Occurs when an incomplete response was received or transmitted [SWS_Lin_91140].
Usage and restrictions
Interpretation: Since the present specification excerpt does not contain specific function signatures, the type likely serves as a return value or status parameter in notifications to upper-layer modules such as the LIN interface. Question Q-6a9c54976345ca2b (open) Further details on reentrancy, call contexts, or synchronous or asynchronous execution are not contained in the excerpt.
This usage note was generated automatically based on the specification of AUTOSAR R20-11.
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/CP_MOD_Lin- Status
- unspecified
- Version
AUTOSAR/AP/record/CP_MOD_Lin@rel:R20-11#e8ea5339- Content hash
e8ea5339- Source
- https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_LINDriver.pdf#nameddest=SWS_Lin_00006
gemini-3.8-flash-low· 2026-10-13 · German original