STM32G0 MCAL 0.0.1
Tiny MCAL for educational purpose.
|
Header file for the CAN interface. More...
#include "CanIf_Cfg.h"
Go to the source code of this file.
Functions | |
void | CanIf_Init (const CanIf_ConfigType *ConfigPtr) |
Initializes the CAN interface. | |
void | CanIf_DeInit (void) |
Deinitializes the CAN interface. | |
Std_ReturnType | CanIf_SetControllerMode (uint8 ControllerId, Can_ControllerStateType ControllerMode) |
Sets the CAN controller mode. | |
Std_ReturnType | CanIf_GetControllerMode (uint8 ControllerId, Can_ControllerStateType *ControllerModePtr) |
Gets the CAN controller mode. | |
Std_ReturnType | CanIf_GetControllerErrorState (uint8 ControllerId, Can_ErrorStateType *ErrorStatePtr) |
Gets the CAN controller error state. | |
Std_ReturnType | CanIf_Transmit (PduIdType TxPduId, const PduInfoType *PduInfoPtr) |
Transmits a CAN L-PDU. | |
Std_ReturnType | CanIf_ReadRxPduData (PduIdType CanIfRxSduId, PduInfoType *CanIfRxInfoPtr) |
CanIf_NotifStatusType | CanIf_ReadTxNotifStatus (PduIdType CanIfTxSduId) |
CanIf_NotifStatusType | CanIf_ReadRxNotifStatus (PduIdType CanIfRxSduId) |
Std_ReturnType | CanIf_SetPduMode (uint8 ControllerId, CanIf_PduModeType PduModeRequest) |
Sets the requested PDU mode. | |
Std_ReturnType | CanIf_GetPduMode (uint8 ControllerId, CanIf_PduModeType *PduModePtr) |
Gets the requested PDU mode. | |
void | CanIf_GetVersionInfo (Std_VersionInfoType *VersionInfo) |
void | CanIf_SetDynamicTxId (PduIdType CanIfTxSduId, Can_IdType CanId) |
Sets the CAN controller baudrate. | |
CanIf_NotifStatusType | CanIf_GetTxConfirmationState (uint8 ControllerId) |
Gets the CAN controller Tx confirmation state. | |
Std_ReturnType | CanIf_SetBaudrate (uint8 ControllerId, uint16 BaudRateConfigID) |
Std_ReturnType | CanIf_GetControllerRxErrorCounter (uint8 ControllerId, uint8 *RxErrorCounterPtr) |
Gets the CAN controller Rx error counter. | |
Std_ReturnType | CanIf_GetControllerTxErrorCounter (uint8 ControllerId, uint8 *TxErrorCounterPtr) |
Gets the CAN controller Tx error counter. | |
Std_ReturnType | CanIf_EnableBusMirroring (uint8 ControllerId, boolean MirroringActive) |
Std_ReturnType | CanIf_GetCurrentTime (uint8 Controller, Can_TimeStampType *timeStampPtr) |
void | CanIf_EnableEgressTimeStamp (PduIdType TxPduId) |
Std_ReturnType | CanIf_GetEgressTimeStamp (PduIdType TxPduId, Can_TimeStampType *timeStampPtr) |
Std_ReturnType | CanIf_GetIngressTimeStamp (PduIdType RxPduId, Can_TimeStampType *timeStampPtr) |
Header file for the CAN interface.
The CAN Interface module provides CAN communication abstracted access to the CAN Driver and CAN Transceiver Driver services for control and supervision of the CAN network. The CAN Interface forwards downwards the status change requests from the CAN State Manager to the lower layer CAN device drivers, and upwards the CAN Driver / CAN Transceiver Driver events are forwarded by the CAN Interface module to e.g. the corresponding NM module.
void CanIf_DeInit | ( | void | ) |
Deinitializes the CAN interface.
De-initializes the CanIf module. Caller of the CanIf_DeInit() function has to be sure there are no on-going transmissions/receptions, nor any pending transmission confirmations.
Std_ReturnType CanIf_GetControllerErrorState | ( | uint8 | ControllerId, |
Can_ErrorStateType * | ErrorStatePtr ) |
Gets the CAN controller error state.
This service calls the corresponding CAN Driver service for getting the current CAN controller error state.
[in] | ControllerId | CAN controller for which the status shall be changed. |
[out] | ErrorStatePtr | Pointer to a memory location, where the current error state of the CAN controller will be stored. |
< Error return value
< OK return value
Std_ReturnType CanIf_GetControllerMode | ( | uint8 | ControllerId, |
Can_ControllerStateType * | ControllerModePtr ) |
Gets the CAN controller mode.
This service calls the corresponding CAN Driver service for getting the current CAN controller mode.
[in] | ControllerId | CAN controller for which the status shall be changed. |
[out] | ControllerModePtr | Pointer to a memory location, where the current mode of the CAN controller will be stored. |
< Error return value
< OK return value
Std_ReturnType CanIf_GetControllerRxErrorCounter | ( | uint8 | ControllerId, |
uint8 * | RxErrorCounterPtr ) |
Gets the CAN controller Rx error counter.
This service calls the corresponding CAN Driver service for obtaining the Rx error counter of the CAN controller.
[in] | ControllerId | CAN controller for which the status shall be changed. |
[out] | RxErrorCounterPtr | Pointer to a memory location, where the current Rx error counter |
< Error return value
< OK return value
Std_ReturnType CanIf_GetControllerTxErrorCounter | ( | uint8 | ControllerId, |
uint8 * | TxErrorCounterPtr ) |
Gets the CAN controller Tx error counter.
This service calls the corresponding CAN Driver service for obtaining the Tx error counter of the CAN controller.
[in] | ControllerId | CAN controller for which the status shall be changed. |
[out] | TxErrorCounterPtr | Pointer to a memory location, where the current Tx error counter |
< Error return value
< OK return value
Std_ReturnType CanIf_GetPduMode | ( | uint8 | ControllerId, |
CanIf_PduModeType * | PduModePtr ) |
Gets the requested PDU mode.
This service returns the requested mode of the L-PDUs of a predefined logical PDU channel.
[in] | ControllerId | All PDUs of the own ECU connected to the corresponding CanIf ControllerId, which is assigned to a physical CAN controller are addressed. |
[out] | PduModePtr | Pointer to a memory location, where the requested PDU mode is stored. |
< Error return value
< OK return value
CanIf_NotifStatusType CanIf_GetTxConfirmationState | ( | uint8 | ControllerId | ) |
Gets the CAN controller Tx confirmation state.
This service reports, if any TX confirmation has been done for the whole CAN controller since the last CAN controller start.
[in] | ControllerId | CAN controller for which the status shall be changed. |
void CanIf_Init | ( | const CanIf_ConfigType * | ConfigPtr | ) |
Initializes the CAN interface.
This service Initializes internal and external interfaces of the CAN Interface for the further processing.
[in] | ConfigPtr | Pointer to the CAN Interface configuration structure. |
Std_ReturnType CanIf_SetControllerMode | ( | uint8 | ControllerId, |
Can_ControllerStateType | ControllerMode ) |
Sets the CAN controller mode.
This service calls the corresponding CAN Driver service for changing of the CAN controller mode.
[in] | ControllerId | CAN controller for which the status shall be changed. |
[in] | ControllerMode | Requested mode transition. |
< Error return value
< OK return value
void CanIf_SetDynamicTxId | ( | PduIdType | CanIfTxSduId, |
Can_IdType | CanId ) |
Sets the CAN controller baudrate.
This service reconfigures the corresponding CAN identifier of the requested CAN L-PDU.
[in] | CanIfTxSduId | L-SDU handle to be transmitted. This handle specifies the corresponding CAN L-SDU ID and implicitly the CAN Driver instance as well as the corresponding CAN controller device. |
[in] | CanId | Standard/Extended CAN ID of CAN L-SDU that shall be transmitted as FD or conventional CAN frame. |
Std_ReturnType CanIf_SetPduMode | ( | uint8 | ControllerId, |
CanIf_PduModeType | PduModeRequest ) |
Sets the requested PDU mode.
This service sets the requested mode at the L-PDUs of a predefined logical PDU channel.
[in] | ControllerId | All PDUs of the own ECU connected to the corresponding CanIf ControllerId, which is assigned to a physical CAN controller are addressed. |
[in] | PduModeRequest | Requested PDU mode change. |
< Error return value
< OK return value
Std_ReturnType CanIf_Transmit | ( | PduIdType | TxPduId, |
const PduInfoType * | PduInfoPtr ) |
Transmits a CAN L-PDU.
This service calls the corresponding CAN Driver service for transmission of a CAN L-PDU.
[in] | TxPduId | Identifier of the PDU to be transmitted |
[in] | PduInfoPtr | Length of and pointer to the PDU data and pointer to MetaData. |
< Error return value
< OK return value