DEENESPTFRRUARHIKOZHNL

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.

Карта тем

Подробный вид

Выберите элемент в оглавлении.

Can

<LPDU_CalloutName> функция

-

boolean <LPDU_CalloutName> (uint8 Hrh, Can_IdType CanId, uint8 CanDataLegth, const uint8* CanSduPtr);
Can_CheckWakeup функция

This function checks if a wakeup has occurred for the given controller.

Std_ReturnType Can_CheckWakeup (uint8 Controller);
Can_DeInit функция

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);
Can_GetControllerMode функция

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);
Can_GetVersionInfo функция

This function returns the version information of this module.

void Can_GetVersionInfo (Std_VersionInfoType* versioninfo);
Can_Init функция

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);
Can_MainFunction_Mode функция

This function performs the polling of CAN controller mode transitions.

void Can_MainFunction_Mode (void);
Can_MainFunction_Read функция

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);
Can_MainFunction_Write функция

This function performs the polling of TX confirmation when CAN_ TX_ PROCESSING is set to POLLING.

void Can_MainFunction_Write (void);
Can_SetBaudrate функция

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); ⚠️
Can_SetControllerMode функция

This function performs software triggered state transitions of the CAN controller State machine.

Std_ReturnType Can_SetControllerMode (uint8 Controller, Can_ControllerStateType Transition);
Can_Write функция

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.

Can_HwType тип

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.

Can_IdType тип

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);
<User_RxIndication> функция

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);
<User_TriggerTransmit> функция

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);
<User_TxConfirmation> функция

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);
CanIf_CheckValidation функция

This service is performed to validate a previous wakeup event.

Std_ReturnType CanIf_CheckValidation (EcuM_WakeupSourceType WakeupSource);
CanIf_CheckWakeup функция

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);
CanIf_ClearTrcvWufFlag функция

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);
CanIf_ControllerBusOff функция

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.

void CanIf_ControllerErrorStatePassive (uint8 ControllerId, uint16 RxErrorCounter, uint16 TxErrorCounter);

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);
CanIf_DeInit функция

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);
CanIf_GetPduMode функция

This service reports the current mode of a requested PDU channel.

Std_ReturnType CanIf_GetPduMode (uint8 ControllerId, CanIf_PduModeType* PduModePtr);
CanIf_GetTrcvMode функция

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);
CanIf_GetVersionInfo функция

This service returns the version information of the called CAN Interface module.

void CanIf_GetVersionInfo (Std_VersionInfoType* VersionInfo);
CanIf_Init функция

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);
CanIf_ReadRxPduData функция

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);
CanIf_RxIndication функция

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);
CanIf_SetBaudrate функция

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);
CanIf_SetDynamicTxId функция

This service reconfigures the corresponding CAN identifier of the requested CAN L-PDU.

void CanIf_SetDynamicTxId (PduIdType CanIfTxSduId, Can_IdType CanId);
CanIf_SetPduMode функция

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);
CanIf_SetTrcvMode функция

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);
CanIf_Transmit функция

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);
CanIf_TriggerTransmit функция

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);
CanIf_TxConfirmation функция

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);
CanNm_DeInit функция

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);
CanNm_GetPduData функция

Get the whole PDU data out of the most recently received NM PDU.

Std_ReturnType CanNm_GetPduData(NetworkHandleType nmChannelHandle, uint8* nmPduDataPtr);
CanNm_GetState функция

Returns the state and the mode of the network management.

Std_ReturnType CanNm_GetState(NetworkHandleType nmChannelHandle, Nm_StateType* nmStatePtr, Nm_ModeType* nmModePtr);
CanNm_GetUserData функция

Get user data out of the most recently received NM PDU.

Std_ReturnType CanNm_GetUserData(NetworkHandleType nmChannelHandle, uint8* nmUserDataPtr);
CanNm_GetVersionInfo функция

This service returns the version information of this module.

void CanNm_GetVersionInfo(Std_VersionInfoType* versioninfo);
CanNm_Init функция

Initialize the Can Nm module.

void CanNm_Init(const CanNm_ConfigType* cannmConfigPtr);
CanNm_MainFunction функция

Main function of the Can Nm which processes the algorithm describes in that document.

void CanNm_MainFunction(void);
CanNm_NetworkRelease функция

Release the network, since ECU doesn't have to communicate on the bus.

Std_ReturnType CanNm_NetworkRelease(NetworkHandleType nmChannelHandle);
CanNm_NetworkRequest функция

Request the network, since ECU needs to communicate on the bus.

Std_ReturnType CanNm_NetworkRequest(NetworkHandleType nmChannelHandle);
CanNm_PassiveStartUp функция

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);
CanNm_RxIndication функция

Indication of a receive d PDU from a lower layer communication interface module.

void CanNm_RxIndication(PduIdType RxPduId, const PduInfoType* PduInfoPtr);
CanNm_SetSleepReadyBit функция

Set the NM Coordinator S leep Ready bit in the Control Bit Vector

Std_ReturnType CanNm_SetSleepReadyBit(NetworkHandleType nmChannelHandle, boolean nmSleepReadyBit);
CanNm_SetUserData функция

