Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] How can I control GPIO port2/3?

2004-05-07 by Bill Knight

This works for me.

Regards
-Bill Knight
theARMPatch

///////////////////////////////////////////////////////////////////////////////
// General Purpose Input/Output Registers (GPIO)
typedef struct

  REG32 in;                             // GPIO Value Register
  REG32 set;                            // GPIO Output Set Register
  REG32 dir;                            // GPIO Direction Register
  REG32 clr;                            // GPIO Output Clear Register
} gpioRegs_t;

#define GPIO0           ((gpioRegs_t *)0xE0028000)
#define GPIO1           ((gpioRegs_t *)0xE0028010)
#define GPIO2           ((gpioRegs_t *)0xE0028020)
#define GPIO3           ((gpioRegs_t *)0xE0028030)

// GPIO Registers
#define IO0PIN          GPIO0->in       /* P0 Pin Value Register */
#define IO0SET          GPIO0->set      /* P0 Pin Output Set Register */
#define IO0DIR          GPIO0->dir      /* P0 Pin Direction Register */
#define IO0CLR          GPIO0->clr      /* P0 Pin Output Clear Register */
#define IO1PIN          GPIO1->in       /* P1 Pin Value Register */
#define IO1SET          GPIO1->set      /* P1 Pin Output Set Register */
#define IO1DIR          GPIO1->dir      /* P1 Pin Direction Register */
#define IO1CLR          GPIO1->clr      /* P1 Pin Output Clear Register */
#define IO2PIN          GPIO2->in       /* P2 Pin Value Register */
#define IO2SET          GPIO2->set      /* P2 Pin Output Set Register */
#define IO2DIR          GPIO2->dir      /* P2 Pin Direction Register */
#define IO2CLR          GPIO2->clr      /* P2 Pin Output Clear Register */
#define IO3PIN          GPIO3->in       /* P3 Pin Value Register */
#define IO3SET          GPIO3->set      /* P3 Pin Output Set Register */
#define IO3DIR          GPIO3->dir      /* P3 Pin Direction Register */
#define IO3CLR          GPIO3->clr      /* P3 Pin Output Clear Register */




On Fri, 07 May 2004 15:16:11 -0000, janesleecn wrote:

Hi, Dear all

I'm using a LPC2214 in my project. and have released P2.31:8 as a 
GPIO but P2.7:0 as an external memory data bus. Strangely, I can't 
control the behavior of P2.31:8 because I can't find PORT2's GPIO 
register(IOPIN2,IODIR2..). How can I do this?

Thanks for your help!

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.