Add an option to specify the DDRAM address of the next line.
This allows using the ST7036 controller like found on EA DOG modules.
This commit is contained in:
@@ -148,7 +148,7 @@ lcd2usb_HD44780_backlight(PrivateData *p, unsigned char state)
|
||||
/* get backlight brightness */
|
||||
int promille = (state == BACKLIGHT_ON) ? p->brightness : p->offbrightness;
|
||||
|
||||
p->hd44780_functions->drv_report(RPT_INFO, "lcd2usb_HD44780_backlight: Setting backlight to %d", promille);
|
||||
p->hd44780_functions->drv_debug(RPT_DEBUG, "lcd2usb_HD44780_backlight: Setting backlight to %d", promille);
|
||||
|
||||
/* and set it (converted from [0,1000] -> [0,255]) */
|
||||
if (usb_control_msg(p->usbHandle, USB_TYPE_VENDOR, LCD2USB_SET_BRIGHTNESS,
|
||||
|
||||
@@ -161,6 +161,7 @@ typedef struct hd44780_private_data {
|
||||
char have_backlight; // off by default
|
||||
char have_output; // have extra output port (off by default)
|
||||
char ext_mode; // use of extended mode required for some weird controllers
|
||||
int line_address; // address of the next line in ext_mode (linear addressing)
|
||||
int delayMult; // Delay multiplier for slow displays
|
||||
char delayBus; // Delay if the computer can send data too fast over
|
||||
// its bus to LPT port
|
||||
|
||||
@@ -60,6 +60,9 @@
|
||||
// Default parallel port address
|
||||
#define LPTPORT 0x378
|
||||
|
||||
// Default Lineaddress in ext_mode
|
||||
#define LADDR 0x20
|
||||
|
||||
// Autorepeat values
|
||||
#define KEYPAD_AUTOREPEAT_DELAY 500
|
||||
#define KEYPAD_AUTOREPEAT_FREQ 15
|
||||
@@ -165,6 +168,7 @@ HD44780_init(Driver *drvthis)
|
||||
|
||||
p->port = drvthis->config_get_int(drvthis->name, "port", 0, LPTPORT);
|
||||
p->ext_mode = drvthis->config_get_bool(drvthis->name, "extendedmode", 0, 0);
|
||||
p->line_address = drvthis->config_get_int(drvthis->name, "lineaddress", 0, LADDR);
|
||||
p->have_keypad = drvthis->config_get_bool(drvthis->name, "keypad", 0, 0);
|
||||
p->have_backlight = drvthis->config_get_bool(drvthis->name, "backlight", 0, 0);
|
||||
p->have_output = drvthis->config_get_bool(drvthis->name, "outputport", 0, 0);
|
||||
@@ -605,7 +609,7 @@ HD44780_position(Driver *drvthis, int x, int y)
|
||||
|
||||
if (p->ext_mode) {
|
||||
// Linear addressing, each line starts 0x20 higher.
|
||||
DDaddr = x + relY * 0x20;
|
||||
DDaddr = x + relY * p->line_address;
|
||||
} else {
|
||||
// 16x1 is a special case
|
||||
if (p->dispSizes[dispID - 1] == 1 && p->width == 16) {
|
||||
|
||||
Reference in New Issue
Block a user