DEENESPTFRRUARHIKOZHNL

CAN Interface (CanIf)

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

ModulegidsAI-GEGENEREERD

Bemiddelt CAN-berichten en modusbesturing hardware-onafhankelijk tussen CAN-drivers en communicatiestack.
DOOR AI GEGENEREERD ongecontroleerd Model: claude-opus-5-5 · Inspanning: high · Temperatuur: niet regelbaar · Prompt: a6221da93ef5 Herkomst Open vragen (1)
Causaal anker: R20-11 Geldig vanaf R20-11 Nieuw gesynthetiseerd voor deze specificatiestand.
vertaald uit de Duitse handleidinggemini-3.8-flash-low · 2026-10-13 · Duits origineel

Bemiddelt CAN-berichten en modusbesturing hardware-onafhankelijk tussen CAN-drivers en communicatiestack.

CanIf is de hardware-onafhankelijke laag tussen CAN-drivers resp. transceivers en de bovenliggende communicatiemodules. Het beeldt zendopdrachten af op Can_Write(), buffert bij bezette hardware en stuurt bevestigingen evenals gefilterde ontvangsten door naar geconfigureerde callbacks [SWS_CANIF_00318]. Controller- en transceivermodi stuurt het aan in opdracht van CanSm en meldt BusOff en moduswijzigingen terug. PDU-kanaalmodi schakelen het zend- en ontvangstpad gescheiden. Er wordt alleen verzonden als de controller in CAN_CS_STARTED staat en het zendpad is vrijgegeven [SWS_CANIF_00317].

Het CAN Interface (CanIf) neemt alle hardware-onafhankelijke taken van de CAN-communicatie over. Daartoe behoren zendopdrachten, bevestigingen, ontvangstindicaties, foutmeldingen alsmede het starten en stoppen van CAN-controllers SWS CanIf p. 13. Toegang tot hardwarebuffers heeft CanIf uitsluitend via CanDrv-diensten [SWS_CANIF_00023]. Controllers en transceivers van meerdere drivers spreekt het aan via abstracte ID's [SWS_CANIF_00653]. Welke callbacks in PduR, CanNm, CanTp, CanSm of EcuM worden aangeroepen, bepaalt de configuratie [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 CAN-driver (Can) één of meer instanties 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()

Contextdiagram: CanIf tussen bovenliggende communicatiemodules, modusbeheer en de drivers voor controllers en transceivers. Bronnen: [SWS_CANIF_00012], [SWS_CANIF_00358], SWS CanIf p. 21

