Wendell Pereira da Silva wendell.silva at
Mon May 23 18:46:26 UTC 2011


In this case (ERC-32), the GPIO configuration register is at 0x01F800A8, and the I/O register is 0x01F800AC. So, the following code fragment illustrates what you want to do:

#define GPIO_DATA_ADDR  (unsigned long *)0x01F800AC
#define GPIO_CONF_ADDR  (unsigned long *)0x01F800A8

rtems_task Init(...)
     // configure all GPIO pins as output
     *GPIO_CONF_ADDR = 0x00;

     // set bit GPIO[0] and clear other ones.
     *GPIO_DATA_ADDR = 0x01;

     // set bit GPIO[3] and leave others untouched.
     *GPIO_DATA_ADDR = *GPIO_DATA_ADDR | (1 << 3);

See the ERC32 datasheet for further details.
Also, there's a lot of good references on Embedded Development in the Internet.
A good one is the book:


De: rtems-users-bounces at [mailto:rtems-users-bounces at] Em nome de Guilherme Resende
Enviada em: segunda-feira, 23 de maio de 2011 10:45
Para: rtems-users at
Assunto: GPIO

Hello everyone,
First of all, I would like to apologize if the level of my doubt is too low , but I am a newbie in the world of RTEMS and Embedded Programming.
What I've been trying to do ,  is to access the GPIO ports bit by bit, like, setting GPIO[7] through GPIO[1] as outputs
and GPIO[0] as an input.
Could anyone help me with that?
My embedded processor is Sparc ERC-32

Guilherme  Resende

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list