LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
LPC11Cxx The CCAN on-chip drivers example

Detailed Description

Example description
This example shows how to use CCAN on-chip driver to send and receive a simple CAN frame.
Upon reset, the LPC11C00 will send a simple CAN frame with ID 0x345. It will send a CAN frame with its data contents of "TEST".
Whenever the LPC11C00 receives a CAN frame whose ID is between 0x400-0x4FF, it will simply resend the received frame back onto the CAN bus.
The baudrate is set to 500kBit/s.

Special connection requirements
Connect the CCAN_L and CCAN_H signal from the LPC11C00 to a CAN BUS Analyzer.

Build procedures:
LPC11xx example quickstart for Code Red Xpresso
LPC11xx example quickstart for Keil uVision4
LPC11xx example quickstart for IAR EWARM

Supported boards and board setup:
NXP Xpresso LPC11C24 board

Submitting LPCOpen issues:
Community support for LPCOpen

Macros

#define TEST_CCAN_BAUD_RATE   500000
 

Functions

void baudrateCalculate (uint32_t baud_rate, uint32_t *can_api_timing_cfg)
 
void CAN_rx (uint8_t msg_obj_num)
 
void CAN_tx (uint8_t msg_obj_num)
 
void CAN_error (uint32_t error_info)
 
void CAN_IRQHandler (void)
 CCAN Interrupt Handler.
 
int main (void)
 Main routine for CCAN_ROM example.
 

Variables

CCAN_MSG_OBJ_T msg_obj
 

Macro Definition Documentation

#define TEST_CCAN_BAUD_RATE   500000

Definition at line 64 of file ccan_rom.c.

Function Documentation

void baudrateCalculate ( uint32_t  baud_rate,
uint32_t can_api_timing_cfg 
)

Definition at line 75 of file ccan_rom.c.

void CAN_error ( uint32_t  error_info)

Definition at line 125 of file ccan_rom.c.

void CAN_IRQHandler ( void  )

CCAN Interrupt Handler.

Returns
Nothing
Note
The CCAN interrupt handler must be provided by the user application. It's function is to call the isr() API located in the ROM

Definition at line 133 of file ccan_rom.c.

void CAN_rx ( uint8_t  msg_obj_num)

Definition at line 104 of file ccan_rom.c.

void CAN_tx ( uint8_t  msg_obj_num)

Definition at line 120 of file ccan_rom.c.

int main ( void  )

Main routine for CCAN_ROM example.

Main program body.

Returns
Nothing

defined(CHIP_LPC175X_6X)

Definition at line 145 of file ccan_rom.c.

Variable Documentation

CCAN_MSG_OBJ_T msg_obj

Definition at line 66 of file ccan_rom.c.