RES: write data to the address (PC104)
Wendell Pereira da Silva
wendell.silva at compsisnet.com.br
Thu Jun 28 14:08:22 UTC 2012
Just a tip: dont' forget to mark the pointer as 'volatile':
volatile unsigned char* addr = (volatile unsigned char*)0xD0000000;
or, even better (#include <stdint.h>):
volatile uint8_t addr = (volatile uint8_t*)0xD0000000;
Since this is supposed to be an I/O addrees, you want to take the compiler's optimizer out of the way in this case.
________________________________________
De: rtems-users-bounces at rtems.org [rtems-users-bounces at rtems.org] em Nome de Joel Sherrill [joel.sherrill at oarcorp.com]
Enviado: quinta-feira, 28 de junho de 2012 8:45
Para: zhoupeng; rtems-users
Assunto: Re: write data to the address (PC104)
Are you sure the device is in memory space and not I/O space?
If you can share the name of the card with a link, we can double check you.
--joel
zhoupeng <zpeng563 at 126.com> wrote:
>hello:
>I am writing a device driver for PC104. I want to write data to the address (D0000). Can I use these code:
>
>unsigned char *address = (unsigned char *)0xD0000000;
>*address=data;
>
>Thank you!
>
>
_______________________________________________
rtems-users mailing list
rtems-users at rtems.org
http://www.rtems.org/mailman/listinfo/rtems-users
More information about the users
mailing list