AUTOSAR Classic CAN
Das CAN-Cluster (Controller Area Network) stellt hardwarenahe Treiber, standardisierte Hardware-Abstraktion (CanIf), State-Management und ISO 15765-2 Transportprotokolle (CanTp) für klassische CAN-, CAN FD- und CAN XL-Netzwerke bereit.
Initialisation et état
Can_DeInitCan_GetVersionInfoCan_InitCanIf_DeInitCanIf_GetVersionInfoCanIf_InitCanNm_DeInitCanNm_GetVersionInfoCanNm_InitCanSM_DeInitCanSM_GetVersionInfoCanSM_InitCanTp_GetVersionInfoCanTp_InitCanTrcv_DeInitCanTrcv_GetVersionInfoCanTrcv_InitServices · T…
Services · Get…
Services · Set…
Services · Check…
Services · Read…
Services · Clear…
Services · Controller…
Services · Confirm…
Services · Enable…
Services · Request…
Services · Transmit…
Services · Autres
Can_DisableControllerInterruptsCan_WriteCanIf_ErrorNotificationCanIf_TrcvModeIndicationCanNm_ActivateTxPnShutdownMsgCanNm_DeactivateTxPnShutdownMsgCanNm_DisableCommunicationCanNm_NetworkReleaseCanNm_NetworkRequestCanNm_PassiveStartUpCanNm_PnLearningRequestCanNm_RepeatMessageRequestCanSM_CurrentIcomConfigurationCanSM_StartWakeupSourceCanSM_StopWakeupSourceCanSM_TransceiverModeIndicationCanSM_TxTimeoutExceptionCanTp_CancelReceiveCanTp_CancelTransmitCanTp_ChangeParameterCanTp_ShutdownCanXL_ImmediateTransmitCanXL_ReleaseRxBufferCallbacks
CanIf_RxIndicationCanIf_TriggerTransmitCanIf_TxConfirmationCanNm_RxIndicationCanNm_TriggerTransmitCanNm_TxConfirmationCanTp_RxIndicationCanTp_TxConfirmationCallouts et interfaces attendues
<LPDU_CalloutName><User_CheckTrcvWakeFlagIndication><User_ClearTrcvWufFlagIndication><User_ConfirmPnAvailability><User_ControllerBusOff><User_ControllerModeIndication><User_Get Bus Off Delay><User_RxIndication><User_TrcvModeIndication><User_TriggerTransmit><User_TriggerTransmit> (TtcanIf)<User_TxConfirmation><User_ValidateWakeupEvent>Cyclique
Can_MainFunction_BusOffCan_MainFunction_ModeCan_MainFunction_ReadCan_MainFunction_WakeupCan_MainFunction_WriteCanNm_MainFunctionCanSM_MainFunctionCanTp_MainFunctionCanTrcv_MainFunctionCanTrcv_MainFunctionDiagnosticsTypes
Can_ConfigTypeCan_ControllerStateTypeCan_ErrorStateTypeCan_ErrorTypeCan_HwHandleTypeCan_HwTypeCan_IdTypeCan_PduTypeCan_TTErrorLevelEnumTypeCan_TTErrorLevelTypeCan_TTMasterSlaveModeTypeCan_TTMasterStateTypeCan_TTSyncModeEnumTypeCan_TTTimeSourceTypeCan_TTTimeTypeCanIf_ConfigTypeCanIf_NotifStatusTypeCanIf_PduModeTypeCanIf_TTErrorLevelEnumTypeCanIf_TTErrorLevelTypeCanIf_TTEventEnumTypeCanIf_TTMasterSlaveModeTypeCanIf_TTMasterStateTypeCanIf_TTSevereErrorEnumTypeCanIf_TTSyncModeEnumTypeCanIf_TTTimeSourceTypeCanIf_TTTimeTypeCanIf_TTTimingErrorIRQTypeCanNm_ConfigTypeCanSM_BswMCurrentStateTypeCanSM_ConfigTypeCanSM_StateTypeCanTp_ConfigTypeCanTrcv_ConfigTypeCanTrcv_PNActivationTypeCanTrcv_TrcvFlagStateTypeCanTrcv_TrcvModeTypeCanTrcv_TrcvWakeupModeTypeCanTrcv_TrcvWakeupReasonTypeFonctions
<LPDU_CalloutName><User_CheckTrcvWakeFlagIndication><User_ClearTrcvWufFlagIndication><User_ConfirmPnAvailability><User_ControllerBusOff><User_ControllerModeIndication><User_Get Bus Off Delay><User_RxIndication><User_TrcvModeIndication><User_TriggerTransmit><User_TriggerTransmit> (TtcanIf)<User_TxConfirmation><User_ValidateWakeupEvent>Can_CheckWakeupCan_DeInitCan_DisableControllerInterruptsCan_EnableControllerInterruptsCan_GetControllerErrorStateCan_GetControllerModeCan_GetControllerRxErrorCounterCan_GetControllerTxErrorCounterCan_GetVersionInfoCan_InitCan_MainFunction_BusOffCan_MainFunction_ModeCan_MainFunction_ReadCan_MainFunction_WakeupCan_MainFunction_WriteCan_SetBaudrateCan_SetControllerModeCan_TTAckTimeMarkCan_TTCancelTimeMarkCan_TTDisableTimeMarkIRQCan_TTEnableTimeMarkIRQCan_TTGetControllerTimeCan_TTGetErrorLevelCan_TTGetMasterStateCan_TTGetNTUActualCan_TTGetSyncQualityCan_TTGetTimeMarkIRQStatusCan_TTGlobalTimePresetCan_TTMainFunction_IRQCan_TTReceiveCan_TTSetEndOfGapCan_TTSetExtClockSyncCommandCan_TTSetNextIsGapCan_TTSetNTUAdjustCan_TTSetTimeCommandCan_TTSetTimeMarkCan_WriteCanIf_CheckTrcvWakeFlagCanIf_CheckTrcvWakeFlagIndicationCanIf_CheckValidationCanIf_CheckWakeupCanIf_ClearTrcvWufFlagCanIf_ClearTrcvWufFlagIndicationCanIf_ConfirmPnAvailabilityCanIf_ControllerBusOffCanIf_ControllerErrorStatePassiveCanIf_ControllerModeIndicationCanIf_DeInitCanIf_EnableBusMirroringCanIf_ErrorNotificationCanIf_GetControllerErrorStateCanIf_GetControllerModeCanIf_GetControllerRxErrorCounterCanIf_GetControllerTxErrorCounterCanIf_GetPduModeCanIf_GetTrcvModeCanIf_GetTrcvWakeupReasonCanIf_GetTxConfirmationStateCanIf_GetVersionInfoCanIf_InitCanIf_ReadRxNotifStatusCanIf_ReadRxPduDataCanIf_ReadTxNotifStatusCanIf_RxIndicationCanIf_SetBaudrateCanIf_SetControllerModeCanIf_SetDynamicTxIdCanIf_SetPduModeCanIf_SetTrcvModeCanIf_SetTrcvWakeupModeCanIf_TransmitCanIf_TrcvModeIndicationCanIf_TriggerTransmitCanIf_TTAckTimeMarkCanIf_TTApplWatchdogErrorCanIf_TTCancelTimeMarkCanIf_TTDisableTimeMarkIRQCanIf_TTEnableTimeMarkIRQCanIf_TTGapCanIf_TTGetControllerTimeCanIf_TTGetErrorLevelCanIf_TTGetMasterStateCanIf_TTGetNTUActualCanIf_TTGetSyncQualityCanIf_TTGetTimeMarkIRQStatusCanIf_TTGlobalTimePresetCanIf_TTJobListExec_ControllerCanIf_TTMasterStateChangeCanIf_TTSetEndOfGapCanIf_TTSetExtClockSyncCommandCanIf_TTSetNextIsGapCanIf_TTSetNTUAdjustCanIf_TTSetTimeCommandCanIf_TTSetTimeMarkCanIf_TTSevereErrorCanIf_TTStartOfCycleCanIf_TTTimeDiscCanIf_TTTimingErrorCanIf_TxConfirmationCanNm_ActivateTxPnShutdownMsgCanNm_CheckRemoteSleepIndicationCanNm_ConfirmPnAvailabilityCanNm_DeactivateTxPnShutdownMsgCanNm_DeInitCanNm_DisableCommunicationCanNm_EnableCommunicationCanNm_GetLocalNodeIdentifierCanNm_GetNodeIdentifierCanNm_GetPduDataCanNm_GetStateCanNm_GetUserDataCanNm_GetVersionInfoCanNm_InitCanNm_MainFunctionCanNm_NetworkReleaseCanNm_NetworkRequestCanNm_PassiveStartUpCanNm_PnLearningRequestCanNm_RepeatMessageRequestCanNm_RequestBusSynchronizationCanNm_RequestSynchronizedPncShutdownCanNm_RxIndicationCanNm_SetSleepReadyBitCanNm_SetUserDataCanNm_TransmitCanNm_TriggerTransmitCanNm_TxConfirmationCanSM_CheckTransceiverWakeFlagIndicationCanSM_ClearTrcvWufFlagIndicationCanSM_ConfirmCtrlPnAvailabilityCanSM_ConfirmPnAvailabilityCanSM_ControllerBusOffCanSM_ControllerModeIndicationCanSM_CurrentIcomConfigurationCanSM_DeInitCanSM_GetCurrentComModeCanSM_GetVersionInfoCanSM_InitCanSM_MainFunctionCanSM_RequestComModeCanSM_SetBaudrateCanSM_SetEcuPassiveCanSM_SetIcomConfigurationCanSM_StartWakeupSourceCanSM_StopWakeupSourceCanSM_TransceiverModeIndicationCanSM_TxTimeoutExceptionCanTp_CancelReceiveCanTp_CancelTransmitCanTp_ChangeParameterCanTp_GetVersionInfoCanTp_InitCanTp_MainFunctionCanTp_ReadParameterCanTp_RxIndicationCanTp_ShutdownCanTp_TransmitCanTp_TxConfirmationCanTrcv_CheckWakeFlagCanTrcv_CheckWakeupCanTrcv_ClearTrcvTimeoutFlagCanTrcv_ClearTrcvWufFlagCanTrcv_DeInitCanTrcv_GetBusWuReasonCanTrcv_GetOpModeCanTrcv_GetTrcvSystemDataCanTrcv_GetVersionInfoCanTrcv_InitCanTrcv_MainFunctionCanTrcv_MainFunctionDiagnosticsCanTrcv_ReadTrcvSilenceFlagCanTrcv_ReadTrcvTimeoutFlagCanTrcv_SetOpModeCanTrcv_SetPNActivationStateCanTrcv_SetWakeupModeCanXL_ImmediateTransmitCanXL_ReleaseRxBufferTypes
Can_ConfigTypeCan_ControllerStateTypeCan_ErrorStateTypeCan_ErrorTypeCan_HwHandleTypeCan_HwTypeCan_IdTypeCan_PduTypeCan_TTErrorLevelEnumTypeCan_TTErrorLevelTypeCan_TTMasterSlaveModeTypeCan_TTMasterStateTypeCan_TTSyncModeEnumTypeCan_TTTimeSourceTypeCan_TTTimeTypeCanIf_ConfigTypeCanIf_NotifStatusTypeCanIf_PduModeTypeCanIf_TTErrorLevelEnumTypeCanIf_TTErrorLevelTypeCanIf_TTEventEnumTypeCanIf_TTMasterSlaveModeTypeCanIf_TTMasterStateTypeCanIf_TTSevereErrorEnumTypeCanIf_TTSyncModeEnumTypeCanIf_TTTimeSourceTypeCanIf_TTTimeTypeCanIf_TTTimingErrorIRQTypeCanNm_ConfigTypeCanSM_BswMCurrentStateTypeCanSM_ConfigTypeCanSM_StateTypeCanTp_ConfigTypeCanTrcv_ConfigTypeCanTrcv_PNActivationTypeCanTrcv_TrcvFlagStateTypeCanTrcv_TrcvModeTypeCanTrcv_TrcvWakeupModeTypeCanTrcv_TrcvWakeupReasonTypeCarte des thèmes
Can
27CanIf
50CanNm
29CanSM
24CanTp
12CanTrcv
23Ttcan
26TtcanIf
36Aucune donnée d'élément pour cette version
Can
-
boolean <LPDU_CalloutName> (uint8 Hrh, Can_IdType CanId, uint8 CanDataLegth, const uint8* CanSduPtr);This function checks if a wakeup has occurred for the given controller.
Std_ReturnType Can_CheckWakeup (uint8 Controller);This function de - initializes the module.
void Can_DeInit (void);This function disables all interrupts for this CAN controller.
void Can_DisableControllerInterrupts (uint8 Controller);This function enables all allowed interrupts.
void Can_EnableControllerInterrupts (uint8 Controller);This service obtains the error state of the CAN controller.
Std_ReturnType Can_GetControllerErrorState (uint8 ControllerId, Can_ErrorStateType* ErrorStatePtr);This service reports about the current status of the requested CAN controller.
Std_ReturnType Can_GetControllerMode (uint8 Controller, Can_ControllerStateType* ControllerModePtr);Returns the Rx error counter for a CAN controller. This value might not be available for all CAN controllers, in which cas e E_ NOT_ OK would be returned. Please note that the value of the counter might not be correct at the moment the API returns it, because the Rx counter is handled asynchronously in hardware. Applications should not trust this value for any assumption about the current bus state.
Std_ReturnType Can_GetControllerRxErrorCounter (uint8 ControllerId, uint8* RxErrorCounterPtr);Returns the Tx error counter for a CAN controller. This value might not be available for all CAN controllers, in which case E_ NOT_ OK would be returned. Please note that the value of the counter might not be correct at the moment the API returns it, because the Tx counter is handled asynchronously in hardware. Applications should not trust this value for any assumption about the current bus state.
Std_ReturnType Can_GetControllerTxErrorCounter (uint8 ControllerId, uint8* TxErrorCounterPtr);This function returns the version information of this module.
void Can_GetVersionInfo (Std_VersionInfoType* versioninfo);This function initializes the module.
void Can_Init (const Can_ConfigType* Config);This function performs the polling of bus - off events that are configured statically as 'to be polled'.
void Can_MainFunction_BusOff (void);This function performs the polling of CAN controller mode transitions.
void Can_MainFunction_Mode (void);This function performs the polling of RX indications when CAN_ RX_ PROCESSING is set to POLLING.
void Can_MainFunction_Read (void);This function performs the polling of wake - up events that are configured statically as 'to be polled'.
void Can_MainFunction_Wakeup (void);This function performs the polling of TX confirmation when CAN_ TX_ PROCESSING is set to POLLING.
void Can_MainFunction_Write (void);This service shall set the baud rate configuration of the CAN controller. Depending on necessary baud rate modifications the controller might have to reset.
Std_ReturnType Can_SetBaudrate (uint8 Controller, uint16 BaudRateConfig ID); ⚠️This function performs software triggered state transitions of the CAN controller State machine.
Std_ReturnType Can_SetControllerMode (uint8 Controller, Can_ControllerStateType Transition);This function is called by Can If to pass a CAN message to Can Drv for transmission.
Std_ReturnType Can_Write (Can_HwHandleType Hth, const Can_PduType* PduInfo);This is the type of the external data structure containing the overall initialization data for the CAN driver and SFR settings affecting all controllers. Furthermore it contains pointers to controller configuration structures. The contents of the initializ ation data structure are CAN hardware specific.
States that are used by the several Controller Mode functions.
Error states of a CAN controller.
The enumeration represents a superset of CAN Error Types which typical CAN HW is able to report. That means not all CAN HW will be able to support the complete set.
Represents the hardware object handles of a CAN hardware unit. For CAN hardware units with more than 255 HW objects use extended range.
This type defines a data structure which clearly provides an Hardware Object Handle including its corresponding CAN Controller and therefore Can Drv as well as the specific Can Id.
Represents the Identifier of an L - PDU. The two most significant bits specify the frame type: 00 CAN message with Standard CAN ID 01 CAN FD frame with Standard CAN ID 10 CAN message with Extended CAN ID 11 CAN FD frame with Extended CAN ID
This type unites Pdu Id (sw Pdu Handle), Sdu Length (length), Sdu Data (sdu), and Can Id (id) for any CAN L - SDU.
CanIf
This service indicates that the wake up flag in the CAN transceiver is set. This function is called in CanIf_CheckTrcvWakeFlagIndication.
void <User_CheckTrcvWakeFlagIndication> (uint8 TransceiverId);This service indicates that the CAN transceiver has cleared the WufFlag. This function is called in CanIf_ClearTrcvWufFlagIndication.
void <User_ClearTrcvWufFlagIndication> (uint8 TransceiverId);This service indicates that the CAN transceiver is running in PN communication mode.
void <User_ConfirmPnAvailability> (uint8 TransceiverId);This service indicates a bus-off event to the corresponding upper layer module (mainly the CAN State Manager module).
void <User_ControllerBusOff> (uint8 ControllerId);This service indicates a CAN controller state transition to the corresponding upper layer module (mainly the CAN State Manager module).
void <User_ControllerModeIndication> (uint8 ControllerId, Can_ControllerStateType ControllerMode);Indication of a received PDU from a lower layer communication interface module.
void <User_RxIndication> (PduIdType RxPduId, const PduInfoType* PduInfoPtr);This service indicates a CAN transceiver state transition to the corresponding upper layer module (mainly the CAN State Manager module).
void <User_TrcvModeIndication> (uint8 TransceiverId, CanTrcv_TrcvModeType TransceiverMode);Within this API, the upper layer module (called module) shall check whether the available data fits into the buffer size reported by PduInfoPtr->SduLength. If it fits, it shall copy its data into the buffer provided by PduInfoPtr->SduDataPtr and update the length of the actual copied data in PduInfoPtr->SduLength. If not, it returns E_NOT_OK without changing PduInfoPtr.
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);This service indicates if a wake up event initiated from the wake up source (CAN controller or transceiver) after a former request to the CAN Driver or CAN Transceiver Driver module is valid.
void <User_ValidateWakeupEvent> (EcuM_WakeupSourceType sources);Requests the CanIf module to check the Wake flag of the designated CAN transceiver.
Std_ReturnType CanIf_CheckTrcvWakeFlag (uint8 TransceiverId);This service indicates that the check of the transceiver's wake-up flag has been finished by the corresponding CAN transceiver with the abstract CanIf TransceiverId. This indication is used to cope with the asynchronous transceiver communication.
void CanIf_CheckTrcvWakeFlagIndication (uint8 TransceiverId);This service is performed to validate a previous wakeup event.
Std_ReturnType CanIf_CheckValidation (EcuM_WakeupSourceType WakeupSource);This service checks, whether an underlying CAN driver or a CAN transceiver driver already signals a wakeup event.
Std_ReturnType CanIf_CheckWakeup (EcuM_WakeupSourceType WakeupSource);Requests the CanIf module to clear the WUF flag of the designated CAN transceiver.
Std_ReturnType CanIf_ClearTrcvWufFlag (uint8 TransceiverId);This service indicates that the transceiver has cleared the WufFlag referring to the corresponding CAN transceiver with the abstract CanIf TransceiverId.
void CanIf_ClearTrcvWufFlagIndication (uint8 TransceiverId);This service indicates that the transceiver is running in PN communication mode referring to the corresponding CAN transceiver with the abstract CanIf TransceiverId.
void CanIf_ConfirmPnAvailability (uint8 TransceiverId);This service indicates a Controller BusOff event referring to the corresponding CAN Controller with the abstract CanIf ControllerId.
void CanIf_ControllerBusOff (uint8 ControllerId);The function derives the ErrorCounterTreshold from RxErrorCounter/ TxErrorCounter values and reports it to the IdsM as security event CANIF_SEV_ERRORSTATE_PASSIVE to the IdsM. It also prepares the context data for the respective security event.
This service indicates a controller state transition referring to the corresponding CAN controller with the abstract CanIf ControllerId.
void CanIf_ControllerModeIndication (uint8 ControllerId, Can_ControllerStateType ControllerMode);De-initializes the CanIf module.
void CanIf_DeInit (void);Enables or disables mirroring for a CAN controller.
Std_ReturnType CanIf_EnableBusMirroring (uint8 ControllerId, boolean MirroringActive);The function shall derive the bus error source rx or tx from the parameter CanError and report the bus error as security event CANIF_SEV_TX_ERROR_DETECTED or CANIF_SEV_RX_ ERROR_DETECTED. It also prepares the context data for the respective security event.
void CanIf_ErrorNotification (uint8 ControllerId, Can_ErrorType Can_ErrorType);This service calls the corresponding CAN Driver service for obtaining the error state of the CAN controller.
Std_ReturnType CanIf_GetControllerErrorState (uint8 ControllerId, Can_ErrorStateType* ErrorStatePtr);This service calls the corresponding CAN Driver service for obtaining the current status of the CAN controller.
Std_ReturnType CanIf_GetControllerMode (uint8 ControllerId, Can_ControllerStateType* ControllerModePtr);This service calls the corresponding CAN Driver service for obtaining the Rx error counter of the CAN controller.
Std_ReturnType CanIf_GetControllerRxErrorCounter (uint8 ControllerId, uint8* RxErrorCounterPtr);This service calls the corresponding CAN Driver service for obtaining the Tx error counter of the CAN controller.
Std_ReturnType CanIf_GetControllerTxErrorCounter (uint8 ControllerId, uint8* TxErrorCounterPtr);This service reports the current mode of a requested PDU channel.
Std_ReturnType CanIf_GetPduMode (uint8 ControllerId, CanIf_PduModeType* PduModePtr);This function invokes CanTrcv_GetOpMode and updates the parameter TransceiverModePtr with the value OpMode provided by CanTrcv.
Std_ReturnType CanIf_GetTrcvMode (uint8 TransceiverId, CanTrcv_TrcvModeType* TransceiverModePtr);This service returns the reason for the wake up of the transceiver TransceiverId, via calling the corresponding CAN Transceiver Driver service.
Std_ReturnType CanIf_GetTrcvWakeupReason (uint8 TransceiverId, CanTrcv_TrcvWakeupReasonType* TrcvWuReasonPtr);This service reports, if any TX confirmation has been done for the whole CAN controller since the last CAN controller start.
CanIf_NotifStatusType CanIf_GetTxConfirmationState (uint8 ControllerId);This service returns the version information of the called CAN Interface module.
void CanIf_GetVersionInfo (Std_VersionInfoType* VersionInfo);This service Initializes internal and external interfaces of the CAN Interface for the further processing.
void CanIf_Init (const CanIf_ConfigType* ConfigPtr);This service returns the indication status (indication occurred or not) of a specific CAN Rx L-PDU, requested by the CanIfRxSduId.
CanIf_NotifStatusType CanIf_ReadRxNotifStatus (PduIdType CanIfRxSduId);This service provides the Data Length and the received data of the requested CanIfRxSduId to the calling upper layer.
Std_ReturnType CanIf_ReadRxPduData (PduIdType CanIfRxSduId, PduInfoType* CanIfRxInfoPtr);This service returns the confirmation status (confirmation occurred or not) of a specific static or dynamic CAN Tx L-PDU, requested by the CanIfTxSduId.
CanIf_NotifStatusType CanIf_ReadTxNotifStatus (PduIdType CanIfTxSduId);This service indicates a successful reception of a received CAN Rx L-PDU to the CanIf after passing all filters and validation checks.
void CanIf_RxIndication (const Can_HwType* Mailbox, const PduInfoType* PduInfoPtr);This service shall set the baud rate configuration of the CAN controller. Depending on necessary baud rate modifications the controller might have to reset.
Std_ReturnType CanIf_SetBaudrate (uint8 ControllerId, uint16 BaudRateConfigID);This service calls the corresponding CAN Driver service for changing of the CAN controller mode.
Std_ReturnType CanIf_SetControllerMode (uint8 ControllerId, Can_ControllerStateType ControllerMode);This service reconfigures the corresponding CAN identifier of the requested CAN L-PDU.
void CanIf_SetDynamicTxId (PduIdType CanIfTxSduId, Can_IdType CanId);This service sets the requested mode at the L-PDUs of a predefined logical PDU channel.
Std_ReturnType CanIf_SetPduMode (uint8 ControllerId, CanIf_PduModeType PduModeRequest);This service changes the operation mode of the tansceiver TransceiverId, via calling the corresponding CAN Transceiver Driver service.
Std_ReturnType CanIf_SetTrcvMode (uint8 TransceiverId, CanTrcv_TrcvModeType TransceiverMode);This function shall call CanTrcv_SetTrcvWakeupMode.
Std_ReturnType CanIf_SetTrcvWakeupMode (uint8 TransceiverId, CanTrcv_TrcvWakeupModeType TrcvWakeupMode);Requests transmission of a PDU.
Std_ReturnType CanIf_Transmit (PduIdType TxPduId, const PduInfoType* PduInfoPtr);This service indicates a transceiver state transition referring to the corresponding CAN transceiver with the abstract CanIf TransceiverId.
void CanIf_TrcvModeIndication (uint8 TransceiverId, CanTrcv_TrcvModeType TransceiverMode);Within this API, the upper layer module (called module) shall check whether the available data fits into the buffer size reported by PduInfoPtr->SduLength. If it fits, it shall copy its data into the buffer provided by PduInfoPtr->SduDataPtr and update the length of the actual copied data in PduInfoPtr->SduLength. If not, it returns E_NOT_OK without changing PduInfoPtr.
Std_ReturnType CanIf_TriggerTransmit (PduIdType TxPduId, PduInfoType* PduInfoPtr);This service confirms a previously successfully processed transmission of a CAN TxPDU.
void CanIf_TxConfirmation (PduIdType CanTxPduId);This type defines a data structure for the post build parameters of the CAN interface for all underlying CAN drivers. At initialization the CanIf gets a pointer to a structure of this type to get access to its configuration data, which is necessary for initialization.
Type CanIf_NotifStatusType.
The PduMode of a channel defines its transmit or receive activity. Communication direction (transmission and/or reception) of the channel can be controlled separately or together by upper layers.
CanNm
NM indicate to activate the transmission of PN shutdown messages on the given NM - Channel. This results in transmission of a NM - PD U with PNSR bit set to 1 (PN shutdown message).
Std_ReturnType CanNm_ActivateTxPnShutdownMsg(NetworkHandleType nmChannelHandle);Check if remote sleep indication takes place or not.
Std_ReturnType CanNm_CheckRemoteSleepIndication(NetworkHandleType nmChannelHandle, boolean* nmRemoteSleepIndPtr);Enables the PN filter functionality on the indicated NM channel. Availability: The API is only available if Can Nm Global Pn Support is TRUE.
void CanNm_ConfirmPnAvailability(NetworkHandleType nmChannelHandle);NM indicate to deactive the transmission of PN shutdown messages on the given NM - Channel. This result in transmission of a usual NM - PDUs with PNSR bit set to 0.
Std_ReturnType CanNm_DeactivateTxPnShutdownMsg(NetworkHandleType nmChannelHandle);De - initializes the Can Nm module.
void CanNm_DeInit(void);Disable the NM PDU transmission ability due to a ISO14229 Communication Control (28hex) service
Std_ReturnType CanNm_DisableCommunication(NetworkHandleType nmChannelHandle);Enable the NM PDU transmission ability due to a ISO14229 Communication Control (28hex) service
Std_ReturnType CanNm_EnableCommunication(NetworkHandleType nmChannelHandle);Get node identifier configured for the local node.
Std_ReturnType CanNm_GetLocalNodeIdentifier(NetworkHandleType nmChannelHandle, uint8* nmNodeIdPtr);Get node identifier out of the most recently received N M PDU.
Std_ReturnType CanNm_GetNodeIdentifier(NetworkHandleType nmChannelHandle, uint8* nmNodeIdPtr);Get the whole PDU data out of the most recently received NM PDU.
Std_ReturnType CanNm_GetPduData(NetworkHandleType nmChannelHandle, uint8* nmPduDataPtr);Returns the state and the mode of the network management.
Std_ReturnType CanNm_GetState(NetworkHandleType nmChannelHandle, Nm_StateType* nmStatePtr, Nm_ModeType* nmModePtr);Get user data out of the most recently received NM PDU.
Std_ReturnType CanNm_GetUserData(NetworkHandleType nmChannelHandle, uint8* nmUserDataPtr);This service returns the version information of this module.
void CanNm_GetVersionInfo(Std_VersionInfoType* versioninfo);Initialize the Can Nm module.
void CanNm_Init(const CanNm_ConfigType* cannmConfigPtr);Main function of the Can Nm which processes the algorithm describes in that document.
void CanNm_MainFunction(void);Release the network, since ECU doesn't have to communicate on the bus.
Std_ReturnType CanNm_NetworkRelease(NetworkHandleType nmChannelHandle);Request the network, since ECU needs to communicate on the bus.
Std_ReturnType CanNm_NetworkRequest(NetworkHandleType nmChannelHandle);Passive startup of the AUTOSAR CAN NM. It triggers the transition from Bus - Sleep Mode or Prepare Bus Sleep Mode to the Network Mode in Repeat Message State. Caveats: Can Nm is initia lized correctly.
Std_ReturnType CanNm_PassiveStartUp(NetworkHandleType nmChannelHandle);Set Repeat Message Request Bit and Partial Network Learning Bit for NM messages transmitted next on the bus. This will force all nodes to enter the PNC Learning Phase. This is needed for the optional Dynamic PNC - to - channel - mapping feature.
Std_ReturnType CanNm_PnLearningRequest(NetworkHandleType nmChannelHandle);Set Repeat Message Request Bit for NM PDUs transmitted next on the bus.
Std_ReturnType CanNm_RepeatMessageRequest(NetworkHandleType nmChannelHandle);Request bus synchronization.
Std_ReturnType CanNm_RequestBusSynchronization(NetworkHandleType nmChannelHandle);Requests transmission of a NM - PDU with PNSR bit set to 1 (PN shutdown message) Tags: atp.Status=draft
Std_ReturnType CanNm_RequestSynchronizedPncShutdown(NetworkHandleType nmChannelHandle, PNCHandleType pncId);Indication of a receive d PDU from a lower layer communication interface module.
void CanNm_RxIndication(PduIdType RxPduId, const PduInfoType* PduInfoPtr);Set the NM Coordinator S leep Ready bit in the Control Bit Vector
Std_ReturnType CanNm_SetSleepReadyBit(NetworkHandleType nmChannelHandle, boolean nmSleepReadyBit);Set user data for NM PDUs transmitted next on the bus.
Std_ReturnType CanNm_SetUserData(NetworkHandleType nmChannelHandle, const uint8* nmUserDataPtr);Requests transmission of a PDU.
Std_ReturnType CanNm_Transmit(PduIdType TxPduId, const PduInfoType* PduInfoPtr);Within this API, the upper layer module (called module) shall check whether the available data fits into the buffer 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 changing Pdu Info Ptr.
Std_ReturnType CanNm_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 CanNm_TxConfirmation(PduIdType TxPduId, Std_ReturnType result);This type shall contain at least all parameters that are post - build able according to chapter 10.
CanSM
This callout function returns the number of Can SM base cycles to wait additionally to L1/ L2 after a Bus Off occurred.
void <User_Get Bus Off Delay>(NetworkHandleType network, uint8* delayCyclesPtr);This callback function indicates the Can If_ Check Trcv Wake Flag API process end for the notified CAN Transceiver.
void CanSM_CheckTransceiverWakeFlagIndication(uint8 Transceiver);This callback function shall indicate the Can If_ Clear Trcv Wuf Flag API process end for the notified CAN Transceiver.
void CanSM_ClearTrcvWufFlagIndication(uint8 Transceiver);This callback function indicates that the controller is running in PN communication mode. Tags: atp.Status=draft
void CanSM_ConfirmCtrlPnAvailability(uint8 ControllerId);This callback function indicates that the transceiver is running in PN communication mode.
void CanSM_ConfirmPnAvailability(uint8 TransceiverId);This callback function notifies the Can SM about a bus - off event on a certain CAN controller, which needs to be considered with the specified bus - off recovery handling for th e impacted CAN network.
void CanSM_ControllerBusOff(uint8 ControllerId);This callback shall notify the Can SM module about a CAN controller mode change.
void CanSM_ControllerModeIndication(uint8 ControllerId, Can_ControllerStateType ControllerMode);This service shall inform about the change of the Icom Configuration of a CAN network.
void CanSM_CurrentIcomConfiguration(uint8 ControllerId, IcomConfigIdType ConfigurationId, IcomSwitch_ErrorType Error);This service de - initializes the Can SM module.
void CanSM_DeInit(void);This service shall put out the current communication mode of a CAN network.
Std_ReturnType CanSM_GetCurrentComMode(NetworkHandleType network, ComM_ModeType* ComM_ModePtr);This service puts out the version information of this module (module ID, vendor ID, vendor specific version numbers related to BSW00407)
void CanSM_GetVersionInfo(Std_VersionInfoType* VersionInfo);This service initializes the Can SM module
void CanSM_Init(const CanSM_ConfigType* ConfigPtr);Scheduled function of the Can SM
void CanSM_MainFunction(void);This service shall change the communication mode of a CAN network to the requested one.
Std_ReturnType CanSM_RequestComMode(NetworkHandleType network, ComM_ModeType ComM_Mode);This service shall start an asynchronous process to change the baud rate for the configured CAN controllers of a certain CAN network. Depending on necessary baud rate modifications the controllers might have to reset.
Std_ReturnType CanSM_SetBaudrate(NetworkHandleType Network, uint16 BaudRateConfig ID); ⚠️Service Name Can SM_ Set Ecu Passive Syntax Std_ Return Type Can SM_ Set Ecu Passive ( boolean Can SM_ Passive ) Service ID [hex] 0x13 Sync/ Async Synchronous Reentrancy Non Reentrant Parameters (in) Can SM_ Passive TRUE: set all Can SM channels to passive, i.e. receive only FALSE: set all Can SM channels back to non - passive Parameters (inout) None Parameters (out) None Return value Std _ Return - E_ OK: Request accepted Type E_ NOT_ OK: Request not accepted Descr iption This function can be used to set all Can SM channels of the ECU to a receive only mode. Available via Can SM.h
Std_ReturnType CanSM_SetEcuPassive(boolean CanSM_Passive);This service shall change the Icom Configuration of a CAN network to the requested one.
Std_ReturnType CanSM_SetIcomConfiguration(NetworkHandleType Network, IcomConfigIdType ConfigurationId);This function shall be called by Ecu M when a wakeup source shall be started.
Std_ReturnType CanSM_StartWakeupSource(NetworkHandleType network);This function shall be called by Ecu M when a wakeup source shall be stopped.
Std_ReturnType CanSM_StopWakeupSource(NetworkHandleType network);This callback shall notify the Can SM module about a CAN transceiver mode change.
void CanSM_TransceiverModeIndication(uint8 TransceiverId, CanTrcv_TrcvModeType TransceiverMode);This function shall notify the Can SM module, that the Can Nm has detected for the affected partial CAN network a tx timeout exception, which shall be recovered within the respective network state machine of the Can SM module.
void CanSM_TxTimeoutException(NetworkHandleType Channel);Can specific communication modes / states notified to the Bsw M module
This type defines a data structure for the post build parameters of the Can SM. At initialization the Can SM gets a pointer to a structure of this type to get access to its configuration data, which is neces sary for initialization. Available Can SM.h via
Defines the values of the internal states of the Can SM module
CanTp
Requests cancellation of an ongoing reception of a PDU in a lower layer transport protocol module.
Std_ReturnType CanTp_CancelReceive (PduIdType RxPduId);Requests cancellation of an ongoing transmission of a PDU in a lower layer communication module.
Std_ReturnType CanTp_CancelTransmit (PduIdType TxPduId);Request to change a specific transport protocol parameter (e.g. block size).
Std_ReturnType CanTp_ChangeParameter (PduIdType id, TPParameterType parameter, uint16 value);This function returns the version information of the Can Tp module.
void CanTp_GetVersionInfo (Std_VersionInfoType* versioninfo);This function initializes the Can Tp module.
void CanTp_Init (const CanTp_ConfigType* CfgPtr);The main function for scheduling the CAN TP.
void CanTp_MainFunction (void);This service is used to read the current value of reception parameters BS and STmin for a specified N - SDU.
Std_ReturnType CanTp_ReadParameter (PduIdType id, TPParameterType parameter, uint16* value);Indication of a received PDU from a lower layer communication interface module.
void CanTp_RxIndication (PduIdType RxPduId, const PduInfoType* PduInfoPtr);This function is called to shutdown the Can Tp module.
void CanTp_Shutdown (void);Requests transmission of a PDU.
Std_ReturnType CanTp_Transmit (PduIdType TxPduId, const PduInfoType* PduInfoPtr);The lower layer communication interface module confirms the transmission of a PDU, or the failure to transmit a PDU.
void CanTp_TxConfirmation (PduIdType TxPduId, Std_ReturnType result);Data structure type for the post - build configuration parameters.
CanTrcv
Requests to check the status of the wakeup flag from the transceiver hardware.
Std_ReturnType CanTrcv_CheckWakeFlag (uint8 Transceiver);Service is called by underlying CANIF in case a wake up interrupt is detected.
Std_ReturnType CanTrcv_CheckWakeup (uint8 Transceiver);Clears the status of the timeout flag in the transceiver hardware. This API shall exist only if Can Trcv Hw Pn Support = TRUE.
Std_ReturnType CanTrcv_ClearTrcvTimeoutFlag (uint8 Transceiver);Clears the WUF flag in the transceiver hardware. This API shall exist only if Can Trcv Hw Pn Support = TRUE.
Std_ReturnType CanTrcv_ClearTrcvWufFlag (uint8 Transceiver);De - initializes the Can Trcv module.
void CanTrcv_DeInit (void);Gets the wakeup reason for the Transceiver and returns it in parameter Reason.
Std_ReturnType CanTrcv_GetBusWuReason (uint8 Transceiver, CanTrcv_TrcvWakeupReasonType* reason);Gets the mode of the Transceiver and returns it in Op Mode.
Std_ReturnType CanTrcv_GetOpMode (uint8 Transceiver, CanTrcv_TrcvModeType* OpMode);Reads the transceiver configuration/ status data and returns it through parameter Trcv Sys Data. This API shall exist only if Can Trcv Hw Pn Support = TRUE.
Std_ReturnType CanTrcv_GetTrcvSystemData (uint8 Transceiver, uint32* TrcvSysData);Gets the version of the module and returns it in Version Info.
void CanTrcv_GetVersionInfo (Std_VersionInfoType* versioninfo);Initializes the Can Trcv module.
void CanTrcv_Init (const CanTrcv_ConfigType* ConfigPtr);Service to scan all busses for wake up events and perform these event.
void CanTrcv_MainFunction (void);Reads the transceiver diagnostic status periodically and sets product/ development accordingly.
void CanTrcv_MainFunctionDiagnostics (void);Reads the status of the silence flag from the transceiver hardware. This API shall exi st only if Can Trcv Hw Pn Support = TRUE.
Std_ReturnType CanTrcv_ReadTrcvSilenceFlag (uint8 Transceiver, CanTrcv_TrcvFlagStateType* FlagState);Reads the status of the tim eout flag from the transceiver hardware. This API shall exist only if Can Trcv Hw Pn Support = TRUE.
Std_ReturnType CanTrcv_ReadTrcvTimeoutFlag (uint8 Transceiver, CanTrcv_TrcvFlagStateType* FlagState);Sets the mode of the Transceiver to the value Op Mode.
Std_ReturnType CanTrcv_SetOpMode (uint8 Transceiver, CanTrcv_TrcvModeType OpMode);The API configures the wake - up of the transceiver for Standby and Sleep Mode: Either the CAN transceiver is woken up by a remote wake - up pattern (standard CAN wake - up) or by the configured remote wake - up frame.
Std_ReturnType CanTrcv_SetPNActivationState (CanTrcv_PNActivationType ActivationState);En ables, disables or clears wake - up events of the Transceiver according to Trcv Wakeup Mode.
Std_ReturnType CanTrcv_SetWakeupMode (uint8 Transceiver, CanTrcv_TrcvWakeupModeType TrcvWakeupMode);This is the type of the external data structure containing the overall initialization data for the CAN transceiver driver and settings affecting all transceivers. Furthermore it contains pointers to transceiver configuration structures. The con tents of the initialization data structure are CAN transceiver hardware specific.
Datatype used for describing whether PN wakeup functionality in Can Trcv is enabled or disabled.
Provides the state of a flag in the transceiver hardware.
Operating modes of the CAN Transceiver Driver.
This type shall be used to control the CAN transceiver concerning wake up events and wake up notifications.
This type denotes the wake up reason detected by the CAN transceiver in detail. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_CANTransceiverDriver
CanXL
Request transmission of an Ethernet frame, where each upper layer a header part as element of a single linked list. All headers together with the payload form an entire Ethernet frame Tags: atp.Status=draft
Std_ReturnType CanXL_ImmediateTransmit(uint8 CtrlIdx, Eth_BufIdxType TxHandleId, uint8 Priority, ListElemStructType* HeaderListPtr, uint8* PayloadPtr, uint16 PayloadLength);Indication from the upper layer to release the reception buffer (ingress queue element) of the given physical Ethernet controller. Tags: atp.Status=draft
void CanXL_ReleaseRxBuffer(uint8 CtrlIdx, Eth_BufIdxType RxHandleId);Ttcan
Acknowledges the time mark interrupt by resetting the flag in the interrupt vector register.
void Can_TTAckTimeMark(uint8 Controller);Cancels the time mark.
void Can_TTCancelTimeMark(uint8 Controller);Disables the time mark interrupt.
void Can_TTDisableTimeMarkIRQ(uint8 Controller);Enables the time mark interrupt.
void Can_TTEnableTimeMarkIRQ(uint8 Controller);Gets the error level. This includes the severity of the error level (S0-S3) and the minimum and maximum value of the message status count.
void Can_TTGetErrorLevel(uint8 Controller, Can_TTErrorLevelType* Can_TTErrorLevel);Gets the master state. The master state includes the sync mode (sync_off, synchronizing, in_ gap, in_schedule) the master-slave mode (master_off, slave, backup_master, current_master) and the current value for ref trigger offset.
void Can_TTGetMasterState(uint8 Controller, Can_TTMasterStateType* Can_TTMasterState);Gets the actual value of NTU (network time unit). Together with the local oscillator period, the actual value of NTU can be derived from the actual value of TUR.
void Can_TTGetNTUActual(uint8 Controller, Can_TTTURType* Can_TTTURAct);Sets the value of "global time preset".
void Can_TTGlobalTimePreset(uint8 Controller, Can_TTTimeType Can_TTGlobalTimePreset);Polls the interrupt flags specific to TTCAN
void Can_TTMainFunction_IRQ(void);Reads received data from the controller by returning the pointer of the CanID, the DLC and the Data of the message in the requested HRH.
void Can_TTReceive(uint8 Controller, uint8 Hrh, Can_IdType* CanId, uint8* CanDlc, uint8* CanSduPtr);Signals the end of a gap.
void Can_TTSetEndOfGap(uint8 Controller);Adjusts the NTU (network time unit) according to the value given by "NTU adjust". Together with the local oscillator period, "TUR adjust" can be derived from "NTU adjust".
void Can_TTSetExtClockSyncCommand(uint8 Controller);Sets the "Next_is_Gap" bit.
void Can_TTSetNextIsGap(uint8 Controller);Sets the value of "NTU adjust". Together with the local oscillator period, "TUR adjust" can be derived from "NTU adjust".
void Can_TTSetNTUAdjust(uint8 Controller, Can_TTTURType Can_TTTURAdjust);Adjusts the global time at the beginning of the next basic cycle by the amount of "global time preset"
void Can_TTSetTimeCommand(uint8 Controller);Sets a new value for the time mark for the given time source.
void Can_TTSetTimeMark(uint8 Controller, Can_TTTimeType Can_TTTimeMark, Can_TTTimeSourceType Can_TTTimeSource);Error level (S0-S3)
TTCAN error level including min and max values of message status count
Master-Slave Mode
Master state type including sync mode, master-slave mode and current ref trigger offset
Sync mode
Time source
16 bit value representing time values of TTCAN, e.g. cycle, local or global time
TtcanIf
Within this API, the upper layer module (called module) shall check whether the available data fits into the buffer size reported by PduInfoPtr->SduLength. If it fits, it shall copy its data into the buffer provided by PduInfoPtr->SduDataPtr and update the length of the actual copied data in PduInfoPtr->SduLength. If not, it returns E_NOT_OK without changing PduInfoPtr.
Std_ReturnType <User_TriggerTransmit>(PduIdType TxPduId, PduInfoType* PduInfoPtr);Acknowledges the time mark interrupt by resetting the flag in the interrupt vector register.
Std_ReturnType CanIf_TTAckTimeMark(uint8 ControllerId);Reports an application watchdog error.
Std_ReturnType CanIf_TTApplWatchdogError(uint8 ControllerId);Cancels the time mark.
Std_ReturnType CanIf_TTCancelTimeMark(uint8 ControllerId);Disables the time mark interrupt.
Std_ReturnType CanIf_TTDisableTimeMarkIRQ(uint8 ControllerId);Enables the time mark interrupt.
Std_ReturnType CanIf_TTEnableTimeMarkIRQ(uint8 ControllerId);Reports the occurrence of a gap.
Std_ReturnType CanIf_TTGap(uint8 ControllerId);Gets the current values for the global, local and cycle time and the cycle count of the controller
Std_ReturnType CanIf_TTGetControllerTime(uint8 ControllerId, CanIf_TTTimeType* CanIf_TTGlobalTime, CanIf_TTTimeType* CanIf_TTLocalTime, CanIf_TTTimeType* CanIf_TTCycleTime, uint8* CanIf_TTCycleCount);Gets the error level. This includes the severity of the error level (S0-S3) and the minimum and maximum value of the message status count.
Std_ReturnType CanIf_TTGetErrorLevel(uint8 ControllerId, CanIf_TTErrorLevelType* CanIf_TTErrorLevel);Gets the master state. The master state includes the sync mode (sync_off, synchronizing, in_ gap, in_schedule) the master-slave mode (master_off, slave, backup_master, current_master) and the current value for ref trigger offset.
Std_ReturnType CanIf_TTGetMasterState(uint8 ControllerId, CanIf_TTMasterStateType* CanIf_TTMasterState);Gets the actual value of NTU (network time unit). Together with the local oscillator period, the actual value of NTU can be derived from the actual value of TUR.
Std_ReturnType CanIf_TTGetNTUActual(uint8 ControllerId, float32 CanIf_TTNTUAct);Gets the synchronization quality.
Std_ReturnType CanIf_TTGetSyncQuality(uint8 ControllerId, boolean* CanIf_TTClockSpeed, boolean* CanIf_TTGlobalTimePhase);Gets the IRQ status of the time mark.
Std_ReturnType CanIf_TTGetTimeMarkIRQStatus(uint8 ControllerId, boolean* CanIf_TTIRQStatus);Sets the value of "global time preset".
Std_ReturnType CanIf_TTGlobalTimePreset(uint8 ControllerId, CanIf_TTTimeType CanIf_TTGlobalTimePreset);Processes the job list of the TTCAN controller <Controller>.
void CanIf_TTJobListExec_<Controller>(void);Reports change of the master state between potential and current master.
Std_ReturnType CanIf_TTMasterStateChange(uint8 ControllerId, CanIf_TTMasterStateType CanIf_TTMasterState);Signals the end of a gap.
Std_ReturnType CanIf_TTSetEndOfGap(uint8 ControllerId);Adjusts the NTU (network time unit) according to the value given by "NTU adjust". Together with the local oscillator period, "TUR adjust" can be derived from "NTU adjust".
Std_ReturnType CanIf_TTSetExtClockSyncCommand(uint8 ControllerId);Sets the "Next_is_Gap" bit.
Std_ReturnType CanIf_TTSetNextIsGap(uint8 ControllerId);Sets the value of "NTU adjust". Together with the local oscillator period, "TUR adjust" can be derived from "NTU adjust".
Std_ReturnType CanIf_TTSetNTUAdjust(uint8 ControllerId, float32 CanIf_TTNTUAdjust);Adjusts the global time at the beginning of the next basic cycle by the amount of "global time preset"
Std_ReturnType CanIf_TTSetTimeCommand(uint8 ControllerId);Sets a new value for the time mark for the given time source.
Std_ReturnType CanIf_TTSetTimeMark(uint8 ControllerId, CanIf_TTTimeType CanIf_TTTimeMark, CanIf_TTTimeSourceType CanIf_TTTimeSource);Reports one of the following errors: • failed to serve appl. watchdog • config error • watch trigger reached
void CanIf_TTSevereError(uint8 ControllerId, CanIf_TTSevereErrorEnumType CanIf_TTSevereError);Reports the start of a basic cycle.
Std_ReturnType CanIf_TTStartOfCycle(uint8 ControllerId, uint8 CanIf_TTCycleCount);Reports a time discontinuity.
Std_ReturnType CanIf_TTTimeDisc(uint8 ControllerId);Reports one of the following errors: • Change of error level • Tx overflow / underflow • Synchronization failed • Init watch trigger
Std_ReturnType CanIf_TTTimingError(uint8 ControllerId, CanIf_TTTimingErrorIRQType CanIf_TTTimingErrorIRQ);Error level (S0-S3)
TTCAN error level including min and max values of message status count
Event that causes a Timing/Error IRQ
Master-Slave Mode
Master state type including sync mode, master-slave mode and current ref trigger offset
Event that causes a severe error
Sync mode
Time source of time values in TTCAN
16 bit value representing time values of TTCAN, e.g. cycle, local or global time
Combines all events that are reported by CanIf_TTTimingError (event indication and error level)
Guide du clusterGÉNÉRÉ PAR IA
Fournit le pilote matériel, l'abstraction d'interface, la segmentation et le contrôle du transceiver pour CAN.
Fournit le pilote matériel, l'abstraction d'interface, la segmentation et le contrôle du transceiver pour CAN.
Le cluster relie le pilote CAN, le CAN Interface, le protocole de transport selon ISO 15765-2 et le pilote de transceiver pour former la partie inférieure de la pile de communication CAN. Les couches supérieures émettent via CanIf_Transmit(). CanIf mappe les L-PDU sur les objets matériels, les met en mémoire tampon lorsque le matériel est occupé et distribue les notifications de réception et de confirmation [SWS_CANIF_00005]. CanTp segmente les grands messages et récupère les données pas à pas via PduR [SWS_CanTp_00086]. L'émission n'a lieu que si le contrôleur est dans l'état CAN_CS_STARTED et que le canal de PDU est prêt à émettre ; CanSM contrôle les modes via CanIf.
Le cluster constitue la partie inférieure de la pile de communication CAN. Can contrôle les contrôleurs et les boîtes aux lettres, CanIf abstrait les pilotes, les contrôleurs et les transceivers, CanTp segmente selon ISO 15765-2 et CanTrcv gère les modes de fonctionnement du transceiver. CanIf n'accède aux tampons matériels que par l'intermédiaire des services du pilote [SWS_CANIF_00023]. Il met à disposition des couches supérieures des plages uniformes pour ControllerId et TransceiverId [SWS_CANIF_00653] [SWS_CANIF_00655].
Diagramme de contexte : CanIf assure l'intermédiation entre PduR, CanTp, CanSM et EcuM d'une part, et les pilotes Can et CanTrcv d'autre part. Sources : [SWS_CANIF_00005] [SWS_CANIF_00006] [SWS_CANIF_00358]
Lors de l'émission, CanIf_Transmit() appelle Can_Write() avec le HTH approprié [SWS_CANIF_00318]. Si le pilote signale CAN_BUSY, CanIf met la L-PDU en mémoire tampon [SWS_CANIF_00381]. Pendant la confirmation d'émission, il transmet l'entrée en mémoire tampon ayant la plus haute priorité [SWS_CANIF_00668]. Les L-PDU reçues passent par le filtrage logiciel et la vérification de la longueur des données dans CanIf avant que ce dernier ne les transmette à CanTp ou PduR [SWS_CANIF_00389] [SWS_CANIF_00390]. CanTp ne met pas lui-même en mémoire tampon les données utiles, mais les récupère via PduR_CanTpCopyTxData() ou les transmet via PduR_CanTpCopyRxData() [SWS_CanTp_00086] [SWS_CanTp_00269].
Diagramme de séquence : transmission directe ou mise en mémoire tampon en cas de CAN_BUSY, suivie de la transmission ultérieure depuis le tampon dans CanIf_TxConfirmation. Sources : [SWS_CANIF_00381] [SWS_CANIF_00183]
Can fonctionne par interruptions ou par scrutation via ses MainFunctions [SWS_Can_00225] [SWS_Can_00226]. CanTp_RxIndication() doit pouvoir être appelée dans le contexte d'interruption [SWS_CanTp_00235], tandis que CanTp_MainFunction() surveille les expirations de délai du protocole [SWS_CanTp_00164]. CanIf protège les tampons partagés contre les accès préemptifs [SWS_CANIF_00064].
Après l'initialisation, tous les canaux de CanIf sont sur CANIF_OFFLINE [SWS_CANIF_00864]. CanSM commute les contrôleurs via CanIf_SetControllerMode() [SWS_CANIF_00308]. SLEEP force CANIF_OFFLINE, STOPPED ou BusOff forcent CANIF_TX_OFFLINE [SWS_CANIF_00865] [SWS_CANIF_00866]. CanIf signale un BusOff à CanSM [SWS_CANIF_00724]. Les erreurs sont transmises au DET ; CanTrcv signale en outre CANTRCV_E_BUS_ERROR au DEM [SWS_CanTrcv_00206]. CanTp interrompt les sessions en cas de timeout avec une confirmation négative [SWS_CanTp_00310].
Architecture système et rôle du cluster
Le cluster « CAN Communication » constitue la partie inférieure de la pile de communication AUTOSAR pour CAN. Il s'étend du pilote CAN proche du matériel jusqu'au protocole de transport sur lequel reposent PduR et DCM. L'élément central est le CAN Interface, qui découple les couches supérieures des détails du pilote et du matériel. Il n'accède aux tampons de communication spécifiques au matériel qu'exclusivement par l'intermédiaire des services du pilote [SWS_CANIF_00023]. Il abstrait les contrôleurs et les transceivers de plusieurs instances de pilote au moyen de plages propres pour ControllerId et TransceiverId [SWS_CANIF_00653] [SWS_CANIF_00655].
| module | Rôle dans le cluster | Références |
|---|---|---|
Can | Accès aux contrôleurs CAN et aux boîtes aux lettres, émission via Can_Write(), machine d'états par contrôleur | [SWS_Can_00233] [SWS_Can_91013] |
CanIf | Mappage de L-PDU sur HTH/HRH, filtres logiciels, tampon d'émission, gestion des modes des contrôleurs, des canaux de PDU et des transceivers | [SWS_CANIF_00662] [SWS_CANIF_00137] |
CanTp | Segmentation et réassemblage selon ISO 15765-2, contrôle de flux, plusieurs connexions parallèles | [SWS_CanTp_00033] [SWS_CanTp_00096] |
CanTrcv | Modes de fonctionnement NORMAL, STANDBY et SLEEP, causes de réveil, diagnostic du transceiver | [SWS_CanTrcv_00102] [SWS_CanTrcv_00107] |
CanIf adresse le matériel via deux types de handles : HTH pour les objets d'émission et HRH pour les objets de réception [SWS_CANIF_00291] [SWS_CANIF_00292]. CanIf intègre plusieurs pilotes CAN au moyen de pointeurs de fonction propres à chaque pilote [SWS_CANIF_00378]. Lors des callbacks, CanIf identifie le pilote appelant grâce au ControllerId présent dans la structure Can_HwType CanIf p. 68. Il existe exactement une instance de CanTrcv pour chaque type de matériel de transceiver [SWS_CanTrcv_00016].
Diagramme de contexte : CanIf est la plaque tournante centrale entre les couches supérieures (PduR, CanTp, CanSM, EcuM) et les pilotes Can et CanTrcv. Sources : [SWS_CANIF_00005] [SWS_CANIF_00006] [SWS_CANIF_00358] [SWS_CANIF_00724] [SWS_CanTp_00216] [SWS_CanTrcv_00206]
Interaction et chemins d'interaction
Émission : une couche supérieure appelle CanIf_Transmit() [SWS_CANIF_00005]. CanIf détermine le HTH correspondant au TxPduId et appelle Can_Write() avec une structure Can_PduType [SWS_CANIF_00318] [SWS_Can_00415]. Si Can_Write() renvoie E_OK, CanIf_Transmit() renvoie également E_OK [SWS_CANIF_00162]. Si aucun objet d'émission n'est libre, le pilote signale CAN_BUSY [SWS_Can_00039]. Si la mise en mémoire tampon d'émission est activée, CanIf stocke alors la L-PDU dans le CanIfTxBuffer [SWS_CANIF_00381] [SWS_CANIF_00063] CanIf p. 138.
Confirmation d'émission : après une émission réussie, Can appelle CanIf_TxConfirmation() [SWS_CANIF_00007]. Pour ce faire, le pilote mémorise le swPduHandle issu de Can_Write() Can p. 40. CanIf vérifie à cette occasion si des entrées sont en mémoire tampon pour le HTH libéré. Il transmet ensuite l'entrée ayant la plus haute priorité selon ISO 11898-1 et la retire immédiatement du tampon [SWS_CANIF_00386] [SWS_CANIF_00070] [SWS_CANIF_00668] [SWS_CANIF_00183]. La couche supérieure reçoit ensuite <User_TxConfirmation>(E_OK) [SWS_CANIF_00383].
Diagramme de séquence : demande d'émission avec transmission directe ou mise en mémoire tampon en cas de CAN_BUSY et transmission ultérieure depuis le tampon pendant la confirmation d'émission. Sources : [SWS_CANIF_00318] [SWS_CANIF_00381] [SWS_CANIF_00668] [SWS_CANIF_00183] CanIf p. 157
Réception : Can signale une L-PDU reçue via CanIf_RxIndication() [SWS_CANIF_00006]. Pour les HRH BasicCAN, CanIf effectue d'abord le filtrage logiciel, puis la vérification de la longueur des données [SWS_CANIF_00389] [SWS_CANIF_00390] [SWS_CANIF_00663]. Il transmet ensuite l'indication au destinataire configuré [SWS_CANIF_00415] [SWS_CANIF_00056], par exemple à CanTp_RxIndication [SWS_CANIF_00448] ou à PduR_CanIfRxIndication [SWS_CANIF_00442].
Protocole de transport : CanTp_Transmit() [SWS_CanTp_00212] démarre une transmission segmentée lorsque les données ne tiennent pas dans une N-PDU [SWS_CanTp_00232]. CanTp ne met pas lui-même les données utiles en mémoire tampon, mais les récupère pour chaque SF, FF et CF via PduR_CanTpCopyTxData() [SWS_CanTp_00086] [SWS_CanTp_00298]. Il transmet les trames via CanIf_Transmit() [SWS_CanTp_00216]. Lors de la réception d'un SF ou d'un FF, CanTp demande le tampon disponible avec PduR_CanTpStartOfReception() [SWS_CanTp_00079] [SWS_CanTp_00080]. Il copie chaque CF avec PduR_CanTpCopyRxData() [SWS_CanTp_00269]. Si le tampon ne suffit pas pour le bloc suivant, CanTp émet un Flow Control WAIT [SWS_CanTp_00082] [SWS_CanTp_00325] CanTp p. 37.
Transceiver : CanIf_SetTrcvMode() transmet les demandes de mode à CanTrcv_SetOpMode() [SWS_CANIF_00358]. Après le changement, CanTrcv appelle CanIf_TrcvModeIndication() [SWS_CanTrcv_00158], et CanIf transmet la notification à CanSM [SWS_CANIF_00712]. De même, CanIf_GetTrcvWakeupReason() et CanIf_SetTrcvWakeupMode() délèguent à CanTrcv [SWS_CANIF_00368] [SWS_CANIF_00372].
Synchronisation, réentrance et contextes de tâches
CanIf_Transmit() est réentrant pour des PduId différents, mais pas pour le même PduId [SWS_CANIF_00005]. CanIf doit protéger mutuellement les accès préemptifs aux ressources partagées [SWS_CANIF_00064]. Cela concerne en particulier les tampons d'émission [SWS_CANIF_00033], le CanId des L-PDU dynamiques pendant CanIf_SetDynamicTxId() [SWS_CANIF_00673] et le tampon de réception pendant CanIf_ReadRxPduData() [SWS_CANIF_00199].
Can prend en charge le fonctionnement par interruptions et par scrutation. Selon la configuration, les MainFunctions scrutent les confirmations d'émission, la réception, le BusOff, le réveil et le mode de contrôleur [SWS_Can_00225] [SWS_Can_00226] [SWS_Can_00227] [SWS_Can_00228] [SWS_Can_00368] CanIf p. 152. Les callbacks tels que CanIf_ControllerBusOff() s'exécutent par conséquent au choix au niveau interruption ou au niveau tâche CanIf p. 119. Can_DisableControllerInterrupts() et Can_EnableControllerInterrupts() ont un effet imbriqué : chaque verrouillage nécessite son propre déverrouillage [SWS_Can_00231] [SWS_Can_00232] Can p. 61.
CanTp_RxIndication() et CanTp_TxConfirmation() doivent pouvoir être appelées dans le contexte d'interruption [SWS_CanTp_00235] [SWS_CanTp_00236]. CanTp_MainFunction() dessert cycliquement les timers N_As, N_Bs, N_Cs, N_Ar, N_Br, N_Cr et STmin [SWS_CanTp_00213] [SWS_CanTp_00164]. Leur cadence suit le paramètre CanTpMainFunctionPeriod [SWS_CanTp_00300]. Interprétation : cette période détermine vraisemblablement la résolution atteignable pour les timeouts. Question Q-6ee587d8a8f38bff (ouverte) Chaque connexion utilise des tampons propres, des timers propres et sa propre machine d'états [SWS_CanTp_00122] CanTp p. 42. CanTrcv_MainFunction() recherche cycliquement des événements de réveil sur les bus en STANDBY et en SLEEP [SWS_CanTrcv_00013] [SWS_CanTrcv_00112].
Cycles de vie et modes de fonctionnement
EcuM initialise CanIf avec CanIf_Init() et les pilotes Can et CanTrcv chacun séparément CanIf p. 40 [SWS_Can_00223] [SWS_CanTrcv_00001]. CanTrcv_Init() place chaque transceiver en SLEEP ou STANDBY selon la configuration [SWS_CanTrcv_00148]. Les pilotes utilisés par CanTrcv doivent être prêts au préalable [SWS_CanTrcv_00099]. Après l'initialisation, CanIf s'attend à ce que les contrôleurs soient dans l'état STOPPED et commute tous les canaux sur CANIF_OFFLINE [SWS_CANIF_00864]. CanIf rejette les appels de services avant l'initialisation [SWS_CANIF_00661]. Interprétation : Can et CanTrcv devraient donc être initialisés avant CanIf. Question Q-4af03fca13da9a5b (ouverte) CanTp passe de CANTP_OFF à CANTP_ON avec CanTp_Init() [SWS_CanTp_00027] [SWS_CanTp_00170]. La segmentation n'a lieu que dans l'état CANTP_ON [SWS_CanTp_00238] CanTp p. 27.
CanSM pilote les changements de mode : CanIf_SetControllerMode() appelle Can_SetControllerMode() [SWS_CANIF_00003] [SWS_CANIF_00308]. Can signale la fin de manière asynchrone via CanIf_ControllerModeIndication(), et CanIf la transmet à CanSM [SWS_CANIF_00699] [SWS_CANIF_00711]. Les états du contrôleur sont UNINIT, STOPPED, STARTED et SLEEP [SWS_Can_91013] Can p. 38. Au-dessus se trouvent les modes de canal de PDU de CanIf [SWS_CANIF_00137]. CanIf_SetPduMode() n'est accepté que dans l'état CAN_CS_STARTED [SWS_CANIF_00874]. SLEEP force CANIF_OFFLINE ; STOPPED ou BusOff forcent CANIF_TX_OFFLINE [SWS_CANIF_00865] [SWS_CANIF_00866].
Diagramme d'états : les modes de canal de PDU de CanIf sont déterminés par CanIf_SetPduMode et par les changements de mode de contrôleur. Sources : [SWS_CANIF_00137] [SWS_CANIF_00864] [SWS_CANIF_00865] [SWS_CANIF_00866] [SWS_CANIF_00874] CanIf p. 61
Pour le réveil, CanIf_CheckWakeup() interroge les pilotes via Can_CheckWakeup() ou CanTrcv_CheckWakeup() [SWS_CANIF_00395] [SWS_Can_00360] [SWS_CanTrcv_00143]. CanIf_CheckValidation() ne signale un événement de réveil à <User_ValidateWakeupEvent> que si une réception valide a été enregistrée depuis le réveil [SWS_CANIF_00178] [SWS_CANIF_00179] [SWS_CANIF_00286] CanIf p. 102. En cas de Partial Networking, le PnTxFilter bloque toutes les émissions après CAN_CS_SLEEP, à l'exception des PDU de filtrage PN. Seule une confirmation d'émission ou une réception lève le blocage [SWS_CANIF_00749] [SWS_CANIF_00750] [SWS_CANIF_00751] [SWS_CANIF_00896]. Avant le passage à un mode basse consommation, CanSM efface l'indicateur WUF via CanIf_ClearTrcvWufFlag() pour éviter qu'un réveil sur trame ne soit perdu [SWS_CANIF_00766] [SWS_CanTrcv_00194] [SWS_CanTrcv_00195] CanTrcv p. 57. Les modules sont arrêtés avec Can_DeInit(), CanIf_DeInit() et CanTrcv_DeInit() [SWS_Can_91002] [SWS_CANIF_91002] [SWS_CanTrcv_91001].
Gestion des erreurs, traçage DET et dégradation
Tous les modules du cluster signalent les erreurs de développement au DET. CanIf le fait par exemple en cas de TxPduId invalide ou de pointeur nul [SWS_CANIF_00319] [SWS_CANIF_00320]. CanTp renvoie en plus E_NOT_OK dans ce cas [SWS_CanTp_00294] ; Can et CanTrcv utilisent leurs propres codes d'erreur [SWS_Can_91019] [SWS_CanTrcv_00050]. Les erreurs d'exécution concernent notamment les longueurs de données rejetées [SWS_CANIF_00168], les tentatives d'émission sur des canaux en mode CANIF_OFFLINE [SWS_CANIF_00382], les messages reçus perdus [SWS_Can_91020] et l'absence de communication avec le transceiver [SWS_CanTrcv_00113].
Parmi les justificatifs examinés, seul CanTrcv mentionne une entrée DEM : CanTrcv_MainFunctionDiagnostics() définit CANTRCV_E_BUS_ERROR à FAILED ou PASSED selon le flag BUSERR [SWS_CanTrcv_00218] [SWS_CanTrcv_00206] [SWS_CanTrcv_00227] CanTrcv p. 48.
Can signale un BusOff via CanIf_ControllerBusOff() [SWS_CANIF_00218]. CanIf place alors le canal sur CANIF_TX_OFFLINE et en informe CanSM [SWS_CANIF_00866] [SWS_CANIF_00724] CanIf p. 147. Lors du passage à CAN_CS_STOPPED, CanIf vide les tampons d'émission et confirme négativement les émissions en attente [SWS_CANIF_00485] [SWS_CANIF_00739]. Pour la reprise, CanSM peut interroger avec CanIf_GetTxConfirmationState() si une confirmation d'émission a eu lieu depuis le dernier démarrage du contrôleur [SWS_CANIF_00734] [SWS_CANIF_00740] CanIf p. 103. L'état d'erreur et les compteurs d'erreurs peuvent être interrogés via CanIf [SWS_CANIF_91001] [SWS_Can_91003] [SWS_CANIF_91003]. Si le signalement des événements de sécurité est activé, CanIf signale les erreurs de bus ainsi que les événements Error-Passive et BusOff à l'IdsM [SWS_CANIF_00913] [SWS_CANIF_00915] [SWS_CANIF_00917] [SWS_CANIF_00918].
Diagramme de séquence : le signalement de BusOff chemine du contrôleur à CanSM via Can et CanIf ; CanIf bloque alors le chemin d'émission et réinitialise les tampons d'émission. Sources : [SWS_CANIF_00218] [SWS_CANIF_00724] [SWS_CANIF_00866] [SWS_CANIF_00918] [SWS_CANIF_00734] CanIf p. 147
CanTp interrompt les sessions en cas de timeout et notifie négativement la couche supérieure, par exemple pour N_As, N_Bs ou N_Cr [SWS_CanTp_00310] [SWS_CanTp_00316] [SWS_CanTp_00313]. CanTp procède de la même manière après WFTmax FC(WAIT) consécutifs [SWS_CanTp_00223] ou en cas de FC avec débordement [SWS_CanTp_00309]. En guise de mode dégradé, CanIf confirme en mode CANIF_TX_OFFLINE_ACTIVE les émissions auprès des couches supérieures sans émettre sur le bus [SWS_CANIF_00072].
Guide généré par IA sur la base des spécifications AUTOSAR des modules Can, CanIf, CanTp et CanTrcv (Classic Platform R20-11). Seules les exigences liées ont un caractère normatif ; les affirmations qualifiées d'interprétations ne sont pas étayées par les sources.
Assure l'émission, la réception et la segmentation fiables des trames CAN et CAN FD entre le matériel et les services BSW.
Le cluster de communication CAN regroupe les modules Can, CanIf, CanTrcv et CanTp pour assurer la transmission et la réception fiables de trames CAN et CAN FD au sein de la Classic Platform d'AUTOSAR [SWS_CANIF_00001]. Il coordonne l'accès au matériel, le filtrage logiciel des PDU, la mise en file d'attente prioritaire et la segmentation des messages de transport selon l'ISO 15765-2 [SWS_CANIF_00005], [SWS_CanTp_00238]. Ce cluster subordonne toute émission à l'état actif du contrôleur et isole automatiquement les transmissions lors d'incidents critiques de type BusOff [SWS_CANIF_00317], [SWS_CANIF_00485].
Le cluster CAN de l'architecture AUTOSAR Classic (R20-11) fédère les modules Can, CanIf, CanTrcv et CanTp pour assurer la transmission, la réception et la segmentation des trames classiques et CAN FD SWS_CANDriver p. 49. Le pilote matériel Can pilote directement les contrôleurs et leurs boîtes aux lettres d'émission/réception (HTH/HRH) [SWS_Can_00429], tandis que CanTrcv gère les émetteurs-récepteurs physiques et leurs modes de veille [SWS_CanTrcv_00002]. L'interface CanIf abstrait ces composants matériels pour les couches supérieures (PduR, CanSM) en offrant un routage unifié des PDU et une gestion dynamique des canaux logiques [SWS_CANIF_00001], [SWS_CANIF_00137].
Diagramme d'architecture : Organisation en couches du cluster CAN et interfaces avec les modules BSW environnants. Sources : SWS_CANInterface p. 22, [SWS_CANIF_00001], [SWS_CanTp_00027], [SWS_Can_00415].
Le traitement des flux de données s'appuie sur le service CanIf_Transmit() qui achemine les requêtes vers le pilote via Can_Write() [SWS_CANIF_00005]. En cas d'indisponibilité matérielle temporaire, CanIf met en file d'attente les messages dans un tampon d'émission ordonné par priorité jusqu'à la notification de confirmation CanIf_TxConfirmation() [SWS_CANIF_00070], [SWS_CANIF_00183]. En réception, CanIf_RxIndication() prend en charge le filtrage logiciel (BasicCAN/FullCAN) et la vérification de longueur de trame avant distribution vers les couches clientes [SWS_CANIF_00006], [SWS_CANIF_00389]. Pour les messages longs de diagnostic, CanTp segmente et reconstitue les flux selon la norme ISO 15765-2 à travers des canaux concurrents dédiés [SWS_CanTp_00096], [SWS_CanTp_00238].
Diagramme de séquence : Traitement d'une demande de transmission et vidage prioritaire du tampon d'émission CanIf. Sources : SWS_CANInterface p. 138, [SWS_CANIF_00005], [SWS_CANIF_00070], [SWS_CANIF_00183], [SWS_CANIF_00383].
L'exécution opérationnelle repose sur des fonctions périodiques planifiées (Can_MainFunction_Write(), CanTp_MainFunction()) ou des interruptions matérielles protégées par des compteurs d'imbrication [SWS_Can_00202], [SWS_CanTp_00213]. Les transitions d'états (CAN_CS_STOPPED, CAN_CS_STARTED, CAN_CS_SLEEP) sont pilotées par le CanSM via CanIf_SetControllerMode() [SWS_CANIF_00003]. En cas d'anomalie critique sur le bus (BusOff), le contrôleur est immédiatement stoppé, les tampons de transmission sont purgés et les couches supérieures sont averties de l'échec pour déclencher le protocole de rétablissement AUTOSAR_SWS_CANInterface p. 147, [SWS_CANIF_00218], [SWS_CANIF_00485].
Architecture système et rôle du cluster CAN
Au sein de la Classic Platform d'AUTOSAR (Release R20-11), le cluster de communication CAN constitue la chaîne logicielle fondamentale pour l'échange de messages sur le bus Controller Area Network, qu'il s'agisse du protocole classique (ISO 11898-1) ou de son extension à débit flexible CAN FD SWS_CANDriver p. 49. Ce cluster est composé de quatre modules complémentaires de la couche logicielle de base (BSW) : le pilote matériel Can (CAN Driver), l'interface d'abstraction CanIf (CAN Interface), le pilote de transceiver CanTrcv (CAN Transceiver Driver) et la couche de transport CanTp (CAN Transport Layer) [SWS_CANIF_00001], [SWS_CanTp_00027].
L'architecture établit une séparation stricte des responsabilités à travers les couches AUTOSAR. Le module Can, situé dans la couche MCAL (Microcontroller Abstraction Layer), accède directement aux registres des contrôleurs CAN sur puce et gère les objets matériels d'émission et de réception (HTH et HRH) [SWS_Can_00429]. Le module CanTrcv appartient à la couche d'abstraction ECU et pilote les circuits d'émetteurs-récepteurs physiques externes ou intégrés, notamment leurs modes de veille et de réveil [SWS_CanTrcv_00002]. Le module CanIf unifie l'accès à ces pilotes bas niveau en masquant les spécificités matérielles pour les couches supérieures telles que le routeur de PDU (PduR), le gestionnaire d'état CAN (CanSM) et le module de gestion de réseau (CanNm) SWS_CANInterface p. 22. Enfin, le module CanTp se situe dans les services de communication pour réaliser la segmentation, le réassemblage et le contrôle de flux selon la norme ISO 15765-2, indispensables aux protocoles de diagnostic comme l'UDS (ISO 14229-1) [SWS_CanTp_00096], [SWS_CanTp_00238].
Diagramme d'architecture : Organisation en couches du cluster CAN et interfaces avec les modules BSW environnants. Sources : SWS_CANInterface p. 22, [SWS_CANIF_00001], [SWS_CanTp_00027], [SWS_Can_00415].
Interactions et chemins de communication entre modules
Le flux de transmission débute lorsque les couches supérieures (PduR, CanTp) appellent la fonction synchrone CanIf_Transmit() en transmettant un identifiant de PDU et une structure PduInfoType [SWS_CANIF_00005]. Le CanIf valide les paramètres, identifie le contrôleur CAN ainsi que l'objet matériel de transmission (HTH) associé, puis appelle le service Can_Write() du pilote Can SWS_CANInterface p. 138. Si les boîtes aux lettres matérielles sont libres, Can_Write() prend en charge la requête et retourne E_OK. Dans le cas contraire, si le pilote renvoie CAN_BUSY, CanIf stocke la PDU dans un tampon interne d'émission (CanIfTxBuffer) ordonné selon la priorité canonique de l'identifiant CAN [SWS_CANIF_00070], [SWS_CANIF_00386]. Il est vraisemblable que cette mise en file d'attente prioritaire vise principalement à absorber les surcharges temporaires du contrôleur sans perturber le cycle d'exécution de la couche appelante.
Diagramme de séquence : Traitement d'une demande de transmission et vidage prioritaire du tampon d'émission CanIf. Sources : SWS_CANInterface p. 138, [SWS_CANIF_00005], [SWS_CANIF_00070], [SWS_CANIF_00183], [SWS_CANIF_00383].
Lorsqu'un message a été envoyé avec succès sur le bus, le matériel signale l'événement et le pilote appelle la fonction de rappel CanIf_TxConfirmation() [SWS_CANIF_00007]. Dès cet instant, CanIf évalue si des requêtes différées subsistent dans le CanIfTxBuffer assigné à ce HTH libéré ; le cas échéant, il sélectionne la PDU la plus prioritaire et invoque immédiatement Can_Write() [SWS_CANIF_00668], [SWS_CANIF_00183]. En parallèle, CanIf propage la confirmation à la couche supérieure propriétaire via le callback configuré <User_TxConfirmation>(E_OK) [SWS_CANIF_00383].
Sur le chemin de réception, la détection d'une trame entrante déclenche l'exécution de CanIf_RxIndication() par le pilote Can, recevant le handle matériel de réception (HRH) et les données [SWS_CANIF_00006]. Le CanIf applique le filtrage logiciel configuré (indispensable en mode BasicCAN où un même HRH reçoit plusieurs identifiants) ainsi que la vérification de longueur de données (DLC) SWS_CANInterface p. 48, [SWS_CANIF_00389], [SWS_CANIF_00467]. Une fois validée, l'indication est directement distribuée aux modules récepteurs (tels que CanTp ou PduR) via LSduR_CanIfRxIndication() [SWS_CANIF_00415]. Si le paramètre CanIfPublicReadRxPduDataApi est activé, les données reçues peuvent également être copiées dans un tampon intermédiaire pour une lecture différée via CanIf_ReadRxPduData() [SWS_CANIF_00194], [SWS_CANIF_00198].
Pour le trafic de transport segmenté, CanTp encapsule les paquets volumineux en trames SF (Single Frame), FF (First Frame), CF (Consecutive Frame) et FC (Flow Control) [SWS_CanTp_00231], [SWS_CanTp_00232]. CanTp prend en charge plusieurs canaux de connexion concurrents et indépendants [SWS_CanTp_00096], [SWS_CanTp_00122]. Si un format avec remplissage (padding) est requis pour assurer la compatibilité matérielle ou réglementaire (comme pour le diagnostic embarqué OBD), CanTp complète les octets inutilisés avec la valeur de configuration CANTP_PADDING_BYTE tout en ne transmettant que la charge utile effective aux couches clientes SWS_CANTransportLayer p. 43, [SWS_CanTp_00059], [SWS_CanTp_00116].
Synchronisation, réentrance et contextes d'exécution
Le fonctionnement du cluster CAN combine des contextes sous interruption (ISR) et des contextes de tâches périodiques planifiés par le Schedule Manager (SchM). Les fonctions d'émission CanIf_Transmit() et CanTp_Transmit() sont réentrantes pour des identifiants de PDU distincts, mais non réentrantes lorsqu'elles s'exécutent simultanément pour un même PduId [SWS_CANIF_00005], [SWS_CanTp_00212]. La manipulation des identifiants dynamiques par CanIf_SetDynamicTxId() nécessite des mécanismes de protection exclusive pour garantir l'intégrité des métadonnées face à des appels concurrents de transmission [SWS_CANIF_00189], [SWS_CANIF_00673].
Pour le pilote Can, le traitement des événements de transmission, de réception, d'erreur BusOff et de réveil peut être configuré soit sous interruption, soit par scrutation cyclique (polling) [SWS_Can_00031], [SWS_Can_00108]. Lorsque la scrutation est sélectionnée, le planificateur exécute périodiquement les fonctions planifiées Can_MainFunction_Write(), Can_MainFunction_Read(), Can_MainFunction_BusOff() et Can_MainFunction_Wakeup() [SWS_Can_00225], [SWS_Can_00226], [SWS_Can_00227], [SWS_Can_00228]. La désactivation et réactivation des interruptions au niveau des registres matériels est assurée par Can_DisableControllerInterrupts() et Can_EnableControllerInterrupts(), qui implémentent un compteur d'imbrication incrémental afin de préserver les sections critiques partagées [SWS_Can_00049], [SWS_Can_00202].
Au niveau de la couche de transport, la fonction CanTp_MainFunction() assure la gestion temporelle globale des protocoles ISO 15765-2 [SWS_CanTp_00213]. Elle surveille les temporisations protocolaires strictes, notamment les délais de transmission et de réception N_As, N_Bs, N_Cs, N_Ar, N_Br, N_Cr, ainsi que le temps de séparation minimal entre trames consécutives STmin [SWS_CanTp_00164]. Côté transceiver, CanTrcv_MainFunctionDiagnostics() lit périodiquement l'état interne de l'émetteur-récepteur afin de remonter d'éventuelles anomalies électriques du bus [SWS_CanTrcv_00204], [SWS_CanTrcv_00218].
Cycles de vie, états et gestion des modes opérationnels
L'initialisation ordonnée du cluster est orchestrée par le module EcuM (ECU State Manager). EcuM invoque CanIf_Init() pour initialiser l'ensemble des structures de données, tampons et drapeaux de l'interface CAN [SWS_CANIF_00001], [SWS_CANIF_00085]. Les pilotes Can et CanTrcv sont initialisés séparément par leurs services dédiés, maintenant initialement les contrôleurs dans l'état passif CAN_CS_STOPPED SWS_CANInterface p. 40. Parallèlement, CanTp_Init() fait passer la couche de transport de l'état CANTP_OFF à l'état opérationnel CANTP_ON, en réinitialisant les machines d'états de ses canaux vers CANTP_RX_WAIT et CANTP_TX_WAIT [SWS_CanTp_00027], [SWS_CanTp_00030], [SWS_CanTp_00170].
Durant la phase de démarrage et d'exploitation, le gestionnaire CanSM orchestre les transitions des contrôleurs CAN en faisant appel à CanIf_SetControllerMode(), qui transmet la commande au pilote via Can_SetControllerMode() [SWS_CANIF_00003], [SWS_Can_00017]. Les transitions supportées couvrent les états CAN_CS_STOPPED, CAN_CS_STARTED et CAN_CS_SLEEP. Le passage réussi à un nouvel état est confirmé de manière asynchrone par le pilote au travers de la notification CanIf_ControllerModeIndication() [SWS_CANIF_00699]. Les requêtes de transmission ne peuvent être traitées que lorsque le contrôleur se trouve dans l'état CAN_CS_STARTED [SWS_CANIF_00317].
En complément des états du contrôleur matériel, CanIf gère indépendamment l'état logique des canaux de communication à l'aide de l'énumération CanIf_PduModeType [SWS_CANIF_00137]. À l'initialisation ou lors du passage en mode veille, les canaux basculent à l'état CANIF_OFFLINE, interdisant toute émission et réception [SWS_CANIF_00073], [SWS_CANIF_00864], [SWS_CANIF_00865]. Lorsque le contrôleur passe à l'état arrêté, le canal commute en CANIF_TX_OFFLINE, ce qui suspend les émissions tout en autorisant la réception [SWS_CANIF_00489], [SWS_CANIF_00866]. Le mode CANIF_ONLINE autorise la pleine communication bidirectionnelle, tandis que CANIF_TX_OFFLINE_ACTIVE simule les transmissions en générant des confirmations internes sans émission physique sur le bus [SWS_CANIF_00072].
Pour le contrôle de l'alimentation, CanIf_SetTrcvMode() transmet les demandes de transition (CANTRCV_TRCVMODE_NORMAL, CANTRCV_TRCVMODE_STANDBY, CANTRCV_TRCVMODE_SLEEP) au pilote de transceiver via CanTrcv_SetOpMode() [SWS_CANIF_00287], [SWS_CanTrcv_00102]. Lors de l'utilisation du réseau partiel (Partial Networking), un filtre spécial PnTxFilter bloque toutes les trames sortantes à l'exception des trames de filtrage explicitement configurées [SWS_CANIF_00747], [SWS_CANIF_00750]. L'effacement du drapeau de réveil matériel WUF (Wake-Up Flag) s'opère par l'intermédiaire de CanIf_ClearTrcvWufFlag() et CanTrcv_ClearTrcvWufFlag() avant la mise en veille effective [SWS_CANIF_00760], [SWS_CanTrcv_00194].
Gestion des erreurs, traçage DET et dégradation
Le cluster intègre une stratégie de détection d'erreurs multiniveau englobant les erreurs de développement rapportées au Default Error Tracer (DET), les défauts de production transmis au Diagnostic Event Manager (DEM) et les alertes de sécurité pour le gestionnaire d'intrusion (IdsM). Toute violation des préconditions d'API (appel avant initialisation, pointeur nul ou identifiant de contrôleur invalide) provoque un signalement au DET, tel que CANTP_E_UNINIT pour CanTp ou CANIF_E_PARAM_CONTROLLERID pour CanIf [SWS_CanTp_00031], [SWS_CANIF_00311].
L'état électrique du contrôleur est représenté par le type Can_ErrorStateType (CAN_ERRORSTATE_ACTIVE, CAN_ERRORSTATE_PASSIVE, CAN_ERRORSTATE_BUSOFF) [SWS_Can_91003]. Les compteurs d'erreurs matériels (TEC et REC) sont surveillés, et la transition vers l'état passif est notifiée par CanIf_ControllerErrorStatePassive() [SWS_CANIF_91008]. De plus, les erreurs de trame élémentaires telles que les défauts de CRC, de bourrage de bits ou d'acquittement sont typées via Can_ErrorType et signalées par CanIf_ErrorNotification() [SWS_Can_91021], [SWS_CANIF_91009].
En cas de dégradation critique conduisant à l'état BusOff (TEC > 255), le pilote Can détecte l'anomalie et déclenche la fonction de rappel CanIf_ControllerBusOff() AUTOSAR_SWS_CANInterface p. 147, [SWS_CANIF_00218]. En réponse, CanIf force le contrôleur dans l'état CAN_CS_STOPPED, commute le canal en CANIF_TX_OFFLINE, vide intégralement les files d'attente CanIfTxBuffer associées et informe les couches clientes des échecs d'émission en cours en envoyant E_NOT_OK [SWS_CANIF_00485], [SWS_CANIF_00739], [SWS_CANIF_00866]. Enfin, CanIf alerte le module CanSM afin d'exécuter la séquence normalisée de rétablissement de communication (BusOff Recovery).
Ce guide de cluster a été généré automatiquement par un assistant IA sur la base de la spécification AUTOSAR Classic R20-11.
Module im Cluster
CAN Driver (Can)
The CAN driver provides hardware-dependent access to the internal and external CAN controllers (CAN 2.0B, CAN FD, CAN XL).
CAN Interface (CanIf)
The CanIf abstracts CAN hardware details and provides uniform access to multiple CAN controllers and transceivers for higher-layer modules (PduR, CanTp, CanNm, CanSM).
CAN Network Management (CanNm)
AUTOSAR Classic Communication Services-Modul CAN Network Management (CanNm, Spezifikation: AUTOSAR_CP_SWS_CANNetworkManagement.pdf, AUTOSAR_SWS_CANNetworkManagement.pdf, AUTOSAR_SWS_CAN_Generic_NM.pdf, AUTOSAR_SWS_CAN_NM.pdf).
CAN State Manager (CanSM)
AUTOSAR Classic Communication Services-Modul CAN State Manager (CanSM, Spezifikation: AUTOSAR_CP_SWS_CANStateManager.pdf, AUTOSAR_SWS_CANStateManager.pdf, AUTOSAR_SWS_CAN_StateManager.pdf).
CAN Transport Layer (CanTp)
Provides segmentation and reassembly of CAN messages up to 4095 bytes (ISO 15765-2).
CAN Transceiver Driver (CanTrcv)
Controls physical bus transceiver states and wakeup detection on CAN lines.
CAN XL Driver (CanXL)
AUTOSAR Classic Communication Drivers-Modul CAN XL Driver (CanXL, Spezifikation: AUTOSAR_CP_SWS_CANXLDriver.pdf, AUTOSAR_SWS_CANXLDriver.pdf).
CAN XL Transceiver Driver (CanXLTrcv)
AUTOSAR Classic Communication HW Abstraction-Modul CAN XL Transceiver Driver (CanXLTrcv, Spezifikation: AUTOSAR_CP_SWS_CANXLTransceiverDriver.pdf, AUTOSAR_SWS_CANXLTransceiverDriver.pdf).
TTCAN Driver (Ttcan)
AUTOSAR Classic Communication Drivers-Modul TTCAN Driver (Ttcan, Spezifikation: AUTOSAR_CP_SWS_TTCANDriver.pdf, AUTOSAR_SWS_TTCANDriver.pdf).
TTCAN Interface (TtcanIf)
AUTOSAR Classic Communication HW Abstraction-Modul TTCAN Interface (TtcanIf, Spezifikation: AUTOSAR_CP_SWS_TTCANInterface.pdf, AUTOSAR_SWS_TTCANInterface.pdf).
gemini-3.8-flash-low· 2026-10-13 · Original allemand