Configuring Register as Analog Input on LPC4088

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

Configuring Register as Analog Input on LPC4088

503 Views
diamond
Contributor I

I am using the LPC4088 development board and my primary goal is to configure a certain GPIO pin as an analog input. In theory, I understand what bits need to be changed in order to achieve this, but I am finding it difficult to actually program this in the LPCXpresso environment.

Specifically I want to configure  IOCON_P0_24 (0x4002 C060) to act as an analog input. My plan to do this was to define the register and then use the |= operator to change the value, for example:

...

 #define IOCON_P0_24 0x4002C060

...

IOCON_P0_24  |=  (0x1 << 0);

...

I am getting an error that is saying "lvalue required as left operant of assignment". This leads me to believe that I need to define IOCON_P0_24 differently or include it from somewhere else.

Could anyone suggest what the best way to adjust the register value? Any help is very much appreciated!

Labels (1)
0 Kudos
1 Reply

436 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Blake,

Pls try to cahge the code as:

 #define IOCON_P0_24 0x4002C060

...

*(unsigned int *)IOCON_P0_24  |=  (0x1 << 0);

or

*(uint32_t *)IOCON_P0_24  |=  (0x1 << 0);

Pls have a try

BR

XiangJun Rong

0 Kudos