It might not be the best place but I think that this mailing list is the
only place I can ask this question.
I'm trying to access the register that would show me what buttons are
pressed on 3850. I noticed this is done in the bootldr. Unfortunately
I'm trying to do it under linux and when I read the register I always
get "0xcf" .
My program is very simple and is attached to the end of this message. I
suspect I'm not initialazing some aspect of the asic2 correctly, or
linux kernel resets it between the time bootldr is capable of reading it
, and time I'm trying to read it in my program.
I would appreciate any comments, or suggestions from you. If you know
where I can find some documetation please let me know. So far I have
just the sourcecode to bootldr and kernel as a refrence.
Thank you in advance,
Damian
#include <unistd.h>
#include <sys/mman.h>
#include <fcntl.h>
#define H3800_ASIC_BASE 0x49000000
#define _H3800_ASIC2_KPIO_Base 0x0200
#define _H3800_ASIC2_KPIO_Data 0x0014 /* R/W, 16 bits */
#define H3800_ASIC2_KPIO_ADDR (_H3800_ASIC2_KPIO_Base +
_H3800_ASIC2_KPIO_Data)
main (int argc, char *argv[])
{
int fd;
unsigned short *p, *b;
if ((fd = open ("/dev/mem", O_RDWR)) < 0)
{
fprintf (stderr, "Error opening /dev/mem\n");
}
b = (unsigned short *) mmap (0, 2, PROT_READ | PROT_WRITE, MAP_SHARED,
fd, H3800_ASIC_BASE);
p = b + H3800_ASIC2_KPIO_ADDR;
while (1)
{
printf ("bits %x\n", *p);
}
}
Received on Tue Oct 08 2002 - 17:42:43 EDT
This archive was generated by hypermail 2.2.0 : Mon Jul 25 2005 - 17:10:43 EDT