Cannot Compile any I2C for LPC1112/102

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Lumen on Sun Jun 21 03:57:22 MST 2015
Hello, I am trying to port my code from LPCxpresso 4.x to the most recent 7.x. for MCPU LPC1112/102, and I am getting errors that make no sense to me.

I found the post here and followed instructions to install the missing header files for LPC11xx

I have enabled the #define CHIP_LPC110X (and disabled the rest and also undefined the define BOARD_NXP_XPRESSO_11C24) and enabled Chip_SystemInit();

Most of the examples compile,
Most of my code compiles, using various LCopen libraries .. UART, SPP, GPIO etc but NOT the i2c example or code.

I just don,t get it ....

If I compile the example peripheral I2C, error as follows :-

#define DEFAULT_I2C             I2CO

!!!error reported by little red cross is
"I2C0" undeclared here (not in a function)

Its a #define how is the example code in error ....

In my code I have ......


before compile the parameters are in blue italic ...  hovering over the 1st I get the number 18, over the second I get the number 15.

after compile, the error reported for the second line is
"Multiple markers at this line
- each undeclared identifier is reported only once for each function it
appears in"

and hovering over the STILL blue IC20_IRQN says 'I2C0_IRQn' undeclared (first use in this function) despite the editor reporting its value as 15 a moment before.

I tried looking for the declarations for those parameters and eventually I found ..  RESERVED15_IRQn = 15 in cmsis110x.h !

1) Why is there NO I2C0_IRQn in the enumeration ...  it is in my OLD Xpresso v4.0 LPC111c.h ...  The peripheral is usable ? or not ?
2) Why does the example code fall over on a simple define .... #define DEFAULT_I2C             I2CO

3) All the I2C example code is greyed by lines like
#if !defined(CHIP_LPC110X)
Does this mean that NONE of the LCOPEN example code may be used for LPC1112, or that LPC1112 I2C should not be used ?

Thank you for your considerations, and assistances,