Home / RL-ARM User's Guide (MDK v4)
CAN_msg
The CAN_msg type is defined in rtx_can.h. It specifies the CAN message
structure used by the CAN driver routines. The CAN_msg type is
defined as:
typedef struct {
U32 id; /* 11/29 bit message ID */
U8 data[8]; /* Data field */
U8 len; /* Length of data field in bytes */
U8 ch; /* Object channel */
U8 format; /* 0-STANDARD, 1-EXTENDED IDENTIFIER */
U8 type; /* 0-DATA FRAME, 1-REMOTE FRAME */
} CAN_msg;
and is used as shown in the following example:
#include <rtx_can.h>
..
CAN_msg msg_buf = {
33, // ID
{ 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00 }, // Data
1, // Length
1, // Channel
STANDARD_FORMAT, // Format
DATA_FRAME // Type
};
..
CAN_send (2, &msg_buf, 0x0F00);
..