Set user data for NM PDUs transmitted next on the bus.

Std_ReturnType CanNm_SetUserData(NetworkHandleType nmChannelHandle, const uint8* nmUserDataPtr);
CanNm_Transmit функция

Requests transmission of a PDU.

Std_ReturnType CanNm_Transmit(PduIdType TxPduId, const PduInfoType* PduInfoPtr);
CanNm_TriggerTransmit функция

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);
CanNm_TxConfirmation функция

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);
CanSM_ControllerBusOff функция

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);
CanSM_DeInit функция

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);
CanSM_GetVersionInfo функция

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);
CanSM_Init функция

This service initializes the Can SM module

void CanSM_Init(const CanSM_ConfigType* ConfigPtr);
CanSM_MainFunction функция

Scheduled function of the Can SM

void CanSM_MainFunction(void);
CanSM_RequestComMode функция

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);
CanSM_SetBaudrate функция

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); ⚠️
CanSM_SetEcuPassive функция

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);
CanSM_StopWakeupSource функция

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

CanTp_CancelReceive функция

Requests cancellation of an ongoing reception of a PDU in a lower layer transport protocol module.

Std_ReturnType CanTp_CancelReceive (PduIdType RxPduId);
CanTp_CancelTransmit функция

Requests cancellation of an ongoing transmission of a PDU in a lower layer communication module.

Std_ReturnType CanTp_CancelTransmit (PduIdType TxPduId);
CanTp_ChangeParameter функция

Request to change a specific transport protocol parameter (e.g. block size).

Std_ReturnType CanTp_ChangeParameter (PduIdType id, TPParameterType parameter, uint16 value);
CanTp_GetVersionInfo функция

This function returns the version information of the Can Tp module.

void CanTp_GetVersionInfo (Std_VersionInfoType* versioninfo);
CanTp_Init функция

This function initializes the Can Tp module.

void CanTp_Init (const CanTp_ConfigType* CfgPtr);
CanTp_MainFunction функция

The main function for scheduling the CAN TP.

void CanTp_MainFunction (void);
CanTp_ReadParameter функция

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);
CanTp_RxIndication функция

Indication of a received PDU from a lower layer communication interface module.

void CanTp_RxIndication (PduIdType RxPduId, const PduInfoType* PduInfoPtr);
CanTp_Shutdown функция

This function is called to shutdown the Can Tp module.

void CanTp_Shutdown (void);
CanTp_Transmit функция

Requests transmission of a PDU.

Std_ReturnType CanTp_Transmit (PduIdType TxPduId, const PduInfoType* PduInfoPtr);
CanTp_TxConfirmation функция

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

CanTrcv_CheckWakeFlag функция

Requests to check the status of the wakeup flag from the transceiver hardware.

Std_ReturnType CanTrcv_CheckWakeFlag (uint8 Transceiver);
CanTrcv_CheckWakeup функция

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);
CanTrcv_DeInit функция

De - initializes the Can Trcv module.

void CanTrcv_DeInit (void);
CanTrcv_GetBusWuReason функция

Gets the wakeup reason for the Transceiver and returns it in parameter Reason.

Std_ReturnType CanTrcv_GetBusWuReason (uint8 Transceiver, CanTrcv_TrcvWakeupReasonType* reason);
CanTrcv_GetOpMode функция

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);
CanTrcv_GetVersionInfo функция

Gets the version of the module and returns it in Version Info.

void CanTrcv_GetVersionInfo (Std_VersionInfoType* versioninfo);
CanTrcv_Init функция

Initializes the Can Trcv module.

void CanTrcv_Init (const CanTrcv_ConfigType* ConfigPtr);
CanTrcv_MainFunction функция

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);
CanTrcv_SetOpMode функция

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);
CanTrcv_SetWakeupMode функция

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);
CanXL_ReleaseRxBuffer функция

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

Can_TTAckTimeMark функция

Acknowledges the time mark interrupt by resetting the flag in the interrupt vector register.

void Can_TTAckTimeMark(uint8 Controller);
Can_TTCancelTimeMark функция

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 current values for the global, local and cycle time and the cycle count of the controller

void Can_TTGetControllerTime(uint8 Controller, Can_TTTimeType* Can_TTGlobalTime, Can_TTTimeType* Can_TTLocalTime, Can_TTTimeType* Can_TTCycleTime, uint8* Can_TTCycleCount);
Can_TTGetErrorLevel функция

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);
Can_TTGetMasterState функция

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);
Can_TTGetNTUActual функция

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);
Can_TTGetSyncQuality функция

Gets the synchronization quality.

void Can_TTGetSyncQuality(uint8 Controller, boolean* Can_TTClockSpeed, boolean* Can_TTGlobalTimePhase);

Gets the IRQ status of the time mark.

void Can_TTGetTimeMarkIRQStatus(uint8 Controller, boolean* Can_TTIRQStatus);
Can_TTGlobalTimePreset функция

Sets the value of "global time preset".

void Can_TTGlobalTimePreset(uint8 Controller, Can_TTTimeType Can_TTGlobalTimePreset);
Can_TTMainFunction_IRQ функция

