From 88aabdccc1d4aaf4a941f3b25055ea5c72d7f58f Mon Sep 17 00:00:00 2001 From: mmdolze Date: Thu, 28 Jan 2010 19:25:17 +0000 Subject: [PATCH] HD44780: Add a charmap which makes input in KOI8-R appear correctly on displays using hd44780 controller with european charset. --- ChangeLog | 1 + LCDd.conf | 2 +- docs/lcdproc-user/drivers/hd44780.docbook | 8 +++- server/drivers/hd44780-charmap.h | 58 +++++++++++++++++++++-- 4 files changed, 63 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6c25001..55464fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,7 @@ v.0.5dev (ongoing development) * hd44780: Exclude pin for switchable backlight from keypad scanning * server core: New network input buffering * hd44780: Extended subdriver API and performance improvement for lcd2usb + * hd44780: Add KOI8-R character mapping (Yura Scheglyuk) v0.5.3 + lcdexec: notification when called program finishes diff --git a/LCDd.conf b/LCDd.conf index 59be65a..5981336 100644 --- a/LCDd.conf +++ b/LCDd.conf @@ -480,7 +480,7 @@ Size=20x4 # Character map to to map ISO-8859-1 to the LCD's character set # [default: hd44780_default; legal: hd44780_default, hd44780_euro, -# ea_ks0073, sed1278f_0b ] +# ea_ks0073, sed1278f_0b, hd44780_koi8_r ] CharMap=hd44780_default # If your display is slow and cannot keep up with the flow of data from diff --git a/docs/lcdproc-user/drivers/hd44780.docbook b/docs/lcdproc-user/drivers/hd44780.docbook index 64b8f5a..081ab05 100644 --- a/docs/lcdproc-user/drivers/hd44780.docbook +++ b/docs/lcdproc-user/drivers/hd44780.docbook @@ -2820,6 +2820,7 @@ This can be done by specifying or by inclu hd44780_euro | ea_ks0073 | sed12780f_0b | + hd44780_koi8_r | none } @@ -2843,6 +2844,11 @@ This can be done by specifying or by inclu sed12780f_0b is for some SED 1278 displays. + + hd44780_koi8_r maps input from a client in + Russian KOI8-R to displays with a ROM mask supporting the european + charset (ROM code A02). + The none charmap does not translate any characters. It displays the characters the display controllers actually has @@ -2851,7 +2857,7 @@ This can be done by specifying or by inclu You only need to set this parameter if you have a non-standard - HD44780 display. + HD44780 display or charmap. diff --git a/server/drivers/hd44780-charmap.h b/server/drivers/hd44780-charmap.h index a854981..8bfd22f 100644 --- a/server/drivers/hd44780-charmap.h +++ b/server/drivers/hd44780-charmap.h @@ -152,17 +152,17 @@ const unsigned char HD44780_euro_charmap[] = { 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - /* #160 */ + /* #160 */ 32, 161, 162, 163, 164, 165, 166, 167, 34, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 39, 181, 182, 183, 44, 185, 186, 187, 188, 189, 190, 191, - /* #192 */ + /* #192 */ 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - /* #224 */ + /* #224 */ 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, @@ -282,6 +282,55 @@ const unsigned char SED1278F_0B_charmap[] = { 175, 151, 163, 150, 129, 121, 32, 253 }; +/* + * Table for HD44780 controller with ROM mask supporting + * the european charset (ROM code A02). + * + * Russian KOI8-R codepage as input, comments in KOI8-R. + */ +const unsigned char HD44780_KOI8R_charmap[] = { + /* #0 */ + 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, + /* #32 */ + 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, + /* #64 */ + 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, + /* #96 */ + 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, + /* #128 */ + 45, 124, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 183, 183, 32, 126, + 28, 29, 32, 32, 176, 178, 183, 247, + /* #160 */ + 45, 124, 43, 203, 43, 43, 43, 43, /* ё */ + 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 203, 43, 43, 43, 43, /* Ё */ + 43, 43, 43, 43, 43, 43, 43, 169, + /* #192 */ + 172, 65, 128, 137, 129, 69, 216, 146, /* ю а б ц д е ф г */ + 88, 132, 133, 75, 134, 77, 72, 79, /* х и й к л м н о */ + 135, 173, 80, 67, 84, 136, 130, 66, /* п я р с т у ж в */ + 98, 142, 131, 139, 143, 140, 138, 141, /* ь ы з ш э щ ч ъ */ + /* #224 */ + 172, 65, 128, 137, 129, 69, 216, 146, /* Ю А Б Ц Д Е Ф Г */ + 88, 132, 133, 75, 134, 77, 72, 79, /* Х И Й К Л М Н О */ + 135, 173, 80, 67, 84, 136, 130, 66, /* П Я Р С Т У Ж В */ + 98, 142, 131, 139, 143, 140, 138, 141 /* Ь Ы З Ш Э Щ Ч Ъ */ +}; + #define MAX_CHARMAP_NAME_LENGTH 16 struct charmap { @@ -290,9 +339,10 @@ struct charmap { }; const struct charmap available_charmaps[] = { - { "none", none_charmap }, + { "none", none_charmap }, { "hd44780_default", HD44780_charmap }, { "hd44780_euro", HD44780_euro_charmap }, + { "hd44780_koi8_r", HD44780_KOI8R_charmap}, { "ea_ks0073", EA_KS0073_charmap }, { "sed1278f_0b", SED1278F_0B_charmap } };