EcuM initialiseert CanIf met CanIf_Init(). Daarna staat elk kanaal op CANIF_OFFLINE [SWS_CANIF_00864], en tot die tijd wijzen de diensten af met E_NOT_OK [SWS_CANIF_00661]. De controllerstart via CanIf_SetControllerMode() loopt asynchroon. De voltooiing meldt CanIf_ControllerModeIndication(), die CanIf doorgeeft aan CanSm [SWS_CANIF_00003] [SWS_CANIF_00711]. Pas daarna accepteert CanIf_SetPduMode() verzoeken [SWS_CANIF_00874]. De PDU-kanaalmodi schakelen het zend- en ontvangstpad gescheiden. Controllergebeurtenissen zoals SLEEP, STOPPED of BusOff stellen deze geforceerd in [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 alleen ontvangst off->txoff CAN_CS_STOPPED / BusOff on CANIF_ONLINE verzending en ontvangst off->on CanIf_SetPduMode(CANIF_ONLINE) txoff->off CAN_CS_SLEEP txoff->on CanIf_SetPduMode(CANIF_ONLINE) txact CANIF_TX_OFFLINE_ACTIVE ontvangst, verzending wordt direct bevestigd txact->off CAN_CS_SLEEP txact->txoff CAN_CS_STOPPED / BusOff txact->on CanIf_SetPduMode(CANIF_ONLINE) on->off CanIf_SetPduMode(CANIF_OFFLINE) of CAN_CS_SLEEP on->txoff CanIf_SetPduMode(CANIF_TX_OFFLINE) of CAN_CS_STOPPED / BusOff on->txact CanIf_SetPduMode(CANIF_TX_OFFLINE_ACTIVE) hinweis CanIf_SetPduMode() wordt alleen geaccepteerd bij controller in CAN_CS_STARTED; weergegeven is een selectie van de overgangen

Toestandsdiagram: de vier PDU-kanaalmodi en hun overgangen door CanIf_SetPduMode() en controllergebeurtenissen. Bronnen: [SWS_CANIF_00137], [SWS_CANIF_00866], SWS CanIf Afb. 7.8 p. 61

Bij het verzenden roept CanIf_Transmit() Can_Write() aan [SWS_CANIF_00318]. Is de hardware bezet, dan buffert CanIf de L-PDU, voor zover er een buffer is geconfigureerd [SWS_CANIF_00381]. Bij de volgende bevestiging verzendt het het item met de hoogste prioriteit alsnog [SWS_CANIF_00668]. Ontvangen L-PDU's doorlopen softwarefilters en een lengtecontrole voordat CanIf ze doorstuurt naar <User_RxIndication> [SWS_CANIF_00389] [SWS_CANIF_00056].

In geval van een fout stelt een BusOff het kanaal in op CANIF_TX_OFFLINE en wordt dit gemeld aan CanSm [SWS_CANIF_00724]. Bij het stoppen van een controller bevestigt CanIf alle openstaande zendopdrachten met E_NOT_OK [SWS_CANIF_00739]. Parameter- en runtimefouten gaan naar de DET [SWS_CANIF_91006] [SWS_CANIF_91007].

Rol: hardware-onafhankelijke draaischijf tussen CAN-drivers en communicatiestack

Het CAN Interface (CanIf) neemt alle hardware-onafhankelijke taken van de CAN-communicatie van een ECU over. De onderliggende CAN-drivers bekommeren zich enkel nog om hun concrete hardware. CanIf verwerkt zendopdrachten, zendbevestigingen, ontvangstindicaties en foutmeldingen en start resp. stopt CAN-controllers SWS CanIf p. 13. Toegang tot hardwarebuffers heeft het uitsluitend via diensten van de CanDrv [SWS_CANIF_00023]. Sturende diensten werken met een abstracte ControllerId, die de controllers van alle CanDrv-instanties doornummert vanaf 0 [SWS_CANIF_00653]. Voor transceivers geldt hetzelfde met de TransceiverId [SWS_CANIF_00655].

Naar beneden toe vat CanIf de API's van meerdere CanTrcv-drivers samen tot een uniforme interface, maar bevat zelf geen transceiverlogica SWS CanIf p. 21. Ook bij meerdere CanDrv's bestaat elke callback slechts één keer. CanIf herkent de aanroepende driver aan de ControllerId in Can_HwType SWS CanIf p. 68.

Naar boven toe roept CanIf configureerbare callbacks zoals <User_TxConfirmation> en <User_RxIndication> aan [SWS_CANIF_00011] [SWS_CANIF_00012]. De configuratie legt de concrete ontvanger vast, zoals PduR_CanIfRxIndication [SWS_CANIF_00442] of CanTp_TxConfirmation [SWS_CANIF_00550]. BusOff en moduswijzigingen meldt CanIf aan CanSm of een CDD [SWS_CANIF_00724] [SWS_CANIF_00711]. Wake-up-validaties gaan naar 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 CAN-driver (Can) één of meer instanties 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()

Contextdiagram: CanIf bemiddelt tussen de bovenliggende communicatiemodules, het modusbeheer (CanSm, EcuM) en de drivers voor CAN-controllers en transceivers. Fout-, beveiligings- en mirroring-meldingen gaan naar DET, IdsM en Mirror. Bronnen: [SWS_CANIF_00011], [SWS_CANIF_00724], [SWS_CANIF_00358], [SWS_CANIF_00905], [SWS_CANIF_00913], SWS CanIf p. 13

De functionaliteit hangt sterk af van de configuratie. CanIf_Init() leest uit de configuratiecontainers onder andere het aantal controllers en de toewijzing van de HTH's/HRH's SWS CanIf p. 22. HTH en HRH zijn handles naar logische zend- resp. ontvangstobjecten [SWS_CANIF_00291] [SWS_CANIF_00292]. Veel diensten kunnen via pre-compile-schakelaars worden uitgeschakeld, bijv. CanIf_ReadRxPduData() [SWS_CANIF_00330] of CanIf_SetBaudrate() [SWS_CANIF_00871]. Is voor een niet-verplichte callback geen naam geconfigureerd, dan vervalt de aanroep SWS CanIf p. 133. <User_ControllerBusOff> moet daarentegen altijd geconfigureerd zijn [SWS_CANIF_00524].

Van initialisatie naar gestarte controller

EcuM roept CanIf_Init() aan [SWS_CANIF_00001]. Daarbij initialiseert CanIf variabelen, vlaggen en buffers [SWS_CANIF_00085] evenals alle zend-L-PDU-buffers [SWS_CANIF_00387]. Elk kanaal start in CANIF_OFFLINE [SWS_CANIF_00864]. De controllers blijven daarna in de modus STOPPED, waarin noch verzonden noch ontvangen wordt. CanDrv en CanTrcv initialiseert EcuM afzonderlijk SWS CanIf p. 40. Vóór de initialisatie leveren alle diensten behalve CanIf_Init() en CanIf_GetVersionInfo() E_NOT_OK [SWS_CANIF_00661] op. Wie CanIf_DeInit() [SWS_CANIF_91002] aanroept, moet ervoor zorgen dat er geen overdrachten meer lopen SWS CanIf p. 81.

De controllerstart verloopt asynchroon. CanIf_SetControllerMode() [SWS_CANIF_00003] roept Can_SetControllerMode() aan [SWS_CANIF_00308]. De voltooide overgang meldt de driver later met CanIf_ControllerModeIndication() [SWS_CANIF_00699], en CanIf geeft de melding door aan CanSm [SWS_CANIF_00711]. In polling-bedrijf herkent Can_MainFunction_Mode() de overgang SWS CanIf p. 152. Pas in CAN_CS_STARTED accepteert CanIf_SetPduMode() verzoeken [SWS_CANIF_00874].

Controller starten en PDU-kanaal vrijgevenCanSm / obere SchichtCanIfCanCanControllerCanIf_SetControllerMode(ControllerId,CAN_CS_STARTED)Can_SetControllerMode(Controller, Transition)Overgang naar START aanvragenE_OKE_OK (Anforderung angenommen)Asynchroon: de overgang isnog niet voltooidloopCan_MainFunction_Mode() bis Moduswechsel erkanntHardwaretoestand controlerenCanIf_ControllerModeIndication(ControllerId,CAN_CS_STARTED)<User_ControllerModeIndication>(CanSM_ControllerModeIndication)Use Case: PDU-Pfade freischaltenCanIf_SetPduMode(ControllerId, CANIF_ONLINE)alleen toegestaan in CAN_CS_STARTEDE_OK

Sequentiediagram: Het startverzoek wordt onmiddellijk bevestigd, maar de moduswijziging wordt pas later geïndiceerd. Daarna kunnen de PDU-paden worden vrijgegeven. Bronnen: [SWS_CANIF_00308], [SWS_CANIF_00711], [SWS_CANIF_00874], SWS CanIf p. 156

PDU-kanaalmodi: Zend- en ontvangstpad gescheiden schakelen

Elk kanaal van een controller heeft een modus van het type CanIf_PduModeType [SWS_CANIF_00137]. Hogere lagen stellen deze in met CanIf_SetPduMode() en lezen deze uit met CanIf_GetPduMode() [SWS_CANIF_00008] [SWS_CANIF_00009]. De modi in detail SWS CanIf p. 58:

  • CANIF_OFFLINE: Zendopdrachten worden met E_NOT_OK afgewezen en de buffers worden geleegd. Indicaties en bevestigingen worden onderdrukt [SWS_CANIF_00073].
  • CANIF_TX_OFFLINE: Alleen het zendpad is geblokkeerd, de ontvangst blijft actief [SWS_CANIF_00489].
  • CANIF_TX_OFFLINE_ACTIVE: Zendopdrachten worden onmiddellijk bevestigd zonder te worden doorgegeven aan CanDrv [SWS_CANIF_00072].
  • CANIF_ONLINE: Zenden en ontvangen zijn volledig actief [SWS_CANIF_00075].

Controllergebeurtenissen stellen de kanaalmodus gedwongen in. CAN_CS_SLEEP leidt tot CANIF_OFFLINE [SWS_CANIF_00865]. CAN_CS_STOPPED en BusOff leiden tot 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 alleen ontvangst off->txoff CAN_CS_STOPPED / BusOff on CANIF_ONLINE verzending en ontvangst off->on CanIf_SetPduMode(CANIF_ONLINE) txoff->off CAN_CS_SLEEP txoff->on CanIf_SetPduMode(CANIF_ONLINE) txact CANIF_TX_OFFLINE_ACTIVE ontvangst, verzending wordt direct bevestigd txact->off CAN_CS_SLEEP txact->txoff CAN_CS_STOPPED / BusOff txact->on CanIf_SetPduMode(CANIF_ONLINE) on->off CanIf_SetPduMode(CANIF_OFFLINE) of CAN_CS_SLEEP on->txoff CanIf_SetPduMode(CANIF_TX_OFFLINE) of CAN_CS_STOPPED / BusOff on->txact CanIf_SetPduMode(CANIF_TX_OFFLINE_ACTIVE) hinweis CanIf_SetPduMode() wordt alleen geaccepteerd bij controller in CAN_CS_STARTED; weergegeven is een selectie van de overgangen

Toestandsdiagram: De vier PDU-kanaalmodi met overgangen door CanIf_SetPduMode() en door controllergebeurtenissen. De drie beperkte modi zijn zoals in de specificatie samengevoegd tot een boventoestand. Bronnen: [SWS_CANIF_00864], [SWS_CANIF_00865], [SWS_CANIF_00866], [SWS_CANIF_00874], SWS CanIf Afb. 7.8 p. 61

Zendpad: CanIf_Transmit, bufferactiviteit en Trigger Transmit

CanIf_Transmit() [SWS_CANIF_00005] bepaalt het HTH en roept Can_Write() aan. De doorgegeven swPduHandle komt later in CanIf_TxConfirmation() terug [SWS_CANIF_00318]. Vooraf stelt CanIf de twee meest significante bits van de CanId in [SWS_CANIF_00243]. Levert Can_Write() E_OK op, dan geldt dat ook voor de zendopdracht [SWS_CANIF_00162].

Een opdracht wordt alleen onder deze voorwaarden geaccepteerd:

Recentere documentpassages noemen aanvullend CanXL_Write() SWS CanIf p. 87. Voor R20-11 is alleen Can_Write() normatief.

txentscheidung start aufruf CanIf_Transmit(TxPduId, PduInfoPtr) start->aufruf init CanIf initialisiert? aufruf->init modus Controller CAN_CS_STARTED en zendpad online / offline active? init->modus ja nok1 E_NOT_OK init->nok1 nein active Kanal in CANIF_TX_OFFLINE_ACTIVE? modus->active ja nok2 E_NOT_OK (bij CANIF_OFFLINE tevens CANIF_E_STOPPED) modus->nok2 nein pn PnTxFilter actief en geen CanIfTxPduPnFilterPdu? active->pn nein bestaetigen <User_TxConfirmation> sofort, kein Can_Write() active->bestaetigen ja laenge SduLength groter dan globale PDU? pn->laenge nein nok3 E_NOT_OK pn->nok3 ja trunc CanIfTxPduTruncation aktiviert? laenge->trunc ja write Can_Write(Hth, PduInfo) laenge->write nein kuerzen Gegevens inkorten tot lengte van de globale PDU trunc->kuerzen ja nok4 CANIF_E_TXPDU_LENGTH_EXCEEDED, E_NOT_OK trunc->nok4 nein kuerzen->write rueck Retourwaarde van Can_Write()? write->rueck puffer Buffering actief en buffergrootte > 0? rueck->puffer CAN_BUSY ok E_OK rueck->ok E_OK gleich dezelfde L-PDU al gebufferd? puffer->gleich ja nok5 E_NOT_OK (L-PDU verloren) puffer->nok5 nein frei freies Pufferelement? gleich->frei nein ueberschreiben gebufferde instantie overschrijven gleich->ueberschreiben ja ablegen L-PDU in CanIfTxBuffer ablegen frei->ablegen ja nok6 E_NOT_OK frei->nok6 nein ueberschreiben->ok ablegen->ok

Activiteitendiagram: Zo kiest CanIf_Transmit() tussen afwijzing, gesimuleerde bevestiging, direct verzenden en buffering. Interpretatie: De volgorde van de controles is gekozen met het oog op de leesbaarheid. Bronnen: [SWS_CANIF_00317], [SWS_CANIF_00382], [SWS_CANIF_00072], [SWS_CANIF_00381], [SWS_CANIF_00837], SWS CanIf Afb. 7.5 p. 51

Meldt Can_Write() CAN_BUSY en is CanIfPublicTxBuffering actief [SWS_CANIF_00063], dan probeert CanIf de L-PDU te bufferen [SWS_CANIF_00381]. Dat vereist een buffergrootte groter dan nul [SWS_CANIF_00835]. Bevindt dezelfde L-PDU zich al in de buffer, dan wordt deze overschreven [SWS_CANIF_00068]. Is de buffer vol, dan wordt een nieuwe L-PDU met E_NOT_OK afgewezen [SWS_CANIF_00837]. Een L-PDU bevindt zich altijd slechts op één plaats: in het hardware-object of in de CanIf-buffer SWS CanIf p. 43.

Bij CanIf_TxConfirmation() [SWS_CANIF_00007] stelt CanIf de verantwoordelijke gebruiker via <User_TxConfirmation> op de hoogte met E_OK [SWS_CANIF_00383]. In dezelfde aanroep controleert het de buffers van het vrijgekomen HTH [SWS_CANIF_00386]. Het draagt de wachtende invoer met de hoogste prioriteit over aan Can_Write() [SWS_CANIF_00668] [SWS_CANIF_00070]. Bij E_OK verwijdert het de invoer onmiddellijk uit de buffer [SWS_CANIF_00183]. Recentere documentpassages noemen de callback LSduR_CanIfTxConfirmation() SWS CanIf p. 157. In R20-11 geldt <User_TxConfirmation>.

Verzenden met buffering en nazenden bij bevestigingObere Schicht (z. B. PduR)CanIfCanCanControllerUse Case: Zendopdracht bij bezette hardwareCanIf_Transmit(TxPduId, PduInfoPtr)Can_Write(Hth, PduInfo)CAN_BUSYL-PDU in CanIfTxBuffer ablegenE_OKUse Case: Bevestiging van een eerdere opdrachtTransmit-InterruptCanIf_TxConfirmation(CanTxPduId)Buffer van de vrijgekomen HTH controlerenaltBuffer gevuldCan_Write() voor invoer methoogste prioriteitL-PDU in Hardware schreibenE_OKInvoer direct uit buffer verwijderenPuffer leerkein weiterer Can_Write()-Aufruf<User_TxConfirmation>(TxPduId, E_OK)

Sequentiediagram: Bij bezette hardware wordt de L-PDU gebufferd. De bevestiging van een eerdere opdracht triggert vervolgens het nasturen vanuit de buffer. Bronnen: [SWS_CANIF_00381], [SWS_CANIF_00386], [SWS_CANIF_00668], [SWS_CANIF_00183], SWS CanIf p. 138, SWS CanIf p. 143

Bij Triggered Transmission geeft de gebruiker geen data mee, maar een NULL-SduDataPtr [SWS_CANIF_00882]. Is de hardware vrij, dan haalt de driver de data op via CanIf_TriggerTransmit() [SWS_CANIF_00883]. CanIf stuurt de aanroep door naar <User_TriggerTransmit> en retourneert het resultaat daarvan [SWS_CANIF_00885]. Is de hardware bezet, dan buffert CanIf alleen het Transmit Request [SWS_CANIF_00881]. De CanId van dynamische L-PDU's kan met CanIf_SetDynamicTxId() worden gewijzigd [SWS_CANIF_00189]. Als alternatief is deze afkomstig uit de MetaData [SWS_CANIF_00855] SWS CanIf p. 34.

Trigger TransmitObere SchichtCanIfCanCanControllerCanIf_Transmit(TxPduId, PduInfoPtr)SduDataPtr = NULL, alleen SduLengthCan_Write(Hth, PduInfo)altHardwareobjekt freiCanIf_TriggerTransmit(TxPduId, PduInfoPtr)<User_TriggerTransmit>(TxPduId, PduInfoPtr)Daten in bereitgestelltenPuffer kopierenE_OKE_OK (retourwaarde doorgegeven)L-PDU in Hardware kopierenE_OKE_OKHardwareobjekt belegtCAN_BUSYalleen transmit request inCanIfTxBuffer bufferen (indien mogelijk)

Sequentiediagram: Bij Trigger Transmit haalt de driver de data pas op bij de gebruiker wanneer het hardware-object vrij is. Bronnen: [SWS_CANIF_00882], [SWS_CANIF_00885], [SWS_CANIF_00881], SWS CanIf Afb. 9.6 p. 137

Ontvangstpad: Filteren, lengte controleren, doorsturen

Na een ontvangst roept de driver CanIf_RxIndication() met Mailbox en data aan [SWS_CANIF_00006]. De verwerking verloopt in drie fasen:

rx start aufruf CanIf_RxIndication(Mailbox, PduInfoPtr) start->aufruf init CanIf initialisiert? aufruf->init keine geen Rx-verwerking init->keine nein filterkonf Software-Filter konfiguriert (BasicCAN-HRH)? init->filterkonf ja filter Software-Filter: CanId akzeptiert? filterkonf->filter ja dlckonf Lengtecontrole actief? filterkonf->dlckonf nein verworfen Einde zonder indicatie filter->verworfen nein filter->dlckonf ja dlc Lengte >= geconfigureerde lengte? dlckonf->dlc ja akzeptiert L-PDU akzeptiert dlckonf->akzeptiert nein dlcfehler Det_ReportRuntimeError() CANIF_E_INVALID_DATA_LENGTH dlc->dlcfehler nein dlc->akzeptiert ja neben afhankelijk van de configuratie: ontvangstbuffer vullen, notificatiestatus instellen akzeptiert->neben ziel Ziel-Nutzer konfiguriert? akzeptiert->ziel indikation <User_RxIndication>(RxPduId, PduInfoPtr) ziel->indikation ja ende Ende ziel->ende nein indikation->ende

Activiteitendiagram: Softwarefilter en lengtecontrole bepalen of een ontvangen L-PDU wordt geïndiceerd. Neveneffecten die afhankelijk zijn van de configuratie worden parallel weergegeven. Bronnen: [SWS_CANIF_00421], [SWS_CANIF_00389], [SWS_CANIF_00168], [SWS_CANIF_00199], [SWS_CANIF_00392], SWS CanIf Afb. 7.6 p. 51

Aanvullend biedt CanIf opvraagdiensten. CanIf_ReadRxPduData() leest data uit een eigen ontvangstbuffer [SWS_CANIF_00194] [SWS_CANIF_00198], maar is niet bedoeld voor bereikontvangst [SWS_CANIF_00329]. CanIf_ReadTxNotifStatus() en CanIf_ReadRxNotifStatus() stellen de status bij het lezen terug [SWS_CANIF_00393] [SWS_CANIF_00394]. Dit „read-and-consume” waarborgt dat er sinds de laatste aanroep minstens één gebeurtenis is opgetreden SWS CanIf p. 55. CanIf_GetTxConfirmationState() vat de bevestigingen van een gehele controller samen [SWS_CANIF_00734].

Transceiver, wake-up en Partial Networking

De transceiver-diensten stuurt CanIf rechtstreeks door naar de CanTrcv-driver. CanIf_SetTrcvMode() roept CanTrcv_SetOpMode() [SWS_CANIF_00358] aan, CanIf_GetTrcvMode() roept CanTrcv_GetOpMode() [SWS_CANIF_00363] aan. Moduswijzigingen van de transceiver geeft CanIf door aan CanSm [SWS_CANIF_00712].

Voor de wake-up vraagt CanIf_CheckWakeup() de controllers en transceivers uit naar de wake-up-bron [SWS_CANIF_00395] SWS CanIf p. 56. Ter validatie slaat CanIf de eerste geldige ontvangst van een gestarte controller op [SWS_CANIF_00286]. CanIf_CheckValidation() meldt deze vervolgens via <User_ValidateWakeupEvent> [SWS_CANIF_00179].

Is Partial Networking actief, dan legt een PnTxFilter per controller een extra laag over de kanaalmodi [SWS_CANIF_00747]. Deze wordt bij CAN_CS_SLEEP geactiveerd [SWS_CANIF_00749] en bij de eerste bevestiging of indicatie weer gedeactiveerd [SWS_CANIF_00751] [SWS_CANIF_00896] SWS CanIf p. 70.

Gedrag in het foutgeval

BusOff: De driver meldt de fout met CanIf_ControllerBusOff() [SWS_CANIF_00218]. CanIf zet het kanaal daarop op CANIF_TX_OFFLINE [SWS_CANIF_00866] en meldt de BusOff aan CanSm [SWS_CANIF_00724] SWS CanIf Afb. 9.11 p. 147. Het herstel wordt door CanSm bestuurd via CanIf_SetControllerMode() SWS CanIf p. 160.

BusOff-melding en herstelCanSm (<User_ControllerBusOff>)CanIfCanCanControllerBusOff-Erkennungcontroller indien nodigop STOPPED instellenCanIf_ControllerBusOff(ControllerId)Kanaal op CANIF_TX_OFFLINE,Sendepuffer leerenbij security event reporting: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>

Sequentiediagram: Verloop van de BusOff-detectie via de melding aan CanSm tot de herstart van de controller. Bronnen: [SWS_CANIF_00218], [SWS_CANIF_00866], [SWS_CANIF_00724], [SWS_CANIF_00918], SWS CanIf p. 154, SWS CanIf p. 160

Controller gestopt: Bij het binnengaan van CAN_CS_STOPPED leegt CanIf de zendbuffers [SWS_CANIF_00485]. Alle openstaande zendopdrachten bevestigt het met E_NOT_OK [SWS_CANIF_00739]. Zo ontvangt elke geaccepteerde PDU een bevestiging, positief of negatief SWS CanIf p. 54.

Foutmeldingen: Ongeldige parameters meldt CanIf als ontwikkelingsfout, bijv. CANIF_E_PARAM_CONTROLLERID [SWS_CANIF_00311] [SWS_CANIF_91006]. Runtimefouten zijn onder andere CANIF_E_INVALID_DATA_LENGTH [SWS_CANIF_00168] en CANIF_E_STOPPED [SWS_CANIF_00382] [SWS_CANIF_91007]. Een verloren gegane zendopdracht blijkt alleen uit de retourwaarde of uit het ontbreken van de bevestiging Error Description p. 22. Beveiligingsincidenten zoals CANIF_SEV_ERRORSTATE_PASSIVE meldt CanIf aan de IdsM [SWS_CANIF_00913] [SWS_CANIF_00917].

Verdere gedetailleerde bewijzen

Door AI gegenereerde handleiding op basis van specificatiefragmenten. Normatief voor R20-11 zijn de gelinkte requirements; documentpassages uit recentere releases zijn als zodanig aangeduid.

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

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

Implementer's Guide volgt (complexiteit I3)

functie CanIf_DeInit [SWS_CANIF_91002] 📄 PDF

void CanIf_DeInit (void);

De-initializes the CanIf module.

Implementer's Guide volgt (complexiteit I1)

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

Implementer's Guide volgt (complexiteit I2)

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

Implementer's Guide volgt (complexiteit I2)

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

Implementer's Guide volgt (complexiteit I2)

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

Implementer's Guide volgt (complexiteit I3)

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

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

Implementer's Guide volgt (complexiteit I2)

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

Implementer's Guide volgt (complexiteit I2)

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

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

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

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

Implementer's Guide volgt (complexiteit I2)

functie CanIf_TxConfirmation [SWS_CANIF_00007] 📄 PDF

void CanIf_TxConfirmation (PduIdType CanTxPduId);

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

Implementer's Guide volgt (complexiteit I3)

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

Implementer's Guide volgt (complexiteit I3)

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

Implementer's Guide volgt (complexiteit I2)

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

Implementer's Guide volgt (complexiteit I2)

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

Implementer's Guide volgt (complexiteit I2)

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

Implementer's Guide volgt (complexiteit I2)

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

Implementer's Guide volgt (complexiteit I2)

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

Implementer's Guide volgt (complexiteit I2)

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

Implementer's Guide volgt (complexiteit I2)

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

Implementer's Guide volgt (complexiteit I2)

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

Implementer's Guide volgt (complexiteit I1)

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

Implementer's Guide volgt (complexiteit I1)

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

Implementer's Guide volgt (complexiteit I2)

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

Implementer's Guide volgt (complexiteit I1)

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

Implementer's Guide volgt (complexiteit I1)

functie <User_ConfirmPnAvailability> [SWS_CANIF_00821] 📄 PDF

void <User_ConfirmPnAvailability> (uint8 TransceiverId);

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

Implementer's Guide volgt (complexiteit I1)

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

Implementer's Guide volgt (complexiteit I1)

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

Implementer's Guide volgt (complexiteit I1)

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

Implementer's Guide volgt (complexiteit I1)

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

Implementer's Guide volgt (complexiteit 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.

Implementer's Guide volgt (complexiteit I2)

type CanIf_NotifStatusType [SWS_CANIF_00201] 📄 PDF

Type CanIf_NotifStatusType.

Implementer's Guide volgt (complexiteit 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#2566830d
Content hash
2566830d
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_CANInterface.pdf#nameddest=SWS_CANIF_00001

Initialisatie en status

CanIf_DeInit functie

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 functie

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

void CanIf_Init (const CanIf_ConfigType* ConfigPtr);

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

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

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

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

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

Diensten · Overige

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 en verwachte interfaces

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

Typen

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.