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

Can Stack types More...

Go to the source code of this file.

Data Structures

struct  _Can_HwType
 This type defines a data structure which clearly provides an Hardware Object Handle including its corresponding CAN Controller and therefore CanDrv as well as the specific CanId. More...
 
struct  _Can_PduType
 This type unites PduId (swPduHandle), SduLength (length), SduData (sdu), and Can Id (id) for any CAN L-SDU. More...
 
struct  _Can_TimeStampType
 CAN Controller Tiemstamp More...
 

Typedefs

typedef uint32 Can_IdType
 Represents the Identifier of an L-PDU. The two most significant bits specify the frame type: 00 CAN message with Standard CAN ID 01 CAN FD frame with Standard CAN ID 10 CAN message with Extended CAN ID 11 CAN FD frame with Extended CAN ID.
 
typedef uint16 Can_HwHandleType
 Represents the hardware object handles of a CAN hardware unit. For CAN hardware units with more than 255 HW objects use extended range.
 
typedef struct _Can_HwType Can_HwType
 This type defines a data structure which clearly provides an Hardware Object Handle including its corresponding CAN Controller and therefore CanDrv as well as the specific CanId.
 
typedef struct _Can_PduType Can_PduType
 This type unites PduId (swPduHandle), SduLength (length), SduData (sdu), and Can Id (id) for any CAN L-SDU.
 
typedef enum _Can_ErrorStateType Can_ErrorStateType
 Error states of a CAN controller.
 
typedef enum _Can_ControllerStateType Can_ControllerStateType
 States that are used by the several ControllerMode functions.
 
typedef enum _Can_ErrorType Can_ErrorType
 The enumeration represents a superset of CAN Error Types which typical CAN HW is able to report. That means not all CAN HW will be able to support the complete set.
 
typedef struct _Can_TimeStampType Can_TimeStampType
 CAN Controller Tiemstamp
 

Enumerations

enum  _Can_ErrorStateType { CAN_ERRORSTATE_ACTIVE = 0x01 , CAN_ERRORSTATE_PASSIVE , CAN_ERRORSTATE_BUSOFF }
 Error states of a CAN controller. More...
 
enum  _Can_ControllerStateType {
  CAN_CS_UNINIT = 0x01 , CAN_CS_STARTED , CAN_CS_STOPPED , CAN_CS_SLEEP ,
  CAN_CS_WAKEUP , CAN_CS_READY
}
 States that are used by the several ControllerMode functions. More...
 
enum  _Can_ErrorType {
  CAN_ERROR_BIT_MONITORING1 = 0x01 , CAN_ERROR_BIT_MONITORING0 , CAN_ERROR_BIT , CAN_ERROR_CHECK_ACK_FAILED ,
  CAN_ERROR_ACK_DELIMITER , CAN_ERROR_ARBITRATION_LOST , CAN_ERROR_OVERLOAD , CAN_ERROR_CHECK_FORM_FAILED ,
  CAN_ERROR_CHECK_STUFFING_FAILED , CAN_ERROR_CHECK_CRC_FAILED , CAN_ERROR_BUS_LOCK
}
 The enumeration represents a superset of CAN Error Types which typical CAN HW is able to report. That means not all CAN HW will be able to support the complete set. More...
 

Detailed Description

Can Stack types

Author
Diego Perez

This is the implementation of the Can Stack types

Typedef Documentation

◆ Can_ControllerStateType

States that are used by the several ControllerMode functions.

Requirement
SWS_Can_91013

◆ Can_ErrorStateType

Error states of a CAN controller.

Requirement
SWS_Can_91003

◆ Can_ErrorType

The enumeration represents a superset of CAN Error Types which typical CAN HW is able to report. That means not all CAN HW will be able to support the complete set.

Requirement
SWS_Can_91021

◆ Can_HwHandleType

Represents the hardware object handles of a CAN hardware unit. For CAN hardware units with more than 255 HW objects use extended range.

Requirement
SWS_Can_00429

◆ Can_HwType

typedef struct _Can_HwType Can_HwType

This type defines a data structure which clearly provides an Hardware Object Handle including its corresponding CAN Controller and therefore CanDrv as well as the specific CanId.

Requirement
SWS_CAN_00496

◆ Can_IdType

typedef uint32 Can_IdType

Represents the Identifier of an L-PDU. The two most significant bits specify the frame type: 00 CAN message with Standard CAN ID 01 CAN FD frame with Standard CAN ID 10 CAN message with Extended CAN ID 11 CAN FD frame with Extended CAN ID.

Requirement
SWS_Can_00416

◆ Can_PduType

typedef struct _Can_PduType Can_PduType

This type unites PduId (swPduHandle), SduLength (length), SduData (sdu), and Can Id (id) for any CAN L-SDU.

Requirement
SWS_Can_00415

◆ Can_TimeStampType

CAN Controller Tiemstamp

Variables of this type are used to express time stamps based on relative time. Value range: * Seconds: 0 .. 4.294.967.295 s (circa 136 years) * Nanoseconds: 0 .. 999.999.999 ns

Requirement
SWS_CAN_91029

Enumeration Type Documentation

◆ _Can_ControllerStateType

States that are used by the several ControllerMode functions.

Requirement
SWS_Can_91013
Enumerator
CAN_CS_UNINIT 

CAN controller state UNINIT.

CAN_CS_STARTED 

CAN controller state STARTED.

CAN_CS_STOPPED 

CAN controller state STOPPED.

CAN_CS_SLEEP 

CAN controller state SLEEP.

CAN_CS_WAKEUP 

CAN controller state WAKEUP.

CAN_CS_READY 

CAN controller state READY.

◆ _Can_ErrorStateType

Error states of a CAN controller.

Requirement
SWS_Can_91003
Enumerator
CAN_ERRORSTATE_ACTIVE 

CAN controller takes fully part in communication.

CAN_ERRORSTATE_PASSIVE 

CAN controller takes part in communication, but does not send active error frames.

CAN_ERRORSTATE_BUSOFF 

CAN controller doesn't take part in communication.

◆ _Can_ErrorType

The enumeration represents a superset of CAN Error Types which typical CAN HW is able to report. That means not all CAN HW will be able to support the complete set.

Requirement
SWS_Can_91021
Enumerator
CAN_ERROR_BIT_MONITORING1 

A 0 was transmitted and a 1 was read back

CAN_ERROR_BIT_MONITORING0 

A 1 was transmitted and a 0 was read back

CAN_ERROR_BIT 

The HW reports a CAN bit error but cannot report distinguish between CAN_ERROR_BIT_MONITORING1 and CAN_ERROR_BIT_MONITORING0

CAN_ERROR_CHECK_ACK_FAILED 

Acknowledgement check failed

CAN_ERROR_ACK_DELIMITER 

Acknowledgement delimiter check failed

CAN_ERROR_ARBITRATION_LOST 

The sender lost in arbitration

CAN_ERROR_OVERLOAD 

CAN overload detected via an overload frame. Indicates that the receive buffers of a receiver are full.

CAN_ERROR_CHECK_FORM_FAILED 

Violations of the fixed frame format

CAN_ERROR_CHECK_STUFFING_FAILED 

Stuffing bits not as expected

CAN_ERROR_CHECK_CRC_FAILED 

CRC check failed

CAN_ERROR_BUS_LOCK 

Bus lock (Bus is stuck to dominant level)