How to write to and read from GPIO registers in LPC1347

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

How to write to and read from GPIO registers in LPC1347

ソリューションへジャンプ
1,697件の閲覧回数
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 解決策
878件の閲覧回数
injunear
Contributor III

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

元の投稿で解決策を見る

0 件の賞賛
3 返答(返信)
879件の閲覧回数
injunear
Contributor III

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

0 件の賞賛
878件の閲覧回数
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 件の賞賛
877件の閲覧回数
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 件の賞賛