DEENESPTFRRUARHIKOZHNL

CAN Interface (CanIf)

ModulCanIf (CAN Interface)
BSW-Modul-ID60
Standard-Header#include "CanIf.h"
SWS-SpezifikationAUTOSAR_SWS_CANInterface.pdf
ClusterCAN

Guide du moduleGÉNÉRÉ PAR IA

Transmet les messages CAN et le contrôle des modes indépendamment du matériel entre les pilotes CAN et la pile de communication.
GÉNÉRÉ PAR IA non vérifié Modèle : claude-opus-5-5 · Effort : high · Température : non réglable · Prompt : a6221da93ef5 Provenance Questions ouvertes (1)
Ancre causale : R20-11 Valable à partir de R20-11 Synthétisé pour cette version de spécification.
traduit du guide allemandgemini-3.8-flash-low · 2026-10-13 · Original allemand

Transmet les messages CAN et le contrôle des modes indépendamment du matériel entre les pilotes CAN et la pile de communication.

CanIf constitue la couche indépendante du matériel entre les pilotes ou transceivers CAN et les modules de communication supérieurs. Il mappe les demandes d'émission sur Can_Write(), met en mémoire tampon lorsque le matériel est occupé et transmet les confirmations ainsi que les réceptions filtrées aux callbacks configurés [SWS_CANIF_00318]. Il commande les modes de contrôleur et de transceiver pour le compte de CanSm et signale en retour les BusOff ainsi que les changements de mode. Les modes de canal de PDU activent et désactivent séparément la voie d'émission et la voie de réception. L'émission n'a lieu que si le contrôleur est en CAN_CS_STARTED et que la voie d'émission est débloquée [SWS_CANIF_00317].

Le CAN Interface (CanIf) prend en charge toutes les tâches indépendantes du matériel de la communication CAN. Celles-ci comprennent les demandes d'émission, les confirmations, les indications de réception, les notifications d'erreurs ainsi que le démarrage et l'arrêt des contrôleurs CAN SWS CanIf p. 13. CanIf n'accède aux tampons matériels que par l'intermédiaire des services de CanDrv [SWS_CANIF_00023]. Il s'adresse aux contrôleurs et transceivers de plusieurs pilotes au moyen d'identifiants abstraits [SWS_CANIF_00653]. La configuration détermine quels callbacks sont appelés dans PduR, CanNm, CanTp, CanSm ou EcuM [SWS_CANIF_00011] [SWS_CANIF_00724].

kontext ul Obere Schichten PduR, CanNm, CanTp, J1939Tp, J1939Nm, CanTSyn, Xcp, CDD canif CanIf ul->canif CanIf_Transmit() CanIf_SetPduMode() CanIf_ReadRxPduData() cansm CanSm / CDD cansm->canif CanIf_SetControllerMode() CanIf_SetTrcvMode() ecum EcuM / Integrationscode ecum->canif CanIf_Init() CanIf_CheckWakeup() CanIf_CheckValidation() canif->ul <User_RxIndication> <User_TxConfirmation> <User_TriggerTransmit> canif->cansm <User_ControllerBusOff> <User_ControllerModeIndication> <User_TrcvModeIndication> canif->ecum <User_ValidateWakeupEvent> can Pilote CAN (Can) une ou plusieurs instances canif->can Can_Write() Can_SetControllerMode() Can_CheckWakeup() trcv CAN-Transceiver-Treiber (CanTrcv) canif->trcv CanTrcv_SetOpMode() CanTrcv_CheckWakeup() det Det canif->det Det_ReportError() Det_ReportRuntimeError() idsm IdsM canif->idsm Sicherheitsereignisse mirror Bus Mirroring canif->mirror Mirror_ReportCanFrame() can->canif CanIf_RxIndication() CanIf_TxConfirmation() CanIf_ControllerBusOff() CanIf_ControllerModeIndication() trcv->canif CanIf_TrcvModeIndication()

Diagramme de contexte : CanIf entre les modules de communication supérieurs, la gestion des modes et les pilotes pour contrôleurs et transceivers. Sources : [SWS_CANIF_00012], [SWS_CANIF_00358], SWS CanIf p. 21

EcuM initialise CanIf avec CanIf_Init(). Ensuite, chaque canal est à CANIF_OFFLINE [SWS_CANIF_00864], et jusque-là, les services rejettent les requêtes avec E_NOT_OK [SWS_CANIF_00661]. Le démarrage du contrôleur via CanIf_SetControllerMode() s'exécute de manière asynchrone. L'achèvement est signalé par CanIf_ControllerModeIndication(), que CanIf transmet à CanSm [SWS_CANIF_00003] [SWS_CANIF_00711]. Ce n'est qu'ensuite que CanIf_SetPduMode() accepte des requêtes [SWS_CANIF_00874]. Les modes de canal de PDU activent et désactivent séparément la voie d'émission et la voie de réception. Les événements de contrôleur tels que SLEEP, STOPPED ou BusOff les forcent [SWS_CANIF_00865] [SWS_CANIF_00866].