Polls the interrupt flags specific to TTCAN

void Can_TTMainFunction_IRQ(void);
Can_TTReceive функция

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);
Can_TTSetEndOfGap функция

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);
Can_TTSetNextIsGap функция

Sets the "Next_is_Gap" bit.

void Can_TTSetNextIsGap(uint8 Controller);
Can_TTSetNTUAdjust функция

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);
Can_TTSetTimeCommand функция

Adjusts the global time at the beginning of the next basic cycle by the amount of "global time preset"

void Can_TTSetTimeCommand(uint8 Controller);
Can_TTSetTimeMark функция

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);
CanIf_TTAckTimeMark функция

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);
CanIf_TTCancelTimeMark функция

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);
CanIf_TTGap функция

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);
CanIf_TTGetErrorLevel функция

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);
CanIf_TTGetMasterState функция

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);
CanIf_TTGetNTUActual функция

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);
CanIf_TTGetSyncQuality функция

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);
CanIf_TTSetEndOfGap функция

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);
CanIf_TTSetNextIsGap функция

Sets the "Next_is_Gap" bit.

Std_ReturnType CanIf_TTSetNextIsGap(uint8 ControllerId);
CanIf_TTSetNTUAdjust функция

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);
CanIf_TTSetTimeCommand функция

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);
CanIf_TTSetTimeMark функция

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);
CanIf_TTSevereError функция

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);
CanIf_TTStartOfCycle функция

Reports the start of a basic cycle.

Std_ReturnType CanIf_TTStartOfCycle(uint8 ControllerId, uint8 CanIf_TTCycleCount);
CanIf_TTTimeDisc функция

Reports a time discontinuity.

Std_ReturnType CanIf_TTTimeDisc(uint8 ControllerId);
CanIf_TTTimingError функция

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)

Руководство по кластеруСОЗДАНО ИИ

Предоставляет аппаратные драйверы, абстракцию интерфейсов, сегментацию и управление трансивером для CAN.
СОЗДАНО ИИ не проверено Модель: claude-opus-5-5 · Усилие: high · Температура: не регулируется · Промпт: fa3308e420a5 Происхождение Открытые вопросы (2)
Причинный якорь: R20-11 Действует с R20-11 Заново синтезировано для этой версии спецификации.
переведено с немецкого руководстваgemini-3.8-flash-low · 2026-10-13 · Немецкий оригинал

Предоставляет аппаратные драйверы, абстракцию интерфейсов, сегментацию и управление трансивером для CAN.

Кластер объединяет драйвер CAN, CAN Interface, транспортный протокол согласно ISO 15765-2 и драйвер трансивера в нижнюю часть коммуникационного стека CAN. Верхние уровни отправляют данные через CanIf_Transmit(). CanIf отображает L-PDU на аппаратные объекты, буферизует их при занятом оборудовании и распределяет сообщения о приеме и подтверждении [SWS_CANIF_00005]. CanTp сегментирует большие сообщения и пошагово забирает данные через PduR [SWS_CanTp_00086]. Отправка выполняется только тогда, когда контроллер находится в состоянии CAN_CS_STARTED и PDU-канал готов к отправке; режимами управляет CanSM через CanIf.

Кластер формирует нижнюю часть коммуникационного стека CAN. Can управляет контроллерами и почтовыми ящиками (Mailboxes), CanIf абстрагирует драйверы, контроллеры и трансиверы, CanTp выполняет сегментацию согласно ISO 15765-2, а CanTrcv управляет режимами работы трансивера. CanIf обращается к аппаратным буферам только через сервисы драйвера [SWS_CANIF_00023]. Для верхних уровней он предоставляет единые диапазоны для ControllerId и TransceiverId [SWS_CANIF_00653] [SWS_CANIF_00655].

architektur cluster_obere Obere Schichten cluster_can Cluster CAN Communication PduR PduR CanTp CanTp (ISO 15765-2) PduR->CanTp CanTp_Transmit CanIf CanIf PduR->CanIf CanIf_Transmit CanSM CanSM CanSM->CanIf CanIf_SetControllerMode / CanIf_SetTrcvMode EcuM EcuM EcuM->CanIf CanIf_Init / CanIf_CheckWakeup CanTp->PduR PduR_CanTpStartOfReception / CopyRxData / CopyTxData CanTp->CanIf CanIf_Transmit Det DET CanTp->Det Det_ReportError CanIf->PduR PduR_CanIfRxIndication / PduR_CanIfTxConfirmation CanIf->CanSM CanSM_ControllerBusOff / Modusindikationen CanIf->CanTp CanTp_RxIndication / CanTp_TxConfirmation Can Can CanIf->Can Can_Write / Can_SetControllerMode CanTrcv CanTrcv CanIf->CanTrcv CanTrcv_SetOpMode / CanTrcv_GetBusWuReason CanIf->Det Det_ReportError Can->CanIf CanIf_RxIndication / CanIf_TxConfirmation / CanIf_ControllerBusOff Can->Det Det_ReportError CanTrcv->CanIf CanIf_TrcvModeIndication CanTrcv->Det Det_ReportError Dem DEM CanTrcv->Dem Dem_SetEventStatus

