Forgive me I am new at this. I am trying to understand whats going on
in the keypad.c sample code provided with the ts-7200 board.
Specifically:
unsigned int get_keys(void) {
unsigned int pos, on = 0;
for(pos = 0; pos < 4; pos++) {
*dat = ~(1 << pos); <- I DON'T UNDERSTAND THIS
on |= (~(*dat >> 4) & 0xf) << (4 * pos);
}
return on;
}
The above arrow is the line I am not following because to me its is
setting *dat equal to ~(1 << pos). But when *dat is used in the line
below it is a different value. I don't know anything about the keypad
and maybe thats my problem. Is it some sort of msg to the keypad? Is
there any documentation out there besides the keypad.c and the
hardware guide that came with the board?
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/
|