Datasheet

UM10398 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2014. All rights reserved.
User manual Rev. 12.3 — 10 June 2014 321 of 547
NXP Semiconductors
UM10398
Chapter 17: LPC11Cxx C_CAN on-chip drivers
17.4 API description
17.4.1 Calling the C_CAN API
A fixed location in ROM contains a pointer to the ROM driver table i.e. 0x1FFF 1FF8. This
location is the same for all LPC11Cxx parts. The ROM driver table contains pointer to the
CAN API table. Pointers to the various CAN API functions are stored in this table. CAN
API functions can be called by using a C structure.
Figure 68
illustrates the pointer mechanism used to access the on-chip CAN API. On-chip
RAM from address 0x1000 0050 to 0x1000 00B8 is used by the CAN API. This address
range should not be used by the application. For applications using the on-chip CAN API,
the linker control file should be modified appropriately to prevent usage of this area for
application’s variable storage.
In C, the structure with the function list that is referenced to call the API functions looks as
follows:
typedef struct _CAND {
void (*init_can) (uint32_t * can_cfg, uint8_t isr_ena);
void (*isr) (void);
void (*config_rxmsgobj) (CAN_MSG_OBJ * msg_obj);
uint8_t (*can_receive) (CAN_MSG_OBJ * msg_obj);
void (*can_transmit) (CAN_MSG_OBJ * msg_obj);
void (*config_canopen) (CAN_CANOPENCFG * canopen_cfg);
void (*canopen_handler) (void);
void (*config_calb) (CAN_CALLBACKS * callback_cfg);
} CAND;
Fig 68. CAN API pointer structure
Ptr to C_CAN API Table
Ptr to Device Table 1
Ptr to Device Table 0
Ptr to Device Table n
init_can
isr
config_canopen
canopen_handler
config_calb
Ptr to Function 2
Ptr to Function 0
Ptr to Function 1
Ptr to Function n
C_CAN API
Device n
ROM Driver Table
0x1FFF 1FF8
0x1FFF 1FFC
0x1FFF 2000
config_rxmsgobj
can_receive
can_transmit