Контекстная диаграмма: CanIf выступает посредником между PduR, CanTp, CanSM и EcuM с одной стороны и драйверами Can и CanTrcv — с другой. Источники: [SWS_CANIF_00005] [SWS_CANIF_00006] [SWS_CANIF_00358]

При отправке CanIf_Transmit() вызывает Can_Write() с соответствующим HTH [SWS_CANIF_00318]. Если драйвер возвращает CAN_BUSY, CanIf буферизует L-PDU [SWS_CANIF_00381]. Во время подтверждения отправки он отправляет следующую буферизованную запись с наивысшим приоритетом [SWS_CANIF_00668]. Принятые L-PDU проходят в CanIf программную фильтрацию и проверку длины данных перед тем, как CanIf перенаправит их в CanTp или PduR [SWS_CANIF_00389] [SWS_CANIF_00390]. CanTp сам не буферизует полезные данные, а забирает их через PduR_CanTpCopyTxData() или передает через PduR_CanTpCopyRxData() [SWS_CanTp_00086] [SWS_CanTp_00269].

Тракт отправки с буферизацией в CanIfObere Schicht (PduR/CanTp)CanIfCanCAN-ControllerCanIf_Transmit(TxPduId, PduInfoPtr)Определить HTH для TxPduId,проверить режим контроллера и PDUCan_Write(Hth, PduInfo)altHardware-Sendeobjekt freiL-PDU kopieren,Sendeanforderung setzenE_OKE_OKkein Sendeobjekt freiCAN_BUSYПоместить L-PDU в CanIfTxBufferE_OKUse Case: Отправка выполнена успешно (прерывание передачи или Can_MainFunction_Write)Отправка подтвержденаCanIf_TxConfirmation(CanTxPduId)optИмеется буферизованная L-PDU для этого HTHCan_Write() для L-PDUс наивысшим приоритетомE_OKНемедленно удалить L-PDU из буфера<User_TxConfirmation>(TxPduId, E_OK)

Диаграмма последовательности: прямая отправка или буферизация при CAN_BUSY с последующей досылкой из буфера в CanIf_TxConfirmation. Источники: [SWS_CANIF_00381] [SWS_CANIF_00183]

Can работает по прерываниям или по опросу через свои MainFunctions [SWS_Can_00225] [SWS_Can_00226]. CanTp_RxIndication() должна допускать вызов в контексте прерывания [SWS_CanTp_00235], в то время как CanTp_MainFunction() контролирует таймауты протокола [SWS_CanTp_00164]. CanIf защищает общие буферы от вытесняющего доступа [SWS_CANIF_00064].

После инициализации все каналы CanIf находятся в состоянии CANIF_OFFLINE [SWS_CANIF_00864]. CanSM переключает контроллеры через CanIf_SetControllerMode() [SWS_CANIF_00308]. Состояние SLEEP принудительно устанавливает CANIF_OFFLINE, STOPPED или BusOff принудительно устанавливают CANIF_TX_OFFLINE [SWS_CANIF_00865] [SWS_CANIF_00866]. О BusOff модуль CanIf сообщает в CanSM [SWS_CANIF_00724]. Ошибки направляются в DET; CanTrcv дополнительно сообщает CANTRCV_E_BUS_ERROR в DEM [SWS_CanTrcv_00206]. CanTp прерывает сессии при таймаутах с отрицательным подтверждением [SWS_CanTp_00310].

Системная архитектура и роль кластера

Кластер «CAN Communication» формирует нижнюю часть коммуникационного стека AUTOSAR для CAN. Он простирается от близкого к аппаратному обеспечению драйвера CAN до транспортного протокола, поверх которого работают PduR и DCM. Ядром является CAN Interface, который отвязывает верхние уровни от деталей драйвера и оборудования. Он обращается к аппаратно-специфичным коммуникационным буферам исключительно через сервисы драйвера [SWS_CANIF_00023]. Контроллеры и трансиверы нескольких экземпляров драйвера он абстрагирует через собственные диапазоны для ControllerId и TransceiverId [SWS_CANIF_00653] [SWS_CANIF_00655].

МодульРоль в кластереДоказательства
CanДоступ к CAN-контроллерам и почтовым ящикам (Mailboxes), отправка через Can_Write(), автомат состояний для каждого контроллера[SWS_Can_00233] [SWS_Can_91013]
CanIfОтображение L-PDU на HTH/HRH, программная фильтрация, буфер отправки, управление режимами контроллеров, PDU-каналов и трансиверов[SWS_CANIF_00662] [SWS_CANIF_00137]
CanTpСегментация и сборка согласно ISO 15765-2, управление потоком, несколько параллельных соединений[SWS_CanTp_00033] [SWS_CanTp_00096]
CanTrcvРежимы работы NORMAL, STANDBY и SLEEP, причины пробуждения, диагностика трансивера[SWS_CanTrcv_00102] [SWS_CanTrcv_00107]

