CAN Transceiver Driver (CanTrcv)
Controls physical bus transceiver states and wakeup detection on CAN lines.
Funktionen — Übersicht
void CanTrcv_Init (const CanTrcv_ConfigType* ConfigPtr);Initializes the Can Trcv module.Std_ReturnType CanTrcv_SetOpMode (uint8 Transceiver, CanTrcv_TrcvModeType OpMode);Sets the mode of the Transceiver to the value Op Mode.Std_ReturnType CanTrcv_GetOpMode (uint8 Transceiver, CanTrcv_TrcvModeType* OpMode);Gets the mode of the Transceiver and returns it in Op Mode.Std_ReturnType CanTrcv_GetBusWuReason (uint8 Transceiver, CanTrcv_TrcvWakeupReasonType* reason);Gets the wakeup reason for the Transceiver and returns it in parameter Reason.void CanTrcv_GetVersionInfo (Std_VersionInfoType* versioninfo);Gets the version of the module and returns it in Version Info.Std_ReturnType CanTrcv_SetWakeupMode (uint8 Transceiver, CanTrcv_TrcvWakeupModeType TrcvWakeupMode);En ables, disables or clears wake - up events of the Transceiver according to Trcv Wakeup Mode.Std_ReturnType CanTrcv_GetTrcvSystemData (uint8 Transceiver, uint32* TrcvSysData);Reads the transceiver configuration/ status data and returns it through parameter Trcv Sys Data.Std_ReturnType CanTrcv_ClearTrcvWufFlag (uint8 Transceiver);Clears the WUF flag in the transceiver hardware.Std_ReturnType CanTrcv_ReadTrcvTimeoutFlag (uint8 Transceiver, CanTrcv_TrcvFlagStateType* FlagState);Reads the status of the tim eout flag from the transceiver hardware.Std_ReturnType CanTrcv_ClearTrcvTimeoutFlag (uint8 Transceiver);Clears the status of the timeout flag in the transceiver hardware.Std_ReturnType CanTrcv_ReadTrcvSilenceFlag (uint8 Transceiver, CanTrcv_TrcvFlagStateType* FlagState);Reads the status of the silence flag from the transceiver hardware.Std_ReturnType CanTrcv_CheckWakeup (uint8 Transceiver);Service is called by underlying CANIF in case a wake up interrupt is detected.Std_ReturnType CanTrcv_SetPNActivationState (CanTrcv_PNActivationType ActivationState);The API configures the wake - up of the transceiver for Standby and Sleep Mode: Either the CAN transceiver is woken up by a...Std_ReturnType CanTrcv_CheckWakeFlag (uint8 Transceiver);Requests to check the status of the wakeup flag from the transceiver hardware.void CanTrcv_DeInit (void);De - initializes the Can Trcv module.void CanTrcv_MainFunction (void);Service to scan all busses for wake up events and perform these event.void CanTrcv_MainFunctionDiagnostics (void);Reads the transceiver diagnostic status periodically and sets product/ development accordingly.
Typen — Übersicht
struct CanTrcv_ConfigTypeThis is the type of the external data structure containing the overall initialization data for the CAN transceiver driver and...CanTrcv_PNActivationTypeDatatype used for describing whether PN wakeup functionality in Can Trcv is enabled or disabled.enum CanTrcv_TrcvFlagStateTypeProvides the state of a flag in the transceiver hardware.enum CanTrcv_TrcvModeTypeOperating modes of the CAN Transceiver Driver.enum CanTrcv_TrcvWakeupModeTypeThis type shall be used to control the CAN transceiver concerning wake up events and wake up notifications.enum CanTrcv_TrcvWakeupReasonTypeThis type denotes the wake up reason detected by the CAN transceiver in detail.
Funktionen & Typen — Detailansicht
function CanTrcv_Init [SWS_CanTrcv_00001] 📄 PDF
void CanTrcv_Init (const CanTrcv_ConfigType* ConfigPtr);
Initializes the Can Trcv module.
Usage and Semantics
The function CanTrcv_Init serves for the basic initialization of the CanTrcv module as well as all connected CAN transceivers [SWS_CanTrcv_00001] [SWS_CanTrcv_00180]. Execution is synchronous and specified as non-reentrant [SWS_CanTrcv_00001]. As a parameter, it expects a pointer to the driver configuration via ConfigPtr and has no return value [SWS_CanTrcv_00001].
Interaction and Hardware Check
During execution, the function performs the hardware-related initialization sequences of all connected transceivers according to the configuration, thereby supporting the initialization sequence of the AUTOSAR stack [SWS_CanTrcv_00180]. Upon the call, each transceiver transitions separately into either mode CANTRCV_TRCVMODE_SLEEP or CANTRCV_TRCVMODE_STANDBY, depending on its respective configuration [SWS_CanTrcv_00148]. If supported by the hardware, CanTrcv_Init also checks whether a wake-up event due to transceiver activity was previously present and reports this via EcuM_SetWakeupEvent with the source defined via CanTrcvWakeupSourceRef to the EcuM [SWS_CanTrcv_00167].
Error handling
In the event of faulty or missing communication with the hardware (for example via port pins or SPI), the function reports the runtime error CANTRCV_E_NO_TRCV_CONTROL to the Default Error Tracer [SWS_CanTrcv_00113]. If development error detection is active, CANTRCV_E_BAUDRATE_NOT_SUPPORTED is furthermore reported if a configured baud rate is not supported by the respective transceiver [SWS_CanTrcv_00168].
This text was generated by an AI based on the AUTOSAR R20-11 specification.
Implementer's Guide to follow (complexity I1)
function CanTrcv_SetOpMode [SWS_CanTrcv_00002] 📄 PDF
Std_ReturnType CanTrcv_SetOpMode (uint8 Transceiver, CanTrcv_TrcvModeType OpMode);
Sets the mode of the Transceiver to the value Op Mode.
The function CanTrcv_SetOpMode is used to asynchronously switch the operating mode of a CAN transceiver [SWS_CanTrcv_00002]. It takes the device number of the transceiver (Transceiver) as well as the desired target mode (OpMode), which can assume the values CANTRCV_TRCVMODE_NORMAL, CANTRCV_TRCVMODE_STANDBY, or CANTRCV_TRCVMODE_SLEEP [SWS_CanTrcv_00102]. The function is reentrant for different transceivers [SWS_CanTrcv_00002]. The return value E_OK confirms acceptance of the mode switch request; E_NOT_OK signals rejection of the request, parameter errors, or lack of support for the mode by the hardware [SWS_CanTrcv_00002], [SWS_CanTrcv_00105].
When calling, specified state transitions must be observed:
- If the transceiver is in mode
CANTRCV_TRCVMODE_NORMAL, onlyCANTRCV_TRCVMODE_STANDBYorCANTRCV_TRCVMODE_NORMALmay be passed as the target mode [SWS_CanTrcv_00103]. - If the transceiver is in
CANTRCV_TRCVMODE_STANDBY, the function may only be called withCANTRCV_TRCVMODE_SLEEPorCANTRCV_TRCVMODE_STANDBY[SWS_CanTrcv_00104].
With Development Error Detection (DET) enabled, the function reports calls prior to initialization as CANTRCV_E_UNINIT [SWS_CanTrcv_00122], invalid transceiver numbers as CANTRCV_E_INVALID_TRANSCEIVER [SWS_CanTrcv_00123], and impermissible operating modes as CANTRCV_E_PARAM_TRCV_OPMODE [SWS_CanTrcv_00087]. If Standby is requested without the transceiver being in Normal or Standby, CANTRCV_E_TRCV_NOT_NORMAL is triggered [SWS_CanTrcv_00120]; upon requesting Sleep outside of Standby or Sleep, the notification CANTRCV_E_TRCV_NOT_STANDBY occurs [SWS_CanTrcv_00121]. If the DET is disabled, E_NOT_OK is returned in these cases. In the event of missing or faulty transceiver communication, the runtime error CANTRCV_E_NO_TRCV_CONTROL is reported to the DET and E_NOT_OK is returned [SWS_CanTrcv_00114].
If Selective Wakeup is supported on the hardware side, the API checks the status flags POR and SYSERR [SWS_CanTrcv_00186]. As soon as the transceiver has reached the requested mode, the module informs the upper layer via the callback CanIf_TrcvModeIndication [SWS_CanTrcv_00158].
This text was generated by an AI based on the specification requirements.
Implementer's Guide to follow (complexity I2)
function CanTrcv_GetOpMode [SWS_CanTrcv_00005] 📄 PDF
Std_ReturnType CanTrcv_GetOpMode (uint8 Transceiver, CanTrcv_TrcvModeType* OpMode);
Gets the mode of the Transceiver and returns it in Op Mode.
function CanTrcv_GetBusWuReason [SWS_CanTrcv_00007] 📄 PDF
Std_ReturnType CanTrcv_GetBusWuReason (uint8 Transceiver, CanTrcv_TrcvWakeupReasonType* reason);
Gets the wakeup reason for the Transceiver and returns it in parameter Reason.
function CanTrcv_GetVersionInfo [SWS_CanTrcv_00008] 📄 PDF
void CanTrcv_GetVersionInfo (Std_VersionInfoType* versioninfo);
Gets the version of the module and returns it in Version Info.
function CanTrcv_SetWakeupMode [SWS_CanTrcv_00009] 📄 PDF
Std_ReturnType CanTrcv_SetWakeupMode (uint8 Transceiver, CanTrcv_TrcvWakeupModeType TrcvWakeupMode);
En ables, disables or clears wake - up events of the Transceiver according to Trcv Wakeup Mode.
Usage and Semantics
The synchronous function CanTrcv_SetWakeupMode is used to enable, disable, or clear wake-up events for a specific transceiver [SWS_CanTrcv_00009]. The target transceiver is passed to it via parameter Transceiver and the desired mode via TrcvWakeupMode. Upon successful state change, the function returns E_OK. If the state cannot be changed or if a parameter is invalid, E_NOT_OK is returned and the previous state remains unchanged [SWS_CanTrcv_00009].
Operating Modes and Interaction
If TrcvWakeupMode is called with the value CANTRCV_WUMODE_CLEAR, the function clears a stored wake-up event of the addressed transceiver [SWS_CanTrcv_00094]. When called with CANTRCV_WUMODE_ENABLE, the module updates the wake-up event to the state "present", provided that a stored wake-up event is already pending for the respective bus [SWS_CanTrcv_00111]. Interpretation: A corresponding mode value presumably exists analogously for disabling wake-up events, even though this is not detailed separately in the present excerpt of requirements. Question Q-e0f15d1d0855db81 (open)
Error Handling and Concurrency
The function is reentrant for different transceiver instances [SWS_CanTrcv_00009]. Before the call, the transceiver driver must be fully initialized: a call in the uninitialized state triggers the error CANTRCV_E_UNINIT if Development Error Detection (DET) is active; otherwise, E_NOT_OK is returned [SWS_CanTrcv_00127]. An invalid index for Transceiver leads to CANTRCV_E_INVALID_TRANSCEIVER (or E_NOT_OK) [SWS_CanTrcv_00131], and an invalid mode value in TrcvWakeupMode reports CANTRCV_E_PARAM_TRCV_WAKEUP_MODE or returns E_NOT_OK [SWS_CanTrcv_00089]. If there is no communication or faulty communication with the transceiver, the runtime error CANTRCV_E_NO_TRCV_CONTROL is reported to the Default Error Tracer and E_NOT_OK is returned [SWS_CanTrcv_00117].
This usage note was generated automatically based on the specification of AUTOSAR Classic R20-11.
Implementer's Guide to follow (complexity I2)
function CanTrcv_GetTrcvSystemData [SWS_CanTrcv_00213] 📄 PDF
Std_ReturnType CanTrcv_GetTrcvSystemData (uint8 Transceiver, uint32* TrcvSysData);
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.
function CanTrcv_ClearTrcvWufFlag [SWS_CanTrcv_00214] 📄 PDF
Std_ReturnType CanTrcv_ClearTrcvWufFlag (uint8 Transceiver);
Clears the WUF flag in the transceiver hardware. This API shall exist only if Can Trcv Hw Pn Support = TRUE.
The synchronous function CanTrcv_ClearTrcvWufFlag clears the wake-up frame flag (WUF) in the hardware of the addressed CAN transceiver and is only available if selective wakeup support is configured (CanTrcvHwPnSupport = TRUE) [SWS_CanTrcv_00214], [SWS_CanTrcv_00175]. Upon successful clearing, E_OK is returned; otherwise, E_NOT_OK is returned [SWS_CanTrcv_00214], [SWS_CanTrcv_00194].
Interaction and Sequence
The API is used by module CanSM when entering a low-power mode to ensure that no frame wake-up event is lost during the state transition [SWS_CanTrcv_00194]. After clearing the WUF flag, the CAN transceiver must be set to standby mode (CANTRCV_STANDBY) [SWS_CanTrcv_00194].
Concurrency and Call Context
Calls to CanTrcv_ClearTrcvWufFlag are reentrant for different transceiver instances (Transceiver) [SWS_CanTrcv_00214].
Error handling
- Development errors (DET): If error detection is active, the function reports error
CANTRCV_E_UNINIT[SWS_CanTrcv_00197] if the driver is uninitialized, and errorCANTRCV_E_INVALID_TRANSCEIVER[SWS_CanTrcv_00198] if parameterTransceiveris invalid. If DET is disabled,E_NOT_OKis returned directly in these cases [SWS_CanTrcv_00197], [SWS_CanTrcv_00198]. - Runtime errors: If communication with the transceiver fails or is faulty, the function reports runtime error
CANTRCV_E_NO_TRCV_CONTROLto the Default Error Tracer and returnsE_NOT_OK[SWS_CanTrcv_00196].
This usage note was generated automatically based on the AUTOSAR specification R20-11.
Implementer's Guide to follow (complexity I1)
function CanTrcv_ReadTrcvTimeoutFlag [SWS_CanTrcv_00215] 📄 PDF
Std_ReturnType CanTrcv_ReadTrcvTimeoutFlag (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.
The synchronous function CanTrcv_ReadTrcvTimeoutFlag reads the status of the timeout flag directly from the hardware of the CAN transceiver [SWS_CanTrcv_00215]. The input parameter Transceiver serves to identify the transceiver to be addressed, while the state of the flag is returned via the output parameter FlagState of type CanTrcv_TrcvFlagStateType* [SWS_CanTrcv_00215]. With E_OK, the return value signals successful reading and with E_NOT_OK that the status of the timeout flag could not be determined [SWS_CanTrcv_00215].
The following boundary conditions apply to the usage and integration in the transceiver driver:
-
Configuration: The API is available exclusively if hardware support for partial networking is enabled (
CanTrcvHwPnSupport = TRUE) [SWS_CanTrcv_00215]. The associated configuration containerCanTrcvPartialNetworkalso exists only under this prerequisite [SWS_CanTrcv_00175]. -
Concurrency: The function is specified as non-reentrant (
Non Reentrant) [SWS_CanTrcv_00215].
Error handling distinguishes according to the state of Development Error Detection (DET):
-
If an invalid transceiver identifier is passed, the module generates the error
CANTRCV_E_INVALID_TRANSCEIVERwhen DET is active; if DET is disabled,E_NOT_OKis returned instead [SWS_CanTrcv_00199]. -
If a null pointer is passed for
FlagState(FlagState = NULL), the module reports the errorCANTRCV_E_PARAM_POINTERwhen DET is active; if DET is turned off, the call yieldsE_NOT_OK[SWS_CanTrcv_00200].
This usage note was generated automatically based on the AUTOSAR CP R20-11 specification.
Implementer's Guide to follow (complexity I2)
function CanTrcv_ClearTrcvTimeoutFlag [SWS_CanTrcv_00216] 📄 PDF
Std_ReturnType CanTrcv_ClearTrcvTimeoutFlag (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.
The synchronous function CanTrcv_ClearTrcvTimeoutFlag is used to reset the timeout flag in the transceiver hardware [SWS_CanTrcv_00216]. It is available exclusively if hardware support for Partial Networking is enabled via the configuration parameter CanTrcvHwPnSupport = TRUE [SWS_CanTrcv_00175], [SWS_CanTrcv_00216].
Usage and Interface
The call is made synchronously via the interface in CanTrcv.h by specifying the target transceiver:
- Parameters: As an input value (
uint8),Transceiverspecifies the transceiver channel to be addressed [SWS_CanTrcv_00216]. - Return value: A
Std_ReturnTypesignals withE_OKthe successful clearing of the hardware flag or withE_NOT_OKa failure of the operation [SWS_CanTrcv_00216].
Error handling
If an invalid identifier is passed to the function for the parameter Transceiver, a differentiated error handling applies:
- With Development Error Detection active, the error
CANTRCV_E_INVALID_TRANSCEIVERis reported to the DET [SWS_CanTrcv_00201]. - If Development Error Detection is disabled, the call terminates and returns
E_NOT_OKto the caller [SWS_CanTrcv_00201].
Concurrency and system integration
The function is classified as non-reentrant (Non Reentrant) [SWS_CanTrcv_00216]. Parallel calls for the same hardware unit must therefore be avoided or synchronized by the calling layer. In addition, the function is part of the functional scope for selective wakeup functions (Partial Networking); the associated configuration structures in the container CanTrcvPartialNetwork also exist only if CanTrcvHwPnSupport is set [SWS_CanTrcv_00175].
This usage note is based on the AUTOSAR CP R20-11 specification.
Implementer's Guide to follow (complexity I1)
function CanTrcv_ReadTrcvSilenceFlag [SWS_CanTrcv_00217] 📄 PDF
Std_ReturnType CanTrcv_ReadTrcvSilenceFlag (uint8 Transceiver, CanTrcv_TrcvFlagStateType* FlagState);
Reads the status of the silence flag from the transceiver hardware. This API shall exi st only if Can Trcv Hw Pn Support = TRUE.
The synchronous and non-reentrant function CanTrcv_ReadTrcvSilenceFlag (service ID 0x0d) is used to read the silence flag status directly from the CAN transceiver hardware [SWS_CanTrcv_00217]. It is provided via the header CanTrcv.h and must not be executed concurrently due to the lack of reentrancy [SWS_CanTrcv_00217].
Parameters and Return Values
Transceiver: Input parameter (uint8) for addressing the respective transceiver instance via its identifier [SWS_CanTrcv_00217].FlagState: Output parameter as a pointer toCanTrcv_TrcvFlagStateTypevia which the read status of the silence flag is returned [SWS_CanTrcv_00217].- Return value (
Std_ReturnType): ReturnsE_OKif the hardware state of the silence flag could be read successfully, otherwiseE_NOT_OK[SWS_CanTrcv_00217].
Error handling
If a null pointer is passed to the function for the output parameter (FlagState == NULL), error handling depends on development error detection: with DET enabled, the CAN transceiver driver reports the development error CANTRCV_E_PARAM_POINTER; if DET is disabled, the call is immediately aborted with E_NOT_OK [SWS_CanTrcv_00203].
Configuration and Interaction
The function is in the context of Selective Wakeup. The associated configuration container CanTrcvPartialNetwork and the interface CanTrcv_ReadTrcvSilenceFlag are available in the driver only if hardware support for Partial Networking is configured via CanTrcvHwPnSupport = TRUE [SWS_CanTrcv_00175], [SWS_CanTrcv_00217].
This usage note was generated automatically based on the AUTOSAR specification R20-11.
Implementer's Guide to follow (complexity I1)
function CanTrcv_CheckWakeup [SWS_CanTrcv_00143] 📄 PDF
Std_ReturnType CanTrcv_CheckWakeup (uint8 Transceiver);
Service is called by underlying CANIF in case a wake up interrupt is detected.
The synchronous and reentrant function CanTrcv_CheckWakeup is called by the underlying interface CanIf as soon as a wake-up interrupt has been detected [SWS_CanTrcv_00143]. The parameter Transceiver addresses the CAN transceiver to be checked [SWS_CanTrcv_00143]. The return value E_OK indicates acceptance of the call, whereas E_NOT_OK indicates non-acceptance [SWS_CanTrcv_00143].
If supported by hardware, the function checks whether a wake-up event due to activity on the transceiver is actually present [SWS_CanTrcv_00146]. If this is the case, the wake-up notification to the EcuM is made via the API EcuM_SetWakeupEvent with the wake-up source referenced in CanTrcvWakeupSourceRef [SWS_CanTrcv_00146].
For error handling, the following specifications apply when development error detection (DET) is activated:
- If the function is called before the initialization of the CanTrcv module, the development error
CANTRCV_E_UNINITis reported; if DET is disabled, the call returnsE_NOT_OKinstead [SWS_CanTrcv_00144]. - If an invalid transceiver number is passed, the function reports
CANTRCV_E_INVALID_TRANSCEIVER; if DET is disabled,E_NOT_OKis returned [SWS_CanTrcv_00145].
This usage note is based exclusively on the specification requirements of AUTOSAR Classic R20-11.
Implementer's Guide to follow (complexity I1)
function CanTrcv_SetPNActivationState [SWS_CanTrcv_00219] 📄 PDF
Std_ReturnType CanTrcv_SetPNActivationState (CanTrcv_PNActivationType ActivationState);
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.
The synchronous function CanTrcv_SetPNActivationState configures the wake-up behavior of the CAN transceiver for Standby and Sleep mode ([SWS_CanTrcv_00219]). It defines whether the transceiver is woken up via a standard wake-up pattern or specifically via a configured remote wake-up frame in the context of Partial Networking ([SWS_CanTrcv_00219]).
Usage and Parameters
The function is provided via CanTrcv.h with the service ID 0x0f and is executed synchronously ([SWS_CanTrcv_00219]). Its passing parameter ActivationState of type CanTrcv_PNActivationType controls the operating mode:
PN_ENABLED: Enables the PN wakeup functionality in the CAN transceiver ([SWS_CanTrcv_00219]).PN_DIABLED: Disables the PN wakeup functionality ([SWS_CanTrcv_00219]).
As the return value, the function returns E_OK if the transceiver was successfully switched to the requested PN configuration. If switching fails, E_NOT_OK is returned; in this case, the previous configuration remains unchanged ([SWS_CanTrcv_00219]).
Restrictions and Error Handling
The function is non-reentrant (Non Reentrant) ([SWS_CanTrcv_00219]). As a mandatory precondition, the module CanTrcv must have been completely initialized prior to the call: if the call occurs prior to initialization, the function reports the error CANTRCV_E_UNINIT to the DET when Development Error Detection is active; if DET is disabled, the call is rejected immediately with the return value E_NOT_OK ([SWS_CanTrcv_00220]).
This usage note was generated automatically based on the specification.
Implementer's Guide to follow (complexity I1)
function CanTrcv_CheckWakeFlag [SWS_CanTrcv_00223] 📄 PDF
Std_ReturnType CanTrcv_CheckWakeFlag (uint8 Transceiver);
Requests to check the status of the wakeup flag from the transceiver hardware.
The function CanTrcv_CheckWakeFlag requests the check of the wakeup flag status directly from the transceiver hardware ([SWS_CanTrcv_00223]). The call is asynchronous and refers via the input parameter Transceiver to the respective identifier of the CAN transceiver to be addressed ([SWS_CanTrcv_00223]).
As return value, the function provides the status Std_ReturnType ([SWS_CanTrcv_00223]):
E_OK: The request to check the wakeup flag was accepted successfully ([SWS_CanTrcv_00223]).E_NOT_OK: The request was rejected ([SWS_CanTrcv_00223]).
Regarding concurrency, it is specified that the function is not reentrant (Non Reentrant) ([SWS_CanTrcv_00223]). Since the service is specified as asynchronous, the return value merely reflects the acceptance of the verification request; the actual reading of the hardware is likely performed downstream ([SWS_CanTrcv_00223]). Question Q-f09b7ff49c24cea8 (open) Specific error codes as well as DET or DEM messages are not listed for this service.
This usage note was generated by an AI based on the AUTOSAR specification.
Implementer's Guide to follow (complexity I1)
function CanTrcv_DeInit [SWS_CanTrcv_91001] 📄 PDF
void CanTrcv_DeInit (void);
De - initializes the Can Trcv module.
The synchronous function CanTrcv_DeInit serves to de-initialize the CAN transceiver driver [SWS_CanTrcv_91001]. It takes no parameters, returns no value, and is specified as non-reentrant (Non Reentrant) [SWS_CanTrcv_91001]. The interface is provided via the header CanTrcv.h with service ID 0x10 [SWS_CanTrcv_91001].
During execution, the function puts the CAN transceiver hardware into state NOT_ACTIVE [SWS_CanTrcv_91003]. Since CanTrcv_DeInit is non-reentrant, calls must not interrupt each other or execute concurrently [SWS_CanTrcv_91001].
Regarding error handling and sequencing conditions, the following applies:
- If development error detection is enabled for the module, the function checks the operating mode of the transceiver. If the transceiver is not in mode
CANTRCV_TRCVMODE_NORMALwhen called,CanTrcv_DeInitreports the development errorCANTRCV_E_TRCV_NOT_NORMAL[SWS_CanTrcv_91005]. - This results in the functional precondition for the caller to operate the transceiver in state
CANTRCV_TRCVMODE_NORMALbefore de-initialization in order to prevent an error report in development mode [SWS_CanTrcv_91005].
This usage note was generated automatically based on the specification AUTOSAR CP R20-11.
function CanTrcv_MainFunction [SWS_CanTrcv_00013] 📄 PDF
void CanTrcv_MainFunction (void);
Service to scan all busses for wake up events and perform these event.
The function CanTrcv_MainFunction serves as a central driver service of the CAN transceiver driver for monitoring all connected bus channels for wake-up events that have occurred and for executing these events [SWS_CanTrcv_00013]. It has the C signature void CanTrcv_MainFunction(void), is defined under the hexadecimal service ID 0x06, and operates synchronously without parameters or return values [SWS_CanTrcv_00013].
For cyclic monitoring, the function specifically scans all buses that are in the low-power states STANDBY or SLEEP [SWS_CanTrcv_00112]. If the driver detects a wake-up event on one of the monitored buses, CanTrcv_MainFunction sets an internal wake-up event flag to initiate the downstream execution and processing of these events in the system [SWS_CanTrcv_00112].
Regarding the call context, the interface is provided via the header file SchM_CanTrcv.h [SWS_CanTrcv_00013]. Interpretation: The provision via this SchM header suggests that the function is likely called periodically by the BSW Scheduler in the context of a cyclic task to regularly sample the bus channels in inactive states. Question Q-588109b1111a0f43 (open) Specific error codes, notifications to the DET or DEM, and reentrancy requirements are not mentioned in this specification excerpt.
This text was generated by an AI based on the AUTOSAR specification R20-11.
Implementer's Guide to follow (complexity I1)
function CanTrcv_MainFunctionDiagnostics [SWS_CanTrcv_00218] 📄 PDF
void CanTrcv_MainFunctionDiagnostics (void);
Reads the transceiver diagnostic status periodically and sets product/ development accordingly.
The function CanTrcv_MainFunctionDiagnostics (service ID 0x08) periodically reads the diagnostic status of the transceiver and sets corresponding production and development errors [SWS_CanTrcv_00218]. The function takes no parameters, has no return value (void CanTrcv_MainFunctionDiagnostics(void)), and is provided via the header SchM_CanTrcv.h [SWS_CanTrcv_00218].
Call Context and Concurrency
Due to the provision via SchM_CanTrcv.h, the main function is presumably called cyclically by the BSW Scheduler (SchM) in a task context (interpretation). Question Q-ab1f6c55abcb8d4b (open) Since the specification does not indicate reentrancy, non-reentrant execution must be assumed.
Error Handling and Interaction with the DEM
Diagnostic evaluation is performed depending on configuration and hardware support:
- If the
BUSERRflag reported by the BSW is set, the function calls the APIDem_SetEventStatuswith parameterEventIdasCANTRCV_E_BUS_ERRORandEventStatusasDEM_EVENT_STATUS_FAILED[SWS_CanTrcv_00206]. - If the
BUSERRflag is reset,CanTrcv_MainFunctionDiagnosticscalls the APIDem_SetEventStatuswith the sameEventId(CANTRCV_E_BUS_ERROR) and the statusDEM_EVENT_STATUS_PASSED[SWS_CanTrcv_00227].
This text was generated by an AI. It does not replace studying the relevant AUTOSAR specifications.
Implementer's Guide to follow (complexity I1)
type CanTrcv_ConfigType [SWS_CanTrcv_00209] 📄 PDF
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.
type CanTrcv_PNActivationType [SWS_CanTrcv_00210] 📄 PDF
Datatype used for describing whether PN wakeup functionality in Can Trcv is enabled or disabled.
type CanTrcv_TrcvFlagStateType [SWS_CanTrcv_00211] 📄 PDF
Provides the state of a flag in the transceiver hardware.
The enumeration type CanTrcv_TrcvFlagStateType represents the state of an individual flag in the transceiver hardware [SWS_CanTrcv_00211]. The declaration is provided for applying software modules and drivers via the header file CanTrcv.h [SWS_CanTrcv_00211].
The value range has a binary structure and distinguishes two discrete states according to [SWS_CanTrcv_00211]:
CANTRCV_FLAG_SET: Indicates that the respective flag in the transceiver hardware is set [SWS_CanTrcv_00211].CANTRCV_FLAG_CLEARED: Indicates that the flag in the transceiver hardware is cleared or not set [SWS_CanTrcv_00211].
Regarding practical usage, it can be noted that the type primarily serves the standardized representation of hardware-related register states [SWS_CanTrcv_00211]. Interpretation: Calling layers such as the CAN interface driver or diagnostic modules are typically expected to read this type via query functions through pointer parameters or return values in order to evaluate any error or wake-up flags. Question Q-1b75b4baf2f4c6e3 (open) Since the type itself contains no functional logic, reentrancy restrictions, or DET notifications, verifying valid value ranges is the responsibility of the processing interfaces.
This text was generated by an AI and serves as guidance. The AUTOSAR specification is authoritative.
Implementer's Guide to follow (complexity I1)
type CanTrcv_TrcvModeType [SWS_CanTrcv_00163] 📄 PDF
Operating modes of the CAN Transceiver Driver.
According to [SWS_CanTrcv_00163], the enumeration type CanTrcv_TrcvModeType defines the standardized operating modes for the CAN transceiver driver (CanTrcv). The declaration is provided via the header file Can_GeneralTypes.h for cross-software interfaces in the AUTOSAR communication stack.
Value Range and Meanings
According to [SWS_CanTrcv_00163], three enumeration values are available:
CANTRCV_TRCVMODE_NORMAL(value0x00): Designates the regular transceiver operating mode for transmitting and receiving CAN messages.CANTRCV_TRCVMODE_STANDBY: Represents the standby mode of the transceiver, in which communication is idle and power consumption is reduced.CANTRCV_TRCVMODE_SLEEP: Represents the sleep mode of the transceiver for maximum power saving.
Usage and restrictions
The enumeration serves as the common data type representation for the hardware state of the CAN transceiver [SWS_CanTrcv_00163]. Interpretation: The type is presumably intended primarily for parameter passing in control and query interfaces of the transceiver driver, via which higher layers such as the CAN interface initiate mode switches or read the current status. Question Q-95fceb6988818621 (open) Because the present specification excerpt contains no runtime errors (DET/DEM), reentrancy specifications, or concrete function signatures, call contexts and concurrency rules are to be taken from the respective using driver functions.
This usage note is based exclusively on the specification data from AUTOSAR R20-11 for [SWS_CanTrcv_00163].
Implementer's Guide to follow (complexity I1)
type CanTrcv_TrcvWakeupModeType [SWS_CanTrcv_00164] 📄 PDF
This type shall be used to control the CAN transceiver concerning wake up events and wake up notifications.
The enumeration type CanTrcv_TrcvWakeupModeType is used to control a CAN transceiver with regard to wake-up events and wake-up notifications [SWS_CanTrcv_00164]. The type definition is provided via the header file Can_GeneralTypes.h and is thus available stack-wide [SWS_CanTrcv_00164].
The value range comprises three control modes for the respectively addressed transceiver [SWS_CanTrcv_00164]:
CANTRCV_WUMODE_ENABLE(value0x00): Enables notification for wakeup events on the addressed transceiver [SWS_CanTrcv_00164].CANTRCV_WUMODE_DISABLE(value0x01): Disables notification for wakeup events on the addressed transceiver [SWS_CanTrcv_00164].CANTRCV_WUMODE_CLEAR(value0x02): Clears a wakeup event stored in the addressed transceiver [SWS_CanTrcv_00164].
Interpretation: In practice, the type is presumably used primarily as a passing parameter in control functions of the transceiver driver to dynamically enable or disable wake-up notifications and to reset detected wake-up events. Question Q-c53d60cdad0442ca (open) Because the specification as a pure enumeration type defines no function signatures, execution semantics, error codes, or concurrency rules, these aspects are determined entirely by the calling and processing driver interfaces [SWS_CanTrcv_00164].
This text was created by an AI; accuracy cannot be guaranteed.
Implementer's Guide to follow (complexity I1)
type CanTrcv_TrcvWakeupReasonType [SWS_CanTrcv_00165] 📄 PDF
This type denotes the wake up reason detected by the CAN transceiver in detail. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_CANTransceiverDriver
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/CP_MOD_CanTrcv- Status
- unspecified
- Version
AUTOSAR/AP/record/CP_MOD_CanTrcv@rel:R20-11#3a4deb89- Content hash
3a4deb89- Source
- https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_CANTransceiverDriver.pdf#nameddest=SWS_CanTrcv_00001
gemini-3.8-flash-low· 2026-10-13 · German original