pdumodi cluster_offline OFFLINE (Oberzustand) start off CANIF_OFFLINE kein Senden, kein Empfang start->off CanIf_Init() txoff CANIF_TX_OFFLINE réception uniquement off->txoff CAN_CS_STOPPED / BusOff on CANIF_ONLINE émission et réception off->on CanIf_SetPduMode(CANIF_ONLINE) txoff->off CAN_CS_SLEEP txoff->on CanIf_SetPduMode(CANIF_ONLINE) txact CANIF_TX_OFFLINE_ACTIVE réception, l'émission est immédiatement confirmée txact->off CAN_CS_SLEEP txact->txoff CAN_CS_STOPPED / BusOff txact->on CanIf_SetPduMode(CANIF_ONLINE) on->off CanIf_SetPduMode(CANIF_OFFLINE) ou CAN_CS_SLEEP on->txoff CanIf_SetPduMode(CANIF_TX_OFFLINE) ou CAN_CS_STOPPED / BusOff on->txact CanIf_SetPduMode(CANIF_TX_OFFLINE_ACTIVE) hinweis CanIf_SetPduMode() n'est accepté que si le contrôleur est dans CAN_CS_STARTED ; une sélection des transitions est représentée

Diagramme d'états : Les quatre modes de canal de PDU et leurs transitions par CanIf_SetPduMode() et par des événements de contrôleur. Sources : [SWS_CANIF_00137], [SWS_CANIF_00866], SWS CanIf Fig. 7.8 p. 61

Lors de l'émission, CanIf_Transmit() appelle Can_Write() [SWS_CANIF_00318]. Si le matériel est occupé, CanIf met la L-PDU en mémoire tampon, pour autant qu'un tampon soit configuré [SWS_CANIF_00381]. À la confirmation suivante, il émet l'entrée ayant la priorité la plus élevée [SWS_CANIF_00668]. Les L-PDU reçues passent par un filtrage logiciel et une vérification de longueur avant que CanIf ne les transmette à <User_RxIndication> [SWS_CANIF_00389] [SWS_CANIF_00056].

En cas d'erreur, un BusOff fait passer le canal à CANIF_TX_OFFLINE et est signalé à CanSm [SWS_CANIF_00724]. Lors de l'arrêt d'un contrôleur, CanIf confirme toutes les demandes d'émission en attente avec E_NOT_OK [SWS_CANIF_00739]. Les erreurs de paramètres et d'exécution sont transmises au DET [SWS_CANIF_91006] [SWS_CANIF_91007].

Rôle : plaque tournante indépendante du matériel entre les pilotes CAN et la pile de communication

Le CAN Interface (CanIf) prend en charge toutes les tâches indépendantes du matériel de la communication CAN d'un ECU. Les pilotes CAN sous-jacents ne s'occupent plus que de leur matériel concret. CanIf traite les demandes d'émission, les confirmations d'émission, les indications de réception et les notifications d'erreurs, et démarre ou arrête les contrôleurs CAN SWS CanIf p. 13. Il n'accède aux tampons matériels qu'exclusivement par les services du CanDrv [SWS_CANIF_00023]. Les services de commande opèrent avec un ControllerId abstrait qui numérote les contrôleurs de toutes les instances de CanDrv à partir de 0 [SWS_CANIF_00653]. Il en va de même pour les transceivers avec le TransceiverId [SWS_CANIF_00655].

Vers le bas, CanIf regroupe les API de plusieurs pilotes CanTrcv en une interface uniforme, mais ne contient lui-même aucune logique de transceiver SWS CanIf p. 21. Même en présence de plusieurs CanDrv, chaque callback n'existe qu'une seule fois. CanIf reconnaît le pilote appelant grâce au ControllerId dans Can_HwType SWS CanIf p. 68.

Vers le haut, CanIf appelle des callbacks configurables tels que <User_TxConfirmation> et <User_RxIndication> [SWS_CANIF_00011] [SWS_CANIF_00012]. La configuration détermine le destinataire concret, par exemple PduR_CanIfRxIndication [SWS_CANIF_00442] ou CanTp_TxConfirmation [SWS_CANIF_00550]. CanIf signale le BusOff et les changements de mode à CanSm ou à un CDD [SWS_CANIF_00724] [SWS_CANIF_00711]. Les validations de réveil sont transmises à EcuM [SWS_CANIF_00563].

kontext ul Obere Schichten PduR, CanNm, CanTp, J1939Tp, J1939Nm, CanTSyn, Xcp, CDD canif CanIf ul->canif CanIf_Transmit() CanIf_SetPduMode() CanIf_ReadRxPduData() cansm CanSm / CDD cansm->canif CanIf_SetControllerMode() CanIf_SetTrcvMode() ecum EcuM / Integrationscode ecum->canif CanIf_Init() CanIf_CheckWakeup() CanIf_CheckValidation() canif->ul <User_RxIndication> <User_TxConfirmation> <User_TriggerTransmit> canif->cansm <User_ControllerBusOff> <User_ControllerModeIndication> <User_TrcvModeIndication> canif->ecum <User_ValidateWakeupEvent> can Pilote CAN (Can) une ou plusieurs instances canif->can Can_Write() Can_SetControllerMode() Can_CheckWakeup() trcv CAN-Transceiver-Treiber (CanTrcv) canif->trcv CanTrcv_SetOpMode() CanTrcv_CheckWakeup() det Det canif->det Det_ReportError() Det_ReportRuntimeError() idsm IdsM canif->idsm Sicherheitsereignisse mirror Bus Mirroring canif->mirror Mirror_ReportCanFrame() can->canif CanIf_RxIndication() CanIf_TxConfirmation() CanIf_ControllerBusOff() CanIf_ControllerModeIndication() trcv->canif CanIf_TrcvModeIndication()