CanIf адресует аппаратное обеспечение через два вида дескрипторов (Handles): HTH для объектов отправки и HRH для объектов приема [SWS_CANIF_00291] [SWS_CANIF_00292]. Несколько драйверов CAN модуль CanIf подключает через указатели на функции для каждого драйвера [SWS_CANIF_00378]. При обратных вызовах (Callbacks) CanIf распознает вызывающий драйвер по значению ControllerId в структуре Can_HwType CanIf с. 68. Для каждого аппаратного типа трансивера существует ровно один экземпляр CanTrcv [SWS_CanTrcv_00016].

architektur cluster_obere Obere Schichten cluster_can Cluster CAN Communication PduR PduR CanTp CanTp (ISO 15765-2) PduR->CanTp CanTp_Transmit CanIf CanIf PduR->CanIf CanIf_Transmit CanSM CanSM CanSM->CanIf CanIf_SetControllerMode / CanIf_SetTrcvMode EcuM EcuM EcuM->CanIf CanIf_Init / CanIf_CheckWakeup CanTp->PduR PduR_CanTpStartOfReception / CopyRxData / CopyTxData CanTp->CanIf CanIf_Transmit Det DET CanTp->Det Det_ReportError CanIf->PduR PduR_CanIfRxIndication / PduR_CanIfTxConfirmation CanIf->CanSM CanSM_ControllerBusOff / Modusindikationen CanIf->CanTp CanTp_RxIndication / CanTp_TxConfirmation Can Can CanIf->Can Can_Write / Can_SetControllerMode CanTrcv CanTrcv CanIf->CanTrcv CanTrcv_SetOpMode / CanTrcv_GetBusWuReason CanIf->Det Det_ReportError Can->CanIf CanIf_RxIndication / CanIf_TxConfirmation / CanIf_ControllerBusOff Can->Det Det_ReportError CanTrcv->CanIf CanIf_TrcvModeIndication CanTrcv->Det Det_ReportError Dem DEM CanTrcv->Dem Dem_SetEventStatus

Контекстная диаграмма: CanIf является центральным узлом взаимодействия между верхними уровнями (PduR, CanTp, CanSM, EcuM) и драйверами Can и CanTrcv. Источники: [SWS_CANIF_00005] [SWS_CANIF_00006] [SWS_CANIF_00358] [SWS_CANIF_00724] [SWS_CanTp_00216] [SWS_CanTrcv_00206]

Взаимодействие и пути взаимодействия

Отправка: верхний уровень вызывает CanIf_Transmit() [SWS_CANIF_00005]. CanIf определяет HTH для TxPduId и вызывает Can_Write() со структурой Can_PduType [SWS_CANIF_00318] [SWS_Can_00415]. Если Can_Write() возвращает E_OK, то и CanIf_Transmit() возвращает E_OK [SWS_CANIF_00162]. Если свободного объекта отправки нет, драйвер сообщает CAN_BUSY [SWS_Can_00039]. При включенной буферизации отправки CanIf затем помещает L-PDU в CanIfTxBuffer [SWS_CANIF_00381] [SWS_CANIF_00063] CanIf с. 138.

Подтверждение отправки: после успешной передачи Can вызывает CanIf_TxConfirmation() [SWS_CANIF_00007]. Для этого драйвер запоминает swPduHandle из Can_Write() Can с. 40. При этом CanIf проверяет, есть ли буферизованные записи для освободившегося HTH. Запись с наивысшим приоритетом согласно ISO 11898-1 он отправляет следом и немедленно удаляет ее из буфера [SWS_CANIF_00386] [SWS_CANIF_00070] [SWS_CANIF_00668] [SWS_CANIF_00183]. Затем верхний уровень получает <User_TxConfirmation>(E_OK) [SWS_CANIF_00383].

Тракт отправки с буферизацией в CanIfObere Schicht (PduR/CanTp)CanIfCanCAN-ControllerCanIf_Transmit(TxPduId, PduInfoPtr)Определить HTH для TxPduId,проверить режим контроллера и PDUCan_Write(Hth, PduInfo)altHardware-Sendeobjekt freiL-PDU kopieren,Sendeanforderung setzenE_OKE_OKkein Sendeobjekt freiCAN_BUSYПоместить L-PDU в CanIfTxBufferE_OKUse Case: Отправка выполнена успешно (прерывание передачи или Can_MainFunction_Write)Отправка подтвержденаCanIf_TxConfirmation(CanTxPduId)optИмеется буферизованная L-PDU для этого HTHCan_Write() для L-PDUс наивысшим приоритетомE_OKНемедленно удалить L-PDU из буфера<User_TxConfirmation>(TxPduId, E_OK)

Диаграмма последовательности: запрос на отправку с прямой передачей или буферизацией при CAN_BUSY и досылкой из буфера во время подтверждения отправки. Источники: [SWS_CANIF_00318] [SWS_CANIF_00381] [SWS_CANIF_00668] [SWS_CANIF_00183] CanIf с. 157

