added Leandro Dardini's lastline patch for the HD44780 driver and

adapted it to the IOWarrior driver that also drives HD44780 displays.
This commit is contained in:
marschap
2005-01-17 20:18:21 +00:00
parent 2899cabedf
commit ffdd1a4925
5 changed files with 49 additions and 3 deletions
+8
View File
@@ -287,6 +287,10 @@ Outputport=no
# If you have the additional output port ("bargraph") and you want to
# be able to control it with the lcdproc OUTPUT command
#Lastline=true
# Specifies if the last line is pixel addressable or it controls an
# underline effect. Default: true (pixel addressable)
Size=20x4
# Specifies the size of the LCD.
# In case of multiple combined displays, this should be the total size.
@@ -334,6 +338,10 @@ Size=20x4
# (if not given, the 1st IOWarrior found gets used)
#SerialNumber=00000674
# Specifies if the last line is pixel addressable or it controls an
# underline effect. Default: true (pixel addressable)
#Lastline=true
[IrMan]
+17 -1
View File
@@ -263,6 +263,9 @@ PrivateData *p;
p->width = w;
p->height = h;
/* special option lastline (some displays need it against the underline effect) */
p->lastline = drvthis->config_get_bool(drvthis->name, "lastline", 0, 1);
/* Contrast of the LCD can be changed by adjusting a trimpot */
/* End of config file parsing */
@@ -1022,6 +1025,9 @@ int row;
if (dat == NULL)
return;
if (!p->lastline)
dat[(p->cellheight - 1) * p->cellwidth] = 0;
for (row = 0; row < p->cellheight; row++) {
int letter = 0;
int col;
@@ -1106,11 +1112,21 @@ char checkbox_gray[CELLWIDTH*CELLHEIGHT] = {
1, 0, 1, 0, 1,
1, 1, 1, 1, 1,
0, 0, 0, 0, 0 };
char block_filled[CELLWIDTH*CELLHEIGHT] = {
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
0, 0, 0, 0, 0 };
/* Yes we know, this is a VERY BAD implementation */
switch(icon) {
case ICON_BLOCK_FILLED:
IOWarrior_chr(drvthis, x, y, 255);
IOWarrior_set_char(drvthis, 6, block_filled);
IOWarrior_chr(drvthis, x, y, 6);
break;
case ICON_HEART_FILLED:
IOWarrior_set_char(drvthis, 0, heart_filled);
+5
View File
@@ -98,6 +98,11 @@ typedef struct driver_private_data {
unsigned int output_mask;
int output_state;
/* lastline controls the use of the last line, if pixel addressable (true, default) or */
/* underline effect (false). To avoid the underline effect in the latter case, the last */
/* line is always zeroed for whatever redefined character */
char lastline;
int brightness;
int backlight;
} PrivateData;
+4 -1
View File
@@ -85,7 +85,10 @@ typedef struct driver_private_data {
int delayMult; // Delay multiplier for slow displays
char delayBus; // Delay if the computer can send data too fast over
// its bus to LPT port
char lastline; // lastline controls the use of the last line, if pixel addressable (true, default) or
// underline effect (false). To avoid the underline effect, last line is always zeroed
// for whatever redefined character
// keyMapDirect contains an array of the ascii-codes that should be generated
// when a directly connected key is pressed (not in matrix).
char *keyMapDirect[KEYPAD_MAXX];
+15 -1
View File
@@ -155,6 +155,7 @@ HD44780_init (Driver * drvthis, char *args)
p->have_output = drvthis->config_get_bool( drvthis->name, "outputport", 0, 0 );
p->delayMult = drvthis->config_get_int( drvthis->name, "delaymult", 0, 1 );
p->delayBus = drvthis->config_get_bool( drvthis->name, "delaybus", 0, 1 );
p->lastline = drvthis->config_get_bool( drvthis->name, "lastline", 0, 1 );
// Get and search for the connection type
s = drvthis->config_get_string( drvthis->name, "connectiontype", 0, "4bit" );
@@ -974,6 +975,9 @@ HD44780_set_char (Driver *drvthis, int n, char *dat)
if (!dat)
return;
if (!p->lastline)
dat[(p->cellheight - 1) * p->cellwidth]=0;
for (row = 0; row < p->cellheight; row++) {
letter = 0;
for (col = 0; col < p->cellwidth; col++) {
@@ -1056,11 +1060,21 @@ HD44780_icon (Driver *drvthis, int x, int y, int icon)
1, 0, 1, 0, 1,
1, 1, 1, 1, 1,
0, 0, 0, 0, 0 };
char block_filled[] = {
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
0, 0, 0, 0, 0 };
/* Yes I know, this is a VERY BAD implementation */
switch( icon ) {
case ICON_BLOCK_FILLED:
HD44780_chr( drvthis, x, y, 255 );
HD44780_set_char( drvthis, 6, block_filled );
HD44780_chr( drvthis, x, y, 6);
break;
case ICON_HEART_FILLED:
HD44780_set_char( drvthis, 0, heart_filled );