Diagramme de contexte : CanIf assure l'intermédiation entre les modules de communication supérieurs, la gestion des modes (CanSm, EcuM) et les pilotes pour contrôleurs et transceivers CAN. Les notifications d'erreurs, de sécurité et de mise en miroir vont vers DET, IdsM et Mirror. Sources : [SWS_CANIF_00011], [SWS_CANIF_00724], [SWS_CANIF_00358], [SWS_CANIF_00905], [SWS_CANIF_00913], SWS CanIf p. 13

L'étendue des fonctionnalités dépend fortement de la configuration. CanIf_Init() lit notamment le nombre de contrôleurs et l'affectation des HTH/HRH à partir des conteneurs de configuration SWS CanIf p. 22. Le HTH et le HRH sont des handles vers des objets logiques d'émission ou de réception [SWS_CANIF_00291] [SWS_CANIF_00292]. De nombreux services peuvent être désélectionnés par des commutateurs de précompilation, par ex. CanIf_ReadRxPduData() [SWS_CANIF_00330] ou CanIf_SetBaudrate() [SWS_CANIF_00871]. Si aucun nom n'est configuré pour un callback non obligatoire, l'appel est omis SWS CanIf p. 133. En revanche, <User_ControllerBusOff> doit toujours être configuré [SWS_CANIF_00524].

De l'initialisation au contrôleur démarré

EcuM appelle CanIf_Init() [SWS_CANIF_00001]. Ce faisant, CanIf initialise les variables, les drapeaux et les tampons [SWS_CANIF_00085] ainsi que tous les tampons de L-PDU d'émission [SWS_CANIF_00387]. Chaque canal démarre en CANIF_OFFLINE [SWS_CANIF_00864]. Les contrôleurs restent ensuite dans le mode STOPPED, dans lequel il n'y a ni émission ni réception. EcuM initialise CanDrv et CanTrcv séparément SWS CanIf p. 40. Avant l'initialisation, tous les services sauf CanIf_Init() et CanIf_GetVersionInfo() renvoient E_NOT_OK [SWS_CANIF_00661]. L'entité qui appelle CanIf_DeInit() [SWS_CANIF_91002] doit s'assurer qu'aucun transfert n'est encore en cours SWS CanIf p. 81.

Le démarrage du contrôleur s'exécute de manière asynchrone. CanIf_SetControllerMode() [SWS_CANIF_00003] appelle Can_SetControllerMode() [SWS_CANIF_00308]. Le pilote signale le changement effectué plus tard avec CanIf_ControllerModeIndication() [SWS_CANIF_00699], et CanIf transmet la notification à CanSm [SWS_CANIF_00711]. En mode scrutation (polling), Can_MainFunction_Mode() détecte le changement SWS CanIf p. 152. Ce n'est qu'en CAN_CS_STARTED que CanIf_SetPduMode() accepte des requêtes [SWS_CANIF_00874].

Démarrer le contrôleur et activer le canal de PDUCanSm / obere SchichtCanIfCanCanControllerCanIf_SetControllerMode(ControllerId,CAN_CS_STARTED)Can_SetControllerMode(Controller, Transition)demander la transition vers STARTE_OKE_OK (Anforderung angenommen)Asynchrone : le changement n'estpas encore accompliloopCan_MainFunction_Mode() bis Moduswechsel erkanntvérifier l'état matérielCanIf_ControllerModeIndication(ControllerId,CAN_CS_STARTED)<User_ControllerModeIndication>(CanSM_ControllerModeIndication)Use Case: PDU-Pfade freischaltenCanIf_SetPduMode(ControllerId, CANIF_ONLINE)autorisé uniquement dans CAN_CS_STARTEDE_OK

Diagramme de séquence : La demande de démarrage est acquittée immédiatement, mais le changement de mode n'est indiqué que plus tard. Les voies de PDU peuvent ensuite être débloquées. Sources : [SWS_CANIF_00308], [SWS_CANIF_00711], [SWS_CANIF_00874], SWS CanIf p. 156

Modes de canal de PDU : commuter séparément la voie d'émission et la voie de réception

Chaque canal d'un contrôleur possède un mode de type CanIf_PduModeType [SWS_CANIF_00137]. Les couches supérieures le définissent avec CanIf_SetPduMode() et le lisent avec CanIf_GetPduMode() [SWS_CANIF_00008] [SWS_CANIF_00009]. Détail des modes SWS CanIf p. 58 :

  • CANIF_OFFLINE : Les demandes d'émission sont rejetées avec E_NOT_OK et les tampons sont vidés. Les indications et confirmations sont supprimées [SWS_CANIF_00073].
  • CANIF_TX_OFFLINE : Seule la voie d'émission est bloquée, la réception reste active [SWS_CANIF_00489].
  • CANIF_TX_OFFLINE_ACTIVE : Les demandes d'émission sont immédiatement confirmées sans être transmises à CanDrv [SWS_CANIF_00072].
  • CANIF_ONLINE : L'émission et la réception sont pleinement actives [SWS_CANIF_00075].

Les événements de contrôleur forcent le mode de canal. CAN_CS_SLEEP entraîne CANIF_OFFLINE [SWS_CANIF_00865]. CAN_CS_STOPPED et BusOff entraînent CANIF_TX_OFFLINE [SWS_CANIF_00866].

