STM32G0 MCAL 0.0.1
Tiny MCAL for educational purpose.
Loading...
Searching...
No Matches
CanIf_Can.h File Reference

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.
 

Detailed Description

Header file for the CAN interface callbacks.

Author
Diego Perez

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.

Function Documentation

◆ CanIf_ControllerBusOff()

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.

Parameters
[in]ControllerIdCAN controller for which the status shall be changed.
Requirement
SWS_CANIF_00218, SWS_CANIF_00661, SWS_CANIF_00429

◆ CanIf_ControllerErrorStatePassive()

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.

Parameters
[in]ControllerIdAbstracted CanIf ControllerId which is assigned to a CAN controller.
[in]RxErrorCounterValue of the Rx error counter
[in]TxErrorCounterValue of the Tx error counter
Requirement
SWS_CANIF_91008, SWS_CANIF_00661

◆ CanIf_ControllerModeIndication()

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.

Parameters
[in]ControllerIdCAN controller for which the status shall be changed.
[in]ControllerModeNew controller mode.
Requirement
SWS_CANIF_00699, SWS_CANIF_00661, SWS_CANIF_00700

◆ CanIf_ErrorNotification()

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.

Parameters
[in]ControllerIdCAN controller for which the status shall be changed.
[in]CanErrorReported CAN error
Requirement
SWS_CANIF_91009, SWS_CANIF_00661, SWS_CANIF_00920, SWS_CANIF_00921

◆ CanIf_RxIndication()

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.

Parameters
[in]MailboxIdentifies the HRH and its corresponding CAN Controller
[in]PduInfoPtrPointer to the received L-PDU
Requirement
SWS_CANIF_00006, SWS_CANIF_00661, SWS_CANIF_00416, SWS_CANIF_00417, SWS_CANIF_00419

◆ CanIf_TxConfirmation()

void CanIf_TxConfirmation ( PduIdType CanTxPduId)

Handles the transmit confirmation.

This service confirms a previously successfully processed transmission of a CAN TxPDU.

Parameters
[in]CanTxPduIdID of the successfully transmitted Tx L-PDU
Requirement
SWS_CANIF_00007, SWS_CANIF_00661, SWS_CANIF_00410