![]() |
LPCOpen Platform
v1.03
LPCOpen Platform for NXP LPC Microcontrollers
|
Example description
This example describes how to use CAN peripheral on LPC17xx and LPC40xx chip. It requires a CAN analyser or, another CAN device connected to CAN_1 pins. After initializing, the device will setup the AF Look-up table which defines acceptable IDs. Then, it transmits first standard message with ID 0x200 on bus, a remote message with ID 0x300 and an extended message with ID 0x10000200. The device always listens message on the bus. Whenever a message whose ID exists in the AF Look-up Table comes, the device will reply back a message with ID 0x200. The data in replied message is the same with the one of received message.
AF Lookup Table:
Full CAN Section: includes 0x03, 0x04, 0x07, 0x09.
Individual Standard ID Section: includes 0x30, 0x40, 0x50, 0x90, 0xB0.
Standard ID Range Section: includes 0x300~0x400, 0x400~0x500, 0x700~0x780.
Extended ID Section: includes 0x803, 0x804, 0x807, 0x809.
Extended ID Range Section: includes 0xB00~0xC00, 0xC00~0xD00, 0xF00~0xF80.
Special connection requirements
Build procedures:
LPC17xx/40xx example quickstart for Keil uVision4
LPC17xx/40xx example quickstart for IAR EWARM
LPC17xx/40xx example quickstart for Code Red Xpresso
Supported boards and board setup:
Embedded Artists' LPC1788 Developer's Kit
Embedded Artists' LPC4088 Developer's Kit
NXP Xpresso LPC1769 board
Submitting LPCOpen issues:
Community support for LPCOpen
Macros | |
| #define | CAN_CTRL_NO 0 |
| #define | LPC_CAN (LPC_CAN1) |
| #define | AF_LUT_USED 1 |
| #define | FULL_CAN_AF_USED 1 |
| #define | CAN_TX_MSG_STD_ID (0x200) |
| #define | CAN_TX_MSG_REMOTE_STD_ID (0x300) |
| #define | CAN_TX_MSG_EXT_ID (0x10000200) |
| #define | CAN_RX_MSG_ID (0x100) |
Functions | |
| static void | PrintCANErrorInfo (uint32_t Status) |
| static void | PrintCANMsg (CAN_MSG_T *pMsg) |
| static void | ReplyRemoteMessage (CAN_MSG_T *pRcvMsg) |
| static void | ReplyNormalMessage (CAN_MSG_T *pRcvMsg) |
| static void | PrintAFLUT (void) |
| static void | SetupAFLUT (void) |
| static void | ChangeAFLUT (void) |
| void | CAN_IRQHandler (void) |
| int | main (void) |
| Main program body. | |
Variables | |
| static char | WelcomeMenu [] |
| CAN_STD_ID_ENTRY_T | FullCANSection [] |
| CAN_STD_ID_ENTRY_T | SFFSection [] |
| CAN_STD_ID_RANGE_ENTRY_T | SffGrpSection [] |
| CAN_EXT_ID_ENTRY_T | EFFSection [] |
| CAN_EXT_ID_RANGE_ENTRY_T | EffGrpSection [] |
| CANAF_LUT_T | AFSections |
| int main | ( | void | ) |
Main program body.
main routine for example_lwip_tcpecho_sa_18xx43xx
Main program body.
Entry point for all the dual core examples. All the dual core example execution starts from this function, it is common for code that runs on core-M4 and core-M0.
Main program body.
Main program body.
Main program entry point. This routine contains the overall program flow, including initial setup of all components and the main program loop.
Main program body.
Main program body.
Main program body.
Main program body.
| CANAF_LUT_T AFSections |
| CAN_EXT_ID_RANGE_ENTRY_T EffGrpSection[] |
| CAN_EXT_ID_ENTRY_T EFFSection[] |
| CAN_STD_ID_ENTRY_T FullCANSection[] |
| CAN_STD_ID_RANGE_ENTRY_T SffGrpSection[] |
| CAN_STD_ID_ENTRY_T SFFSection[] |