pdumodi cluster_offline OFFLINE (Oberzustand) start off CANIF_OFFLINE kein Senden, kein Empfang start->off CanIf_Init() txoff CANIF_TX_OFFLINE réception uniquement off->txoff CAN_CS_STOPPED / BusOff on CANIF_ONLINE émission et réception off->on CanIf_SetPduMode(CANIF_ONLINE) txoff->off CAN_CS_SLEEP txoff->on CanIf_SetPduMode(CANIF_ONLINE) txact CANIF_TX_OFFLINE_ACTIVE réception, l'émission est immédiatement confirmée txact->off CAN_CS_SLEEP txact->txoff CAN_CS_STOPPED / BusOff txact->on CanIf_SetPduMode(CANIF_ONLINE) on->off CanIf_SetPduMode(CANIF_OFFLINE) ou CAN_CS_SLEEP on->txoff CanIf_SetPduMode(CANIF_TX_OFFLINE) ou CAN_CS_STOPPED / BusOff on->txact CanIf_SetPduMode(CANIF_TX_OFFLINE_ACTIVE) hinweis CanIf_SetPduMode() n'est accepté que si le contrôleur est dans CAN_CS_STARTED ; une sélection des transitions est représentée

Diagramme d'états : Les quatre modes de canal de PDU avec les transitions par CanIf_SetPduMode() et par les événements de contrôleur. Les trois modes restreints sont regroupés en un super-état comme dans la spécification. Sources : [SWS_CANIF_00864], [SWS_CANIF_00865], [SWS_CANIF_00866], [SWS_CANIF_00874], SWS CanIf Fig. 7.8 p. 61

Voie d'émission : CanIf_Transmit, mise en mémoire tampon et Trigger Transmit

CanIf_Transmit() [SWS_CANIF_00005] détermine le HTH et appelle Can_Write(). Le swPduHandle transmis revient plus tard dans CanIf_TxConfirmation() [SWS_CANIF_00318]. Auparavant, CanIf positionne les deux bits de poids le plus fort du CanId [SWS_CANIF_00243]. Si Can_Write() renvoie E_OK, cela s'applique également à la demande d'émission [SWS_CANIF_00162].

Une demande n'est acceptée que sous les conditions suivantes :

Des passages documentaires plus récents mentionnent en plus CanXL_Write() SWS CanIf p. 87. Pour R20-11, seul Can_Write() est normatif.

txentscheidung start aufruf CanIf_Transmit(TxPduId, PduInfoPtr) start->aufruf init CanIf initialisiert? aufruf->init modus contrôleur CAN_CS_STARTED et voie d'émission online / offline active ? init->modus Oui nok1 E_NOT_OK init->nok1 Non active Kanal in CANIF_TX_OFFLINE_ACTIVE? modus->active Oui nok2 E_NOT_OK (avec CANIF_OFFLINE en plus CANIF_E_STOPPED) modus->nok2 Non pn PnTxFilter actif et aucune CanIfTxPduPnFilterPdu ? active->pn Non bestaetigen <User_TxConfirmation> sofort, kein Can_Write() active->bestaetigen Oui laenge SduLength supérieure à la PDU globale ? pn->laenge Non nok3 E_NOT_OK pn->nok3 Oui trunc CanIfTxPduTruncation aktiviert? laenge->trunc Oui write Can_Write(Hth, PduInfo) laenge->write Non kuerzen tronquer les données à la longueur de la PDU globale trunc->kuerzen Oui nok4 CANIF_E_TXPDU_LENGTH_EXCEEDED, E_NOT_OK trunc->nok4 Non kuerzen->write rueck retour de Can_Write() ? write->rueck puffer mise en mémoire tampon active et taille du tampon > 0 ? rueck->puffer CAN_BUSY ok E_OK rueck->ok E_OK gleich même L-PDU déjà mise en mémoire tampon ? puffer->gleich Oui nok5 E_NOT_OK (L-PDU verloren) puffer->nok5 Non frei freies Pufferelement? gleich->frei Non ueberschreiben écraser l'instance mise en mémoire tampon gleich->ueberschreiben Oui ablegen L-PDU in CanIfTxBuffer ablegen frei->ablegen Oui nok6 E_NOT_OK frei->nok6 Non ueberschreiben->ok ablegen->ok

Diagramme d'activités : C'est ainsi que CanIf_Transmit() arbitre entre rejet, confirmation simulée, émission directe et mise en mémoire tampon. Interprétation : L'ordre des vérifications est choisi pour la lisibilité. Sources : [SWS_CANIF_00317], [SWS_CANIF_00382], [SWS_CANIF_00072], [SWS_CANIF_00381], [SWS_CANIF_00837], SWS CanIf Fig. 7.5 p. 51

Si Can_Write() signale CAN_BUSY et que CanIfPublicTxBuffering est actif [SWS_CANIF_00063], CanIf tente de mettre la L-PDU en mémoire tampon [SWS_CANIF_00381]. Cela suppose une taille de tampon supérieure à zéro [SWS_CANIF_00835]. Si la même L-PDU se trouve déjà dans le tampon, elle est écrasée [SWS_CANIF_00068]. Si le tampon est plein, une nouvelle L-PDU est rejetée avec E_NOT_OK [SWS_CANIF_00837]. Une L-PDU ne réside toujours qu'à un seul endroit : dans l'objet matériel ou dans le tampon de CanIf SWS CanIf p. 43.

Lors de CanIf_TxConfirmation() [SWS_CANIF_00007], CanIf notifie l'utilisateur concerné via <User_TxConfirmation> avec E_OK [SWS_CANIF_00383]. Dans le même appel, il vérifie les tampons du HTH libéré [SWS_CANIF_00386]. Il transmet à Can_Write() l'entrée en attente ayant la priorité la plus élevée [SWS_CANIF_00668] [SWS_CANIF_00070]. Lors de E_OK, il supprime immédiatement l'entrée du tampon [SWS_CANIF_00183]. Des passages documentaires plus récents nomment le callback LSduR_CanIfTxConfirmation() SWS CanIf p. 157. Dans R20-11, <User_TxConfirmation> fait foi.

