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

Can Driver More...

#include "Can_Types.h"

Go to the source code of this file.

Data Structures

struct  _CanIf_CtrlCfgType
 CanIf controller type. More...
 
struct  _CanIf_ConfigType
 Configuration structure for the CAN interface. More...
 

Macros

#define CANIF_ID_INIT   0x01
 
#define CANIF_ID_DE_INIT   0x02
 
#define CANIF_ID_SET_CTRL_MODE   0x03
 
#define CANIF_ID_GET_CTRL_MODE   0x04
 
#define CANIF_ID_GET_CTRL_ERR_STATE   0x4b
 
#define CANIF_ID_TRANSMIT   0x49
 
#define CANIF_ID_READ_RX_PDU_DATA   0x06
 
#define CANIF_ID_READ_TX_NOTIF_STATUS   0x07
 
#define CANIF_ID_READ_RX_NOTIF_STATUS   0x08
 
#define CANIF_ID_SET_PDU_MODE   0x09
 
#define CANIF_ID_GET_PDU_MODE   0x0a
 
#define CANIF_ID_GET_VERSION_INFO   0x0b
 
#define CANIF_ID_SET_DYNAMIC_TX_ID   0x0c
 
#define CANIF_ID_GET_TX_CONFIRM_STATE   0x19
 
#define CANIF_ID_SET_BAUDRATE   0x27
 
#define CANIF_ID_GET_CTRL_RX_ERR_CNT   0x4d
 
#define CANIF_ID_GET_CTRL_TX_ERR_CNT   0x4e
 
#define CANIF_ID_ENABLE_BUS_MIRROR   0x4c
 
#define CANIF_ID_GET_CURRENT_TIME   0x51
 
#define CANIF_ID_ENABLE_EGRESS_TS   0x52
 
#define CANIF_ID_GET_EGRESS_TS   0x53
 
#define CANIF_ID_GET_INGRESS_TS   0x54
 
#define CANIF_ID_TX_CONFIRMATION   0x13
 
#define CANIF_ID_RX_INDICATION   0x14
 
#define CANIF_ID_CTRL_BUS_OFF   0x16
 
#define CANIF_ID_CTRL_MODE_INDICATION   0x17
 
#define CANIF_ID_CTRL_ERR_ST_PASIVE   0x4f
 
#define CANIF_ID_ERR_NOTIF   0x50
 
#define CANIF_E_PARAM_CANID   0x10
 
#define CANIF_E_PARAM_HOH   0x12
 
#define CANIF_E_PARAM_LPDU   0x13
 
#define CANIF_E_PARAM_CONTROLLERID   0x15
 
#define CANIF_E_PARAM_WAKEUPSOURCE   0x16
 
#define CANIF_E_PARAM_TRCV   0x17
 
#define CANIF_E_PARAM_TRCVMODE   0x18
 
#define CANIF_E_PARAM_TRCVWAKEUPMODE   0x19
 
#define CANIF_E_PARAM_POINTER   0x20
 
#define CANIF_E_PARAM_CTRLMODE   0x21
 
#define CANIF_E_PARAM_PDU_MODE   0x22
 
#define CANIF_E_PARAM_CAN_ERROR   0x23
 
#define CANIF_E_UNINIT   0x30
 
#define CANIF_E_INVALID_TXPDUID   0x50
 
#define CANIF_E_INVALID_RXPDUID   0x60
 
#define CANIF_E_INIT_FAILED   0x80
 
#define CANIF_E_INVALID_DATA_LENGTH   0x61
 
#define CANIF_E_DATA_LENGTH_MISMATCH   0x62
 
#define CANIF_E_STOPPED   0x70
 
#define CANIF_E_TXPDU_LENGTH_EXCEEDED   0x90
 

Typedefs

typedef enum _CanIf_PduModeType CanIf_PduModeType
 Pdu mode type.
 
typedef enum _CanIf_NotifStatusType CanIf_NotifStatusType
 Notification status type.
 
typedef struct _CanIf_CtrlCfgType CanIf_CtrlCfgType
 CanIf controller type.
 
typedef struct _CanIf_ConfigType CanIf_ConfigType
 Configuration structure for the CAN interface.
 

Enumerations

enum  _CanIf_PduModeType { CANIF_OFFLINE = 0x00 , CANIF_TX_OFFLINE = 0x01 , CANIF_TX_OFFLINE_ACTIVE = 0x02 , CANIF_ONLINE = 0x03 }
 Pdu mode type. More...
 
enum  _CanIf_NotifStatusType { CANIF_NO_NOTIFICATION = 0x00 , CANIF_TX_RX_NOTIFICATION = 0x01 }
 Notification status type. More...
 

Detailed Description

Can Driver

Author
Diego Perez

The header contains the type definitions that are used by the Can module. The file is implemnted as a means of abstraction from the hardware, this way we can avoid to include Arch headers in the actual driver header, making the low level interfaces available for upper layers.

Typedef Documentation

◆ CanIf_ConfigType

Configuration structure for the CAN interface.

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.

Requirement
SWS_CANIF_00144

◆ CanIf_CtrlCfgType

CanIf controller type.

This container contains the configuration (parameters) of an adressed CAN controller by an underlying CAN Driver module. This container is configurable per CAN controller

◆ CanIf_NotifStatusType

Notification status type.

Return value of CAN L-PDU notification status.

Requirement
SWS_CANIF_00201

◆ CanIf_PduModeType

Pdu mode type.

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.

Requirement
SWS_CANIF_00137

Enumeration Type Documentation

◆ _CanIf_NotifStatusType

Notification status type.

Return value of CAN L-PDU notification status.

Requirement
SWS_CANIF_00201
Enumerator
CANIF_NO_NOTIFICATION 

No transmit or receive event occurred for the requested L-PDU

CANIF_TX_RX_NOTIFICATION 

The requested Rx/Tx CAN L-PDU was successfully transmitted or received.

◆ _CanIf_PduModeType

Pdu mode type.

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.

Requirement
SWS_CANIF_00137
Enumerator
CANIF_OFFLINE 

= 0 Transmit and receive path of the corresponding channel are disabled => no communication mode

CANIF_TX_OFFLINE 

Transmit path of the corresponding channel is disabled. The receive path is enabled

CANIF_TX_OFFLINE_ACTIVE 

Transmit path of the corresponding channel is in offline active mode (see SWS_CANIF_00072). The receive path is enabled. This mode requires CanIfTxOfflineActive Support = TRUE

CANIF_ONLINE 

Transmit and receive path of the corresponding channel are enabled => full operation mode