105 #include "Std_Types.h"
106 #include "ComStack_Types.h"
107 #include "Can_GeneralTypes.h"
132 #define CAN_SW_MAJOR_VERSION (10U)
135 #define CAN_SW_MINOR_VERSION (2U)
138 #define CAN_SW_PATCH_VERSION (0U)
147 #define CAN_AR_RELEASE_MAJOR_VERSION (4U)
149 #define CAN_AR_RELEASE_MINOR_VERSION (3U)
152 #define CAN_AR_RELEASE_REVISION_VERSION (1U)
160 #define CAN_VENDOR_ID (44U)
162 #define CAN_MODULE_ID (80U)
164 #define CAN_INSTANCE_ID (0U)
172 #define CAN_UNINIT ((uint8)0U)
174 #define CAN_READY ((uint8)1U)
185 #define CAN_INIT_ID (0x00U)
187 #define CAN_MAINFCT_WRITE_ID (0x01U)
189 #define CAN_SETCTR_ID (0x03U)
191 #define CAN_DIINT_ID (0x04U)
193 #define CAN_ENINT_ID (0x05U)
195 #define CAN_WRITE_ID (0x06U)
197 #define CAN_VERSION_ID (0x07U)
199 #define CAN_MAINFCT_READ_ID (0x08U)
201 #define CAN_MAINFCT_BO_ID (0x09U)
203 #define CAN_MAINFCT_WU_ID (0x0AU)
205 #define CAN_CKWAKEUP_ID (0x0BU)
207 #define CAN_MAINFCT_MODE_ID (0x0CU)
209 #define CAN_SETBAUDRATE_ID (0x0FU)
211 #define CAN_DEINIT_ID (0x10U)
213 #define CAN_GETCTRERRST_ID (0x11U)
215 #define CAN_GETCTRMODE_ID (0x12U)
217 #define CAN_LOOPBACK_ID (0x20U)
219 #define CAN_RXPROCESS_ID (0x21U)
229 #ifndef CAN_E_PARAM_POINTER
230 #define CAN_E_PARAM_POINTER (0x01U)
233 #ifndef CAN_E_PARAM_HANDLE
234 #define CAN_E_PARAM_HANDLE (0x02U)
237 #ifndef CAN_E_PARAM_DLC
238 #define CAN_E_PARAM_DLC (0x03U)
241 #ifndef CAN_E_PARAM_CONTROLLER
242 #define CAN_E_PARAM_CONTROLLER (0x04U)
246 #define CAN_E_UNINIT (0x05U)
249 #ifndef CAN_E_TRANSITION
250 #define CAN_E_TRANSITION (0x06U)
253 #ifndef CAN_E_DATALOST
254 #define CAN_E_DATALOST (0x07U)
257 #ifndef CAN_E_PARAM_BAUDRATE
258 #define CAN_E_PARAM_BAUDRATE (0x08U)
261 #ifndef CAN_E_ICOM_CONFIG_INVALID
262 #define CAN_E_ICOM_CONFIG_INVALID (0x09U)
265 #ifndef CAN_E_INIT_FAILED
266 #define CAN_E_INIT_FAILED (0x0AU)
279 #define CAN_CFG_ID_0 (0x01U)
282 #define CAN_CFG_ID_1 (0x02U)
284 #define CAN_CFG_ID_2 (0x04U)
286 #define CAN_CFG_ID_3 (0x08U)
289 #define CAN_CFG_ID_4 (0x10U)
292 #define CAN_CFG_ID_5 (0x20U)
294 #define CAN_CFG_ID_6 (0x40U)
302 #define MIXED_MODE_MB_ID (2U)
305 #if (STD_ON == CAN_SAFETY_DIAGNOSTIC)
313 #define MCAN_ERR_TYPE_PEA_ERROR (1U)
315 #define MCAN_ERR_TYPE_TOO_ERROR (2U)
323 #define MCAN_LSB_BIT_SET (1U)
370 #if (STD_ON == CAN_SAFETY_DIAGNOSTIC)
410 typedef struct Can_MaskStruct
419 typedef struct Can_HwFilterStruct
430 typedef struct Can_FdBaudConfigStruct
455 typedef struct Can_BaudConfigStruct
478 typedef struct Can_ControllerStruct
489 typedef struct Can_ControllerStruct_PC
512 typedef struct Can_MailboxStruct
543 typedef struct Can_MailboxStruct_PC
564 typedef struct Can_ConfigType_s
580 #if (STD_ON == CAN_REGISTER_READBACK_API)
637 #if (CAN_VERSION_INFO_API == STD_ON)
660 CAN_APPL_DATA) VersionInfo);
712 uint8 Controller, Can_ControllerStateType Transition);
744 FUNC(Std_ReturnType, CAN_CODE)
Can_Write(Can_HwHandleType Hth,
745 const Can_PduType *PduInfo);
871 #if (STD_ON == CAN_SET_BAUDRATE_API)
899 uint16 BaudRateConfigID);
902 #if (CAN_LOOPBACK_ENABLE == STD_ON)
962 #if (STD_ON == CAN_REGISTER_READBACK_API)
988 CAN_APPL_DATA) RegRbPtr);
991 #if (STD_ON == CAN_SAFETY_DIAGNOSTIC)
1018 VAR(uint8, AUTOMATIC)CanErrVar);
1046 VAR(uint8, AUTOMATIC)CanErrVar);
1177 Can_ControllerStateType* ControllerModePtr);
1204 (uint8 ControllerId, Can_ErrorStateType* ErrorStatePtr);
This file contains generated pre compile configuration file for CAN MCAL driver.
void Can_IntISR_Fun(Can_ControllerInstance CanInstanceID)
This function is the ISR for CAN controller 0/INT 0.
Std_ReturnType Can_DisableIntr(VAR(uint8,) Controller, VAR(uint8,) CanErrVar)
This service will Disable the Interrupts.
void Can_MainFunction_Write(void)
This function performs the polling of TX confirmation when CAN_TX_PROCESSING is set to POLLING.
Std_ReturnType Can_Write(Can_HwHandleType Hth, const Can_PduType *PduInfo)
This function is called by CanIf to pass a CAN message to CanDrv for transmission.
void Can_MainFunction_Mode(void)
This function performs the polling of CAN controller mode transitions.
uint8 CanControllerState_Type
Can Controller State enum type.
Definition: Can.h:400
void Can_MainFunction_BusOff(void)
This function performs the polling of bus-off events that are configured statically as 'to be polled'...
Std_ReturnType Can_TestLoopBackModeEnable(uint8 Controller, uint8 Mode)
This service will enable CAN loopback mode.
void Can_MainFunction_Read(void)
This function performs the polling of RX indications when CAN_RX_PROCESSING is set to POLLING.
Std_ReturnType Can_SetControllerMode(uint8 Controller, Can_ControllerStateType Transition)
This function performs software triggered state transitions of the CAN controller State machine.
Can_MailBoxDirectionType
Can Mailbox direction enum.
Definition: Can.h:339
void Can_GetVersionInfo(Std_VersionInfoType *VersionInfo)
Function returns the version information of this module.
Can_HandleType
Can Handle Type enum.
Definition: Can.h:350
Can_TxRxProcessingType
Can Tx/Rx processing enum.
Definition: Can.h:361
void Can_DeInit(void)
This function de-initializes the module.
uint32 Can_InterruptMask_Type
Can Interrupt Mask type.
Definition: Can.h:405
Std_ReturnType Can_TestLoopBackModeDisable(uint8 Controller, uint8 Mode)
This service will disable CAN loopback mode.
void Can_DisableControllerInterrupts(uint8 Controller)
This function disables all interrupts for this CAN controller.
void Can_MainFunction_Wakeup(void)
This function performs the polling of wake-up events that are configured statically as 'to be polled'...
Can_IrqStatusType
CAN IRQ status enum.
Definition: Can.h:375
Std_ReturnType Can_RegisterReadback(VAR(uint8,) Controller, Can_RegisterReadbackType *RegRbPtr)
This service will readback CAN registers.
Std_ReturnType Can_SetBaudrate(uint8 Controller, uint16 BaudRateConfigID)
This service shall set the baud rate configuration of the CAN controller. Depending on necessary baud...
Std_ReturnType Can_ClearIntrStatus(VAR(uint8,) Controller)
This service will clear the interrupt status.
Std_ReturnType Can_EnableIntr(VAR(uint8,) Controller, VAR(uint8,) CanErrVar)
This service will Enable the interrupts.
void Can_Init(const Can_ConfigType *CfgPtr)
This function initializes the module.
Can_IrqStatusType Can_GetIntrStatus(VAR(uint8,) Controller)
This service will provide the status of the interrupt.
void Can_EnableControllerInterrupts(uint8 Controller)
This function enables all allowed interrupts.
Std_ReturnType Can_GetControllerErrorState(uint8 ControllerId, Can_ErrorStateType *ErrorStatePtr)
This service obtains the error state of the CAN controller.
Std_ReturnType Can_GetControllerMode(uint8 Controller, Can_ControllerStateType *ControllerModePtr)
This service reports about the current status of the requested CAN controller.
Can_ControllerType ** CanControllerList
Definition: Can.h:566
uint32 CanReadBackRegCTRL
Definition: Can.h:598
uint8 Pseg2
Definition: Can.h:463
uint32 CanReadBackRegTXESC
Definition: Can.h:624
Can_ControllerInstance CanControllerInst
Definition: Can.h:503
uint32 CanReadBackRegCREL
Definition: Can.h:594
Can_ControllerInstance
Can Controller Instances enum.
Definition: Can_Cfg.h:390
uint8 Pseg1
Definition: Can.h:436
boolean CanHardwareObjectUsesPolling
Definition: Can.h:536
boolean BusOffProcessingInterrupt
Definition: Can.h:501
uint32 CanReadBackRegRWD
Definition: Can.h:602
uint8 CanHandleType
Definition: Can.h:514
uint32 CanReadBackRegDBTP
Definition: Can.h:600
uint32 CanReadBackRegPID
Definition: Can.h:590
boolean BrsSwitch
Definition: Can.h:448
Can_HwHandleType HwHandle
Definition: Can.h:518
Can_MailboxType ** MailBoxList
Definition: Can.h:570
uint32 CanReadBackRegTXBC
Definition: Can.h:622
Can_IdType IDValue
Definition: Can.h:421
uint32 CanReadBackRegCCCR
Definition: Can.h:604
Can_HwFilterType ** HwFilterList
Definition: Can.h:526
uint32 CanReadBackRegENDN
Definition: Can.h:596
uint32 MaxMbCnt
Definition: Can.h:572
uint16 Baud
Definition: Can.h:457
uint32 CanReadBackRegRXF1C
Definition: Can.h:620
uint8 CanMaxControllerCount
Definition: Can.h:568
Can_TxRxProcessingType TxProcessingType
Definition: Can.h:499
Can_FdBaudConfigType BaudFdRateConfig
Definition: Can.h:471
uint32 CanReadBackRegGFC
Definition: Can.h:610
boolean CntrActive
Definition: Can.h:493
const Can_ControllerType_PC * Controller
Definition: Can.h:524
uint8 ControllerId
Definition: Can.h:491
uint16 BrpValue
Definition: Can.h:469
Can_MailBoxDirectionType MBDir
Definition: Can.h:522
uint32 CanReadBackRegSIDFC
Definition: Can.h:612
uint32 CntrAddr
Definition: Can.h:495
uint8 PropSeg
Definition: Can.h:434
uint32 CanReadBackRegRXF0C
Definition: Can.h:616
uint16 TrcvCompDelay
Definition: Can.h:446
uint32 Reserved
Definition: Can.h:554
#define CAN_MAX_CONTROLLER
Definition: Can_Cfg.h:181
boolean CanFDModeEnabled
Definition: Can.h:505
Can_DmaPrms * DmaPrms
Definition: Can.h:576
uint16 TimingValues
Definition: Can.h:467
uint8 Pseg1
Definition: Can.h:461
uint32 Mask
Definition: Can.h:423
uint32 HwFilterCnt
Definition: Can.h:528
uint16 BrpValue
Definition: Can.h:444
uint32 CanReadBackRegTXEFC
Definition: Can.h:626
uint32 MBIdType
Definition: Can.h:516
Can_BaudConfigType * DefaultBaud
Definition: Can.h:480
uint16 Baud
Definition: Can.h:432
uint8 CanFdPaddingValue
Definition: Can.h:530
Can_BaudConfigType ** BaudRateConfigList
Definition: Can.h:482
uint32 CanHwObjectCount
Definition: Can.h:520
uint8 Pseg2
Definition: Can.h:438
uint8 Sjw
Definition: Can.h:465
uint32 CanReadBackRegXIDFC
Definition: Can.h:614
Can_TxRxProcessingType RxProcessingType
Definition: Can.h:497
uint32 CanReadBackRegSTAT
Definition: Can.h:592
uint32 MaskValue
Definition: Can.h:412
uint16 CanObjectId
Definition: Can.h:545
uint8 PropSeg
Definition: Can.h:459
uint32 CanReadBackRegNBTP
Definition: Can.h:606
uint32 CanReadBackRegRXBC
Definition: Can.h:618
uint16 TimingValues
Definition: Can.h:442
uint8 Sjw
Definition: Can.h:440
uint32 CanReadBackRegTDCR
Definition: Can.h:608
@ CAN_MAILBOX_DIRECTION_RX
Definition: Can.h:340
@ CAN_MAILBOX_DIRECTION_TX
Definition: Can.h:342
@ CAN_FULL
Definition: Can.h:351
@ CAN_BASIC
Definition: Can.h:353
@ CAN_TX_RX_PROCESSING_POLLING
Definition: Can.h:366
@ CAN_TX_RX_PROCESSING_INTERRUPT
Definition: Can.h:362
@ CAN_TX_RX_PROCESSING_MIXED
Definition: Can.h:364
@ CAN_IRQ_INTR_ACK_EVENT
Definition: Can.h:382
@ CAN_IRQ_STATUS_READ_FAIL
Definition: Can.h:392
@ CAN_IRQ_INTR_TOO_EVENT
Definition: Can.h:390
@ CAN_IRQ_INTR_BIT0_EVENT
Definition: Can.h:386
@ CAN_IRQ_INTR_BIT1_EVENT
Definition: Can.h:384
@ CAN_IRQ_INTR_CRC_EVENT
Definition: Can.h:388
@ CAN_IRQ_INTR_STUFF_EVENT
Definition: Can.h:378
@ CAN_IRQ_NO_INTR_EVENT
Definition: Can.h:376
@ CAN_IRQ_INTR_FORM_EVENT
Definition: Can.h:380
VAR(uint8, ETH_VAR_NO_INIT_128) Eth_Ctrl_0_Egress_BufferMem_0[24576U]
Structure defining the CAN baud rate configuration.
Definition: Can.h:456
Can MCAL root configuration structure.
Definition: Can.h:565
Can Controller Pre Compile Configuration definition.
Definition: Can.h:490
Can Controller Configuration definition.
Definition: Can.h:479
Dummy structure will be used if DMA support is required.
Definition: Can.h:553
Structure defining the CAN FD data phase baud rate configuration.
Definition: Can.h:431
Structure defining the HW filter to be used.
Definition: Can.h:420
Can mailox Pre compile configuration definition.
Definition: Can.h:544
Can mailox configuration definition.
Definition: Can.h:513
Structure defining the filter mask to be used.
Definition: Can.h:411
Register Readback Structure.
Definition: Can.h:589