Émission avec mise en mémoire tampon et réémission lors de la confirmationObere Schicht (z. B. PduR)CanIfCanCanControllerUse Case: demande d'émission avec matériel occupéCanIf_Transmit(TxPduId, PduInfoPtr)Can_Write(Hth, PduInfo)CAN_BUSYL-PDU in CanIfTxBuffer ablegenE_OKUse Case: confirmation d'une demande antérieureTransmit-InterruptCanIf_TxConfirmation(CanTxPduId)vérifier le tampon du HTH libéréalttampon rempliCan_Write() pour l'entrée deplus haute prioritéL-PDU in Hardware schreibenE_OKsupprimer immédiatement l'entrée du tamponPuffer leerkein weiterer Can_Write()-Aufruf<User_TxConfirmation>(TxPduId, E_OK)

Diagramme de séquence : Lorsque le matériel est occupé, la L-PDU est mise en mémoire tampon. La confirmation d'une demande antérieure déclenche ensuite l'émission différée depuis le tampon. Sources : [SWS_CANIF_00381], [SWS_CANIF_00386], [SWS_CANIF_00668], [SWS_CANIF_00183], SWS CanIf p. 138, SWS CanIf p. 143

Lors d'une Triggered Transmission, l'utilisateur ne transmet pas de données, mais un SduDataPtr NULL [SWS_CANIF_00882]. Si le matériel est libre, le pilote récupère les données via CanIf_TriggerTransmit() [SWS_CANIF_00883]. CanIf transmet l'appel à <User_TriggerTransmit> et renvoie son résultat [SWS_CANIF_00885]. Si le matériel est occupé, CanIf ne met en mémoire tampon que la Transmit Request [SWS_CANIF_00881]. Le CanId des L-PDU dynamiques peut être modifié avec CanIf_SetDynamicTxId() [SWS_CANIF_00189]. Alternativement, il provient des MetaData [SWS_CANIF_00855] SWS CanIf p. 34.

Trigger TransmitObere SchichtCanIfCanCanControllerCanIf_Transmit(TxPduId, PduInfoPtr)SduDataPtr = NULL, uniquement SduLengthCan_Write(Hth, PduInfo)altHardwareobjekt freiCanIf_TriggerTransmit(TxPduId, PduInfoPtr)<User_TriggerTransmit>(TxPduId, PduInfoPtr)Daten in bereitgestelltenPuffer kopierenE_OKE_OK (valeur de retour relayée)L-PDU in Hardware kopierenE_OKE_OKHardwareobjekt belegtCAN_BUSYuniquement la demande d'émission dansCanIfTxBuffer en tampon (si possible)

Diagramme de séquence : Avec Trigger Transmit, le pilote ne récupère les données auprès de l'utilisateur que lorsque l'objet matériel est libre. Sources : [SWS_CANIF_00882], [SWS_CANIF_00885], [SWS_CANIF_00881], SWS CanIf Fig. 9.6 p. 137

Voie de réception : filtrer, vérifier la longueur, transmettre

Après une réception, le pilote appelle CanIf_RxIndication() avec Mailbox et les données [SWS_CANIF_00006]. Le traitement se déroule en trois étapes :

rx start aufruf CanIf_RxIndication(Mailbox, PduInfoPtr) start->aufruf init CanIf initialisiert? aufruf->init keine aucun traitement Rx init->keine Non filterkonf Software-Filter konfiguriert (BasicCAN-HRH)? init->filterkonf Oui filter Software-Filter: CanId akzeptiert? filterkonf->filter Oui dlckonf vérification de longueur active ? filterkonf->dlckonf Non verworfen fin sans indication filter->verworfen Non filter->dlckonf Oui dlc longueur >= longueur configurée ? dlckonf->dlc Oui akzeptiert L-PDU akzeptiert dlckonf->akzeptiert Non dlcfehler Det_ReportRuntimeError() CANIF_E_INVALID_DATA_LENGTH dlc->dlcfehler Non dlc->akzeptiert Oui neben selon la configuration : remplir le tampon de réception, définir l'état de notification akzeptiert->neben ziel Ziel-Nutzer konfiguriert? akzeptiert->ziel indikation <User_RxIndication>(RxPduId, PduInfoPtr) ziel->indikation Oui ende Ende ziel->ende Non indikation->ende

Diagramme d'activités : Le filtrage logiciel et la vérification de longueur décident si une L-PDU reçue est indiquée. Les effets secondaires dépendants de la configuration sont représentés en parallèle. Sources : [SWS_CANIF_00421], [SWS_CANIF_00389], [SWS_CANIF_00168], [SWS_CANIF_00199], [SWS_CANIF_00392], SWS CanIf Fig. 7.6 p. 51

De manière complémentaire, CanIf propose des services d'interrogation. CanIf_ReadRxPduData() lit des données depuis son propre tampon de réception [SWS_CANIF_00194] [SWS_CANIF_00198], mais n'est pas conçu pour la réception par plage [SWS_CANIF_00329]. CanIf_ReadTxNotifStatus() et CanIf_ReadRxNotifStatus() réinitialisent l'état lors de la lecture [SWS_CANIF_00393] [SWS_CANIF_00394]. Ce « read-and-consume » garantit qu'au moins un événement est survenu depuis le dernier appel SWS CanIf p. 55. CanIf_GetTxConfirmationState() regroupe les confirmations de tout un contrôleur [SWS_CANIF_00734].