Прием: Can сообщает о принятом L-PDU через CanIf_RxIndication() [SWS_CANIF_00006]. Для BasicCAN-HRH модуль CanIf сначала выполняет программную фильтрацию, а затем проверку длины данных [SWS_CANIF_00389] [SWS_CANIF_00390] [SWS_CANIF_00663]. После этого он передает индикацию сконфигурированному получателю [SWS_CANIF_00415] [SWS_CANIF_00056], например в CanTp_RxIndication [SWS_CANIF_00448] или в PduR_CanIfRxIndication [SWS_CANIF_00442].

Транспортный протокол: CanTp_Transmit() [SWS_CanTp_00212] запускает сегментированную передачу, если данные не помещаются в один N-PDU [SWS_CanTp_00232]. CanTp сам не буферизует полезные данные, а забирает их для каждого SF, FF и CF через PduR_CanTpCopyTxData() [SWS_CanTp_00086] [SWS_CanTp_00298]. Кадры он передает через CanIf_Transmit() [SWS_CanTp_00216]. При приеме SF или FF модуль CanTp запрашивает доступный буфер с помощью PduR_CanTpStartOfReception() [SWS_CanTp_00079] [SWS_CanTp_00080]. Каждый CF он копирует с помощью PduR_CanTpCopyRxData() [SWS_CanTp_00269]. Если буфера для следующего блока недостаточно, CanTp отправляет Flow Control WAIT [SWS_CanTp_00082] [SWS_CanTp_00325] CanTp с. 37.

Трансивер: CanIf_SetTrcvMode() передает запросы режима в CanTrcv_SetOpMode() [SWS_CANIF_00358]. После переключения CanTrcv вызывает CanIf_TrcvModeIndication() [SWS_CanTrcv_00158], и CanIf пересылает уведомление в CanSM [SWS_CANIF_00712]. Точно так же CanIf_GetTrcvWakeupReason() и CanIf_SetTrcvWakeupMode() делегируют вызовы в CanTrcv [SWS_CANIF_00368] [SWS_CANIF_00372].

Синхронизация, реентерабельность и контексты задач

CanIf_Transmit() является реентерабельным для различных PduId, но не для одного и того же PduId [SWS_CANIF_00005]. CanIf должен защищать доступ к общим ресурсам от взаимного вытеснения [SWS_CANIF_00064]. В частности, это касается буферов отправки [SWS_CANIF_00033], CanId динамических L-PDU во время CanIf_SetDynamicTxId() [SWS_CANIF_00673] и буфера приема во время CanIf_ReadRxPduData() [SWS_CANIF_00199].

Can поддерживает работу по прерываниям и по опросу. В зависимости от конфигурации MainFunctions опрашивают подтверждения отправки, прием, BusOff, Wakeup и режим контроллера [SWS_Can_00225] [SWS_Can_00226] [SWS_Can_00227] [SWS_Can_00228] [SWS_Can_00368] CanIf с. 152. Поэтому функции обратного вызова (Callbacks), такие как CanIf_ControllerBusOff(), выполняются либо на уровне прерываний, либо на уровне задач CanIf с. 119. Can_DisableControllerInterrupts() и Can_EnableControllerInterrupts() действуют по принципу вложенности: каждая блокировка требует отдельного снятия [SWS_Can_00231] [SWS_Can_00232] Can с. 61.

CanTp_RxIndication() и CanTp_TxConfirmation() должны допускать вызов в контексте прерывания [SWS_CanTp_00235] [SWS_CanTp_00236]. CanTp_MainFunction() циклически обслуживает таймеры N_As, N_Bs, N_Cs, N_Ar, N_Br, N_Cr и STmin [SWS_CanTp_00213] [SWS_CanTp_00164]. Их такт определяется параметром CanTpMainFunctionPeriod [SWS_CanTp_00300]. Интерпретация: этот период, предположительно, определяет достижимое разрешение таймаутов. Вопрос Q-6ee587d8a8f38bff (открытый) Каждое соединение использует собственные буферы, таймеры и собственный автомат состояний [SWS_CanTp_00122] CanTp с. 42. CanTrcv_MainFunction() циклически проверяет шины в состояниях STANDBY и SLEEP на наличие событий пробуждения [SWS_CanTrcv_00013] [SWS_CanTrcv_00112].

Жизненные циклы и режимы работы

EcuM инициализирует CanIf с помощью CanIf_Init(), а драйверы Can и CanTrcv — отдельно каждый CanIf с. 40 [SWS_Can_00223] [SWS_CanTrcv_00001]. CanTrcv_Init() переводит каждый трансивер в зависимости от конфигурации в SLEEP или STANDBY [SWS_CanTrcv_00148]. Драйверы, используемые модулем CanTrcv, должны быть предварительно готовы [SWS_CanTrcv_00099]. После инициализации CanIf ожидает, что контроллеры находятся в состоянии STOPPED, и переключает все каналы в CANIF_OFFLINE [SWS_CANIF_00864]. Вызовы сервисов до инициализации CanIf отклоняет [SWS_CANIF_00661]. Интерпретация: поэтому Can и CanTrcv, вероятно, должны инициализироваться до CanIf. Вопрос Q-4af03fca13da9a5b (открытый) CanTp переходит с помощью CanTp_Init() из CANTP_OFF в CANTP_ON [SWS_CanTp_00027] [SWS_CanTp_00170]. Сегментация выполняется только в состоянии CANTP_ON [SWS_CanTp_00238] CanTp с. 27.

