STM32G0 MCAL 0.0.1
Tiny MCAL for educational purpose.
|
Header file for the CAN interface callbacks. More...
#include "Can_Types.h"
Go to the source code of this file.
Functions | |
void | CanIf_TxConfirmation (PduIdType CanTxPduId) |
Handles the transmit confirmation. | |
void | CanIf_RxIndication (const Can_HwType *Mailbox, const PduInfoType *PduInfoPtr) |
Handles the received CAN frame. | |
void | CanIf_ControllerBusOff (uint8 ControllerId) |
Handles the bus-off event. | |
void | CanIf_ControllerModeIndication (uint8 ControllerId, Can_ControllerStateType ControllerMode) |
Controller mode indication. | |
void | CanIf_ControllerErrorStatePassive (uint8 ControllerId, uint16 RxErrorCounter, uint16 TxErrorCounter) |
Signal the error state of the CAN controller. | |
void | CanIf_ErrorNotification (uint8 ControllerId, Can_ErrorType CanError) |
Signal the error notification of the CAN controller. | |
Header file for the CAN interface callbacks.
This file contains the prototypes for the CAN interface callbacks. As per AUTOSAR, these functions are called by the CAN driver to notify the CAN interface of certain events. like a message reception, a trnasmition complete or a bus-off condition.
void CanIf_ControllerBusOff | ( | uint8 | ControllerId | ) |
Handles the bus-off event.
This service indicates a Controller BusOff event referring to the corresponding CAN Controller with the abstract CanIf ControllerId.
[in] | ControllerId | CAN controller for which the status shall be changed. |
void CanIf_ControllerErrorStatePassive | ( | uint8 | ControllerId, |
uint16 | RxErrorCounter, | ||
uint16 | TxErrorCounter ) |
Signal the error state of the CAN controller.
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.
[in] | ControllerId | Abstracted CanIf ControllerId which is assigned to a CAN controller. |
[in] | RxErrorCounter | Value of the Rx error counter |
[in] | TxErrorCounter | Value of the Tx error counter |
void CanIf_ControllerModeIndication | ( | uint8 | ControllerId, |
Can_ControllerStateType | ControllerMode ) |
Controller mode indication.
This service indicates a controller state transition referring to the corresponding CAN controller with the abstract CanIf ControllerId.
[in] | ControllerId | CAN controller for which the status shall be changed. |
[in] | ControllerMode | New controller mode. |
void CanIf_ErrorNotification | ( | uint8 | ControllerId, |
Can_ErrorType | CanError ) |
Signal the error notification of the CAN controller.
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.
[in] | ControllerId | CAN controller for which the status shall be changed. |
[in] | CanError | Reported CAN error |
void CanIf_RxIndication | ( | const Can_HwType * | Mailbox, |
const PduInfoType * | PduInfoPtr ) |
Handles the received CAN frame.
This service indicates a successful reception of a received CAN Rx L-PDU to the CanIf after passing all filters and validation checks.
[in] | Mailbox | Identifies the HRH and its corresponding CAN Controller |
[in] | PduInfoPtr | Pointer to the received L-PDU |
void CanIf_TxConfirmation | ( | PduIdType | CanTxPduId | ) |
Handles the transmit confirmation.
This service confirms a previously successfully processed transmission of a CAN TxPDU.
[in] | CanTxPduId | ID of the successfully transmitted Tx L-PDU |