Transceiver, réveil et Partial Networking

CanIf transmet les services de transceiver directement au pilote CanTrcv. CanIf_SetTrcvMode() appelle CanTrcv_SetOpMode() [SWS_CANIF_00358], CanIf_GetTrcvMode() appelle CanTrcv_GetOpMode() [SWS_CANIF_00363]. CanIf transmet les changements de mode du transceiver à CanSm [SWS_CANIF_00712].

Pour le réveil, CanIf_CheckWakeup() interroge les contrôleurs et les transceivers sur la source de réveil [SWS_CANIF_00395] SWS CanIf p. 56. Pour la validation, CanIf enregistre la première réception valide d'un contrôleur démarré [SWS_CANIF_00286]. CanIf_CheckValidation() la signale ensuite via <User_ValidateWakeupEvent> [SWS_CANIF_00179].

Si le Partial Networking est actif, un PnTxFilter applique une couche supplémentaire sur les modes de canal par contrôleur [SWS_CANIF_00747]. Il est activé lors de CAN_CS_SLEEP [SWS_CANIF_00749] et désactivé à nouveau avec la première confirmation ou indication [SWS_CANIF_00751] [SWS_CANIF_00896] SWS CanIf p. 70.

Comportement en cas d'erreur

BusOff : Le pilote signale l'erreur avec CanIf_ControllerBusOff() [SWS_CANIF_00218]. CanIf fait alors passer le canal à CANIF_TX_OFFLINE [SWS_CANIF_00866] et signale le BusOff à CanSm [SWS_CANIF_00724] SWS CanIf Fig. 9.11 p. 147. CanSm pilote le rétablissement via CanIf_SetControllerMode() SWS CanIf p. 160.

Notification de Bus-Off et rétablissementCanSm (<User_ControllerBusOff>)CanIfCanCanControllerBusOff-ErkennungContrôleur au besoindéfinir sur STOPPEDCanIf_ControllerBusOff(ControllerId)canal sur CANIF_TX_OFFLINE,Sendepuffer leerenen cas de signalement d'événements de sécurité :CANIF_SEV_ERRORSTATE_BUSOFF<User_ControllerBusOff>(ControllerId)= CanSM_ControllerBusOff()Use Case: WiederherstellungCanIf_SetControllerMode(ControllerId,CAN_CS_STARTED)Can_SetControllerMode(Controller, Transition)E_OKE_OKCanIf_ControllerModeIndication(ControllerId,CAN_CS_STARTED)<User_ControllerModeIndication>

Diagramme de séquence : Déroulement depuis la détection du BusOff jusqu'au redémarrage du contrôleur en passant par la notification à CanSm. Sources : [SWS_CANIF_00218], [SWS_CANIF_00866], [SWS_CANIF_00724], [SWS_CANIF_00918], SWS CanIf p. 154, SWS CanIf p. 160

Contrôleur arrêté : Lors de l'entrée dans CAN_CS_STOPPED, CanIf vide les tampons d'émission [SWS_CANIF_00485]. Il confirme toutes les demandes d'émission en attente avec E_NOT_OK [SWS_CANIF_00739]. Ainsi, chaque PDU acceptée reçoit une confirmation, positive ou négative SWS CanIf p. 54.

Notifications d'erreurs : CanIf signale les paramètres invalides comme erreurs de développement, par ex. CANIF_E_PARAM_CONTROLLERID [SWS_CANIF_00311] [SWS_CANIF_91006]. Les erreurs d'exécution comprennent notamment CANIF_E_INVALID_DATA_LENGTH [SWS_CANIF_00168] et CANIF_E_STOPPED [SWS_CANIF_00382] [SWS_CANIF_91007]. Une demande d'émission perdue ne se manifeste que par la valeur de retour ou par l'absence de confirmation Error Description p. 22. CanIf signale les événements de sécurité tels que CANIF_SEV_ERRORSTATE_PASSIVE à l'IdsM [SWS_CANIF_00913] [SWS_CANIF_00917].

Preuves détaillées supplémentaires

Guide généré par IA sur la base d'extraits de spécifications. Pour R20-11, les exigences liées font foi ; les passages documentaires issus de versions plus récentes sont identifiés comme tels.

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

Funktionen — Übersicht

Typen — Übersicht

Funktionen & Typen — Detailansicht

fonction CanIf_Init [SWS_CANIF_00001] 📄 PDF

void CanIf_Init (const CanIf_ConfigType* ConfigPtr);

This service Initializes internal and external interfaces of the CAN Interface for the further processing.

Guide de l'implémenteur à venir (complexité I3)

fonction CanIf_DeInit [SWS_CANIF_91002] 📄 PDF

void CanIf_DeInit (void);

De-initializes the CanIf module.

Guide de l'implémenteur à venir (complexité I1)

fonction CanIf_ReadRxPduData [SWS_CANIF_00194] 📄 PDF

Std_ReturnType CanIf_ReadRxPduData (PduIdType CanIfRxSduId, PduInfoType* CanIfRxInfoPtr);

This service provides the Data Length and the received data of the requested CanIfRxSduId to the calling upper layer.

Guide de l'implémenteur à venir (complexité I2)

fonction CanIf_ReadTxNotifStatus [SWS_CANIF_00202] 📄 PDF

CanIf_NotifStatusType CanIf_ReadTxNotifStatus (PduIdType CanIfTxSduId);