Переключением режимов управляет CanSM: CanIf_SetControllerMode() вызывает Can_SetControllerMode() [SWS_CANIF_00003] [SWS_CANIF_00308]. О завершении Can сообщает асинхронно через CanIf_ControllerModeIndication(), и CanIf пересылает это в CanSM [SWS_CANIF_00699] [SWS_CANIF_00711]. Состояниями контроллера являются UNINIT, STOPPED, STARTED и SLEEP [SWS_Can_91013] Can с. 38. Выше них располагаются режимы PDU-каналов CanIf [SWS_CANIF_00137]. CanIf_SetPduMode() принимается только в состоянии CAN_CS_STARTED [SWS_CANIF_00874]. SLEEP принудительно переводит в CANIF_OFFLINE; STOPPED или BusOff принудительно переводят в CANIF_TX_OFFLINE [SWS_CANIF_00865] [SWS_CANIF_00866].

pdukanalmodus Init CanIf_Init() OFFLINE CANIF_OFFLINE (Tx и Rx заблокированы) Init->OFFLINE Initialisierung ONLINE CANIF_ONLINE (Tx и Rx активны) OFFLINE->ONLINE CanIf_SetPduMode (только при CAN_CS_STARTED) TXOFF CANIF_TX_OFFLINE (активен только Rx) TXOFF->OFFLINE CAN_CS_SLEEP TXACT CANIF_TX_OFFLINE_ACTIVE (Rx активен, Tx только подтверждается) TXOFF->TXACT CanIf_SetPduMode TXOFF->ONLINE CanIf_SetPduMode TXACT->OFFLINE CAN_CS_SLEEP TXACT->TXOFF CAN_CS_STOPPED / BusOff TXACT->ONLINE CanIf_SetPduMode ONLINE->OFFLINE CAN_CS_SLEEP ONLINE->TXOFF CanIf_SetPduMode / CAN_CS_STOPPED / BusOff

Диаграмма состояний: режимы PDU-каналов CanIf определяются через CanIf_SetPduMode и переключением режима контроллера. Источники: [SWS_CANIF_00137] [SWS_CANIF_00864] [SWS_CANIF_00865] [SWS_CANIF_00866] [SWS_CANIF_00874] CanIf с. 61

Для пробуждения CanIf_CheckWakeup() опрашивает драйверы через Can_CheckWakeup() или CanTrcv_CheckWakeup() [SWS_CANIF_00395] [SWS_Can_00360] [SWS_CanTrcv_00143]. CanIf_CheckValidation() сообщает о событии пробуждения в <User_ValidateWakeupEvent> только в том случае, если с момента пробуждения был сохранен корректный прием [SWS_CANIF_00178] [SWS_CANIF_00179] [SWS_CANIF_00286] CanIf с. 102. При частичной работе в сети (Partial Networking) PnTxFilter после CAN_CS_SLEEP блокирует все отправки, кроме PN-Filter-PDU. Только подтверждение отправки или прием снимает блокировку [SWS_CANIF_00749] [SWS_CANIF_00750] [SWS_CANIF_00751] [SWS_CANIF_00896]. Перед переходом в режим энергосбережения CanSM сбрасывает флаг WUF через CanIf_ClearTrcvWufFlag(), чтобы не было потеряно пробуждение по кадру [SWS_CANIF_00766] [SWS_CanTrcv_00194] [SWS_CanTrcv_00195] CanTrcv с. 57. Работа модулей завершается с помощью Can_DeInit(), CanIf_DeInit() и CanTrcv_DeInit() [SWS_Can_91002] [SWS_CANIF_91002] [SWS_CanTrcv_91001].

Обработка ошибок, трассировка DET и деградация

Все модули кластера сообщают об ошибках разработки в DET. CanIf делает это, например, при недействительном TxPduId или нулевом указателе [SWS_CANIF_00319] [SWS_CANIF_00320]. При этом CanTp дополнительно возвращает E_NOT_OK [SWS_CanTp_00294]; Can и CanTrcv используют собственные коды ошибок [SWS_Can_91019] [SWS_CanTrcv_00050]. Ошибки времени выполнения касаются, среди прочего, отклоненной длины данных [SWS_CANIF_00168], попыток отправки по каналам в режиме CANIF_OFFLINE [SWS_CANIF_00382], потерянных входящих сообщений [SWS_Can_91020] и отсутствия связи с трансивером [SWS_CanTrcv_00113].

Из рассмотренных свидетельств только CanTrcv указывает запись DEM: CanTrcv_MainFunctionDiagnostics() устанавливает CANTRCV_E_BUS_ERROR в FAILED или PASSED в зависимости от флага BUSERR [SWS_CanTrcv_00218] [SWS_CanTrcv_00206] [SWS_CanTrcv_00227] CanTrcv с. 48.

