Configuring Register as Analog Input on LPC4088

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Configuring Register as Analog Input on LPC4088

730件の閲覧回数
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!

ラベル(1)
タグ(2)
0 件の賞賛
返信
1 返信

663件の閲覧回数
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 件の賞賛
返信