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

Can Driver More...

#include "ComStack_Types.h"
#include "Can_GeneralTypes.h"

Go to the source code of this file.

Data Structures

struct  _Can_ControllerBaudrateConfig
 CAN Controller Baudrate Configuration More...
 
struct  _Can_Controller
 CAN Controller More...
 
struct  _Can_HwFilter
 CAN Hardware Filter More...
 
struct  _Can_HardwareObject
 CAN Hardware Object More...
 
struct  _Can_ConfigType
 Hardware unit configuration structure More...
 
struct  _Can_HwUnit
 Hardware control unit structure More...
 

Macros

#define CAN_STATIC   static
 
#define CAN_ID_INIT   0x00u
 
#define CAN_ID_DE_INIT   0x10u
 
#define CAN_ID_SET_BAUDRATE   0x0fu
 
#define CAN_ID_SET_CTRL_MODE   0x03u
 
#define CAN_ID_DISABLE_CTRL_INT   0x04u
 
#define CAN_ID_ENABLE_CTRL_INT   0x05u
 
#define CAN_ID_CHECK_WAKEUP   0x0bu
 
#define CAN_ID_GET_CTRL_MODE   0x12u
 
#define CAN_ID_GET_CTRL_ERR_STATE   0x11u
 
#define CAN_ID_GET_CTRL_RX_ERR_CNT   0x30u
 
#define CAN_ID_GET_CTRL_TX_ERR_CNT   0x31u
 
#define CAN_ID_WRITE   0x06u
 
#define CAN_ID_MF_WRITE   0x01u
 
#define CAN_ID_MF_READ   0x08u
 
#define CAN_ID_MF_BUSOFF   0x09u
 
#define CAN_ID_MF_WAKEUP   0x0au
 
#define CAN_ID_MF_MODE   0x0cu
 
#define CAN_ID_GET_VERSION_INFO   0x07u
 
#define CAN_ID_GET_CURRENT_TIME   0x32u
 
#define CAN_ID_ENABLE_EGRESS_TS   0x33u
 
#define CAN_ID_GET_EGRESS_TS   0x34u
 
#define CAN_ID_GET_INGRESS_TS   0x35u
 
#define CAN_ID_ISR_TRANSMITION   0x02u
 
#define CAN_ID_ISR_RECEPTION   0x0du
 
#define CAN_E_PARAM_POINTER   0x01u
 
#define CAN_E_PARAM_HANDLE   0x02u
 
#define CAN_E_PARAM_DATA_LENGTH   0x03u
 
#define CAN_E_PARAM_CONTROLLER   0x04u
 
#define CAN_E_UNINIT   0x05u
 
#define CAN_E_TRANSITION   0x06u
 
#define CAN_E_PARAM_BAUDRATE   0x07u
 
#define CAN_E_INIT_FAILED   0x09u
 
#define CAN_E_PARAM_LPDU   0x0Au
 
#define CAN_E_DATALOST   0x01u
 

Typedefs

typedef struct _Can_ControllerBaudrateConfig Can_ControllerBaudrateConfig
 CAN Controller Baudrate Configuration
 
typedef struct _Can_Controller Can_Controller
 CAN Controller
 
typedef struct _Can_HwFilter Can_HwFilter
 CAN Hardware Filter
 
typedef struct _Can_HardwareObject Can_HardwareObject
 CAN Hardware Object
 
typedef struct _Can_ConfigType Can_ConfigType
 Hardware unit configuration structure
 
typedef struct _Can_HwUnit Can_HwUnit
 Hardware control unit structure
 

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

◆ Can_ConfigType

Hardware unit configuration structure

This structure contains the paramters to configure the hardware unit incuding the controllers and the hardware objects

Requirement
SWS_Can_00413

◆ Can_Controller

CAN Controller

This container contains the configuration parameters of the CAN controller(s).

Note
the element ID defined by autosar is suppressed due to the fact that the index array it is used as an ID. the default baud rate element is not a pointer but rather an index to the baud rate array

◆ Can_ControllerBaudrateConfig

CAN Controller Baudrate Configuration

This container contains bit timing related configuration parameters of the CAN controller(s).

Note
the element ID defined by autosar is suppressed due to the fact that the index array it is used as an ID

◆ Can_HardwareObject

CAN Hardware Object

This container contains the configuration parameters of the CAN hardware objects.

◆ Can_HwFilter

typedef struct _Can_HwFilter Can_HwFilter

CAN Hardware Filter

This container contains the configuration parameters of the CAN hardware filter.

◆ Can_HwUnit

typedef struct _Can_HwUnit Can_HwUnit

Hardware control unit structure

This structure contains the hardware unit configuration and the state of the hardware unit pointers to controller extructure s