new ConnectionType pertelian in hd44780 driver (Matteo Pillon)

This commit is contained in:
marschap
2007-03-18 15:28:32 +00:00
parent 4efec0996a
commit bbfe65da9f
5 changed files with 35 additions and 7 deletions
+1
View File
@@ -44,6 +44,7 @@ static const ConnectionMapping connectionMapping[] = {
{"los-panel", hd_init_serial, "\tnone\n"},
{"vdr-lcd", hd_init_serial, "\tnone\n"},
{"vdr-wakeup", hd_init_serial, "\tnone\n"},
{"pertelian", hd_init_serial, "\tnone\n"},
/* End serial connectiontypes */
{"lis2", hd_init_lis2, "\tnone\n"},
#ifdef HAVE_LIBUSB
+7 -6
View File
@@ -267,18 +267,19 @@ serial_HD44780_senddata (PrivateData *p, unsigned char displayID, unsigned char
void
serial_HD44780_backlight (PrivateData *p, unsigned char state)
{
unsigned char send[1];
if (p->have_backlight) {
if (SERIAL_IF.backlight_escape) {
unsigned char send[2];
send[0] = SERIAL_IF.backlight_escape;
send[1] = state ? 0 : 0xFF;
write(p->fd, &send, 2);
write(p->fd, &send, 1);
}
if (SERIAL_IF.backlight_on && SERIAL_IF.backlight_off) {
send[0] = state ? SERIAL_IF.backlight_on : SERIAL_IF.backlight_off;
}
else {
unsigned char send[1];
send[0] = state ? SERIAL_IF.backlight_on : SERIAL_IF.backlight_off;
write(p->fd, &send, 1);
send[0] = state ? 0 : 0xFF;
}
write(p->fd, &send, 1);
}
}
+8 -1
View File
@@ -18,6 +18,12 @@ typedef struct SerialInterface {
char keypad;
char keypad_escape;
char backlight;
/*
if both escape and on/off codes are set means that display
can't set brightness, but can only switch light on or off and
needs both escape and on/off bytes (see pertelian,
http://pertelian.com/index.php?option=com_content&task=view&id=27&Itemid=33)
*/
char backlight_escape; /* leave to 0 is the interface uses on/off codes */
char backlight_off;
char backlight_on; /* leave these two to 0 is backlight_escape is set */
@@ -33,7 +39,8 @@ static const SerialInterface serial_interfaces[] = {
{ "lcdserializer", 0xFE, 0, 0x00, 0x00, 9600, 8, 0, 0x00, 0, 0, 0, 0, 0, 0 },
{ "los-panel", 0xFE, 0, 0x00, 0x00, 9600, 4, 1, 0xFE, 1, 0xFF, 0, 0, 0, 0 },
{ "vdr-lcd", 0xFE, 0, 0x00, 0x00, 9600, 4, 0, 0x00, 0, 0, 0, 0, 0, 0 },
{ "vdr-wakeup", 0xC0, 0xC4, 0xC0, 0xD0, 9600, 4, 0, 0x00, 1, 0, 0xC9, 0xC8, 1, 0xCF }
{ "vdr-wakeup", 0xC0, 0xC4, 0xC0, 0xD0, 9600, 4, 0, 0x00, 1, 0, 0xC9, 0xC8, 1, 0xCF },
{ "pertelian", 0xFE, 0, 0x00, 0x00, 9600, 8, 0, 0x00, 1, 0xFE, 0x02, 0x03, 0, 0 }
};
/* initialize this particular driver */