О BusOff модуль Can сообщает через CanIf_ControllerBusOff() [SWS_CANIF_00218]. После этого CanIf переводит канал в режим CANIF_TX_OFFLINE и информирует CanSM [SWS_CANIF_00866] [SWS_CANIF_00724] CanIf с. 147. При переходе в состояние CAN_CS_STOPPED модуль CanIf очищает буферы отправки и подтверждает незавершенные отправки отрицательно [SWS_CANIF_00485] [SWS_CANIF_00739]. Для восстановления (Recovery) CanSM с помощью CanIf_GetTxConfirmationState() может запросить, поступало ли подтверждение отправки с момента последнего запуска контроллера [SWS_CANIF_00734] [SWS_CANIF_00740] CanIf с. 103. Состояние ошибки и счетчики ошибок можно запросить через CanIf [SWS_CANIF_91001] [SWS_Can_91003] [SWS_CANIF_91003]. Если активирована передача отчетов о событиях безопасности (Security Event Reporting), CanIf сообщает об ошибках шины, а также о событиях Error-Passive и BusOff в IdsM [SWS_CANIF_00913] [SWS_CANIF_00915] [SWS_CANIF_00917] [SWS_CANIF_00918].

Сообщение BusOff в стеке CANCAN-ControllerCanCanIfCanSMBusOff erkannt(Прерывание или Can_MainFunction_BusOff)Контроллер при необходимостиin STOPPED versetzenCanIf_ControllerBusOff(ControllerId)Канал PDU в CANIF_TX_OFFLINE,Сбросить буфер передачиoptSecurity-Event-Reporting aktiviertCANIF_SEV_ERRORSTATE_BUSOFF an IdsM meldenCanSM_ControllerBusOff(ControllerId)Use Case: Recovery durch CanSMoptCanIfPublicTxConfirmPollingSupport aktivCanIf_GetTxConfirmationState(ControllerId)CanIf_NotifStatusType

Диаграмма последовательности: сообщение BusOff передается от контроллера через Can и CanIf в CanSM; CanIf при этом блокирует путь отправки и сбрасывает буферы отправки. Источники: [SWS_CANIF_00218] [SWS_CANIF_00724] [SWS_CANIF_00866] [SWS_CANIF_00918] [SWS_CANIF_00734] CanIf с. 147

CanTp прерывает сессии при таймаутах и уведомляет верхний уровень отрицательно, например при N_As, N_Bs или N_Cr [SWS_CanTp_00310] [SWS_CanTp_00316] [SWS_CanTp_00313]. Так же CanTp поступает после WFTmax последовательных FC(WAIT) [SWS_CanTp_00223] или при FC с Overflow [SWS_CanTp_00309]. В качестве режима деградации CanIf в режиме CANIF_TX_OFFLINE_ACTIVE подтверждает отправки перед верхними уровнями без фактической отправки в шину [SWS_CANIF_00072].

Сформированное ИИ руководство на основе спецификаций AUTOSAR для модулей Can, CanIf, CanTp и CanTrcv (Classic Platform 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).

BSW ID 80 27 APIs (19 Funktionen, 8 Typen) #include "Can.h"

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).

BSW ID 60 50 APIs (47 Funktionen, 3 Typen) #include "CanIf.h"

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).

BSW ID 31 28 APIs (28 Funktionen, 0 Typen) #include "CanNm.h"

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).

BSW ID 140 21 APIs (21 Funktionen, 0 Typen) #include "CanSM.h"

CAN Transport Layer (CanTp)

Provides segmentation and reassembly of CAN messages up to 4095 bytes (ISO 15765-2).

BSW ID 35 12 APIs (11 Funktionen, 1 Typen) #include "CanTp.h"

CAN Transceiver Driver (CanTrcv)

Controls physical bus transceiver states and wakeup detection on CAN lines.

BSW ID 70 23 APIs (17 Funktionen, 6 Typen) #include "CanTrcv.h"

CAN XL Driver (CanXL)

AUTOSAR Classic Communication Drivers-Modul CAN XL Driver (CanXL, Spezifikation: AUTOSAR_CP_SWS_CANXLDriver.pdf, AUTOSAR_SWS_CANXLDriver.pdf).

BSW ID 85 2 APIs (2 Funktionen, 0 Typen) #include "CanXL.h"

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).

BSW ID 72 Keine C-API · 0 Records #include "CanXLTrcv.h"

TTCAN Driver (Ttcan)

AUTOSAR Classic Communication Drivers-Modul TTCAN Driver (Ttcan, Spezifikation: AUTOSAR_CP_SWS_TTCANDriver.pdf, AUTOSAR_SWS_TTCANDriver.pdf).

BSW ID 84 26 APIs (19 Funktionen, 7 Typen) #include "Ttcan.h"

TTCAN Interface (TtcanIf)

AUTOSAR Classic Communication HW Abstraction-Modul TTCAN Interface (TtcanIf, Spezifikation: AUTOSAR_CP_SWS_TTCANInterface.pdf, AUTOSAR_SWS_TTCANInterface.pdf).

BSW ID 66 36 APIs (26 Funktionen, 10 Typen) #include "TtcanIf.h"