This service returns the confirmation status (confirmation occurred or not) of a specific static or dynamic CAN Tx L-PDU, requested by the CanIfTxSduId.

Guide de l'implémenteur à venir (complexité I2)

fonction CanIf_ReadRxNotifStatus [SWS_CANIF_00230] 📄 PDF

CanIf_NotifStatusType CanIf_ReadRxNotifStatus (PduIdType CanIfRxSduId);

This service returns the indication status (indication occurred or not) of a specific CAN Rx L-PDU, requested by the CanIfRxSduId.

Guide de l'implémenteur à venir (complexité I2)

fonction CanIf_SetTrcvMode [SWS_CANIF_00287] 📄 PDF

Std_ReturnType CanIf_SetTrcvMode (uint8 TransceiverId, CanTrcv_TrcvModeType TransceiverMode);

This service changes the operation mode of the tansceiver TransceiverId, via calling the corresponding CAN Transceiver Driver service.

Guide de l'implémenteur à venir (complexité I3)

fonction CanIf_GetTxConfirmationState [SWS_CANIF_00734] 📄 PDF

CanIf_NotifStatusType CanIf_GetTxConfirmationState (uint8 ControllerId);

This service reports, if any TX confirmation has been done for the whole CAN controller since the last CAN controller start.

fonction CanIf_ClearTrcvWufFlag [SWS_CANIF_00760] 📄 PDF

Std_ReturnType CanIf_ClearTrcvWufFlag (uint8 TransceiverId);

Requests the CanIf module to clear the WUF flag of the designated CAN transceiver.

Guide de l'implémenteur à venir (complexité I2)

fonction CanIf_CheckTrcvWakeFlag [SWS_CANIF_00761] 📄 PDF

Std_ReturnType CanIf_CheckTrcvWakeFlag (uint8 TransceiverId);

Requests the CanIf module to check the Wake flag of the designated CAN transceiver.

Guide de l'implémenteur à venir (complexité I2)

fonction CanIf_SetBaudrate [SWS_CANIF_00867] 📄 PDF

Std_ReturnType CanIf_SetBaudrate (uint8 ControllerId, uint16 BaudRateConfigID);

This service shall set the baud rate configuration of the CAN controller. Depending on necessary baud rate modifications the controller might have to reset.

fonction CanIf_GetControllerRxErrorCounter [SWS_CANIF_91003] 📄 PDF

Std_ReturnType CanIf_GetControllerRxErrorCounter (uint8 ControllerId, uint8* RxErrorCounterPtr);

This service calls the corresponding CAN Driver service for obtaining the Rx error counter of the CAN controller.

fonction CanIf_GetControllerTxErrorCounter [SWS_CANIF_91004] 📄 PDF

Std_ReturnType CanIf_GetControllerTxErrorCounter (uint8 ControllerId, uint8* TxErrorCounterPtr);

This service calls the corresponding CAN Driver service for obtaining the Tx error counter of the CAN controller.

fonction CanIf_TriggerTransmit [SWS_CANIF_00883] 📄 PDF

Std_ReturnType CanIf_TriggerTransmit (PduIdType TxPduId, PduInfoType* PduInfoPtr);

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.

Guide de l'implémenteur à venir (complexité I2)

fonction CanIf_TxConfirmation [SWS_CANIF_00007] 📄 PDF

void CanIf_TxConfirmation (PduIdType CanTxPduId);

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

Guide de l'implémenteur à venir (complexité I3)

fonction CanIf_RxIndication [SWS_CANIF_00006] 📄 PDF

void CanIf_RxIndication (const Can_HwType* Mailbox, const PduInfoType* PduInfoPtr);

This service indicates a successful reception of a received CAN Rx L-PDU to the CanIf after passing all filters and validation checks.

Guide de l'implémenteur à venir (complexité I3)

fonction CanIf_ControllerBusOff [SWS_CANIF_00218] 📄 PDF

void CanIf_ControllerBusOff (uint8 ControllerId);

This service indicates a Controller BusOff event referring to the corresponding CAN Controller with the abstract CanIf ControllerId.

Guide de l'implémenteur à venir (complexité I2)

fonction CanIf_ConfirmPnAvailability [SWS_CANIF_00815] 📄 PDF

