How to write to and read from GPIO registers in LPC1347

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

How to write to and read from GPIO registers in LPC1347

Jump to solution
2,064 Views
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?

Labels (3)
0 Kudos
Reply
1 Solution
1,245 Views
injunear
Contributor III

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

View solution in original post

0 Kudos
Reply
3 Replies
1,246 Views
injunear
Contributor III

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

0 Kudos
Reply
1,245 Views
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 Kudos
Reply
1,244 Views
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 Kudos
Reply