Hi Alba,
looks ok but I dont think its doing what you want. See below.
On 11/14/10, Giulio D'Aversa <> wrote:
>> unsigned char *start;
>> int fd = open("/dev/mem", O_RDWR);
>>
>> // TRACE(printf("DIO_SETUP()\n"));
>> start = mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, fd,
>> 0x80840000);
>> // DIO registers
>> PBDR = (unsigned int *)(start + 0x04); // port b
>> PBDDR = (unsigned int *)(start + 0x14); // port b direction register
>> PEDR = (unsigned int *)(start + 0x20); // port e data
>> PEDDR = (unsigned int *)(start + 0x24); // port e direction register
>> GPIOBDB = (unsigned int *)(start + 0xC4); // debounce on port b
>> GEN_DBG_PRT_DEBUG_FL("ok1\n");
>> fflush(NULL);
>> *PBDDR =0xFF;
Port B is all outputs.
>> *PBDR=0x01; // upper nibble output,
You turn on bit 0
>> *GPIOBDB = 0x01; // enable debounce on bit 0
why debounce an output?
>> GEN_DBG_PRT_DEBUG_FL("ok2\n");
>> fflush(NULL);
>>
>> // *PEDDR = 255; // all output (just 2 bits)
>> close(fd);
>> //}
>>
>> }
--
Joel R. Morgan
Morgan Millwright Services, Inc.
Linux User #504110 http://counter.li.org/
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|