DEENESPTFRRUARHIKOZHNL

CAN Interface (CanIf)

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

Guia do móduloGERADO POR IA

Intermedeia mensagens CAN e controle de modo de forma independente de hardware entre os drivers CAN e a pilha de comunicação.
GERADO POR IA não revisado Modelo: claude-opus-5-5 · Esforço: high · Temperatura: não controlável · Prompt: a6221da93ef5 Procedência Perguntas em aberto (1)
Âncora causal: R20-11 Válido a partir de R20-11 Sintetizado para esta versão de especificação.
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

Intermedeia mensagens CAN e controle de modo de forma independente de hardware entre os drivers CAN e a pilha de comunicação.

O CanIf é a camada independente de hardware entre drivers CAN ou transceivers e os módulos superiores de comunicação. Ele mapeia ordens de transmissão em Can_Write(), faz o buffering quando o hardware está ocupado e encaminha confirmações bem como recepções filtradas para callbacks configurados [SWS_CANIF_00318]. Ele controla modos de controller e transceiver por solicitação do CanSm e reporta de volta BusOff e mudanças de modo. Modos de canal de PDU comutam os caminhos de transmissão e recepção separadamente. A transmissão ocorre somente se o controller estiver em CAN_CS_STARTED e o caminho de transmissão estiver liberado [SWS_CANIF_00317].

