AUTOSAR Classic LIN
Das LIN-Cluster umfasst Low-Cost-Subbus-Kommunikation für Karosserie- und Komfortfunktionen inklusive Treiber, LinIf-Schedule-Tabellen-Handling, Transceiver-Steuerung und State-Management.
Initialisatie en status
Lin_GetStatusLin_GetVersionInfoLin_InitLinIf_GetVersionInfoLinIf_InitLinSM_GetVersionInfoLinSM_InitLinTp_GetVersionInfoLinTp_InitLinTrcv_GetVersionInfoLinTrcv_InitDiensten · Get…
Diensten · Set…
Diensten · Wakeup…
Diensten · Check…
Diensten · Goto…
Diensten · Schedule…
Diensten · Overige
Lin_GoToSleepLin_GoToSleepInternalLin_SendFrameLinIf_EnableBusMirroringLinIf_HeaderIndicationLinIf_LinErrorIndicationLinIf_TransmitLinSM_RequestComModeLinTp_ChangeParameterLinTp_ShutdownLinTp_TransmitCallbacks
LinIf_RxIndicationLinIf_TxConfirmationCallouts en verwachte interfaces
<User_ResponseErrorSignalChanged><User_RxIndication><User_SaveConfigurationRequest><User_TriggerTransmit><User_TxConfirmation>Cyclisch
LinSM_MainFunctionTypen
Lin_ConfigTypeLin_FrameCsModelTypeLin_FrameDlTypeLin_FramePidTypeLin_FrameResponseTypeLin_PduTypeLin_SlaveErrorTypeLin_StatusTypeLinIf_ConfigTypeLinIf_SchHandleTypeLinSM_ConfigTypeLinSM_ModeTypeLinTp_ConfigTypeLinTp_ModeLinTrcv_ConfigTypeLinTrcv_TrcvModeTypeLinTrcv_TrcvWakeupModeTypeLinTrcv_TrcvWakeupReasonTypeFuncties
<User_ResponseErrorSignalChanged><User_RxIndication><User_SaveConfigurationRequest><User_TriggerTransmit><User_TxConfirmation>Lin_CheckWakeupLin_GetStatusLin_GetVersionInfoLin_GoToSleepLin_GoToSleepInternalLin_InitLin_SendFrameLin_WakeupLin_WakeupInternalLinIf_CheckWakeupLinIf_EnableBusMirroringLinIf_GetConfiguredNADLinIf_GetPIDTableLinIf_GetTrcvModeLinIf_GetTrcvWakeupReasonLinIf_GetVersionInfoLinIf_GotoSleepLinIf_HeaderIndicationLinIf_InitLinIf_LinErrorIndicationLinIf_RxIndicationLinIf_ScheduleRequestLinIf_SetConfiguredNADLinIf_SetPIDTableLinIf_SetTrcvModeLinIf_SetTrcvWakeupModeLinIf_TransmitLinIf_TxConfirmationLinIf_WakeupLinIf_WakeupConfirmationLinSM_GetCurrentComModeLinSM_GetVersionInfoLinSM_GotoSleepConfirmationLinSM_GotoSleepIndicationLinSM_InitLinSM_MainFunctionLinSM_RequestComModeLinSM_ScheduleRequestLinSM_ScheduleRequestConfirmationLinSM_WakeupConfirmationLinTp_ChangeParameterLinTp_GetVersionInfoLinTp_InitLinTp_ShutdownLinTp_TransmitLinTrcv_CheckWakeupLinTrcv_GetBusWuReasonLinTrcv_GetOpModeLinTrcv_GetVersionInfoLinTrcv_InitLinTrcv_SetOpModeLinTrcv_SetWakeupModeTypen
Lin_ConfigTypeLin_FrameCsModelTypeLin_FrameDlTypeLin_FramePidTypeLin_FrameResponseTypeLin_PduTypeLin_SlaveErrorTypeLin_StatusTypeLinIf_ConfigTypeLinIf_SchHandleTypeLinSM_ConfigTypeLinSM_ModeTypeLinTp_ConfigTypeLinTp_ModeLinTrcv_ConfigTypeLinTrcv_TrcvModeTypeLinTrcv_TrcvWakeupModeTypeLinTrcv_TrcvWakeupReasonTypeThemakaart
Lin
17LinIf
35LinSM
12Geen elementgegevens voor deze release
Lin
This function checks if a wakeup has occurred on the addressed LIN channel.
Std_ReturnType Lin_CheckWakeup (uint8 Channel);Service Lin_GetStatus.
Lin_StatusType Lin_GetStatus (uint8 Channel, const uint8* * Lin_SduPtr);Returns the version information of this module.
void Lin_GetVersionInfo (Std_VersionInfoType* versioninfo);The service instructs the driver to transmit a go - to - sleep - command on the addressed LIN channel. Only used for LIN master nodes.
Std_ReturnType Lin_GoToSleep (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).
Std_ReturnType Lin_GoToSleepInternal (uint8 Channel);Initializes the LIN module.
void Lin_Init (const Lin_ConfigType* Config);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.
Std_ReturnType Lin_SendFrame (uint8 Channel, const Lin_PduType* PduInfoPtr);Generates a wake up pulse and sets the channel state to LIN_ CH_ OPERATIONAL.
Std_ReturnType Lin_Wakeup (uint8 Channel);Sets the channel state to LIN_ CH_ OPERATIONAL without generating a wake up pulse.
Std_ReturnType Lin_WakeupInternal (uint8 Channel);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.
This type is used to specify the Checksum model to be used for the LIN Frame.
This type is used to specify the number of SDU data bytes to copy.
Represents all valid protected identifier used by Lin_ Send Frame().
Thi s type is used to specify whether the frame processor is required to transmit the response part of the LIN frame.
This Type is used to provide PID, checksum model, data length and SDU pointer from the LIN Interface to the LIN driver.
This type represents the slave error types that are detected during header reception and response transmission / reception.
LIN operation states for a LIN channel or frame, as returned by the API service Lin_ Get Status().
LinIf
Notifies the change of the response error signal with the new value. Only applicable for LIN slave nodes. AUTOSAR CP R20 - of Document ID : AUTOSAR_ SWS_ LINInterface
void <User_ResponseErrorSignalChanged> (NetworkHandleType Channel, boolean RespErrSigValue);Indication of a received PDU from a lower layer communication interface module.
void <User_RxIndication> (PduIdType RxPduId, const PduInfoType* PduInfoPtr);Notifies the reception of a Save Configuration request. Only applicable for LIN slave nodes.
boolean <User_SaveConfigurationRequest> (NetworkHandleType Channel);Within this API, the upper layer module (called module) shall check whether the available data fits into the b uffer size reported by Pdu Info Ptr - >Sdu Length. If it fits, it shall copy its data into the buffer provided by Pdu Info Ptr - >Sdu Data Ptr and update the length of the actual copied data in Pdu Info Ptr - >Sdu Length. If not, it returns E_ NOT_ OK without ch anging Pdu Info Ptr.
Std_ReturnType <User_TriggerTransmit> (PduIdType TxPduId, PduInfoType* PduInfoPtr);The lower layer communication interface module confirms the transmission of a PDU, or the failure to transmit a PDU.
void <User_TxConfirmation> (PduIdType TxPduId, Std_ReturnType result);Will be called when the Ecu M has been notified about a wakeup on a specific LIN channel.
Std_ReturnType LinIf_CheckWakeup (EcuM_WakeupSourceType WakeupSource);Enables or disables mirroring for a LIN channel.
Std_ReturnType LinIf_EnableBusMirroring (NetworkHandleType Channel, boolean MirroringActive);Reports the current configured NAD. Only applicable for LIN slave nodes.
Std_ReturnType LinIf_GetConfiguredNAD (NetworkHandleType Channel, uint8* Nad);Retrieves all assigned PID values. The order is congruent to the LIN frame index. Only applicable for LIN slave nodes.
Std_ReturnType LinIf_GetPIDTable (NetworkHandleType Channel, Lin_FramePidType* PidBuffer, uint8* PidBufferLength);Returns the actual sta te of a LIN Transceiver Driver.
Std_ReturnType LinIf_GetTrcvMode (NetworkHandleType Channel, LinTrcv_TrcvModeType* TransceiverModePtr);Returns the reason for the wake up that has been detected by the LIN Transceiver Driver.
Std_ReturnType LinIf_GetTrcvWakeupReason (NetworkHandleType Channel, LinTrcv_TrcvWakeupReasonType* TrcvWuReasonPtr);Returns the version information of this module.
void LinIf_GetVersionInfo (Std_VersionInfoType* versioninfo);Initiates a transition into the Sleep Mode on the selected channel.
Std_ReturnType LinIf_GotoSleep (NetworkHandleType Channel);The LIN Driver will call this function to report a received LIN header. This function is only applicable for LIN slave nodes (available only if the ECU has any LIN slave channel).
Std_ReturnType LinIf_HeaderIndication (NetworkHandleType Channel, Lin_PduType* PduPtr);Initializes the LIN Interface.
void LinIf_Init (const LinIf_ConfigType* ConfigPtr);The LIN Driver will call this function to report a detected error event during header or response processing. This function is only applicable for LIN slave nodes (available only if the ECU has any LIN slave channel).
void LinIf_LinErrorIndication (NetworkHandleType Channel, Lin_SlaveErrorType ErrorStatus);The LIN Driver will call this function to report a successfully received response and provides the reception data to the LIN Interface. This function is only applicable for LIN slave nodes (available only if the ECU has any LIN slave channel).
void LinIf_RxIndication (NetworkHandleType Channel, uint8* Lin_SduPtr);Requests a schedule table to be executed. Only used for LIN master nodes.
Std_ReturnType LinIf_ScheduleRequest (NetworkHandleType Channel, LinIf_SchHandleType Schedule);Sets the current configured NAD. Only applicable for LIN slave nodes.
Std_ReturnType LinIf_SetConfiguredNAD (NetworkHandleType Channel, uint8 Nad);Sets all assigned PID values. The order is congruent to the LIN frame index. Only applicable for LIN slave nodes.
Std_ReturnType LinIf_SetPIDTable (NetworkHandleType Channel, Lin_FramePidType* PidBuffer, uint8 PidBufferLength);Set the given LIN transceiver to the given mode.
Std_ReturnType LinIf_SetTrcvMode (NetworkHandleType Channel, LinTrcv_TrcvModeType TransceiverMode);This API enables, disables and cl ears the notification for wakeup events on the addressed network
Std_ReturnType LinIf_SetTrcvWakeupMode (NetworkHandleType Channel, LinTrcv_TrcvWakeupModeType LinTrcvWakeupMode);Re quests transmission of a PDU.
Std_ReturnType LinIf_Transmit (PduIdType TxPduId, const PduInfoType* PduInfoPtr);The LIN Driver will call this function to report a successfully transmitted response. This function is only applicable for LIN slave nodes (available only if the ECU has any LIN slave channel).
void LinIf_TxConfirmation (NetworkHandleType Channel);Initiates the wake up process.
Std_ReturnType LinIf_Wakeup (NetworkHandleType Channel);The LIN Driver or LIN Transceiver Driver will call this function to report the wake up source after the successful wakeup detection during Check Wakeup or after power on by bus.
void LinIf_WakeupConfirmation (EcuM_WakeupSourceType WakeupSource);Request to change a specific transport protocol parameter (e.g. block size).
Std_ReturnType LinTp_ChangeParameter (PduIdType id, TPParameterType parameter, uint16 value);Returns the version information of this module.
void LinTp_GetVersionInfo (Std_VersionInfoType* versioninfo);Initializes the LIN Transport Layer.
void LinTp_Init (const LinTp_ConfigType* ConfigPtr);Shutdowns the LIN TP.
void LinTp_Shutdown (void);Requests transmission of a PDU.
Std_ReturnType LinTp_Transmit (PduIdType TxPduId, const PduInfoType* PduInfoPtr);A pointer to an instance of this structure will be used in the initialization of the LIN Interface. The outline of the structure is defined in chapter 10 Configuration Specification.
Index of the schedule table that is selectable and followed by LIN Interface. Value is unique per LIN c hannel/ controller, but not per ECU. The number of schedule tables is limited to 255
This is the base type for the configuration of the LIN Transport Protocol A pointer to an instance of this structure will be used in the initialization of the LIN Transport Protocol. The outline of the structure is defined in chapter 10 Configuration Specification
This type denotes which Schedule table can be requested by LIN TP during diagnostic session
LinSM
Function to query the current communication mode.
Std_ReturnType LinSM_GetCurrentComMode (NetworkHandleType network, ComM_ModeType* mode);-
void LinSM_GetVersionInfo (Std_VersionInfoType* versioninfo);The Lin If will call this callback when the go to sleep command is sent successfully or not sent successfully on the network.
void LinSM_GotoSleepConfirmation (NetworkHandleType network, boolean success);The Lin If will call this callback when the go to sleep command is received on the network or a bus idle timeout occurs. Only applicable for LIN slave nodes.
void LinSM_GotoSleepIndication (NetworkHandleType Channel);This function initializes the Lin SM.
void LinSM_Init (const LinSM_ConfigType* ConfigPtr);Periodic function that runs the timers of different request timeouts
void LinSM_MainFunction (void);Requesting of a communication mode. The mode switch will not be made instant. The Lin SM will notify the caller when mode transition is made.
Std_ReturnType LinSM_RequestComMode (NetworkHandleType network, ComM_ModeType mode);The upper layer requests a schedule table to be changed on one LIN network.
Std_ReturnType LinSM_ScheduleRequest (NetworkHandleType network, LinIf_SchHandleType schedule);The Lin If module will call this callback when the new requested schedule table is active.
void LinSM_ScheduleRequestConfirmation (NetworkHandleType network, LinIf_SchHandleType schedule);The Lin If will call this callback when the wake up signal command is sent not successfully/ successfully on the network.
void LinSM_WakeupConfirmation (NetworkHandleType network, boolean success);Data structure type for the post - build configuration parameters.
Type used to report the current mode to the Bsw M
LinTrcv
Service LinTrcv_CheckWakeup.
Std_ReturnType LinTrcv_CheckWakeup (uint8 LinNetwork);This API provides the reason for the wakeup that the LIN transceiver has detected in the parameter "Reason". The ability to dete ct and differentiate the possible wakeup reasons depends strongly on the LIN transceiver hardware.
Std_ReturnType LinTrcv_GetBusWuReason (uint8 LinNetwork, LinTrcv_TrcvWakeupReasonType* Reason);API detects the actual software state of LIN transceiver driv er.
Std_ReturnType LinTrcv_GetOpMode (uint8 LinNetwork, LinTrcv_TrcvModeType* OpMode);This service provides the version information of this module through the parameter "versioninfo".
void LinTrcv_GetVersionInfo (Std_VersionInfoType* versioninfo);Initializes the Lin Transceiver Driver module.
void LinTrcv_Init (const LinTrcv_ConfigType* ConfigPtr);The internal state of the LIN transceiver driver is switched to mode given in the parameter Op Mode.
Std_ReturnType LinTrcv_SetOpMode (uint8 LinNetwork, LinTrcv_TrcvModeType OpMode);This API enables, disables and clears the notification for wakeup events on the addressed network. A vailable via Lin Trcv.h
Std_ReturnType LinTrcv_SetWakeupMode (uint8 LINNetwork, LinTrcv_TrcvWakeupModeType TrcvWakupMode);Configuration data structure of the Lin Trcv module. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_LINTransceiverDriver
Operating modes of the LIN Transceiver Driver
Wake up operating modes of the LIN Transceiver Driver.
This type denotes the wake up reason detected by the LIN transceiver in detail.
ClustergidsAI-GEGENEREERD
Maakt de kostenefficiënte netwerkkoppeling van sensoren en actuatoren via het Local Interconnect Network in het voertuig mogelijk.
Maakt de kostenefficiënte netwerkkoppeling van sensoren en actuatoren via het Local Interconnect Network in het voertuig mogelijk.
Het modulecluster LIN Communication realiseert de gestandaardiseerde aansluiting van LIN-subbussystemen via de modules LinSM, LinIf, LinTrcv en Lin (SWS COMManager p. 19). Het bestuurt de schedule-gebaseerde overdracht van frames bij masters en de reactieve header-evaluatie en gegevensoverdracht bij slaves ([SWS_LinIf_91004], [SWS_Lin_00168]). Tegelijkertijd coördineert het cluster de ordelijke overgang tussen volledige communicatie en slaapmodus, evenals de autonome foutafhandeling via het response_error-signaal ([SWS_LinIf_00763]).
Het modulecluster LIN Communication biedt de volledige AUTOSAR-implementatie van het LIN-protocol en omvat de statusmanager LinSM, de interface LinIf (inclusief transportprotocol LinTp), de transceiver-driver LinTrcv en de MCAL-driver Lin (SWS COMManager p. 19). Het verbindt subnetwerken, sensoren en actuatoren met de AUTOSAR-communicatiematrix en maakt een strikt onderscheid tussen master-nodes met autonome schedule-afhandeling en puur reactief antwoordende slave-nodes ([SWS_LinIf_00197], [SWS_Lin_00272]).
Architectuurdiagram: Lagenarchitectuur en interfacerelaties van het LIN-cluster tussen communicatieservices, abstractielaag en MCAL. Bronnen: SWS COMManager p. 19, AUTOSAR SWS LINInterface p. 133.
De gegevensoverdracht vindt op master-ECU's plaats door periodieke aansturing van de driver via Lin_SendFrame en daaropvolgende statusopvraag via Lin_GetStatus ([SWS_Lin_00168]). Bij de slave leidt de detectie van een header in de driver daarentegen tot de synchrone callback LinIf_HeaderIndication ([SWS_LinIf_91004]). De interface beslist op basis van de PID over ontvangst, antwoord of negeren en bevestigt de voltooiing via LinIf_RxIndication respectievelijk LinIf_TxConfirmation ([SWS_LinIf_91005], [SWS_LinIf_91006]). Diagnoseberichten worden door het geïntegreerde LinTp afgehandeld via geautomatiseerde omschakelingen van de schedule-tabel ([SWS_LinIf_00641]).
Tijdens de bedrijfscyclus coördineert LinSM de statusovergangen tussen LINSM_NO_COM en LINSM_FULL_COM ([SWS_LinSM_00026], [SWS_LinSM_00032]). Het wekken vindt plaats via een buspuls via Lin_Wakeup ([SWS_Lin_00169]). De overgang naar de slaapmodus vindt bij de master plaats door het actief verzenden van een sleep-frame, bij de slave na ontvangst van het sleep-commando of bij bus-idle via LinIf_GotoSleep, Lin_GoToSleepInternal en transceiver-slaapbesturing ([SWS_LinSM_00231], [SWS_LinIf_00757]).
Sequentiediagram: Samenspel van de BSW-modules bij het ingaan van de slaaptoestand door een LIN-slave na een bus-sleep-signaal. Bronnen: [SWS_LinSM_91000], [SWS_LinSM_00231], [SWS_LinIf_00757], AUTOSAR SWS LINStateManager p. 48.
Communicatiefouten worden op slaves via LinIf_LinErrorIndication geregistreerd en autonoom in het response_error-signaal aan de master gemeld ([SWS_LinIf_91007], [SWS_LinIf_00763]). Kanaaloverstijgende synchronisatiebereiken en strikte scheidingen tussen cyclische taken (LinIf_MainFunction) en driver-ISR's waarborgen de systeemstabiliteit ([SWS_LinIf_00384]).
Systeemarchitectuur & rol van het modulecluster
Het modulecluster LIN Communication biedt in de AUTOSAR Classic Basic Software-stack de gestandaardiseerde communicatie via het Local Interconnect Network (LIN) conform ISO 17987. Het fungeert primair als kostenefficiënt subbussysteem voor de aansluiting van sensoren en actuatoren in het voertuignetwerk (AUTOSAR FO Features p. 58). Het cluster strekt zich uit over meerdere lagen van de AUTOSAR-architectuur: De LIN State Manager (LinSM) opereert op het niveau van de Communication Services, het LIN Interface (LinIf) inclusief het geïntegreerde transportprotocol (LinTp) vormt de Communication Abstraction, de LIN Transceiver Driver (LinTrcv) maakt deel uit van de ECU Abstraction en de LIN Driver (Lin) resideert als hardwarenahe module in de Microcontroller Abstraction Layer (MCAL) (SWS COMManager p. 19).
Architectonisch differentieert het cluster strikt tussen master- en slave-nodes. Een LIN-master bestuurt via schedule-tabellen zelfstandig het busverkeer en genereert alle headers, terwijl LIN-slaves puur reactief op ontvangen headers antwoorden of signalen evalueren ([SWS_LinIf_00197], [SWS_Lin_00272]). Voor diagnose- en transporttaken conform ISO 14229 kapselt het LIN Interface de TP-functionaliteit in, die gesegmenteerde diagnoseberichten (Master Request Frame MRF en Slave Response Frame SRF) via PduR en DCM afhandelt ([SWS_LinIf_00351], [SWS_LinIf_00629]). Naar buiten toe interacteert het cluster intensief met de Communication Manager (ComM), de Basic Software Mode Manager (BswM), de PDU Router (PduR) en de ECU State Manager (EcuM) (SWS COMManager p. 19).
Architectuurdiagram: Lagenarchitectuur en interfacerelaties van het LIN-cluster tussen communicatieservices, abstractielaag en MCAL. Bronnen: SWS COMManager p. 19, AUTOSAR SWS LINInterface p. 133.
Samenspel & interactiepaden tussen de modules
Die interactiepaden in het cluster verschillen fundamenteel afhankelijk van de knooppuntrol. In de LIN-master initieert het LIN Interface via zijn periodieke task de afhandeling van de actieve schedule-tabel. Voor verzendframes die moeten worden verstuurd, haalt LinIf de payload op via trigger-transmit-mechanismen van de hogere laag en draagt het de Lin_PduType-structuur over aan de LIN-driver via Lin_SendFrame ([SWS_Lin_00232], SWS LINInterface p. 37). De driver verstuurt header en data niet-blokkerend ([SWS_Lin_00027]). Na afloop van de maximale frame-looptijd stelt LinIf het transmissieresultaat vast via Lin_GetStatus ([SWS_Lin_00168], SWS LINInterface p. 35). Bij ontvangstslots haalt LinIf de door de driver in de buffer geplaatste data op en stuurt deze door naar de hogere lagen ([SWS_Lin_00233]).
Op een LIN-slave verloopt het datapand gebeurtenisgestuurd: herkent de MCAL-driver Lin op de hardware een geldige break-, synch- en PID-header, dan roept deze synchroon de callback LinIf_HeaderIndication aan ([SWS_Lin_00280], [SWS_LinIf_91004]). Het interface controleert de protected identifier (PID) aan de hand van de interne PID-tabel ([SWS_LinIf_00816], [SWS_LinIf_00823]). Gaat het om een verzendframe, dan haalt LinIf de payload op, configureert het responstype naar LIN_FRAMERESPONSE_TX en stelt de data in de buffer beschikbaar voor de driver ([SWS_Lin_00230]). Is het frame geconfigureerd voor ontvangst, dan meldt de driver na volledige byte-ontvangst het succes via LinIf_RxIndication ([SWS_LinIf_91005]), waarna LinIf de data doorgeeft aan de PDU-router. Bevestigingen van verzonden slave-responses vinden plaats via LinIf_TxConfirmation ([SWS_LinIf_91006]).
Via het LIN-interface wordt bovendien de transceiverbesturing transparant ingekapseld: modusverzoeken zoals LinIf_SetTrcvMode stuurt het interface synchroon door naar LinTrcv_SetOpMode ([SWS_LinIf_00544], [SWS_LinTrcv_00002]). Bij transportprotocoltransacties bestuurt LinTp via BswM_LinTp_RequestMode de gerichte omschakeling van de schedule-tabel van de master tussen applicatiemodus (LINTP_APPLICATIVE_SCHEDULE), diagnoseverzoek (LINTP_DIAG_REQUEST) en diagnoserespons (LINTP_DIAG_RESPONSE) ([SWS_LinIf_00641], [SWS_LinIf_00642], [SWS_LinIf_00643]).
Sequentiediagram: dynamische besturings- en datastroom bij headerindicatie, verzendtriggering en ontvangstbevestiging op een LIN-slave. Bronnen: [SWS_Lin_00280], [SWS_LinIf_91004], [SWS_LinIf_91005], AUTOSAR SWS LINInterface p. 133.
Synchronisatie, re-entrantie en taakcontexten
De uitvoering binnen het modulecluster is opgedeeld in cyclische taskcontexten en hardwarenabije interruptniveaus. De kern van de cyclische procesbesturing in het LIN Interface is de geplande functie LinIf_MainFunction_<LinIfChannel.ShortName>, die dwingend voor elk geconfigureerd LIN-kanaal afzonderlijk wordt geïnstantieerd ([SWS_LinIf_00384], [SWS_LinIf_00725]). Deze verzorgt het doorschakelen van de schedule-slots, het opvragen van de status bij de driver en de time-outhandling van het transportprotocol ([SWS_LinIf_00800], SWS LINInterface p. 119). Parallel daaraan beheert LinSM_MainFunction de countdown- en bevestigingstimers voor asynchrone kanaal- en wake-upverzoeken ([SWS_LinSM_00162], [SWS_LinSM_00159]).
In tegenstelling tot het taskniveau lopen de driverroutines van de MCAL-module Lin bij aanwezigheid van een interruptgestuurde controller of een UART-interface in de interruptcontext (ISR) (AUTOSAR CP SWS LINDriver p. 53). De callbacks LinIf_HeaderIndication, LinIf_RxIndication en LinIf_TxConfirmation worden direct vanuit deze ISR-context synchroon geactiveerd ([SWS_Lin_00280], [SWS_LinIf_91005], [SWS_LinIf_91006]). Dit vereist een strikte beveiliging van kritieke secties (Exclusive Areas) in het LIN Interface: besturingsaanroepen zoals LinIf_Transmit, LinIf_GotoSleep, LinIf_ScheduleRequest of LinIf_Wakeup mogen interne kanaalstructuren uitsluitend beschermd tegen parallelle toegang vanuit de LinIf_MainFunction of ISR-callbacks wijzigen (SWS LINInterface p. 119).
Wat betreft re-entrantie zijn de API-functies van de modules LinIf en LinSM overwegend re-entrant voor verschillende kanalen respectievelijk netwerken, maar niet-re-entrant voor hetzelfde kanaal ontworpen ([SWS_LinSM_00126], [SWS_LinIf_00201], [SWS_LinIf_00204]). Hetzelfde geldt voor de driverdiensten in Lin (bijv. Lin_Wakeup, Lin_GoToSleepInternal), die strikt per fysiek kanaal gesynchroniseerd moeten worden ([SWS_Lin_00167], [SWS_Lin_00169]). Bij eenvoudige UART-hardware zonder multi-byte-FIFO buffert de LIN-driver bytes tijdelijk in software ([SWS_Lin_00026]), wat interpretatie: bij hoge busbelasting vermoedelijk tot een verhoogde CPU-interruptbelasting op slave-knooppunten leidt. Vraag Q-0d07d89d1ade6a01 (open)
Typische levenscycli en bedrijfsmodi
Tijdens het opstarten van het systeem initialiseert de BswM de BSW-modules in een vooraf vastgelegde keten: eerst worden de basisdrivers Lin_Init en LinTrcv_Init geïnitialiseerd, gevolgd door LinIf_Init, LinTp_Init en tot slot LinSM_Init (ModemanagementGuide p. 54). LinIf_Init stelt het schedule van alle masterkanalen standaard in op NULL_SCHEDULE ([SWS_LinIf_00233]) en laadt bij slaves de voorgeconfigureerde NAD- en PID-tabellen ([SWS_LinIf_00767], [SWS_LinIf_00768]). LinSM start in de toestand LINSM_NO_COM, zonder bij de initialisatie callbacks te sturen naar ComM of BswM ([SWS_LinSM_00026], [SWS_LinSM_00166]).
Vraagt de ComM via LinSM_RequestComMode(COMM_FULL_COMMUNICATION) communicatievrijgave aan, dan triggert LinSM direct LinIf_Wakeup en start een bewakingstimer ([SWS_LinSM_00047], [SWS_LinSM_00100]). LinIf verstuurt via Lin_Wakeup de fysieke wake-uppuls op de bus ([SWS_LinIf_00205], [SWS_Lin_00043]). Meldt LinIf het succesvolle ontwaakproces via LinSM_WakeupConfirmation(success=TRUE), dan wisselt de toestand naar LINSM_FULL_COM ([SWS_LinSM_00049], [SWS_LinSM_00132]). Dit wordt gesignaleerd aan ComM via ComM_BusSM_ModeIndication en aan BswM via BswM_LinSM_CurrentState ([SWS_LinSM_00033], [SWS_LinSM_00192]). Bij slaves geldt de bus pas als succesvol ontwaakt wanneer de master de eerste LIN-header verstuurt en deze wordt ontvangen ([SWS_LinIf_00761], SWS LINStateManager p. 28).
Het afsluiten naar de slaapmodus (go-to-sleep) verschilt aanzienlijk: op een master leidt het verzoek COMM_NO_COMMUNICATION tot de aanroep van LinIf_GotoSleep ([SWS_LinSM_00036], [SWS_LinSM_10208]). LinIf geeft de driver via Lin_GoToSleep de opdracht om een gestandaardiseerd go-to-sleep-frame op de bus te versturen ([SWS_Lin_00166], [SWS_Lin_00089]). Op een slave daarentegen ontvangt het interface het go-to-sleep-commando of detecteert het een bus-idle-time-out en informeert het LinSM via LinSM_GotoSleepIndication ([SWS_LinSM_91000]). LinSM roept daarop synchroon LinIf_GotoSleep aan ([SWS_LinSM_00231]). Het interface schakelt de driver via Lin_GoToSleepInternal lokaal naar de toestand LIN_CH_SLEEP ([SWS_LinIf_00757], [SWS_Lin_00095]) en brengt de transceiver via LinIf_SetTrcvMode(LINTRCV_TRCV_MODE_SLEEP) in de slaaptoestand ([SWS_LinIf_00544], AUTOSAR CP SWS LINInterface p. 137). Na de bevestiging LinSM_GotoSleepConfirmation wisselt LinSM definitief naar LINSM_NO_COM ([SWS_LinSM_00046], [SWS_LinSM_00233]).
Sequentiediagram: Samenspel van de BSW-modules bij het ingaan van de slaaptoestand door een LIN-slave na een bus-sleep-signaal. Bronnen: [SWS_LinSM_91000], [SWS_LinSM_00231], [SWS_LinIf_00757], AUTOSAR SWS LINStateManager p. 48.
Foutafhandeling, DET-tracing en degradatie
Het cluster beschikt over een meertraps foutdetectie- en diagnoseconcept. Ontwikkelfouten worden geregistreerd via de Default Error Tracer (Det): ongeldige kanaal- of netwerkparameters worden gemeld door LIN_E_INVALID_CHANNEL ([SWS_Lin_00259]), LINIF_E_NONEXISTENT_CHANNEL ([SWS_LinIf_00539]) respectievelijk LINSM_E_NONEXISTENT_NETWORK ([SWS_LinSM_00127]). Aanroepen van niet-geïnitialiseerde modules hebben LIN_E_UNINIT, LINIF_E_UNINIT of LINSM_E_UNINIT tot gevolg ([SWS_Lin_00258], [SWS_LinSM_00128]). Transceiverfouten zoals ongeldige netwerknummers melden LINTRCV_E_INVALID_LIN_NETWORK aan DET ([SWS_LinTrcv_00145]).
Tijdens bedrijf optredende communicatiestoringen worden geclassificeerd als runtimefouten: het interface definieert LINIF_E_RESPONSE bij defecte frames en LINIF_E_NC_NO_RESPONSE bij ontbrekende antwoorden op node configuration requests ([SWS_LinIf_00729]). Fysieke bus- en protocolfouten (framingfouten, checksumfouten, bit-monitoringfouten) meldt de MCAL-driver op de slave via LinIf_LinErrorIndication met de status Lin_SlaveErrorType ([SWS_LinIf_91007], [SWS_Lin_91140]). Op masterknooppunten levert Lin_GetStatus gedetailleerde foutcodes zoals LIN_TX_HEADER_ERROR, LIN_TX_ERROR of LIN_RX_ERROR aan het interface ([SWS_Lin_00168], [SWS_Lin_00233]).
Een centraal foutmechanisme voor LIN-slaves is het gestandaardiseerde response_error-signaal. Het LIN-interface beheert dit 1-bit-signaal autonoom: treedt er een transmissiefout op, dan zet LinIf de bit, die in het volgende ongeconditioneerde verzendframe naar de master wordt verzonden ([SWS_LinIf_00763], SWS LINInterface p. 58). Na succesvolle frame-overdracht wist LinIf de vlag automatisch ([SWS_LinIf_00747]). In het diagnosekanaal bewaakt LinTp strikte protocoltijdvensters: bij het uitblijven van N-PDU's breken de timers $N_{As}$ en $N_{Cr}$ de transactie gedefinieerd af en melden E_NOT_OK aan de PDU-router ([SWS_LinIf_00799], [SWS_LinIf_00804], [SWS_LinIf_00806]). Ontbreekt er buffercapaciteit bij de PDU-router, dan breekt het interface de opname af en schakelt de schedule-tabel van de master terug naar applicatiebedrijf ([SWS_LinIf_00676], [SWS_LinIf_00792]).
Deze handleiding is gebaseerd op de AUTOSAR-specificaties voor release R20-11 van de modules Lin, LinIf, LinSM en LinTrcv. Alle normatieve verwijzingen zijn afkomstig uit de gerefereerde documenten en requirement-items.
Module im Cluster
LIN Driver (Lin)
Controls hardware LIN controllers on the ECU.
LIN Interface (LinIf)
Abstracts LIN hardware and manages schedule tables and frame transmission.
LIN Network Management (LinNm)
AUTOSAR Classic Communication Services-Modul LIN Network Management (LinNm, Spezifikation: AUTOSAR_SWS_LINNetworkManagement.pdf).
LIN State Manager (LinSM)
Manages state transitions of LIN networks.
LIN Transceiver Driver (LinTrcv)
Controls physical bus transceiver states and wakeup on LIN lines.
gemini-3.8-flash-low· 2026-10-13 · Duits origineel