How to write to and read from GPIO registers in LPC1347

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to write to and read from GPIO registers in LPC1347

跳至解决方案
1,999 次查看
injunear
Contributor III

I have spent the last four days searching for info on how to use the GPIOs in a LPC1347. What little I have found assumes an understanding far beyond mine. I want to write a simple program that reads inputs, writes outputs and delays a little at times. After four days of searching I have yet to find even the simple commands that let me read from and write to the GPIO registers. The LPCOpen programs were of little help. Where might I find this information, please?

标签 (3)
0 项奖励
回复
1 解答
1,180 次查看
injunear
Contributor III

I discovered the problem. I need to put "void" in front of the asterisk.

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,181 次查看
injunear
Contributor III

I discovered the problem. I need to put "void" in front of the asterisk.

0 项奖励
回复
1,180 次查看
hillbillyinjune
Contributor I

Thank you for your response. Using your recommendation I was able to turn on and off the LED. However I am still unable to read from or write to the GPIO registers. I get errors for what "I think" are legitimate commands. The following is part of my code:

        Chip_GPIO_Init(0x50000000);
     [Gives error: passing argument 1 of 'Chip_GPIO_Init' makes pointer from integer without a cast [-Wint-conversion]]

        Chip_GPIO_SetPinDIROutput((*)0x50000000, 0, 7);
      [Gives error: Syntax error]

        Chip_GPIO_SetPinState((*)0x50000000, 0, 7, 1);
      [Gives error: Syntax error]

        Chip_GPIO_SetPinToggle((*)0x50000000, 0, 7, 1);
      [Gives error: Syntax error]

        x = Chip_GPIO_GetPinState((*)0x50000000, 0, 1);
      [Gives error: Syntax error]

Is this the correct way to access the GPIO registers? If not, what is the correct way. If so, where are these errors coming from, please.

0 项奖励
回复
1,179 次查看
soledad
NXP Employee
NXP Employee

Hi,

 

Please check the following document, this is for LPC11u24 however the process is the same for the LPC1347 device.

How to create a new LPC project using LPCOpen and LPCXpresso 

 

Let me know if this helps!!


Have a great day,
Sol

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复