CANopen FD Master Library
Making your systems precise, reliable and high-quality - 5.10.01
Data Fields
CpCanMsg_s Struct Reference

Detailed Description

For transmission and reception of CAN messages a structure which holds all necessary informations is used. The structure has the following data fields:

+ Collaboration diagram for CpCanMsg_s:

Data Fields

uint32_t ulIdentifier
 
union {
   uint8_t   aubByte [CP_DATA_SIZE]
 
   uint16_t   auwWord [CP_DATA_SIZE/2]
 
   uint32_t   aulLong [CP_DATA_SIZE/4]
 
tuMsgData
 
uint8_t ubMsgDLC
 
uint8_t ubMsgCtrl
 
CpTime_ts tsMsgTime
 
uint32_t ulMsgUser
 
uint32_t ulMsgMarker
 

Field Documentation

◆ aubByte

uint8_t CpCanMsg_s::aubByte[CP_DATA_SIZE]

byte access, array of bytes

◆ aulLong

uint32_t CpCanMsg_s::aulLong[CP_DATA_SIZE/4]

32 bit access, array of longs

◆ auwWord

uint16_t CpCanMsg_s::auwWord[CP_DATA_SIZE/2]

16 bit access, array of words

◆ tsMsgTime

CpTime_ts CpCanMsg_s::tsMsgTime

The time stamp field defines the time when a CAN message was received by the CAN controller. This is an optional field (available if #CP_CAN_MSG_TIME is set to 1).

◆ tuMsgData

union { ... } CpCanMsg_s::tuMsgData

The data field has up to 8 bytes (for classic CAN) or 64 bytes (for ISO CAN FD) of message data. The number of used bytes is described via the structure member ubMsgDLC.

◆ ubMsgCtrl

uint8_t CpCanMsg_s::ubMsgCtrl

The structure member ubMsgCtrl defines the different data frames (2.0A / 2.0B) and the RTR frames.

  • Bit 0: Std. / Ext. Frame
  • Bit 1: ISO CAN FD: value of FDF bit
  • Bit 2: Remote Frame
  • Bit 3: Overload Frame
  • Bit 4: reserved, always 0
  • Bit 5: reserved, always 0
  • Bit 6: ISO CAN FD: value of BRS bit
  • Bit 7: ISO CAN FD: value of ESI bit
See also
CP_MSG_CTRL

◆ ubMsgDLC

uint8_t CpCanMsg_s::ubMsgDLC

The data length code denotes the number of data bytes which are transmitted by a message. The possible value range for the data length code is from 0 to 8 for classic CAN and 0 to 15 for ISO CAN FD.

◆ ulIdentifier

uint32_t CpCanMsg_s::ulIdentifier

The identifier field may have 11 bits for standard frames (CAN specification 2.0A) or 29 bits for extended frames (CAN specification 2.0B). The three most significant bits are reserved (always read 0).

See also
CP_MASK

◆ ulMsgMarker

uint32_t CpCanMsg_s::ulMsgMarker

The field message marker can hold a 32 bit value, which is defined by the application. This is an optional field (available if #CP_CAN_MSG_MARKER is set to 1).

◆ ulMsgUser

uint32_t CpCanMsg_s::ulMsgUser

The field user data can hold a 32 bit value, which is defined by the user. This is an optional field (available if #CP_CAN_MSG_USER is set to 1).