Problem with Chip_GPIO_SetPinState

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

Problem with Chip_GPIO_SetPinState

1,038件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by strawhats10 on Fri Jul 31 08:52:48 MST 2015
Hi all,

I have a question about setting the pin state in LPCXpresso54102 platform. What i would like to do is to set a pin high before a task is executed and set it back to low after the task has been executed. Right now I am doing it like this:

#define GPIO_PORT 1
#define GPIO_PIN 29

Chip_GPIO_SetPinState(LPC_GPIO, GPIO_PORT, GPIO_PIN, true);
delay();
bool temp1= Chip_GPIO_GetPinState(LPC_GPIO, GPIO_PORT, GPIO_PIN);
task();
Chip_GPIO_SetPinState(LPC_GPIO, GPIO_PORT, GPIO_PIN, false);
delay();
bool temp2= Chip_GPIO_GetPinState(LPC_GPIO, GPIO_PORT, GPIO_PIN);


The problem is that i check the values of temp1 and temp2 and they do not change at all. It is like the Chip_GPIO_SetPinState has no effect at all. Am I missing something? Thank you in advance!
ラベル(1)
0 件の賞賛
返信
1 返信

775件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by HCTEK on Tue Aug 04 02:31:29 MST 2015
Hello,

first you must configure the pin to a specific function. For your case it is the GPIO. Normally it is in the System Control Unit (SCU) registers.


Regards,
0 件の賞賛
返信