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.
التهيئة والحالة
Lin_GetStatusLin_GetVersionInfoLin_InitLinIf_GetVersionInfoLinIf_InitLinSM_GetVersionInfoLinSM_InitLinTp_GetVersionInfoLinTp_InitLinTrcv_GetVersionInfoLinTrcv_Initالخدمات · Get…
الخدمات · Set…
الخدمات · Wakeup…
الخدمات · Check…
الخدمات · Goto…
الخدمات · Schedule…
الخدمات · أخرى
Lin_GoToSleepLin_GoToSleepInternalLin_SendFrameLinIf_EnableBusMirroringLinIf_HeaderIndicationLinIf_LinErrorIndicationLinIf_TransmitLinSM_RequestComModeLinTp_ChangeParameterLinTp_ShutdownLinTp_Transmitدوال الاستدعاء الراجع
LinIf_RxIndicationLinIf_TxConfirmationدوال Callout والواجهات المتوقعة
<User_ResponseErrorSignalChanged><User_RxIndication><User_SaveConfigurationRequest><User_TriggerTransmit><User_TxConfirmation>دورية
LinSM_MainFunctionالأنواع
Lin_ConfigTypeLin_FrameCsModelTypeLin_FrameDlTypeLin_FramePidTypeLin_FrameResponseTypeLin_PduTypeLin_SlaveErrorTypeLin_StatusTypeLinIf_ConfigTypeLinIf_SchHandleTypeLinSM_ConfigTypeLinSM_ModeTypeLinTp_ConfigTypeLinTp_ModeLinTrcv_ConfigTypeLinTrcv_TrcvModeTypeLinTrcv_TrcvWakeupModeTypeLinTrcv_TrcvWakeupReasonTypeالدوال
<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_SetWakeupModeالأنواع
Lin_ConfigTypeLin_FrameCsModelTypeLin_FrameDlTypeLin_FramePidTypeLin_FrameResponseTypeLin_PduTypeLin_SlaveErrorTypeLin_StatusTypeLinIf_ConfigTypeLinIf_SchHandleTypeLinSM_ConfigTypeLinSM_ModeTypeLinTp_ConfigTypeLinTp_ModeLinTrcv_ConfigTypeLinTrcv_TrcvModeTypeLinTrcv_TrcvWakeupModeTypeLinTrcv_TrcvWakeupReasonTypeخريطة المواضيع
Lin
17LinIf
35LinSM
12لا توجد بيانات عناصر لهذا الإصدار
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.
دليل العنقودمولَّد بالذكاء الاصطناعي
يتيح التوصيل الشبكي الفعال من حيث التكلفة للمستشعرات والمشغلات عبر Local Interconnect Network في المركبة.
يتيح التوصيل الشبكي الفعال من حيث التكلفة للمستشعرات والمشغلات عبر Local Interconnect Network في المركبة.
تحقق المجموعة النمطية LIN Communication الربط القياسي لأنظمة ناقل LIN الفرعية عبر الوحدات LinSM وLinIf وLinTrcv وLin (SWS COMManager ص. 19). وتتحكم في الإرسال القائم على جدول المواعيد (Schedule) للإطارات لدى العقد الرئيسية (Masters)، بالإضافة إلى التقييم التفاعلي للترويسة ونقل البيانات لدى العقد التابعة (Slaves) ([SWS_LinIf_91004]، [SWS_Lin_00168]). وفي الوقت نفسه، تنسق المجموعة النمطية الانتقال المنظم بين الاتصال الكامل ووضع السكون، فضلاً عن المعالجة الذاتية للأخطاء عبر إشارة response_error ([SWS_LinIf_00763]).
توفر المجموعة النمطية LIN Communication تطبيق AUTOSAR الكامل لبروتوكول LIN وتشتمل على مدير الحالة LinSM، والواجهة LinIf (بما في ذلك بروتوكول النقل LinTp)، ومشغل جهاز الإرسال والاستقبال LinTrcv بالإضافة إلى مشغل MCAL Lin (SWS COMManager ص. 19). وتقوم بربط الشبكات الفرعية والمستشعرات والمشغلات بمصفوفة اتصالات AUTOSAR، وتميز بدقة بين العقد الرئيسية ذات المعالجة الذاتية لجدول المواعيد والعقد التابعة التي تستجيب بشكل تفاعلي بحت ([SWS_LinIf_00197]، [SWS_Lin_00272]).
مخطط البنية المعمارية: بنية الطبقات وعلاقات الواجهات للمجموعة النمطية LIN بين خدمات الاتصال، وطبقة التجريد، وMCAL. المصادر: SWS COMManager ص. 19، AUTOSAR SWS LINInterface ص. 133.
يتم نقل البيانات في وحدات التحكم الإلكترونية (ECU) الرئيسية عبر التحفيز الدوري للمشغل عبر Lin_SendFrame والاستعلام اللاحق عن الحالة عبر Lin_GetStatus ([SWS_Lin_00168]). أما في العقدة التابعة، فيؤدي اكتشاف الترويسة في المشغل إلى استدعاء راجع متزامن LinIf_HeaderIndication ([SWS_LinIf_91004]). وتقرر الواجهة بناءً على PID بشأن الاستقبال أو الاستجابة أو التجاهل، وتؤكد الإتمام عبر LinIf_RxIndication أو LinIf_TxConfirmation ([SWS_LinIf_91005]، [SWS_LinIf_91006]). ويعالج LinTp المدمج رسائل التشخيص عبر التبديل التلقائي لجدول المواعيد ([SWS_LinIf_00641]).
في دورة التشغيل، ينسق LinSM انتقالات الحالة بين LINSM_NO_COM وLINSM_FULL_COM ([SWS_LinSM_00026]، [SWS_LinSM_00032]). ويتم التنبيه بنبضة ناقل عبر Lin_Wakeup ([SWS_Lin_00169]). ويتم الانتقال إلى وضع السكون في العقدة الرئيسية عن طريق إرسال إطار سكون بنشاط، وفي العقدة التابعة بعد استقبال أمر السكون أو عند خمول الناقل (Bus-Idle) عبر LinIf_GotoSleep وLin_GoToSleepInternal والتحكم في سكون جهاز الإرسال والاستقبال ([SWS_LinSM_00231]، [SWS_LinIf_00757]).
مخطط التسلسل: تفاعل وحدات BSW عند دخول عقدة LIN تابعة في حالة السكون بعد إشارة سكون الناقل. المصادر: [SWS_LinSM_91000]، [SWS_LinSM_00231]، [SWS_LinIf_00757]، AUTOSAR SWS LINStateManager ص. 48.
يتم تسجيل أخطاء الاتصال في العقد التابعة عبر LinIf_LinErrorIndication والإبلاغ عنها بشكل مستقل في إشارة response_error إلى العقدة الرئيسية ([SWS_LinIf_91007]، [SWS_LinIf_00763]). وتضمن مناطق المزامنة عبر القنوات والفصل الصارم بين المهام الدورية (LinIf_MainFunction) وروتينات خدمة المقاطعة (ISRs) للمشغل استقرار النظام ([SWS_LinIf_00384]).
معمارية النظام & دور مجموعة الوحدات
توفر المجموعة النمطية LIN Communication في حزمة البرمجيات الأساسية لـ AUTOSAR Classic الاتصال القياسي عبر Local Interconnect Network (LIN) وفقاً للمعيار ISO 17987. وتعمل في المقام الأول كنظام ناقل فرعي فعال من حيث التكلفة لربط المستشعرات والمشغلات في شبكة المركبة (AUTOSAR FO Features ص. 58). وتمتد المجموعة النمطية عبر عدة طبقات من بنية AUTOSAR المعمارية: يعمل LIN State Manager (LinSM) على مستوى خدمات الاتصال (Communication Services)، وتُشكل LIN Interface (LinIf) بما في ذلك بروتوكول النقل المدمج (LinTp) طبقة تجريد الاتصال (Communication Abstraction)، ويعد LIN Transceiver Driver (LinTrcv) جزءاً من تجريد وحدة التحكم الإلكترونية (ECU Abstraction)، ويستقر LIN Driver (Lin) كوحدة قريبة من العتاد في طبقة تجريد المتحكم الدقيق (MCAL) (SWS COMManager ص. 19).
من الناحية المعمارية، تفرق المجموعة النمطية بشكل صارم بين العقد الرئيسية والتابعة. تتحكم عقدة LIN الرئيسية عبر جداول المواعيد بشكل ذاتي في حركة مرور الناقل وتولد جميع الترويسات، بينما تستجيب عقد LIN التابعة بشكل تفاعلي بحت للترويسات المستلمة أو تقيم الإشارات ([SWS_LinIf_00197]، [SWS_Lin_00272]). ولمهام التشخيص والنقل وفقاً لـ ISO 14229، تغلف LIN Interface وظائف TP، والتي تعالج رسائل التشخيص المجزأة (إطار طلب العقدة الرئيسية MRF وإطار استجابة العقدة التابعة SRF) عبر PduR وDCM ([SWS_LinIf_00351]، [SWS_LinIf_00629]). وخارجياً، تتفاعل المجموعة النمطية بشكل مكثف مع Communication Manager (ComM)، وBasic Software Mode Manager (BswM)، وPDU Router (PduR)، وECU State Manager (EcuM) (SWS COMManager ص. 19).
مخطط البنية المعمارية: بنية الطبقات وعلاقات الواجهات للمجموعة النمطية LIN بين خدمات الاتصال، وطبقة التجريد، وMCAL. المصادر: SWS COMManager ص. 19، AUTOSAR SWS LINInterface ص. 133.
التكامل ومسارات التفاعل بين الوحدات
تختلف مسارات التفاعل في المجموعة النمطية اختلافاً جوهرياً وفقاً لدور العقدة. في عقدة LIN الرئيسية، تبدأ LIN Interface عبر مهمتها الدورية معالجة جدول المواعيد النشط. وبالنسبة لإطارات الإرسال المستحقة، تجلب LinIf البيانات الصالحة عبر آليات إطلاق الإرسال (Trigger-Transmit) للطبقة العليا وتمرر بنية Lin_PduType إلى مشغل LIN عبر Lin_SendFrame ([SWS_Lin_00232]، SWS LINInterface ص. 37). وينقل المشغل الترويسة والبيانات بشكل غير حاجب ([SWS_Lin_00027]). وبعد انقضاء الحد الأقصى لزمن تشغيل الإطار، تحدد LinIf نتيجة الإرسال عبر Lin_GetStatus ([SWS_Lin_00168]، SWS LINInterface ص. 35). وفي فتحات الاستقبال، تجلب LinIf البيانات المخزنة مؤقتاً بواسطة المشغل وتمررها إلى الطبقات العليا ([SWS_Lin_00233]).
في عقدة LIN التابعة، يعمل مسار البيانات بأسلوب موجه بالأحداث: عندما يكتشف مشغل MCAL Lin ترويسة صالحة لـ Break وSynch وPID على العتاد، فإنه يستدعي بشكل متزامن دالة الاستدعاء الراجع LinIf_HeaderIndication ([SWS_Lin_00280]، [SWS_LinIf_91004]). وتتحقق الواجهة من المعرف المحمي (PID) بناءً على جدول PID الداخلي ([SWS_LinIf_00816]، [SWS_LinIf_00823]). وإذا كان إطار إرسال، تجلب LinIf البيانات الصالحة، وتهيئ نوع الاستجابة إلى LIN_FRAMERESPONSE_TX وتوفر البيانات للمشغل في المخزن المؤقت ([SWS_Lin_00230]). وإذا تم تكوين الإطار كاستقبال، يبلغ المشغل بعد استلام البايت بالكامل بالنجاح عبر LinIf_RxIndication ([SWS_LinIf_91005])، وبعد ذلك تمرر LinIf البيانات إلى PDU Router. وتتم تأكيدات استجابات العقدة التابعة المرسلة عبر LinIf_TxConfirmation ([SWS_LinIf_91006]).
عبر LIN Interface، يتم أيضاً تغليف التحكم في جهاز الإرسال والاستقبال بشكل شفاف: تُمرر الواجهة طلبات الوضع مثل LinIf_SetTrcvMode بشكل متزامن إلى LinTrcv_SetOpMode ([SWS_LinIf_00544]، [SWS_LinTrcv_00002]). وفي معاملات بروتوكول النقل، يتحكم LinTp عبر BswM_LinTp_RequestMode في التبديل المستهدف لجدول مواعيد العقدة الرئيسية بين وضع التطبيق (LINTP_APPLICATIVE_SCHEDULE)، وطلب التشخيص (LINTP_DIAG_REQUEST)، واستجابة التشخيص (LINTP_DIAG_RESPONSE) ([SWS_LinIf_00641]، [SWS_LinIf_00642]، [SWS_LinIf_00643]).
مخطط التسلسل: تدفق التحكم والبيانات الديناميكي عند دلالة الترويسة، وتحفيز الإرسال، وتأكيد الاستقبال في عقدة LIN تابعة. المصادر: [SWS_Lin_00280]، [SWS_LinIf_91004]، [SWS_LinIf_91005]، AUTOSAR SWS LINInterface ص. 133.
المزامنة، وقابلية إعادة الدخول، وسياقات المهام
ينقسم التنفيذ داخل المجموعة النمطية إلى سياقات مهام دورية ومستويات مقاطعة قريبة من العتاد. يتمثل جوهر التحكم في التسلسل الدوري في LIN Interface في الدالة المجدولة LinIf_MainFunction_<LinIfChannel.ShortName>، والتي يتم إنشاء مثيل لها بشكل إلزامي ومنفصل لكل قناة LIN مهيأة ([SWS_LinIf_00384]، [SWS_LinIf_00725]). وهي تتولى التبديل بين فتحات جدول المواعيد، والاستعلام عن الحالة من المشغل، ومعالجة مهلة بروتوكول النقل ([SWS_LinIf_00800]، SWS LINInterface ص. 119). بالتوازي مع ذلك، تدير LinSM_MainFunction مؤقتات العد التنازلي والتأكيد لطلبات القناة والاستيقاظ غير المتزامنة ([SWS_LinSM_00162]، [SWS_LinSM_00159]).
على عكس مستوى المهام، تعمل روتينات المشغل لوحدة MCAL Lin في سياق المقاطعة (ISR) عند وجود وحدة تحكم موجهة بالمقاطعة أو واجهة UART (AUTOSAR CP SWS LINDriver ص. 53). ويتم إطلاق دوال الاستدعاء الراجع LinIf_HeaderIndication وLinIf_RxIndication وLinIf_TxConfirmation بشكل متزامن مباشرة من سياق ISR هذا ([SWS_Lin_00280]، [SWS_LinIf_91005]، [SWS_LinIf_91006]). ويتطلب ذلك تأميناً صارماً للمناطق الحصرية (Exclusive Areas) في LIN Interface: لا يجوز لاستدعاءات التحكم مثل LinIf_Transmit أو LinIf_GotoSleep أو LinIf_ScheduleRequest أو LinIf_Wakeup تعديل هياكل القناة الداخلية إلا مع توفير الحماية ضد الوصول المتوازي من LinIf_MainFunction أو استدعاءات ISR الراجعة (SWS LINInterface ص. 119).
فيما يتعلق بإمكانية إعادة الدخول (Reentrancy)، فإن دوال API للوحدات LinIf وLinSM مصممة في الغالب لتكون قابلة لإعادة الدخول لقنوات أو شبكات مختلفة، ولكنها غير قابلة لإعادة الدخول للقناة نفسها ([SWS_LinSM_00126]، [SWS_LinIf_00201]، [SWS_LinIf_00204]). وتتصرف خدمات المشغل في Lin بالطريقة نفسها (مثل Lin_Wakeup، Lin_GoToSleepInternal)، حيث يجب مزامنتها بدقة لكل قناة فيزيائية ([SWS_Lin_00167]، [SWS_Lin_00169]). وفي حالة عتاد UART البسيط الخالي من FIFO متعدد البايتات، يخزن مشغل LIN البايتات مؤقتاً في البرمجيات ([SWS_Lin_00026])، مما تفسير: يُرجح أن يؤدي في ظل حمل الناقل المرتفع إلى زيادة عبء مقاطعات وحدة المعالجة المركزية (CPU) في العقد التابعة. سؤال Q-0d07d89d1ade6a01 (مفتوح)
دورات الحياة النموذجية وأنماط التشغيل
أثناء بدء تشغيل النظام، يقوم BswM بتهيئة وحدات BSW وفق سلسلة محددة مسبقًا: أولاً تتم تهيئة برامج التشغيل الأساسية Lin_Init وLinTrcv_Init، متبوعة بـ LinIf_Init وLinTp_Init وأخيرًا LinSM_Init (ModemanagementGuide ص. 54). يضبط LinIf_Init جدول كل قنوات Master افتراضيًا على NULL_SCHEDULE ([SWS_LinIf_00233])، ويقوم عند الـ Slaves بتحميل جداول NAD وPID المهيأة مسبقًا ([SWS_LinIf_00767]، [SWS_LinIf_00768]). يبدأ LinSM في الحالة LINSM_NO_COM، دون إرسال استدعاءات رد نداء (Callbacks) إلى ComM أو BswM أثناء التهيئة ([SWS_LinSM_00026]، [SWS_LinSM_00166]).
إذا طلب ComM تصريح الاتصال عبر LinSM_RequestComMode(COMM_FULL_COMMUNICATION)، يقوم LinSM مباشرة بإطلاق LinIf_Wakeup وبدء مؤقت مراقبة ([SWS_LinSM_00047]، [SWS_LinSM_00100]). يرسل LinIf نبضة الاستيقاظ المادية إلى الناقل عبر Lin_Wakeup ([SWS_LinIf_00205]، [SWS_Lin_00043]). وإذا أبلغ LinIf عن نجاح عملية الاستيقاظ عبر LinSM_WakeupConfirmation(success=TRUE)، تنتقل الحالة إلى LINSM_FULL_COM ([SWS_LinSM_00049]، [SWS_LinSM_00132]). ويتم إشعار ComM بذلك عبر ComM_BusSM_ModeIndication وBswM عبر BswM_LinSM_CurrentState ([SWS_LinSM_00033]، [SWS_LinSM_00192]). بالنسبة للـ Slaves، لا يُعتبر الناقل قد استيقظ بنجاح إلا عندما يرسل الـ Master أول ترويسة LIN ويتم استقبالها ([SWS_LinIf_00761]، SWS LINStateManager ص. 28).
يختلف الانتقال إلى وضع السكون (Go-to-Sleep) اختلافًا جوهريًا: في Master، يؤدي الطلب COMM_NO_COMMUNICATION إلى استدعاء LinIf_GotoSleep ([SWS_LinSM_00036]، [SWS_LinSM_10208]). يكلف LinIf برنامج التشغيل عبر Lin_GoToSleep بإرسال إطار Go-to-Sleep قياسي على الناقل ([SWS_Lin_00166]، [SWS_Lin_00089]). أما في Slave، فإن الواجهة تستقبل أمر Go-to-Sleep أو تكتشف مهلة خمول الناقل (Bus-Idle-Timeout) وتُخطر LinSM عبر LinSM_GotoSleepIndication ([SWS_LinSM_91000]). يستدعي LinSM عندئذٍ LinIf_GotoSleep بشكل متزامن ([SWS_LinSM_00231]). وتقوم الواجهة بتبديل برنامج التشغيل محليًا عبر Lin_GoToSleepInternal إلى الحالة LIN_CH_SLEEP ([SWS_LinIf_00757]، [SWS_Lin_00095]) ونقل جهاز الإرسال والاستقبال (Transceiver) عبر LinIf_SetTrcvMode(LINTRCV_TRCV_MODE_SLEEP) إلى حالة السكون ([SWS_LinIf_00544]، AUTOSAR CP SWS LINInterface ص. 137). وبعد التأكيد LinSM_GotoSleepConfirmation، ينتقل LinSM نهائيًا إلى LINSM_NO_COM ([SWS_LinSM_00046]، [SWS_LinSM_00233]).
مخطط التسلسل: تفاعل وحدات BSW عند دخول عقدة LIN تابعة في حالة السكون بعد إشارة سكون الناقل. المصادر: [SWS_LinSM_91000]، [SWS_LinSM_00231]، [SWS_LinIf_00757]، AUTOSAR SWS LINStateManager ص. 48.
معالجة الأخطاء، وتتبع DET، والتدهور التدريجي للخدمة (Degradation)
يحتوي العنقود على مفهوم متعدد المستويات لاكتشاف الأخطاء والتشخيص. يتم تسجيل أخطاء التطوير عبر Default Error Tracer (Det): حيث تبلغ معاملات القناة أو الشبكة غير الصالحة عن LIN_E_INVALID_CHANNEL ([SWS_Lin_00259]) أو LINIF_E_NONEXISTENT_CHANNEL ([SWS_LinIf_00539]) أو LINSM_E_NONEXISTENT_NETWORK ([SWS_LinSM_00127]). تؤدي استدعاءات الوحدات غير المهيأة إلى LIN_E_UNINIT أو LINIF_E_UNINIT أو LINSM_E_UNINIT ([SWS_Lin_00258]، [SWS_LinSM_00128]). وتبلغ أخطاء جهاز الإرسال والاستقبال، مثل أرقام الشبكة غير الصالحة، عن LINTRCV_E_INVALID_LIN_NETWORK إلى DET ([SWS_LinTrcv_00145]).
تُصنّف اضطرابات الاتصال التي تحدث أثناء التشغيل المستمر كأخطاء وقت التشغيل: تحدد الواجهة LINIF_E_RESPONSE في حالة الإطارات الخاطئة، وLINIF_E_NC_NO_RESPONSE عند غياب الردود على طلبات تهيئة العقد (Node-Configuration-Requests) ([SWS_LinIf_00729]). يُبلغ برنامج تشغيل MCAL في الـ Slave عن أخطاء الناقل والبروتوكول المادية (أخطاء التأطير، أخطاء المجموع الاختباري، أخطاء مراقبة البتات) عبر LinIf_LinErrorIndication مع الحالة Lin_SlaveErrorType ([SWS_LinIf_91007]، [SWS_Lin_91140]). وفي عقدة Master، يقدم Lin_GetStatus أكواد أخطاء تفصيلية مثل LIN_TX_HEADER_ERROR أو LIN_TX_ERROR أو LIN_RX_ERROR إلى الواجهة ([SWS_Lin_00168]، [SWS_Lin_00233]).
تعد إشارة response_error القياسية آلية مركزية لمعالجة الأخطاء بالنسبة لـ LIN-Slaves. تدير واجهة LIN هذه الإشارة المكونة من بت واحد بشكل مستقل: في حالة حدوث خطأ في الإرسال، يضبط LinIf البت، والذي يُنقل إلى Master في إطار الإرسال غير المشروط التالي ([SWS_LinIf_00763]، SWS LINInterface ص. 58). وبعد نجاح إرسال الإطار، يقوم LinIf بمسح الراية ذاتيًا ([SWS_LinIf_00747]). وفي قناة التشخيص، يراقب LinTp النوافذ الزمنية الصارمة للبروتوكول: عند غياب N-PDUs، يقوم المؤقتان $N_{As}$ و$N_{Cr}$ بإلغاء المعاملة بشكل محدد وإبلاغ موجه PDU بـ E_NOT_OK ([SWS_LinIf_00799]، [SWS_LinIf_00804]، [SWS_LinIf_00806]). وإذا كانت سعة المخزن المؤقت غير كافية لدى موجه PDU، توقف الواجهة الاستيعاب وتعيد جدول المواعيد (Schedule) الخاص بالـ Master إلى تشغيل التطبيق ([SWS_LinIf_00676]، [SWS_LinIf_00792]).
يعتمد هذا الدليل على مواصفات AUTOSAR للإصدار R20-11 للوحدات Lin وLinIf وLinSM وLinTrcv. وجميع الأدلة المعيارية مأخوذة من الوثائق وبنود المتطلبات المشار إليها.
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 · الأصل الألماني