Access U1IIR register

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Access U1IIR register

362 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dhill on Mon May 21 16:51:42 MST 2012
I am compiling code for a LPC2368 processor with Red Suite 4. I need a variable that will access the processor's U1IIR register. I tried:

volatile __attribute__ ((io (0xE0010008))) __uartiir_bits U1IIR_bit;

But the compiler didn't seem to understand the io attribute.

Does anyone know the correct way of doing this?
0 Kudos
3 Replies

332 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by atomicdog on Tue May 22 13:28:32 MST 2012
It may come with  Red Suite 4 depending on which one you have. I don't have the 512k version but I found the LPC23xx.h header in other places.

The nxp_swim library has it and lpcxpresso_3.6_317 has it.

/* Universal Asynchronous Receiver Transmitter 1 (UART1) */
#define UART1_BASE_ADDR        0xE0010000
#define U1RBR          (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x00))
#define U1THR          (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x00))
#define U1DLL          (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x00))
#define U1DLM          (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x04))
#define U1IER          (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x04))
#define U1IIR          (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x08))
#define U1FCR          (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x08))
#define U1LCR          (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x0C))
#define U1MCR          (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x10))
#define U1LSR          (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x14))
#define U1MSR          (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x18))
#define U1SCR          (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x1C))
#define U1ACR          (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x20))
#define U1FDR          (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x28))
#define U1TER          (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x30))
0 Kudos

332 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dhill on Tue May 22 09:42:16 MST 2012

Quote: atomicdog
You can just look at the header file for an example of how it's done.
#define U1IIR               ((uint32_t   *) 0xE0010008   )



Thanks. Where can I get a header file for the LPC2368 that has these definitions?
0 Kudos

332 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by atomicdog on Mon May 21 18:01:03 MST 2012

Quote: dhill
I am compiling code for a LPC2368 processor with Red Suite 4. I need a variable that will access the processor's U1IIR register. I tried:

volatile __attribute__ ((io (0xE0010008))) __uartiir_bits U1IIR_bit;

But the compiler didn't seem to understand the io attribute.

Does anyone know the correct way of doing this?


That attribute is only supported by MeP target so no other target like the ARM will understand it.

You can just look at the header file for an example of how it's done.
#define U1IIR               ((uint32_t   *) 0xE0010008   )
0 Kudos