• Home • Files • Structures         • Download

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:

Data Fields

union {
   _U16   uwStd
   _U32   ulExt
tuMsgId
union {
   _U08   aubByte [8]
   _U16   auwWord [4]
   _U32   aulLong [2]
tuMsgData
_U08 ubMsgDLC
_U08 ubMsgCtrl
_TsCpTime tsMsgTime
_U32 ulMsgUser

Field Documentation

identifier for Standard Frame

identifier for Extended Frame

union { ... } CpCanMsg_s::tuMsgId

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:
Mask values for CAN messages

byte access, array of 8 byte

16 bit access, array of 4 words

32 bit access, array of 2 longs

union { ... } CpCanMsg_s::tuMsgData

The data field has up to 8 bytes (64 bit) of message data. The number of used bytes is described via the structure member 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 (bytes).

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

  • Bit 0: Extended Frame if set to 1, else Standard Frame
  • Bit 1: Remote Frame if set to 1, else Data Frame
  • Bit 2: Receiver Overrun if set to 1, else normal reception
See also:
Mask values for CAN messages

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).

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).


The documentation for this struct was generated from the following file:


SourceForge.net Logo

© MicroControl GmbH & Co. KG

CANpie - V1.93