void CanIf_ConfirmPnAvailability (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.

Guide de l'implémenteur à venir (complexité I2)

fonction CanIf_ClearTrcvWufFlagIndication [SWS_CANIF_00762] 📄 PDF

void CanIf_ClearTrcvWufFlagIndication (uint8 TransceiverId);

This service indicates that the transceiver has cleared the WufFlag referring to the corresponding CAN transceiver with the abstract CanIf TransceiverId.

Guide de l'implémenteur à venir (complexité I2)

fonction CanIf_CheckTrcvWakeFlagIndication [SWS_CANIF_00763] 📄 PDF

void CanIf_CheckTrcvWakeFlagIndication (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.

Guide de l'implémenteur à venir (complexité I2)

fonction CanIf_ControllerModeIndication [SWS_CANIF_00699] 📄 PDF

void CanIf_ControllerModeIndication (uint8 ControllerId, Can_ControllerStateType ControllerMode);

This service indicates a controller state transition referring to the corresponding CAN controller with the abstract CanIf ControllerId.

Guide de l'implémenteur à venir (complexité I2)

fonction CanIf_TrcvModeIndication [SWS_CANIF_00764] 📄 PDF

void CanIf_TrcvModeIndication (uint8 TransceiverId, CanTrcv_TrcvModeType TransceiverMode);

This service indicates a transceiver state transition referring to the corresponding CAN transceiver with the abstract CanIf TransceiverId.

Guide de l'implémenteur à venir (complexité I2)

fonction CanIf_ControllerErrorStatePassive [SWS_CANIF_91008] 📄 PDF

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

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.

Guide de l'implémenteur à venir (complexité I2)

fonction CanIf_ErrorNotification [SWS_CANIF_91009] 📄 PDF

void CanIf_ErrorNotification (uint8 ControllerId, Can_ErrorType Can_ErrorType);

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.

Guide de l'implémenteur à venir (complexité I2)

fonction <User_TriggerTransmit> [SWS_CANIF_00886] 📄 PDF

Std_ReturnType <User_TriggerTransmit> (PduIdType TxPduId, PduInfoType* PduInfoPtr);

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.

Guide de l'implémenteur à venir (complexité I1)

fonction <User_TxConfirmation> [SWS_CANIF_00011] 📄 PDF

void <User_TxConfirmation> (PduIdType TxPduId, Std_ReturnType result);

The lower layer communication interface module confirms the transmission of a PDU, or the failure to transmit a PDU.

Guide de l'implémenteur à venir (complexité I1)

fonction <User_RxIndication> [SWS_CANIF_00012] 📄 PDF

void <User_RxIndication> (PduIdType RxPduId, const PduInfoType* PduInfoPtr);

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

Guide de l'implémenteur à venir (complexité I2)

fonction <User_ValidateWakeupEvent> [SWS_CANIF_00532] 📄 PDF

void <User_ValidateWakeupEvent> (EcuM_WakeupSourceType sources);

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.

Guide de l'implémenteur à venir (complexité I1)

fonction <User_ControllerBusOff> [SWS_CANIF_00014] 📄 PDF

void <User_ControllerBusOff> (uint8 ControllerId);

This service indicates a bus-off event to the corresponding upper layer module (mainly the CAN State Manager module).

Guide de l'implémenteur à venir (complexité I1)

fonction <User_ConfirmPnAvailability> [SWS_CANIF_00821] 📄 PDF

void <User_ConfirmPnAvailability> (uint8 TransceiverId);

This service indicates that the CAN transceiver is running in PN communication mode.

Guide de l'implémenteur à venir (complexité I1)

fonction <User_ClearTrcvWufFlagIndication> [SWS_CANIF_00788] 📄 PDF

void <User_ClearTrcvWufFlagIndication> (uint8 TransceiverId);

This service indicates that the CAN transceiver has cleared the WufFlag. This function is called in CanIf_ClearTrcvWufFlagIndication.

Guide de l'implémenteur à venir (complexité I1)

fonction <User_CheckTrcvWakeFlagIndication> [SWS_CANIF_00814] 📄 PDF

void <User_CheckTrcvWakeFlagIndication> (uint8 TransceiverId);

This service indicates that the wake up flag in the CAN transceiver is set. This function is called in CanIf_CheckTrcvWakeFlagIndication.

Guide de l'implémenteur à venir (complexité I1)

fonction <User_ControllerModeIndication> [SWS_CANIF_00687] 📄 PDF

void <User_ControllerModeIndication> (uint8 ControllerId, Can_ControllerStateType ControllerMode);

This service indicates a CAN controller state transition to the corresponding upper layer module (mainly the CAN State Manager module).

Guide de l'implémenteur à venir (complexité I1)

fonction <User_TrcvModeIndication> [SWS_CANIF_00693] 📄 PDF

void <User_TrcvModeIndication> (uint8 TransceiverId, CanTrcv_TrcvModeType TransceiverMode);

This service indicates a CAN transceiver state transition to the corresponding upper layer module (mainly the CAN State Manager module).

Guide de l'implémenteur à venir (complexité I1)

type CanIf_ConfigType [SWS_CANIF_00144] 📄 PDF

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_PduModeType [SWS_CANIF_00137] 📄 PDF

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.

Guide de l'implémenteur à venir (complexité I2)

type CanIf_NotifStatusType [SWS_CANIF_00201] 📄 PDF

Type CanIf_NotifStatusType.

Guide de l'implémenteur à venir (complexité I2)

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/CP_MOD_CanIf
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_CanIf@rel:R20-11#fab19d87
Content hash
fab19d87
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_CANInterface.pdf#nameddest=SWS_CANIF_00001

Initialisation et état

CanIf_DeInit fonction

De-initializes the CanIf module.

void CanIf_DeInit (void);

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

void CanIf_GetVersionInfo (Std_VersionInfoType* VersionInfo);
CanIf_Init fonction

This service Initializes internal and external interfaces of the CAN Interface for the further processing.

void CanIf_Init (const CanIf_ConfigType* ConfigPtr);

Services · Get…

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

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

Std_ReturnType CanIf_GetPduMode (uint8 ControllerId, CanIf_PduModeType* PduModePtr);

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

Services · Set…

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

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

void CanIf_SetDynamicTxId (PduIdType CanIfTxSduId, Can_IdType CanId);

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

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

Services · Check…

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

This service is performed to validate a previous wakeup event.

Std_ReturnType CanIf_CheckValidation (EcuM_WakeupSourceType WakeupSource);

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

Services · Controller…

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

Services · Read…

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

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

Services · Autres

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

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

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

Callbacks

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

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

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

void CanIf_TxConfirmation (PduIdType CanTxPduId);

Callouts et interfaces attendues

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

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

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

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

Types

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.