C_CAN ROM API Documentation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

C_CAN ROM API Documentation

1,143 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by martinho on Mon Aug 24 11:21:08 MST 2015
I'm evaluation if i can use the Can rom Api or have to write my own Can-Bus driver. Unfortunatly the doccumentation for the ROM API is not very helpful. My questions are:

To send a Can message I have to use:

void hwCAN_MsgTransmit(CAN_HANDLE_T hCan, CAN_MSG_OBJ * msg_obj);

where msg_obj is a struct of:

typedef struct _CAN_MSG_OBJ {
          uint32_t mode_id;
          uint32_t mask;
          uint8_t  data[8];
          uint8_t  dlc;
          uint8_t msgobj;
} CAN_MSG_OBJ;

So fare so good but:
- I have not found any information about the range of msgobj, is this the Messagenumer from IF1_CMDREQ (0x01 to 0x20)? I yes why is the example using 0x00?
- How can I tell the Function that I want to send a 28 Bit or a 11 bit ID?

In general is there any other documentation about the ROM API (apart from the UM10736)?

thanks

Martin
Labels (1)
0 Kudos
Reply
1 Reply

1,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Aug 24 12:06:08 MST 2015

Quote: martinho
- I have not found any information about the range of msgobj, is this the Messagenumer from IF1_CMDREQ (0x01 to 0x20)? I yes why is the example using 0x00?



That's wrong in this example...


Quote: martinho

- How can I tell the Function that I want to send a 28 Bit or a 11 bit ID?



You can't use 28 bits  :O

Either 11 or 29:

UM:

Quote:
The message object structure uses the following variables:
mode_id: C_CAN operation mode
#define CAN_MSGOBJ_STD 0x00000000UL // CAN 2.0a 11-bit ID
[color=#f00]#define CAN_MSGOBJ_EXT 0x20000000UL // CAN 2.0b 29-bit ID[/color]
#define CAN_MSGOBJ_DAT 0x00000000UL // data frame
#define CAN_MSGOBJ_RTR 0x40000000UL // rtr frame

0 Kudos
Reply