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 327 of 547
NXP Semiconductors
UM10398
Chapter 17: LPC11Cxx C_CAN on-chip drivers
/* Callback function prototypes */
void CAN_rx(uint8_t msg_obj_num);
void CAN_tx(uint8_t msg_obj_num);
void CAN_error(uint32_t error_info);
/* CANopen Callback function prototypes */
uint32_t CANOPEN_sdo_exp_read (uint16_t index, uint8_t subindex);
uint32_t CANOPEN_sdo_exp_write(uint16_t index, uint8_t subindex, uint8_t *dat_ptr);
uint32_t CANOPEN_sdo_seg_read(uint16_t index, uint8_t subindex, uint8_t openclose, uint8_t *length, uint8_t *data,
uint8_t *last);
uint32_t CANOPEN_sdo_seg_write(uint16_t index, uint8_t subindex, uint8_t openclose, uint8_t length, uint8_t *data,
uint8_t *fast_resp);
uint8_t CANOPEN_sdo_req(uint8_t length_req, uint8_t *req_ptr, uint8_t *length_resp, uint8_t *resp_ptr);
Example call:
// Publish callbacks
(*rom)->pCAND->config_calb(&callbacks);
17.4.10 CAN message received callback
The CAN message received callback function is called on the interrupt level by the CAN
interrupt handler.
Example call:
// CAN receive handler
void CAN_rx(uint8_t msgobj_num)
{
// Read out received message
msg_obj.msgobj = msgobj_num;
(*rom)->pCAND->can_receive(&msg_obj);
return;
}
Remark: The callback is not called if the user CANopen handler is activated for the
message object that is used for SDO receive.
17.4.11 CAN message transmit callback
Called on the interrupt level by the CAN interrupt handler after a message has been
successfully transmitted on the bus.
Example call:
// CAN transmit handler
void CAN_tx(uint8_t msgobj_num)
{
// Reset flag used by application to wait for transmission finished
if (wait_for_tx_finished == msgobj_num)
wait_for_tx_finished = 0;
return;
}