A CAN Interface (CanIf) assume todas as tarefas independentes de hardware da comunicação CAN. Entre elas estão ordens de transmissão, confirmações, indicações de recepção, notificações de erro, bem como o início e a parada de controllers CAN SWS CanIf p. 13. O CanIf acessa buffers de hardware exclusivamente por meio de serviços CanDrv [SWS_CANIF_00023]. Ele endereça controllers e transceivers de múltiplos drivers por meio de IDs abstratos [SWS_CANIF_00653]. Quais callbacks são chamados em PduR, CanNm, CanTp, CanSm ou EcuM é definido pela configuração [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 Driver CAN (Can) uma ou mais instâncias 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()

Diagrama de contexto: CanIf entre módulos superiores de comunicação, gerenciamento de modo e os drivers de controller e transceiver. Fontes: [SWS_CANIF_00012], [SWS_CANIF_00358], SWS CanIf p. 21

O EcuM inicializa o CanIf com CanIf_Init(). Depois disso, cada canal permanece em CANIF_OFFLINE [SWS_CANIF_00864], e até esse momento os serviços recusam chamadas com E_NOT_OK [SWS_CANIF_00661]. O início do controller via CanIf_SetControllerMode() é assíncrono. A conclusão é reportada por CanIf_ControllerModeIndication(), que o CanIf repassa ao CanSm [SWS_CANIF_00003] [SWS_CANIF_00711]. Somente depois disso CanIf_SetPduMode() aceita requisições [SWS_CANIF_00874]. Os modos de canal de PDU comutam os caminhos de transmissão e recepção separadamente. Eventos de controller como SLEEP, STOPPED ou BusOff os definem compulsoriamente [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 apenas recepção off->txoff CAN_CS_STOPPED / BusOff on CANIF_ONLINE transmissão e recepção off->on CanIf_SetPduMode(CANIF_ONLINE) txoff->off CAN_CS_SLEEP txoff->on CanIf_SetPduMode(CANIF_ONLINE) txact CANIF_TX_OFFLINE_ACTIVE recepção, transmissão é confirmada imediatamente 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() é aceito apenas com controlador em CAN_CS_STARTED; é mostrada uma seleção das transições

Diagrama de estados: os quatro modos de canal de PDU e suas transições por CanIf_SetPduMode() e eventos de controller. Fontes: [SWS_CANIF_00137], [SWS_CANIF_00866], SWS CanIf Fig. 7.8 p. 61

Durante a transmissão, CanIf_Transmit() chama Can_Write() [SWS_CANIF_00318]. Se o hardware estiver ocupado, o CanIf faz o buffering da L-PDU, caso um buffer esteja configurado [SWS_CANIF_00381]. Na próxima confirmação, ele envia a entrada de maior prioridade subsequentemente [SWS_CANIF_00668]. As L-PDUs recebidas passam por filtragem de software e verificação de comprimento antes de o CanIf encaminhá-las para <User_RxIndication> [SWS_CANIF_00389] [SWS_CANIF_00056].

Em caso de erro, um BusOff define o canal para CANIF_TX_OFFLINE e é reportado ao CanSm [SWS_CANIF_00724]. Na parada de um controller, o CanIf confirma todas as ordens de transmissão pendentes com E_NOT_OK [SWS_CANIF_00739]. Erros de parâmetros e de tempo de execução são enviados ao DET [SWS_CANIF_91006] [SWS_CANIF_91007].

Papel: hub independente de hardware entre os drivers CAN e a pilha de comunicação

A CAN Interface (CanIf) assume todas as tarefas independentes de hardware da comunicação CAN de uma ECU. Os drivers CAN subjacentes cuidam apenas de seu hardware concreto. O CanIf processa ordens de transmissão, confirmações de transmissão, indicações de recepção e notificações de erro, além de iniciar e parar controllers CAN SWS CanIf p. 13. Ele acessa buffers de hardware exclusivamente por meio de serviços do CanDrv [SWS_CANIF_00023]. Serviços de controle operam com um ControllerId abstrato, que numera sequencialmente a partir de 0 os controllers de todas as instâncias CanDrv [SWS_CANIF_00653]. Para transceivers, aplica-se o mesmo com o TransceiverId [SWS_CANIF_00655].

Para baixo, o CanIf consolida as APIs de vários drivers CanTrcv em uma interface uniforme, mas ele próprio não contém lógica de transceiver SWS CanIf p. 21. Mesmo com múltiplos CanDrvs, cada callback existe apenas uma vez. O CanIf reconhece o driver chamador pelo ControllerId em Can_HwType SWS CanIf p. 68.

Para cima, o CanIf chama callbacks configuráveis como <User_TxConfirmation> e <User_RxIndication> [SWS_CANIF_00011] [SWS_CANIF_00012]. A configuração define o receptor concreto, como PduR_CanIfRxIndication [SWS_CANIF_00442] ou CanTp_TxConfirmation [SWS_CANIF_00550]. O CanIf reporta BusOff e mudanças de modo ao CanSm ou a um CDD [SWS_CANIF_00724] [SWS_CANIF_00711]. Validações de wake-up são enviadas ao 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 Driver CAN (Can) uma ou mais instâncias 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()

Diagrama de contexto: o CanIf intermedeia entre os módulos superiores de comunicação, o gerenciamento de modo (CanSm, EcuM) e os drivers para controllers e transceivers CAN. Notificações de erro, segurança e espelhamento vão para DET, IdsM e Mirror. Fontes: [SWS_CANIF_00011], [SWS_CANIF_00724], [SWS_CANIF_00358], [SWS_CANIF_00905], [SWS_CANIF_00913], SWS CanIf p. 13

O escopo funcional depende fortemente da configuração. CanIf_Init() lê dos contêineres de configuração, entre outros, o número de controllers e a atribuição dos HTHs/HRHs SWS CanIf p. 22. HTH e HRH são handles para objetos lógicos de transmissão e de recepção, respectivamente [SWS_CANIF_00291] [SWS_CANIF_00292]. Muitos serviços podem ser desativados via switches de pré-compilação, por exemplo, CanIf_ReadRxPduData() [SWS_CANIF_00330] ou CanIf_SetBaudrate() [SWS_CANIF_00871]. Se nenhum nome estiver configurado para um callback não obrigatório, a chamada é omitida SWS CanIf p. 133. <User_ControllerBusOff>, por outro lado, deve estar sempre configurado [SWS_CANIF_00524].

Da inicialização ao controller iniciado

O EcuM chama CanIf_Init() [SWS_CANIF_00001]. Com isso, o CanIf inicializa variáveis, flags e buffers [SWS_CANIF_00085], bem como todos os buffers de L-PDU de transmissão [SWS_CANIF_00387]. Cada canal inicia em CANIF_OFFLINE [SWS_CANIF_00864]. Em seguida, os controllers permanecem no modo STOPPED, no qual não se transmite nem se recebe. O EcuM inicializa CanDrv e CanTrcv separadamente SWS CanIf p. 40. Antes da inicialização, todos os serviços, exceto CanIf_Init() e CanIf_GetVersionInfo(), retornam E_NOT_OK [SWS_CANIF_00661]. Quem chama CanIf_DeInit() [SWS_CANIF_91002] deve garantir que nenhuma transmissão esteja mais em execução SWS CanIf p. 81.

A inicialização do controller ocorre de forma assíncrona. CanIf_SetControllerMode() [SWS_CANIF_00003] chama Can_SetControllerMode() [SWS_CANIF_00308]. O driver reporta a mudança realizada mais tarde com CanIf_ControllerModeIndication() [SWS_CANIF_00699], e o CanIf repassa a notificação ao CanSm [SWS_CANIF_00711]. Em operação de polling, Can_MainFunction_Mode() reconhece a mudança SWS CanIf p. 152. Somente em CAN_CS_STARTED CanIf_SetPduMode() aceita requisições [SWS_CANIF_00874].

Iniciar controlador e habilitar canal de PDUCanSm / obere SchichtCanIfCanCanControllerCanIf_SetControllerMode(ControllerId,CAN_CS_STARTED)Can_SetControllerMode(Controller, Transition)Solicitar transição para STARTE_OKE_OK (Anforderung angenommen)Assíncrono: a mudança aindanão foi concluídaloopCan_MainFunction_Mode() bis Moduswechsel erkanntverificar estado de hardwareCanIf_ControllerModeIndication(ControllerId,CAN_CS_STARTED)<User_ControllerModeIndication>(CanSM_ControllerModeIndication)Use Case: PDU-Pfade freischaltenCanIf_SetPduMode(ControllerId, CANIF_ONLINE)permitido apenas em CAN_CS_STARTEDE_OK

Diagrama de sequência: a solicitação de início é confirmada imediatamente, mas a mudança de modo é indicada apenas mais tarde. Em seguida, os caminhos de PDU podem ser liberados. Fontes: [SWS_CANIF_00308], [SWS_CANIF_00711], [SWS_CANIF_00874], SWS CanIf p. 156

Modos de canal de PDU: comutar caminhos de transmissão e de recepção separadamente

Cada canal de um controller possui um modo do tipo CanIf_PduModeType [SWS_CANIF_00137]. As camadas superiores o definem com CanIf_SetPduMode() e o leem com CanIf_GetPduMode() [SWS_CANIF_00008] [SWS_CANIF_00009]. Os modos detalhadamente SWS CanIf p. 58:

  • CANIF_OFFLINE: ordens de transmissão são rejeitadas com E_NOT_OK e os buffers são esvaziados. Indicações e confirmações são suprimidas [SWS_CANIF_00073].
  • CANIF_TX_OFFLINE: apenas o caminho de transmissão é bloqueado; a recepção permanece ativa [SWS_CANIF_00489].
  • CANIF_TX_OFFLINE_ACTIVE: ordens de transmissão são confirmadas imediatamente, sem serem repassadas ao CanDrv [SWS_CANIF_00072].
  • CANIF_ONLINE: transmissão e recepção estão plenamente ativas [SWS_CANIF_00075].

Eventos de controller definem compulsoriamente o modo de canal. CAN_CS_SLEEP leva a CANIF_OFFLINE [SWS_CANIF_00865]. CAN_CS_STOPPED e BusOff levam a 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 apenas recepção off->txoff CAN_CS_STOPPED / BusOff on CANIF_ONLINE transmissão e recepção off->on CanIf_SetPduMode(CANIF_ONLINE) txoff->off CAN_CS_SLEEP txoff->on CanIf_SetPduMode(CANIF_ONLINE) txact CANIF_TX_OFFLINE_ACTIVE recepção, transmissão é confirmada imediatamente 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() é aceito apenas com controlador em CAN_CS_STARTED; é mostrada uma seleção das transições

Diagrama de estados: os quatro modos de canal de PDU com transições por CanIf_SetPduMode() e por eventos de controller. Os três modos restritos são agrupados em um superestado, como na especificação. Fontes: [SWS_CANIF_00864], [SWS_CANIF_00865], [SWS_CANIF_00866], [SWS_CANIF_00874], SWS CanIf Fig. 7.8 p. 61

Caminho de transmissão: CanIf_Transmit, buffering e Trigger Transmit

CanIf_Transmit() [SWS_CANIF_00005] determina o HTH e chama Can_Write(). O swPduHandle passado retorna mais tarde em CanIf_TxConfirmation() [SWS_CANIF_00318]. Antes disso, o CanIf define os dois bits mais significativos do CanId [SWS_CANIF_00243]. Se Can_Write() retornar E_OK, isso também se aplica à ordem de transmissão [SWS_CANIF_00162].

Uma ordem só é aceita sob estas condições:

Passagens mais recentes de documentos mencionam adicionalmente CanXL_Write() SWS CanIf p. 87. Para o R20-11, apenas Can_Write() é normativo.

txentscheidung start aufruf CanIf_Transmit(TxPduId, PduInfoPtr) start->aufruf init CanIf initialisiert? aufruf->init modus Controlador CAN_CS_STARTED e caminho de transmissão online / offline active? init->modus sim nok1 E_NOT_OK init->nok1 não active Kanal in CANIF_TX_OFFLINE_ACTIVE? modus->active sim nok2 E_NOT_OK (em CANIF_OFFLINE adicionalmente CANIF_E_STOPPED) modus->nok2 não pn PnTxFilter ativo e nenhuma CanIfTxPduPnFilterPdu? active->pn não bestaetigen <User_TxConfirmation> sofort, kein Can_Write() active->bestaetigen sim laenge SduLength maior que a PDU global? pn->laenge não nok3 E_NOT_OK pn->nok3 sim trunc CanIfTxPduTruncation aktiviert? laenge->trunc sim write Can_Write(Hth, PduInfo) laenge->write não kuerzen Truncar dados para o comprimento da PDU global trunc->kuerzen sim nok4 CANIF_E_TXPDU_LENGTH_EXCEEDED, E_NOT_OK trunc->nok4 não kuerzen->write rueck Retorno de Can_Write()? write->rueck puffer Bufferização ativa e tamanho do buffer > 0? rueck->puffer CAN_BUSY ok E_OK rueck->ok E_OK gleich a mesma L-PDU já está bufferizada? puffer->gleich sim nok5 E_NOT_OK (L-PDU verloren) puffer->nok5 não frei freies Pufferelement? gleich->frei não ueberschreiben sobrescrever instância bufferizada gleich->ueberschreiben sim ablegen L-PDU in CanIfTxBuffer ablegen frei->ablegen sim nok6 E_NOT_OK frei->nok6 não ueberschreiben->ok ablegen->ok

Diagrama de atividades: assim CanIf_Transmit() decide entre rejeição, confirmação simulada, transmissão direta e buffering. Interpretação: a ordem das verificações foi escolhida para fins de legibilidade. Fontes: [SWS_CANIF_00317], [SWS_CANIF_00382], [SWS_CANIF_00072], [SWS_CANIF_00381], [SWS_CANIF_00837], SWS CanIf Fig. 7.5 p. 51

Se Can_Write() reportar CAN_BUSY e CanIfPublicTxBuffering estiver ativo [SWS_CANIF_00063], o CanIf tenta fazer o buffering da L-PDU [SWS_CANIF_00381]. Isso pressupõe um tamanho de buffer maior que zero [SWS_CANIF_00835]. Se a mesma L-PDU já estiver no buffer, ela é sobrescrita [SWS_CANIF_00068]. Se o buffer estiver cheio, uma nova L-PDU é rejeitada com E_NOT_OK [SWS_CANIF_00837]. Uma L-PDU permanece sempre em apenas um lugar: no objeto de hardware ou no buffer do CanIf SWS CanIf p. 43.

Em CanIf_TxConfirmation() [SWS_CANIF_00007], o CanIf notifica o usuário responsável via <User_TxConfirmation> com E_OK [SWS_CANIF_00383]. Na mesma chamada, ele verifica os buffers do HTH liberado [SWS_CANIF_00386]. Ele entrega a entrada em espera com a maior prioridade para Can_Write() [SWS_CANIF_00668] [SWS_CANIF_00070]. Em caso de E_OK, ele remove a entrada imediatamente do buffer [SWS_CANIF_00183]. Passagens de documentos mais recentes denominam o callback como LSduR_CanIfTxConfirmation() SWS CanIf p. 157. No R20-11, aplica-se <User_TxConfirmation>.

Transmissão com bufferização e retransmissão mediante confirmaçãoObere Schicht (z. B. PduR)CanIfCanCanControllerUse Case: Solicitação de transmissão com hardware ocupadoCanIf_Transmit(TxPduId, PduInfoPtr)Can_Write(Hth, PduInfo)CAN_BUSYL-PDU in CanIfTxBuffer ablegenE_OKUse Case: Confirmação de uma solicitação anteriorTransmit-InterruptCanIf_TxConfirmation(CanTxPduId)Verificar buffer do HTH liberadoaltBuffer preenchidoCan_Write() para a entrada demaior prioridadeL-PDU in Hardware schreibenE_OKRemover entrada do buffer imediatamentePuffer leerkein weiterer Can_Write()-Aufruf<User_TxConfirmation>(TxPduId, E_OK)

Diagrama de sequência: com o hardware ocupado, a L-PDU é colocada em buffer. A confirmação de uma ordem anterior dispara subsequentemente o reenvio a partir do buffer. Fontes: [SWS_CANIF_00381], [SWS_CANIF_00386], [SWS_CANIF_00668], [SWS_CANIF_00183], SWS CanIf p. 138, SWS CanIf p. 143

No caso de Triggered Transmission, o usuário não entrega dados, mas sim um SduDataPtr NULL [SWS_CANIF_00882]. Se o hardware estiver livre, o driver obtém os dados via CanIf_TriggerTransmit() [SWS_CANIF_00883]. O CanIf encaminha a chamada para <User_TriggerTransmit> e retorna seu resultado [SWS_CANIF_00885]. Se o hardware estiver ocupado, o CanIf faz o buffering apenas do transmit request [SWS_CANIF_00881]. O CanId de L-PDUs dinâmicas pode ser alterado com CanIf_SetDynamicTxId() [SWS_CANIF_00189]. Como alternativa, ele provém dos MetaData [SWS_CANIF_00855] SWS CanIf p. 34.

Trigger TransmitObere SchichtCanIfCanCanControllerCanIf_Transmit(TxPduId, PduInfoPtr)SduDataPtr = NULL, apenas SduLengthCan_Write(Hth, PduInfo)altHardwareobjekt freiCanIf_TriggerTransmit(TxPduId, PduInfoPtr)<User_TriggerTransmit>(TxPduId, PduInfoPtr)Daten in bereitgestelltenPuffer kopierenE_OKE_OK (valor de retorno repassado)L-PDU in Hardware kopierenE_OKE_OKHardwareobjekt belegtCAN_BUSYbufferizar apenas Transmit Request noCanIfTxBuffer (se possível)

Diagrama de sequência: no Trigger Transmit, o driver busca os dados junto ao usuário somente quando o objeto de hardware estiver livre. Fontes: [SWS_CANIF_00882], [SWS_CANIF_00885], [SWS_CANIF_00881], SWS CanIf Fig. 9.6 p. 137

Caminho de recepção: filtrar, verificar comprimento, encaminhar

Após uma recepção, o driver chama CanIf_RxIndication() com Mailbox e dados [SWS_CANIF_00006]. O processamento ocorre em três etapas:

rx start aufruf CanIf_RxIndication(Mailbox, PduInfoPtr) start->aufruf init CanIf initialisiert? aufruf->init keine sem processamento de Rx init->keine não filterkonf Software-Filter konfiguriert (BasicCAN-HRH)? init->filterkonf sim filter Software-Filter: CanId akzeptiert? filterkonf->filter sim dlckonf Verificação de comprimento ativa? filterkonf->dlckonf não verworfen Fim sem indicação filter->verworfen não filter->dlckonf sim dlc Comprimento >= comprimento configurado? dlckonf->dlc sim akzeptiert L-PDU akzeptiert dlckonf->akzeptiert não dlcfehler Det_ReportRuntimeError() CANIF_E_INVALID_DATA_LENGTH dlc->dlcfehler não dlc->akzeptiert sim neben conforme a configuração: preencher buffer de recepção, definir status de notificação akzeptiert->neben ziel Ziel-Nutzer konfiguriert? akzeptiert->ziel indikation <User_RxIndication>(RxPduId, PduInfoPtr) ziel->indikation sim ende Ende ziel->ende não indikation->ende

Diagrama de atividades: filtro de software e verificação de comprimento decidem se uma L-PDU recebida é indicada. Efeitos colaterais dependentes de configuração são representados em paralelo. Fontes: [SWS_CANIF_00421], [SWS_CANIF_00389], [SWS_CANIF_00168], [SWS_CANIF_00199], [SWS_CANIF_00392], SWS CanIf Fig. 7.6 p. 51

Complementarmente, o CanIf oferece serviços de consulta. CanIf_ReadRxPduData() lê dados de um buffer de recepção próprio [SWS_CANIF_00194] [SWS_CANIF_00198], mas não é destinado à recepção por faixa (range reception) [SWS_CANIF_00329]. CanIf_ReadTxNotifStatus() e CanIf_ReadRxNotifStatus() redefinem o status durante a leitura [SWS_CANIF_00393] [SWS_CANIF_00394]. Este «read-and-consume» assegura que pelo menos um evento ocorreu desde a última chamada SWS CanIf p. 55. CanIf_GetTxConfirmationState() agrupa as confirmações de um controller inteiro [SWS_CANIF_00734].

Transceiver, Wake-up e Partial Networking

O CanIf encaminha os serviços de transceiver diretamente ao driver CanTrcv. CanIf_SetTrcvMode() chama CanTrcv_SetOpMode() [SWS_CANIF_00358], CanIf_GetTrcvMode() chama CanTrcv_GetOpMode() [SWS_CANIF_00363]. O CanIf repassa mudanças de modo do transceiver ao CanSm [SWS_CANIF_00712].

Para o wake-up, CanIf_CheckWakeup() consulta os controllers e transceivers quanto à fonte de wake-up [SWS_CANIF_00395] SWS CanIf p. 56. Para validação, o CanIf armazena a primeira recepção válida de um controller iniciado [SWS_CANIF_00286]. CanIf_CheckValidation() a reporta, então, via <User_ValidateWakeupEvent> [SWS_CANIF_00179].

Se o Partial Networking estiver ativo, um PnTxFilter sobrepõe uma camada adicional sobre os modos de canal para cada controller [SWS_CANIF_00747]. Ele é ativado em CAN_CS_SLEEP [SWS_CANIF_00749] e desativado novamente com a primeira confirmação ou indicação [SWS_CANIF_00751] [SWS_CANIF_00896] SWS CanIf p. 70.

Comportamento em caso de erro

BusOff: o driver reporta o erro com CanIf_ControllerBusOff() [SWS_CANIF_00218]. O CanIf define então o canal como CANIF_TX_OFFLINE [SWS_CANIF_00866] e reporta o BusOff ao CanSm [SWS_CANIF_00724] SWS CanIf Fig. 9.11 p. 147. A recuperação é controlada pelo CanSm via CanIf_SetControllerMode() SWS CanIf p. 160.

Notificação de BusOff e recuperaçãoCanSm (<User_ControllerBusOff>)CanIfCanCanControllerBusOff-ErkennungControlador, se necessáriodefinir como STOPPEDCanIf_ControllerBusOff(ControllerId)canal para CANIF_TX_OFFLINE,Sendepuffer leerenno caso de reporte de eventos de segurança: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>

Diagrama de sequência: fluxo desde o reconhecimento de BusOff, passando pela notificação ao CanSm, até o reinício do controller. Fontes: [SWS_CANIF_00218], [SWS_CANIF_00866], [SWS_CANIF_00724], [SWS_CANIF_00918], SWS CanIf p. 154, SWS CanIf p. 160

Controller parado: ao entrar em CAN_CS_STOPPED, o CanIf esvazia os buffers de transmissão [SWS_CANIF_00485]. Ele confirma todas as ordens de transmissão pendentes com E_NOT_OK [SWS_CANIF_00739]. Dessa forma, cada PDU aceita recebe uma confirmação, positiva ou negativa SWS CanIf p. 54.

Notificações de erro: o CanIf reporta parâmetros inválidos como erros de desenvolvimento, por exemplo, CANIF_E_PARAM_CONTROLLERID [SWS_CANIF_00311] [SWS_CANIF_91006]. Erros de tempo de execução incluem, entre outros, CANIF_E_INVALID_DATA_LENGTH [SWS_CANIF_00168] e CANIF_E_STOPPED [SWS_CANIF_00382] [SWS_CANIF_91007]. Uma ordem de transmissão perdida reflete-se apenas no valor de retorno ou na ausência de confirmação Error Description p. 22. Eventos de segurança como CANIF_SEV_ERRORSTATE_PASSIVE são reportados pelo CanIf ao IdsM [SWS_CANIF_00913] [SWS_CANIF_00917].

Evidências mais detalhadas

Guia gerado por IA com base em excertos de especificação. Normativos para o R20-11 são os requirements com link; passagens de documentos de releases mais recentes são identificadas como tal.

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

função 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.

Guia do implementador em breve (complexidade I3)

função CanIf_DeInit [SWS_CANIF_91002] 📄 PDF

void CanIf_DeInit (void);

De-initializes the CanIf module.

Guia do implementador em breve (complexidade I1)

função 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.

Guia do implementador em breve (complexidade I2)

função 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.

Guia do implementador em breve (complexidade I2)

função 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.

Guia do implementador em breve (complexidade I2)

função 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.

Guia do implementador em breve (complexidade I3)

função 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.

função 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.

Guia do implementador em breve (complexidade I2)

função 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.

Guia do implementador em breve (complexidade I2)

função 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.

função 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.

função 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.

função 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.

Guia do implementador em breve (complexidade I2)

função CanIf_TxConfirmation [SWS_CANIF_00007] 📄 PDF

void CanIf_TxConfirmation (PduIdType CanTxPduId);

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

Guia do implementador em breve (complexidade I3)

função 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.

Guia do implementador em breve (complexidade I3)

função 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.

Guia do implementador em breve (complexidade I2)

função 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.

Guia do implementador em breve (complexidade I2)

função 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.

Guia do implementador em breve (complexidade I2)

função 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.

Guia do implementador em breve (complexidade I2)

função 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.

Guia do implementador em breve (complexidade I2)

função 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.

Guia do implementador em breve (complexidade I2)

função 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.

Guia do implementador em breve (complexidade I2)

função 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.

Guia do implementador em breve (complexidade I2)

função <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.

Guia do implementador em breve (complexidade I1)

função <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.

Guia do implementador em breve (complexidade I1)

função <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.

Guia do implementador em breve (complexidade I2)

função <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.

Guia do implementador em breve (complexidade I1)

função <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).

Guia do implementador em breve (complexidade I1)

função <User_ConfirmPnAvailability> [SWS_CANIF_00821] 📄 PDF

void <User_ConfirmPnAvailability> (uint8 TransceiverId);

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

Guia do implementador em breve (complexidade I1)

função <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.

Guia do implementador em breve (complexidade I1)

função <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.

Guia do implementador em breve (complexidade I1)

função <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).

Guia do implementador em breve (complexidade I1)

função <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).

Guia do implementador em breve (complexidade I1)

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

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

Guia do implementador em breve (complexidade I2)

tipo CanIf_NotifStatusType [SWS_CANIF_00201] 📄 PDF

Type CanIf_NotifStatusType.

Guia do implementador em breve (complexidade 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#46414314
Content hash
46414314
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_CANInterface.pdf#nameddest=SWS_CANIF_00001

Inicialização e estado

CanIf_DeInit função

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 função

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

void CanIf_Init (const CanIf_ConfigType* ConfigPtr);

Serviços · 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);

Serviços · 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);

Serviços · 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);

Serviços · 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);

Serviços · 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);

Serviços · Outros

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 e interfaces esperadas

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

Tipos

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.