I think that there is an error in the LPC23xx.h include file that apperars in the KEIL web site:
RealView MDK 3.10 -> Supported Devices -> LPC2378 -> Header Files
The lines:
/* FIOs can be accessed through WORD, HALF-WORD or BYTE. */ #define FIO0DIR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x01)) #define FIO1DIR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x21)) #define FIO2DIR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x41)) #define FIO3DIR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x61)) #define FIO4DIR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x81))
#define FIO0DIR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x02)) #define FIO1DIR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x22)) #define FIO2DIR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x42)) #define FIO3DIR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x62)) #define FIO4DIR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x82))
#define FIO0DIR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x03)) #define FIO1DIR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x23)) #define FIO2DIR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x43)) #define FIO3DIR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x63)) #define FIO4DIR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x83))
#define FIO0DIR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x04)) #define FIO1DIR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x24)) #define FIO2DIR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x44)) #define FIO3DIR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x64)) #define FIO4DIR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x84))
must be:
/* FIOs can be accessed through WORD, HALF-WORD or BYTE. */ #define FIO0DIR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x00)) #define FIO1DIR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x20)) #define FIO2DIR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x40)) #define FIO3DIR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x60)) #define FIO4DIR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x80))
#define FIO0DIR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x01)) #define FIO1DIR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x21)) #define FIO2DIR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x41)) #define FIO3DIR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x61)) #define FIO4DIR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x81))
#define FIO0DIR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x02)) #define FIO1DIR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x22)) #define FIO2DIR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x42)) #define FIO3DIR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x62)) #define FIO4DIR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x82))
#define FIO0DIR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x03)) #define FIO1DIR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x23)) #define FIO2DIR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x43)) #define FIO3DIR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x63)) #define FIO4DIR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x83))
Best regards.
Victor Sanchez
I have uploaded now a new version of the file - so the issue is corrected.
Thank you for pointing it out.
Note that the MDK Version 3.11 contains already a corrected header file version. I strongly recommed to use the current version of the toolchain (since also some other issues with LPC23xx devices are corrected there).