Wendell Pereira da Silva
wendell.silva at compsisnet.com.br
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
// configure all GPIO pins as output
*GPIO_CONF_ADDR = 0x00;
// set bit GPIO and clear other ones.
*GPIO_DATA_ADDR = 0x01;
// set bit GPIO 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: http://ebookee.org/Programming-Embedded-Systems-With-C-and-Gnu-Development-Tools-2nd-Edition_336503.html
De: rtems-users-bounces at rtems.org [mailto:rtems-users-bounces at rtems.org] Em nome de Guilherme Resende
Enviada em: segunda-feira, 23 de maio de 2011 10:45
Para: rtems-users at rtems.org
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 through GPIO as outputs
and GPIO as an input.
Could anyone help me with that?
My embedded processor is Sparc ERC-32
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the users