Originally Posted by
CommonTater
Some embedded systems identify bits on hardware ports that way... Can't remember exactly where but I have seen this before.
In any case, even if the variable names are bogus... the concept is right.
Hm...
C and the 8051 - Google Books
Maybe something like that table, column four? C wouldn't let you use a number as a variable name, which is why I mentioned it. But I suppose if you were writing your own hardware specific compiler you could. But I'm guessing it's really just a way to reference it for discussion, rather than an actual variable name.
edit - a few seconds and a search engine confirms my suspicions:
Code:
/*
Program:Lcd4b.C
Patchup file:Lcd4ba.c
Author: Vineet Kulkarni
Date:06-07-2000
Modified:07-07-2000
Language: C + assembly
LCD test program, to be used with Mini51 evaluation/prototyping board
LCD connections:
p2.0 to p2.3 are connected to 4 MSBits of LCD databus
p2.4 is connected to EN of LCD (1 means LCD selected)
p2.5 is connected to A0 of LCD (0 means command, 1 means data)
WR of LCD is connected to Ground, so we can never read LCD status
This program has functions to initialize LCD and display a
string on it.
Here the LCD is port driven and used in 4 bit interface.
*/
They use the .# for reference, but the actual code does not:
Code:
void display_lcd(char arr[32]) {
// displays first 16 characters in the string on line 1 and
// remaining 16 characters on 2nd line
// assumed 16 X 2 display
unsigned char count, tempchar;
lcd_cmd(0x80);
for(count=0;count<16;count++) { // first line
if(arr[count]) {
tempchar = arr[count] ;
lcd_dat(tempchar);
}
else return;
}
lcd_cmd(0xc0); //addrs for second line
for(count=16;count<32;count++) {
if (arr[count]) {
tempchar = arr[count] ;
lcd_dat(tempchar);
}
else return;
}
}
Quzah.