My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lcdprint_hd44780.cpp 34KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. /**
  23. * @file lcdprint_hd44780.cpp
  24. * @brief LCD print api for HD44780
  25. * @author Yunhui Fu (yhfudev@gmail.com)
  26. * @version 1.0
  27. * @date 2016-08-19
  28. * @copyright GPL/BSD
  29. */
  30. /**
  31. * Due to the limitation of the HD44780 hardware, the current available LCD modules can only support
  32. * Western(English), Cyrillic(Russian), Kana(Japanese) charsets.
  33. */
  34. #include "../../inc/MarlinConfigPre.h"
  35. #if HAS_MARLINUI_HD44780
  36. #include "../marlinui.h"
  37. #include "../../MarlinCore.h"
  38. #include "marlinui_HD44780.h"
  39. #include <string.h>
  40. extern LCD_CLASS lcd;
  41. int lcd_glyph_height() { return 1; }
  42. typedef struct _hd44780_charmap_t {
  43. wchar_t uchar; // the unicode char
  44. uint8_t idx; // the glyph of the char in the ROM
  45. uint8_t idx2; // the char used to be combined with the idx to simulate a single char
  46. } hd44780_charmap_t;
  47. #ifdef __AVR__
  48. #define IV(a) U##a
  49. #else
  50. #define IV(a) L##a
  51. #endif
  52. static const hd44780_charmap_t g_hd44780_charmap_device[] PROGMEM = {
  53. // sorted by uchar:
  54. #if DISPLAY_CHARSET_HD44780 == JAPANESE
  55. {IV('¢'), 0xEC, 0}, // A2
  56. {IV('°'), 0xDF, 0}, // B0, Marlin special: '°' LCD_STR_DEGREE (0x09)
  57. {IV('ä'), 0xE1, 0}, // E4
  58. {IV('ö'), 0xEF, 0}, // F6
  59. {IV('÷'), 0xFD, 0}, // 00F7
  60. {IV('ü'), 0xF5, 0}, // 00FC
  61. {IV('ˣ'), 0xEB, 0}, // 02E3
  62. {IV('·'), 0xA5, 0}, // 0387
  63. {IV('Ώ'), 0xF4, 0}, // 038F
  64. {IV('Θ'), 0xF2, 0}, // 0398, Theta
  65. {IV('Ξ'), 0xE3, 0}, // 039E, Xi
  66. {IV('Σ'), 0xF6, 0}, // 03A3, Sigma
  67. {IV('Ω'), 0xF4, 0}, // 03A9, Omega
  68. {IV('ά'), 0xE0, 0}, // 03AC
  69. {IV('έ'), 0xE3, 0}, // 03AD
  70. {IV('α'), 0xE0, 0}, // 03B1, alpha
  71. {IV('β'), 0xE2, 0}, // 03B2, beta
  72. {IV('ε'), 0xE3, 0}, // 03B5, epsilon
  73. {IV('θ'), 0xF2, 0}, // 03B8, theta
  74. {IV('μ'), 0xE4, 0}, // 03BC, mu
  75. {IV('ξ'), 0xE3, 0}, // 03BE, xi
  76. {IV('π'), 0xF7, 0}, // 03C0, pi
  77. {IV('ρ'), 0xE6, 0}, // 03C1, rho
  78. {IV('σ'), 0xE5, 0}, // 03C3, sigma
  79. {IV('←'), 0x7F, 0}, // 2190
  80. {IV('→'), 0x7E, 0}, // 2192, Marlin special: '⮈⮉⮊⮋➤→' LCD_STR_ARROW_RIGHT (0x03)
  81. {IV('√'), 0xE8, 0}, // 221A
  82. {IV('∞'), 0xF3, 0}, // 221E
  83. {IV('█'), 0xFF, 0}, // 2588
  84. //{IV(''), 0xA0, 0},
  85. {IV('。'), 0xA1, 0},
  86. {IV('「'), 0xA2, 0},
  87. {IV('」'), 0xA3, 0},
  88. {IV('゛'), 0xDE, 0}, // ‶
  89. {IV('゜'), 0xDF, 0}, // '〫'
  90. {IV('゠'), '=', 0},
  91. {IV('ァ'), 0xA7, 0},
  92. {IV('ア'), 0xB1, 0},
  93. {IV('ィ'), 0xA8, 0},
  94. {IV('イ'), 0xB2, 0},
  95. {IV('ゥ'), 0xA9, 0},
  96. {IV('ウ'), 0xB3, 0},
  97. {IV('ェ'), 0xAA, 0},
  98. {IV('エ'), 0xB4, 0},
  99. {IV('ォ'), 0xAB, 0},
  100. {IV('オ'), 0xB5, 0},
  101. {IV('カ'), 0xB6, 0},
  102. {IV('ガ'), 0xB6, 0xDE},
  103. {IV('キ'), 0xB7, 0},
  104. {IV('ギ'), 0xB7, 0xDE},
  105. {IV('ク'), 0xB8, 0},
  106. {IV('グ'), 0xB8, 0xDE},
  107. {IV('ケ'), 0xB9, 0},
  108. {IV('ゲ'), 0xB9, 0xDE},
  109. {IV('コ'), 0xBA, 0},
  110. {IV('ゴ'), 0xBA, 0xDE},
  111. {IV('サ'), 0xBB, 0},
  112. {IV('ザ'), 0xBB, 0xDE},
  113. {IV('シ'), 0xBC, 0},
  114. {IV('ジ'), 0xBC, 0xDE},
  115. {IV('ス'), 0xBD, 0},
  116. {IV('ズ'), 0xBD, 0xDE},
  117. {IV('セ'), 0xBE, 0},
  118. {IV('ゼ'), 0xBE, 0xDE},
  119. {IV('ソ'), 0xBF, 0},
  120. {IV('ゾ'), 0xBF, 0xDE},
  121. {IV('タ'), 0xC0, 0},
  122. {IV('ダ'), 0xC0, 0xDE},
  123. {IV('チ'), 0xC1, 0},
  124. {IV('ヂ'), 0xC1, 0xDE},
  125. {IV('ッ'), 0xAF, 0},
  126. {IV('ツ'), 0xC2, 0},
  127. {IV('ヅ'), 0xC2, 0xDE},
  128. {IV('テ'), 0xC3, 0},
  129. {IV('デ'), 0xC3, 0xDE},
  130. {IV('ト'), 0xC4, 0},
  131. {IV('ド'), 0xC4, 0xDE},
  132. {IV('ナ'), 0xC5, 0},
  133. {IV('ニ'), 0xC6, 0},
  134. {IV('ヌ'), 0xC7, 0},
  135. {IV('ネ'), 0xC8, 0},
  136. {IV('ノ'), 0xC9, 0},
  137. {IV('ハ'), 0xCA, 0},
  138. {IV('バ'), 0xCA, 0xDE},
  139. {IV('パ'), 0xCA, 0xDF},
  140. {IV('ヒ'), 0xCB, 0},
  141. {IV('ビ'), 0xCB, 0xDE},
  142. {IV('ピ'), 0xCB, 0xDF},
  143. {IV('フ'), 0xCC, 0},
  144. {IV('ブ'), 0xCC, 0xDE},
  145. {IV('プ'), 0xCC, 0xDF},
  146. {IV('ヘ'), 0xCD, 0},
  147. {IV('ベ'), 0xCD, 0xDE},
  148. {IV('ペ'), 0xCD, 0xDF},
  149. {IV('ホ'), 0xCE, 0},
  150. {IV('ボ'), 0xCE, 0xDE},
  151. {IV('ポ'), 0xCE, 0xDF},
  152. {IV('マ'), 0xCF, 0},
  153. {IV('ミ'), 0xD0, 0},
  154. {IV('ム'), 0xD1, 0},
  155. {IV('メ'), 0xD2, 0},
  156. {IV('モ'), 0xD3, 0},
  157. {IV('ャ'), 0xAC, 0},
  158. {IV('ヤ'), 0xD4, 0},
  159. {IV('ュ'), 0xAD, 0},
  160. {IV('ユ'), 0xD5, 0},
  161. {IV('ョ'), 0xAE, 0},
  162. {IV('ヨ'), 0xD6, 0},
  163. {IV('ラ'), 0xD7, 0},
  164. {IV('リ'), 0xD8, 0},
  165. {IV('ル'), 0xD9, 0},
  166. {IV('レ'), 0xDA, 0},
  167. {IV('ロ'), 0xDB, 0},
  168. {IV('ワ'), 0xDC, 0},
  169. {IV('ヲ'), 0xA6, 0},
  170. {IV('ン'), 0xDD, 0},
  171. {IV('ヴ'), 0xB3, 0xDE},
  172. {IV('ヷ'), 0xDC, 0xDE},
  173. {IV('ヺ'), 0xA6, 0xDE},
  174. {IV('・'), 0xA5, 0},
  175. {IV('ー'), 0xB0, 0},
  176. {IV('ヽ'), 0xA4, 0},
  177. //{IV('g'), 0xE7, 0}, // error
  178. //{IV(''), 0xE9, 0},
  179. //{IV('j'), 0xEA, 0}, // error
  180. //{IV(''), 0xED, 0},
  181. //{IV(''), 0xEE, 0},
  182. //{IV('p'), 0xF0, 0}, // error
  183. //{IV('q'), 0xF1, 0}, // error
  184. //{IV(''), 0xF8, 0},
  185. //{IV('y'), 0xF9, 0}, // error
  186. {IV('万'), 0xFB, 0},
  187. {IV('円'), 0xFC, 0},
  188. {IV('千'), 0xFA, 0},
  189. //{IV(''), 0xFE, 0},
  190. //、・ヲァィゥェォャュョッー
  191. {IV('、'), 0xA4, 0}, //ヽ
  192. {IV('・'), 0xA5, 0}, //・
  193. {IV('ヲ'), 0xA6, 0}, //ヲ
  194. {IV('ァ'), 0xA7, 0}, //ァ
  195. {IV('ィ'), 0xA8, 0}, //ィ
  196. {IV('ゥ'), 0xA9, 0}, //ゥ
  197. {IV('ェ'), 0xAA, 0}, //ェ
  198. {IV('ォ'), 0xAB, 0}, //ォ
  199. {IV('ャ'), 0xAC, 0}, //ャ
  200. {IV('ュ'), 0xAD, 0}, //ュ
  201. {IV('ョ'), 0xAE, 0}, //ョ
  202. {IV('ッ'), 0xAF, 0}, //ッ
  203. {IV('ー'), 0xB0, 0}, //ー
  204. //アイウエオカキクケコサシスセ
  205. {IV('ア'), 0xB1, 0}, //ア
  206. {IV('イ'), 0xB2, 0}, //イ
  207. {IV('ウ'), 0xB3, 0}, //ウ
  208. {IV('エ'), 0xB4, 0}, //エ
  209. {IV('オ'), 0xB5, 0}, //オ
  210. {IV('カ'), 0xB6, 0}, //カ
  211. {IV('キ'), 0xB7, 0}, //キ
  212. {IV('ク'), 0xB8, 0}, //ク
  213. {IV('ケ'), 0xB9, 0}, //ケ
  214. {IV('コ'), 0xBA, 0}, //コ
  215. {IV('サ'), 0xBB, 0}, //サ
  216. {IV('シ'), 0xBC, 0}, //シ
  217. {IV('ス'), 0xBD, 0}, //ス
  218. {IV('セ'), 0xBE, 0}, //セ
  219. //ソタチツテトナニヌネノハヒフ
  220. {IV('ソ'), 0xBF, 0}, //ソ
  221. {IV('タ'), 0xC0, 0}, //タ
  222. {IV('チ'), 0xC1, 0}, //チ
  223. {IV('ツ'), 0xC2, 0}, //ツ
  224. {IV('テ'), 0xC3, 0}, //テ
  225. {IV('ト'), 0xC4, 0}, //ト
  226. {IV('ナ'), 0xC5, 0}, //ナ
  227. {IV('ニ'), 0xC6, 0}, //ニ
  228. {IV('ヌ'), 0xC7, 0}, //ヌ
  229. {IV('ネ'), 0xC8, 0}, //ネ
  230. {IV('ノ'), 0xC9, 0}, //ノ
  231. {IV('ハ'), 0xCA, 0}, //ハ
  232. {IV('ヒ'), 0xCB, 0}, //ヒ
  233. {IV('フ'), 0xCC, 0}, //フ
  234. //ヘホマミムメモヤユヨラリルレロワン゙゚
  235. {IV('ヘ'), 0xCD, 0}, //ヘ
  236. {IV('ホ'), 0xCE, 0}, //ホ
  237. {IV('マ'), 0xCF, 0}, //マ
  238. {IV('ミ'), 0xD0, 0}, //ミ
  239. {IV('ム'), 0xD1, 0}, //ム
  240. {IV('メ'), 0xD2, 0}, //メ
  241. {IV('モ'), 0xD3, 0}, //モ
  242. {IV('ヤ'), 0xD4, 0}, //ヤ
  243. {IV('ユ'), 0xD5, 0}, //ユ
  244. {IV('ヨ'), 0xD6, 0}, //ヨ
  245. {IV('ラ'), 0xD7, 0}, //ラ
  246. {IV('リ'), 0xD8, 0}, //リ
  247. {IV('ル'), 0xD9, 0}, //ル
  248. {IV('レ'), 0xDA, 0}, //レ
  249. {IV('ロ'), 0xDB, 0}, //ロ
  250. {IV('ワ'), 0xDC, 0}, //ワ
  251. {IV('ン'), 0xDD, 0}, //ン
  252. {IV('゙'), 0xDE, 0}, // ゛
  253. {IV('゚'), 0xDF, 0}, // ゜
  254. {IV('¥'), 0x5C, 0},
  255. #elif DISPLAY_CHARSET_HD44780 == WESTERN
  256. // 0x10 -- 0x1F (except 0x1C)
  257. // 0x80 -- 0xFF (except 0xA7,0xB0,0xB1,0xB3,0xB4,0xBF,0xD1,0xF8,0xFA,0xFC-0xFF)
  258. {IV('¡'), 0xA9, 0},
  259. {IV('¢'), 0xA4, 0},
  260. {IV('£'), 0xA5, 0},
  261. {IV('¥'), 0xA6, 0},
  262. {IV('§'), 0xD2, 0}, // section sign
  263. {IV('©'), 0xCF, 0},
  264. {IV('ª'), 0x9D, 0},
  265. {IV('«'), 0xBB, 0},
  266. {IV('®'), 0xCE, 0},
  267. {IV('°'), 0xB2, 0}, // Marlin special: '°' LCD_STR_DEGREE (0x09)
  268. //{IV(''), 0xD1, 0},
  269. {IV('±'), 0x10, 0}, //∓±
  270. //{'='), 0x1C, 0}, // error
  271. {IV('²'), 0x1E, 0},
  272. {IV('³'), 0x1F, 0},
  273. {IV('¶'), 0xD3, 0}, // pilcrow sign
  274. {IV('º'), 0x9E, 0},
  275. {IV('»'), 0xBC, 0}, // 00BB
  276. //{IV(''), 0xB3, 0}, // error
  277. //{IV(''), 0xB4, 0}, // error
  278. {IV('¼'), 0xB6, 0}, // 00BC
  279. {IV('½'), 0xB5, 0}, // 00BD
  280. //{IV('¾'), '3', 0}, // 00BE
  281. {IV('¿'), 0x9F, 0}, // 00BF
  282. {IV('Â'), 0x8F, 0},
  283. {IV('Ã'), 0xAA, 0},
  284. {IV('Ä'), 0x8E, 0},
  285. {IV('Æ'), 0x92, 0},
  286. {IV('Ç'), 0x80, 0},
  287. {IV('É'), 0x90, 0},
  288. {IV('Ñ'), 0x9C, 0},
  289. {IV('Õ'), 0xAC, 0},
  290. {IV('Ö'), 0x99, 0},
  291. {IV('×'), 0xB7, 0},
  292. {IV('Ø'), 0xAE, 0},
  293. {IV('Ü'), 0x9A, 0},
  294. {IV('à'), 0x85, 0},
  295. {IV('á'), 0xA0, 0},
  296. {IV('â'), 0x83, 0},
  297. {IV('ã'), 0xAB, 0},
  298. {IV('ä'), 0x84, 0},
  299. {IV('å'), 0x86, 0},
  300. {IV('æ'), 0x91, 0},
  301. {IV('ç'), 0x87, 0},
  302. {IV('è'), 0x8A, 0},
  303. {IV('é'), 0x82, 0},
  304. {IV('ê'), 0x88, 0},
  305. {IV('ë'), 0x89, 0},
  306. {IV('ì'), 0x8D, 0},
  307. {IV('í'), 0xA1, 0},
  308. {IV('î'), 0x8C, 0},
  309. {IV('ï'), 0x8B, 0},
  310. {IV('ñ'), 0x9B, 0},
  311. {IV('ò'), 0x95, 0},
  312. {IV('ó'), 0xA2, 0},
  313. {IV('ô'), 0x93, 0},
  314. {IV('õ'), 0xAD, 0},
  315. {IV('ö'), 0x94, 0},
  316. {IV('÷'), 0xB8, 0},
  317. {IV('ø'), 0xAF, 0},
  318. {IV('ù'), 0x97, 0},
  319. {IV('ú'), 0xA3, 0},
  320. {IV('û'), 0x96, 0},
  321. {IV('ü'), 0x81, 0},
  322. {IV('ÿ'), 0x98, 0},
  323. //{IV(''), 0xB0, 0}, // error
  324. //{IV(''), 0xB1, 0}, // error
  325. {IV('ƒ'), 0xA8, 0}, // 0192
  326. {IV('Ύ'), 0xDB, 0}, // 038E
  327. {IV('Ώ'), 0xDE, 0}, // 038F
  328. {IV('ΐ'), 0xE7, 0}, // 0390
  329. {IV('Γ'), 0xD4, 0}, // 0393, Gamma
  330. {IV('Δ'), 0xD5, 0}, // 0394, Delta, ◿
  331. {IV('Θ'), 0xD6, 0}, // 0398, Theta
  332. {IV('Λ'), 0xD7, 0}, // 039B, Lambda
  333. {IV('Ξ'), 0xD8, 0}, // 039E, Xi
  334. {IV('Π'), 0xD9, 0}, // Pi
  335. {IV('Σ'), 0xDA, 0}, // Sigma
  336. {IV('Υ'), 0xDB, 0}, // Upsilon
  337. {IV('Φ'), 0xDC, 0}, // Phi
  338. {IV('Ψ'), 0xDD, 0}, // Psi
  339. {IV('Ω'), 0xDE, 0}, // Omega
  340. {IV('ά'), 0xDF, 0}, // 03AC
  341. {IV('έ'), 0xE3, 0}, // 03AD
  342. {IV('ή'), 0xE5, 0}, // 03AE
  343. {IV('ί'), 0xE7, 0}, // 03AF
  344. {IV('ΰ'), 0xF1, 0}, // 03B0
  345. {IV('α'), 0xDF, 0}, // alpha
  346. {IV('β'), 0xE0, 0}, // beta
  347. {IV('γ'), 0xE1, 0}, // gamma
  348. {IV('δ'), 0xE2, 0}, // delta
  349. {IV('ε'), 0xE3, 0}, // epsilon
  350. {IV('ζ'), 0xE4, 0}, // zeta
  351. {IV('η'), 0xE5, 0}, // eta
  352. {IV('θ'), 0xE6, 0}, // theta
  353. {IV('ι'), 0xE7, 0}, // lota
  354. {IV('κ'), 0xE8, 0}, // kappa
  355. {IV('λ'), 0xE9, 0}, // lambda
  356. {IV('μ'), 0xEA, 0}, // mu
  357. {IV('ν'), 0xEB, 0}, // nu
  358. {IV('ξ'), 0xEC, 0}, // xi
  359. {IV('π'), 0xED, 0}, // pi
  360. {IV('ρ'), 0xEE, 0}, // rho
  361. {IV('σ'), 0xEF, 0}, // sigma
  362. {IV('τ'), 0xF0, 0}, // tau
  363. {IV('υ'), 0xF1, 0}, // upsilon
  364. {IV('χ'), 0xF2, 0}, // chi
  365. {IV('ψ'), 0xF3, 0}, // psi
  366. {IV('ω'), 0xF4, 0}, // 03C9, omega
  367. {IV('ϊ'), 0xE7, 0}, // 03CA
  368. {IV('ϋ'), 0xF1, 0}, // 03CB
  369. {IV('ύ'), 0xF1, 0}, // 03CD
  370. {IV('ώ'), 0xF4, 0}, // 03CE
  371. {IV('•'), 0xCD, 0}, // ·
  372. {IV('℞'), 0xA7, 0}, // ℞ Pt ASCII 158
  373. {IV('™'), 0xD0, 0},
  374. {IV('↤'), 0xF9, 0}, // ⟻
  375. {IV('↵'), 0xC4, 0},
  376. {IV('↻'), 0x04, 0}, // Marlin special: '↻↺⟳⟲' LCD_STR_REFRESH (0x01)
  377. {IV('⇥'), 0xFB, 0},
  378. {IV('√'), 0xBE, 0}, // √
  379. {IV('∞'), 0xC2, 0}, // infinity
  380. {IV('∫'), 0x1B, 0},
  381. {IV('∼'), 0x1D, 0},
  382. {IV('≈'), 0x1A, 0},
  383. {IV('≠'), 0xBD, 0},
  384. {IV('≡'), 0x11, 0},
  385. {IV('≤'), 0xB9, 0},// ≤≥ ⩽⩾
  386. {IV('≥'), 0xBA, 0},
  387. //{IV(''), 0xBF, 0}, // error
  388. {IV('⌠'), 0xC0, 0},
  389. {IV('⌡'), 0xC1, 0},
  390. {IV('⎧'), 0x14, 0},
  391. {IV('⎩'), 0x15, 0},
  392. {IV('⎫'), 0x16, 0},
  393. {IV('⎭'), 0x17, 0},
  394. {IV('⎰'), 0x18, 0},
  395. {IV('⎱'), 0x19, 0},
  396. {IV('⎲'), 0x12, 0},
  397. {IV('⎳'), 0x13, 0},
  398. {IV('⏱'), 0x07, 0}, // Marlin special: '🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚🕛🕜🕝🕞🕟🕠🕡🕢🕣🕤🕥🕦🕧 ⌚⌛⏰⏱⏳⧖⧗' LCD_STR_CLOCK (0x05)
  399. {IV('┌'), 0xC9, 0},
  400. {IV('┐'), 0xCA, 0},
  401. {IV('└'), 0xCB, 0},
  402. {IV('┘'), 0xCC, 0},
  403. {IV('◸'), 0xC3, 0}, // ◿
  404. {IV('⭠'), 0xC8, 0},
  405. {IV('⭡'), 0xC5, 0},
  406. {IV('⭢'), 0xC7, 0},
  407. {IV('⭣'), 0xC6, 0},
  408. {IV('⯆'), 0xF5, 0},
  409. {IV('⯇'), 0xF7, 0}, // ⯅
  410. {IV('⯈'), 0xF6, 0},
  411. //{IV(''), 0xF8, 0}, // error
  412. //{IV(''), 0xFA, 0}, // error
  413. //{IV(''), 0xFC, 0}, // error
  414. //{IV(''), 0xFD, 0}, // error
  415. //{IV(''), 0xFE, 0}, // error
  416. //{IV(''), 0xFF, 0}, // error
  417. #elif DISPLAY_CHARSET_HD44780 == CYRILLIC
  418. {IV('¢'), 0x5C, 0}, // 00A2
  419. {IV('£'), 0xCF, 0}, // 00A3
  420. {IV('°'), 0x01, 0}, // 00B0, Marlin special: '°' LCD_STR_DEGREE (0x09)
  421. //{IV(''), 0x80, 0},
  422. //{IV(''), 0x81, 0},
  423. //{IV(''), 0x82, 0},
  424. //{IV(''), 0x83, 0},
  425. //{IV(''), 0x84, 0},
  426. //{IV(''), 0x85, 0},
  427. //{IV(''), 0x86, 0},
  428. //{IV(''), 0x87, 0},
  429. //{IV(''), 0x88, 0},
  430. //{IV(''), 0x89, 0},
  431. //{IV(''), 0x8A, 0},
  432. //{IV(''), 0x8B, 0},
  433. //{IV(''), 0x8C, 0},
  434. //{IV(''), 0x8D, 0},
  435. //{IV(''), 0x8E, 0},
  436. //{IV(''), 0x8F, 0},
  437. //{IV(''), 0x90, 0},
  438. //{IV(''), 0x91, 0},
  439. //{IV(''), 0x92, 0},
  440. //{IV(''), 0x93, 0},
  441. //{IV(''), 0x94, 0},
  442. //{IV(''), 0x95, 0},
  443. //{IV(''), 0x96, 0},
  444. //{IV(''), 0x97, 0},
  445. //{IV(''), 0x98, 0},
  446. //{IV(''), 0x99, 0},
  447. //{IV(''), 0x9A, 0},
  448. //{IV(''), 0x9B, 0},
  449. //{IV(''), 0x9C, 0},
  450. //{IV(''), 0x9D, 0},
  451. //{IV(''), 0x9E, 0},
  452. //{IV(''), 0x9F, 0},
  453. {IV('¼'), 0xF0, 0}, // 00BC
  454. {IV('⅓'), 0xF1, 0},
  455. {IV('½'), 0xF2, 0}, // 00BD
  456. {IV('¾'), 0xF3, 0}, // 00BE
  457. {IV('¿'), 0xCD, 0}, // 00BF
  458. #if ENABLED(DISPLAY_CHARSET_ISO10646_5)
  459. // Map Cyrillic to HD44780 extended CYRILLIC where possible
  460. {IV('Ё'), 0xA2, 0}, // 0401
  461. {IV('А'), 'A', 0}, // 0410
  462. {IV('Б'), 0xA0, 0},
  463. {IV('В'), 'B', 0},
  464. {IV('Г'), 0xA1, 0},
  465. {IV('Д'), 0xE0, 0},
  466. {IV('Е'), 'E', 0},
  467. {IV('Ж'), 0xA3, 0},
  468. {IV('З'), 0xA4, 0},
  469. {IV('И'), 0xA5, 0},
  470. {IV('Й'), 0xA6, 0},
  471. {IV('К'), 'K', 0},
  472. {IV('Л'), 0xA7, 0},
  473. {IV('М'), 'M', 0},
  474. {IV('Н'), 'H', 0},
  475. {IV('О'), 'O', 0},
  476. {IV('П'), 0xA8, 0},
  477. {IV('Р'), 'P', 0},
  478. {IV('С'), 'C', 0},
  479. {IV('Т'), 'T', 0},
  480. {IV('У'), 0xA9, 0},
  481. {IV('Ф'), 0xAA, 0},
  482. {IV('Х'), 'X', 0},
  483. {IV('Ц'), 0xE1, 0},
  484. {IV('Ч'), 0xAB, 0},
  485. {IV('Ш'), 0xAC, 0},
  486. {IV('Щ'), 0xE2, 0},
  487. {IV('Ъ'), 0xAD, 0},
  488. {IV('Ы'), 0xAE, 0},
  489. {IV('Ь'), 'b', 0},
  490. {IV('Э'), 0xAF, 0},
  491. {IV('Ю'), 0xB0, 0},
  492. {IV('Я'), 0xB1, 0},
  493. {IV('а'), 'a', 0},
  494. {IV('б'), 0xB2, 0},
  495. {IV('в'), 0xB3, 0},
  496. {IV('г'), 0xB4, 0},
  497. {IV('д'), 0xE3, 0},
  498. {IV('е'), 'e', 0},
  499. {IV('ж'), 0xB6, 0},
  500. {IV('з'), 0xB7, 0},
  501. {IV('и'), 0xB8, 0},
  502. {IV('й'), 0xB9, 0},
  503. {IV('к'), 0xBA, 0}, //клмноп
  504. {IV('л'), 0xBB, 0},
  505. {IV('м'), 0xBC, 0},
  506. {IV('н'), 0xBD, 0},
  507. {IV('о'), 'o', 0},
  508. {IV('п'), 0xBE, 0},
  509. {IV('р'), 'p', 0},
  510. {IV('с'), 'c', 0},
  511. {IV('т'), 0xBF, 0},
  512. {IV('у'), 'y', 0},
  513. {IV('ф'), 0xE4, 0},
  514. {IV('х'), 'x', 0},
  515. {IV('ц'), 0xE5, 0},
  516. {IV('ч'), 0xC0, 0},
  517. {IV('ш'), 0xC1, 0},
  518. {IV('щ'), 0xE6, 0},
  519. {IV('ъ'), 0xC2, 0},
  520. {IV('ы'), 0xC3, 0},
  521. {IV('ь'), 0xC4, 0},
  522. {IV('э'), 0xC5, 0},
  523. {IV('ю'), 0xC6, 0},
  524. {IV('я'), 0xC7, 0}, // 044F
  525. {IV('ё'), 0xB5, 0}, // 0451
  526. //{IV(''), 0xC8, 0},
  527. //{IV(''), 0xC9, 0},
  528. //{IV(''), 0xCA, 0},
  529. //{IV(''), 0xCB, 0},
  530. //{IV(''), 0xCC, 0},
  531. //{IV(''), 0xCD, 0},
  532. //{IV(''), 0xCE, 0},
  533. //{IV(''), 0xD0, 0},
  534. //{IV(''), 0xD1, 0},
  535. //{IV(''), 0xD2, 0},
  536. //{IV(''), 0xD3, 0},
  537. //{IV(''), 0xD4, 0},
  538. //{IV(''), 0xD5, 0},
  539. //{IV(''), 0xD6, 0},
  540. //{IV(''), 0xD7, 0},
  541. //{IV(''), 0xD8, 0},
  542. //{IV(''), 0xDB, 0},
  543. //{IV(''), 0xDC, 0},
  544. //{IV(''), 0xDD, 0},
  545. //{IV(''), 0xDE, 0},
  546. //{IV(''), 0xDF, 0},
  547. //{IV(''), 0xE7, 0},
  548. //{IV(''), 0xE8, 0},
  549. //{IV(''), 0xE9, 0},
  550. //{IV(''), 0xEA, 0},
  551. //{IV(''), 0xEB, 0},
  552. //{IV(''), 0xEC, 0},
  553. //{IV(''), 0xED, 0},
  554. //{IV(''), 0xEE, 0},
  555. //{IV(''), 0xEF, 0},
  556. //{IV(''), 0xF4, 0},
  557. //{IV(''), 0xF5, 0},
  558. //{IV(''), 0xF6, 0},
  559. //{IV(''), 0xF7, 0},
  560. //{IV(''), 0xF8, 0},
  561. //{IV(''), 0xF9, 0},
  562. //{IV(''), 0xFA, 0},
  563. //{IV(''), 0xFB, 0},
  564. //{IV(''), 0xFC, 0},
  565. //{IV(''), 0xFD, 0},
  566. //{IV(''), 0xFE, 0},
  567. //{IV(''), 0xFF, 0},
  568. #endif
  569. {IV('↑'), 0xD9, 0}, // 2191 ←↑→↓
  570. {IV('↓'), 0xDA, 0}, // 2193
  571. #endif
  572. };
  573. // the plain ASCII replacement for various char
  574. static const hd44780_charmap_t g_hd44780_charmap_common[] PROGMEM = {
  575. {IV('¡'), 'i', 0}, // A1
  576. {IV('¢'), 'c', 0}, // A2
  577. {IV('°'), 0x09, 0}, // B0 Marlin special: '°' LCD_STR_DEGREE (0x09)
  578. // Map WESTERN code to plain ASCII
  579. {IV('Á'), 'A', 0}, // C1
  580. {IV('Â'), 'A', 0}, // C2
  581. {IV('Ã'), 'A', 0}, // C3
  582. {IV('Ä'), 'A', 0}, // C4
  583. {IV('Å'), 'A', 0}, // C5
  584. {IV('Æ'), 'A', 'E'}, // C6
  585. {IV('Ç'), 'C', 0}, // C7
  586. {IV('È'), 'E', 0}, // C8
  587. {IV('É'), 'E', 0}, // C9
  588. {IV('Í'), 'I', 0}, // CD
  589. {IV('Ñ'), 'N', 0}, // D1
  590. {IV('Õ'), 'O', 0}, // D5
  591. {IV('Ö'), 'O', 0}, // D6
  592. {IV('×'), 'x', 0}, // D7
  593. {IV('Ü'), 'U', 0}, // DC
  594. {IV('Ý'), 'Y', 0}, // DD
  595. {IV('à'), 'a', 0}, // E0
  596. {IV('á'), 'a', 0},
  597. {IV('â'), 'a', 0},
  598. {IV('ã'), 'a', 0},
  599. {IV('ä'), 'a', 0},
  600. {IV('å'), 'a', 0},
  601. {IV('æ'), 'a', 'e'},
  602. {IV('ç'), 'c', 0},
  603. {IV('è'), 'e', 0}, // 00E8
  604. {IV('é'), 'e', 0},
  605. {IV('ê'), 'e', 0},
  606. {IV('ë'), 'e', 0},
  607. {IV('ì'), 'i', 0}, // 00EC
  608. {IV('í'), 'i', 0},
  609. {IV('î'), 'i', 0},
  610. {IV('ï'), 'i', 0}, // 00EF
  611. {IV('ñ'), 'n', 0}, // 00F1
  612. {IV('ò'), 'o', 0},
  613. {IV('ó'), 'o', 0},
  614. {IV('ô'), 'o', 0},
  615. {IV('õ'), 'o', 0},
  616. {IV('ö'), 'o', 0},
  617. //{IV('÷'), 0xB8, 0},
  618. {IV('ø'), 'o', 0},
  619. {IV('ù'), 'u', 0},
  620. {IV('ú'), 'u', 0},
  621. {IV('û'), 'u', 0},
  622. {IV('ü'), 'u', 0}, // FC
  623. {IV('ý'), 'y', 0}, // FD
  624. {IV('ÿ'), 'y', 0}, // FF
  625. {IV('Ą'), 'A', 0}, // 0104
  626. {IV('ą'), 'a', 0}, // 0105
  627. {IV('Ć'), 'C', 0}, // 0106
  628. {IV('ć'), 'c', 0}, // 0107
  629. {IV('Č'), 'C', 0}, // 010C
  630. {IV('č'), 'c', 0}, // 010D
  631. {IV('Ď'), 'D', 0}, // 010E
  632. {IV('ď'), 'd', 0}, // 010F
  633. {IV('đ'), 'd', 0}, // 0111
  634. {IV('ę'), 'e', 0}, // 0119
  635. {IV('Ě'), 'E', 0}, // 011A
  636. {IV('ě'), 'e', 0}, // 011B
  637. {IV('ğ'), 'g', 0}, // 011F
  638. {IV('İ'), 'I', 0}, // 0130
  639. {IV('ı'), 'i', 0}, // 0131
  640. {IV('Ł'), 'L', 0}, // 0141
  641. {IV('ł'), 'l', 0}, // 0142
  642. {IV('Ń'), 'N', 0}, // 0143
  643. {IV('ń'), 'n', 0}, // 0144
  644. {IV('ň'), 'n', 0}, // 0148
  645. {IV('Ř'), 'R', 0}, // 0158
  646. {IV('ř'), 'r', 0}, // 0159
  647. {IV('Ś'), 'S', 0}, // 015A
  648. {IV('ś'), 's', 0}, // 015B
  649. {IV('ş'), 's', 0}, // 015F
  650. {IV('Š'), 'S', 0}, // 0160
  651. {IV('š'), 's', 0}, // 0161
  652. {IV('ť'), 't', 0}, // 0165
  653. {IV('ů'), 'u', 0}, // 016F
  654. {IV('ż'), 'z', 0}, // 017C
  655. {IV('Ž'), 'Z', 0}, // 017D
  656. {IV('ž'), 'z', 0}, // 017E
  657. {IV('ƒ'), 'f', 0}, // 0192
  658. {IV('ˣ'), 'x', 0}, // 02E3
  659. #if ENABLED(DISPLAY_CHARSET_ISO10646_VI)
  660. // Map Vietnamese phonetics
  661. //{IV('à'), 'a', 0}, {IV('À'), 'A', 0},
  662. {IV('ạ'), 'a', 0}, {IV('Ạ'), 'A', 0},
  663. {IV('ả'), 'a', 0}, {IV('Ả'), 'A', 0},
  664. //{IV('ã'), 'a', 0}, {IV('Ã'), 'A', 0},
  665. //{IV('á'), 'á', 0}, {IV('Á'), 'A', 0},
  666. {IV('Ạ'), 'A', 0},
  667. {IV('ă'), 'a', 0}, {IV('Ă'), 'A', 0},
  668. {IV('ằ'), 'a', 0}, {IV('Ằ'), 'A', 0},
  669. {IV('ẳ'), 'a', 0}, {IV('Ẳ'), 'A', 0},
  670. {IV('ẵ'), 'a', 0}, {IV('Ẵ'), 'A', 0},
  671. {IV('ắ'), 'a', 0}, {IV('Ắ'), 'A', 0},
  672. {IV('ặ'), 'a', 0}, {IV('Ặ'), 'A', 0},
  673. {IV('â'), 'a', 0}, {IV('Â'), 'A', 0},
  674. {IV('ầ'), 'a', 0}, {IV('Ầ'), 'A', 0},
  675. {IV('ẩ'), 'a', 0}, {IV('Ẩ'), 'A', 0},
  676. {IV('ẫ'), 'a', 0}, {IV('Ẫ'), 'A', 0},
  677. {IV('ấ'), 'a', 0}, {IV('Ấ'), 'A', 0},
  678. {IV('ậ'), 'a', 0}, {IV('Ậ'), 'A', 0},
  679. //{IV('đ'), 'd', 0},
  680. {IV('Đ'), 'D', 0},
  681. {IV('e'), 'e', 0}, {IV('E'), 'E', 0},
  682. {IV('è'), 'e', 0}, {IV('È'), 'E', 0},
  683. {IV('ẻ'), 'e', 0}, {IV('Ẻ'), 'E', 0},
  684. {IV('ẽ'), 'e', 0}, {IV('Ẽ'), 'E', 0},
  685. {IV('é'), 'e', 0}, {IV('É'), 'E', 0},
  686. {IV('ẹ'), 'e', 0}, {IV('Ẹ'), 'E', 0},
  687. {IV('ê'), 'e', 0}, {IV('Ê'), 'E', 0},
  688. {IV('ề'), 'e', 0}, {IV('Ề'), 'E', 0},
  689. {IV('ể'), 'e', 0}, {IV('Ể'), 'E', 0},
  690. {IV('ễ'), 'e', 0}, {IV('Ễ'), 'E', 0},
  691. {IV('ế'), 'e', 0}, {IV('Ế'), 'E', 0},
  692. {IV('ệ'), 'e', 0}, {IV('Ệ'), 'E', 0},
  693. {IV('i'), 'i', 0}, {IV('I'), 'I', 0},
  694. //{IV('ì'), 'ì', 0}, {IV('Ì'), 'Ì', 0},
  695. {IV('ỉ'), 'ỉ', 0}, {IV('Ỉ'), 'Ỉ', 0},
  696. {IV('ĩ'), 'ĩ', 0}, {IV('Ĩ'), 'Ĩ', 0},
  697. {IV('í'), 'í', 0}, {IV('Í'), 'Í', 0},
  698. {IV('ị'), 'ị', 0}, {IV('Ị'), 'Ị', 0},
  699. {IV('o'), 'o', 0}, {IV('O'), 'O', 0},
  700. {IV('ò'), 'o', 0}, {IV('Ò'), 'O', 0},
  701. {IV('ỏ'), 'o', 0}, {IV('Ỏ'), 'O', 0},
  702. {IV('õ'), 'o', 0}, {IV('Õ'), 'O', 0},
  703. {IV('ó'), 'o', 0}, {IV('Ó'), 'O', 0},
  704. {IV('ọ'), 'o', 0}, {IV('Ọ'), 'O', 0},
  705. {IV('ô'), 'o', 0}, {IV('Ô'), 'O', 0},
  706. {IV('ồ'), 'o', 0}, {IV('Ồ'), 'O', 0},
  707. {IV('ổ'), 'o', 0}, {IV('Ổ'), 'O', 0},
  708. {IV('ỗ'), 'o', 0}, {IV('Ỗ'), 'O', 0},
  709. {IV('ố'), 'o', 0}, {IV('Ố'), 'O', 0},
  710. {IV('ộ'), 'o', 0}, {IV('Ộ'), 'O', 0},
  711. {IV('ơ'), 'o', 0}, {IV('Ơ'), 'O', 0},
  712. {IV('ờ'), 'o', 0}, {IV('Ờ'), 'O', 0},
  713. {IV('ở'), 'o', 0}, {IV('Ở'), 'O', 0},
  714. {IV('ỡ'), 'o', 0}, {IV('Ỡ'), 'O', 0},
  715. {IV('ớ'), 'o', 0}, {IV('Ớ'), 'O', 0},
  716. {IV('ợ'), 'o', 0}, {IV('Ợ'), 'O', 0},
  717. {IV('ù'), 'u', 0}, {IV('Ù'), 'U', 0},
  718. {IV('ủ'), 'u', 0}, {IV('Ủ'), 'U', 0},
  719. {IV('ũ'), 'u', 0}, {IV('Ũ'), 'U', 0},
  720. //{IV('ú'), 'u', 0}, {IV('Ú'), 'U', 0},
  721. {IV('ụ'), 'u', 0}, {IV('Ụ'), 'U', 0},
  722. {IV('ư'), 'u', 0}, {IV('Ư'), 'U', 0},
  723. {IV('ừ'), 'u', 0}, {IV('Ừ'), 'U', 0},
  724. {IV('ử'), 'u', 0}, {IV('Ử'), 'U', 0},
  725. {IV('ữ'), 'u', 0}, {IV('Ữ'), 'U', 0},
  726. {IV('ứ'), 'u', 0}, {IV('Ứ'), 'U', 0},
  727. {IV('ự'), 'u', 0}, {IV('Ự'), 'U', 0},
  728. {IV('y'), 'y', 0}, {IV('Y'), 'Y', 0},
  729. #endif
  730. #if ENABLED(DISPLAY_CHARSET_ISO10646_GREEK)
  731. {IV('΄'), '\'', 0}, // 0384
  732. {IV('΅'), '\'', 0}, // 0385
  733. {IV('Ά'), 'A', 0}, // 0386
  734. {IV('·'), '.', 0}, // 0387
  735. {IV('Έ'), 'E', 0}, // 0388
  736. {IV('Ή'), 'H', 0}, // 0389
  737. {IV('Ί'), 'I', 0}, // 038A
  738. {IV('Ό'), 'O', 0}, // 038C
  739. {IV('Ύ'), 'Y', 0}, // 038E
  740. {IV('Ώ'), 'O', 0}, // 038F
  741. {IV('ΐ'), 'i', 0}, // 0390
  742. {IV('Α'), 'A', 0}, // 0391
  743. {IV('Β'), 'B', 0}, // 0392
  744. {IV('Γ'), 'T', 0}, // 0393, Gamma
  745. {IV('Δ'), '4', 0}, // 0394, Delta, ◿
  746. {IV('Ε'), 'E', 0}, // 0395
  747. {IV('Ζ'), 'Z', 0}, // 0396
  748. {IV('Η'), 'H', 0}, // 0397
  749. {IV('Θ'), '0', 0}, // 0398, Theta
  750. {IV('Ι'), 'I', 0}, // 0399
  751. {IV('Κ'), 'K', 0}, // 039A
  752. {IV('Λ'), '^', 0}, // 039B, Lambda
  753. {IV('Μ'), 'M', 0}, // 039C
  754. {IV('Ν'), 'N', 0}, // 039D
  755. {IV('Ξ'), '3', 0}, // 039E, Xi
  756. {IV('Ο'), 'O', 0}, // 039F
  757. {IV('Π'), 'n', 0}, // 03A0, Pi
  758. {IV('Ρ'), 'P', 0}, // 03A1
  759. {IV('Σ'), 'E', 0}, // 03A3, Sigma
  760. {IV('Τ'), 'T', 0}, // 03A4
  761. {IV('Υ'), 'Y', 0}, // 03A5, Upsilon
  762. {IV('Φ'), 'p', 0}, // 03A6, Phi
  763. {IV('Χ'), 'X', 0}, // 03A7
  764. {IV('Ψ'), 'P', 0}, // 03A8, Psi
  765. {IV('Ω'), 'O', 0}, // 03A9, Omega
  766. {IV('Ϊ'), 'I', 0}, // 03AA
  767. {IV('Ϋ'), 'Y', 0}, // 03AB
  768. {IV('ά'), 'a', 0}, // 03AC
  769. {IV('έ'), 'e', 0}, // 03AD
  770. {IV('ή'), 'n', 0}, // 03AE
  771. {IV('ί'), 'i', 0}, // 03AF
  772. {IV('ΰ'), 'v', 0}, // 03B0
  773. {IV('α'), 'a', 0}, // 03B1, alpha
  774. {IV('β'), 'B', 0}, // 03B2, beta
  775. {IV('γ'), 'v', 0}, // 03B3, gamma
  776. {IV('δ'), 'd', 0}, // 03B4, delta
  777. {IV('ε'), 'e', 0}, // 03B5, epsilon
  778. {IV('ζ'), 'Z', 0}, // 03B6, zeta
  779. {IV('η'), 'n', 0}, // 03B7, eta
  780. {IV('θ'), '0', 0}, // 03B8, theta
  781. {IV('ι'), 'i', 0}, // 03B9, lota
  782. {IV('κ'), 'k', 0}, // 03BA, kappa
  783. {IV('λ'), 'L', 0}, // 03BB, lambda
  784. {IV('μ'), 'u', 0}, // 03BC, mu
  785. {IV('ν'), 'v', 0}, // 03BD, nu
  786. {IV('ξ'), 'e', 0}, // 03BE, xi
  787. {IV('ο'), 'o', 0}, // 03BF
  788. {IV('π'), 'n', 0}, // 03C0, pi
  789. {IV('ρ'), 'p', 0}, // 03C1, rho
  790. {IV('ς'), 'c', 0}, // 03C2
  791. {IV('σ'), 'o', 0}, // 03C3, sigma
  792. {IV('τ'), 't', 0}, // 03C4, tau
  793. {IV('υ'), 'v', 0}, // 03C5, upsilon
  794. {IV('φ'), 'p', 0}, // 03C6
  795. {IV('χ'), 'X', 0}, // 03C7, chi
  796. {IV('ψ'), 'W', 0}, // 03C8, psi
  797. {IV('ω'), 'w', 0}, // 03C9, omega
  798. {IV('ϊ'), 'i', 0}, // 03CA
  799. {IV('ϋ'), 'v', 0}, // 03CB
  800. {IV('ό'), 'o', 0}, // 03CC
  801. {IV('ύ'), 'v', 0}, // 03CD
  802. {IV('ώ'), 'w', 0}, // 03CE
  803. #endif
  804. #if ENABLED(DISPLAY_CHARSET_ISO10646_5)
  805. // Map CYRILLIC code to plain ASCII
  806. {IV('Ё'), 'E', 0}, // 0401
  807. {IV('А'), 'A', 0}, // 0410
  808. {IV('Б'), 'b', 0}, // 0411
  809. {IV('В'), 'B', 0}, // 0412
  810. {IV('Г'), 'T', 0}, // 0413
  811. {IV('Д'), 'Q', 0}, // 0414
  812. {IV('Е'), 'E', 0}, // 0415
  813. {IV('Ж'), '*', 0}, // 0416
  814. {IV('З'), 'E', 0}, // 0417
  815. {IV('И'), 'N', 0}, // 0418
  816. {IV('Й'), 'N', 0}, // 0419
  817. {IV('К'), 'K', 0}, // 041A
  818. {IV('Л'), 'T', 0}, // 041B
  819. {IV('М'), 'M', 0}, // 041C
  820. {IV('Н'), 'H', 0}, // 041D
  821. {IV('О'), 'O', 0}, // 041E
  822. {IV('П'), 'n', 0}, // 041F
  823. {IV('Р'), 'P', 0}, // 0420
  824. {IV('С'), 'C', 0}, // 0421
  825. {IV('Т'), 'T', 0}, // 0422
  826. {IV('У'), 'Y', 0},
  827. {IV('Ф'), 'o', 0},
  828. {IV('Х'), 'X', 0},
  829. {IV('Ц'), 'U', 0},
  830. {IV('Ч'), 'y', 0},
  831. {IV('Ш'), 'W', 0},
  832. {IV('Щ'), 'W', 0},
  833. {IV('Ъ'), 'b', 0},
  834. {IV('Ы'), 'b', '|'},
  835. {IV('Ь'), 'b'},
  836. {IV('Э'), 'e'},
  837. {IV('Ю'), '|', 'O'},
  838. {IV('Я'), '9', '|'}, // 042F
  839. {IV('а'), 'a', 0}, // 0430
  840. {IV('б'), '6', 0}, // 0431
  841. {IV('в'), 'B', 0}, // 0432,
  842. {IV('г'), 'r', 0}, // 0433
  843. {IV('д'), 'a', 0}, // 0434,
  844. {IV('е'), 'e', 0}, // 0435
  845. {IV('ж'), '*', 0}, // 0436
  846. {IV('з'), 'e', 0}, // 0437,
  847. {IV('и'), 'u', 0}, // 0438
  848. {IV('й'), 'u', 0}, // 0439,
  849. {IV('к'), 'k', 0}, // 043A
  850. {IV('л'), 'n', 0},
  851. {IV('м'), 'm', 0},
  852. {IV('н'), 'H', 0},
  853. {IV('о'), 'o', 0},
  854. {IV('п'), 'n', 0},
  855. {IV('р'), 'p', 0},
  856. {IV('с'), 'c', 0},
  857. {IV('т'), 't', 0},
  858. {IV('у'), 'y', 0},
  859. {IV('ф'), 'q', 'p'},
  860. {IV('х'), 'x', 0},
  861. {IV('ц'), 'u', 0},
  862. {IV('ч'), 'y', 0},
  863. {IV('ш'), 'w', 0},
  864. {IV('щ'), 'w', 0},
  865. {IV('ъ'), 'b', 0},
  866. {IV('ы'), 'b', '|'},
  867. {IV('ь'), 'b', 0},
  868. {IV('э'), 'e', 0},
  869. {IV('ю'), '|', 'o'},
  870. {IV('я'), 'g', 0}, // 044F
  871. {IV('ё'), 'e', 0}, // 0451
  872. #endif
  873. {IV('•'), '.', 0}, // 2022 ·
  874. {IV('℞'), 'P', 'x'}, // 211E ℞ Pt ASCII 158
  875. {IV('™'), 'T', 'M'}, // 2122
  876. {IV('←'), '<', '-'}, // 2190
  877. {IV('→'), '-', '>'}, // 2192, Marlin special: '⮈⮉⮊⮋➤→⏵➟➠➡' LCD_STR_ARROW_RIGHT (0x03)
  878. //{IV('↰'), '<', 0}, // 21B0, Marlin special: '⮥⮭⮉⇧↑↰⤴' LCD_STR_UPLEVEL (0x04)
  879. {IV('↰'), 0x03, 0}, // 21B0, Marlin special: '⮥⮭⮉⇧↑↰⤴' LCD_STR_UPLEVEL (0x04)
  880. {IV('↻'), 0x04, 0}, // 21BB Marlin special: '↻↺⟳⟲' LCD_STR_REFRESH (0x01)
  881. {IV('∼'), '~', 0}, // 223C
  882. {IV('≈'), '~', '='}, // 2248
  883. {IV('≠'), '!', '='}, // 2260
  884. {IV('≡'), '=', 0}, // 2261
  885. {IV('≤'), '<', '='},// 2264, ≤≥ ⩽⩾
  886. {IV('≥'), '>', '='}, // 2265
  887. {IV('⏱'), 0x07, 0}, // 23F1, Marlin special: '🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚🕛🕜🕝🕞🕟🕠🕡🕢🕣🕤🕥🕦🕧 ⌚⌛⏰⏱⏳⧖⧗' LCD_STR_CLOCK (0x05)
  888. {IV('゠'), '=', 0}, // 30A0
  889. // ⏰⏱⏲⏳◴◵◶◷
  890. // ⏻⏼♁♂
  891. //{IV(''), 0x00, 0}, // Marlin special: '' LCD_STR_BEDTEMP (0x07)
  892. {IV('🌡'), 0x02, 0}, // D83CDF21 Marlin special: '🌡' LCD_STR_THERMOMETER (0x08)
  893. {IV('📂'), 0x05, 0}, // D83DDCC2 Marlin special: '📁📂' LCD_STR_FOLDER (0x02)
  894. //{IV(''), 0x06, 0}, // Marlin special: '' LCD_STR_FEEDRATE (0x06)
  895. };
  896. /* return v1 - v2 */
  897. static int hd44780_charmap_compare(hd44780_charmap_t * v1, hd44780_charmap_t * v2) {
  898. return (v1->uchar < v2->uchar) ? -1 : (v1->uchar > v2->uchar) ? 1 : 0;
  899. }
  900. static int pf_bsearch_cb_comp_hd4map_pgm(void *userdata, size_t idx, void * data_pin) {
  901. hd44780_charmap_t localval;
  902. hd44780_charmap_t *p_hd44780_charmap = (hd44780_charmap_t *)userdata;
  903. memcpy_P(&localval, p_hd44780_charmap + idx, sizeof(localval));
  904. return hd44780_charmap_compare(&localval, (hd44780_charmap_t *)data_pin);
  905. }
  906. void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row) { lcd.setCursor(col, row); }
  907. void lcd_put_int(const int i) { lcd.print(i); }
  908. // return < 0 on error
  909. // return the advanced cols
  910. int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length) {
  911. // find the HD44780 internal ROM first
  912. int ret;
  913. size_t idx = 0;
  914. hd44780_charmap_t pinval;
  915. hd44780_charmap_t *copy_address = nullptr;
  916. pinval.uchar = c;
  917. pinval.idx = -1;
  918. if (max_length < 1) return 0;
  919. // TODO: fix the '\\' that doesn't exist in the HD44870
  920. if (c < 128) {
  921. lcd.write((uint8_t)c);
  922. return 1;
  923. }
  924. copy_address = nullptr;
  925. ret = pf_bsearch_r((void *)g_hd44780_charmap_device, COUNT(g_hd44780_charmap_device), pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx);
  926. if (ret >= 0) {
  927. copy_address = (hd44780_charmap_t *)(g_hd44780_charmap_device + idx);
  928. }
  929. else {
  930. ret = pf_bsearch_r((void *)g_hd44780_charmap_common, COUNT(g_hd44780_charmap_common), pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx);
  931. if (ret >= 0) copy_address = (hd44780_charmap_t *)(g_hd44780_charmap_common + idx);
  932. }
  933. if (ret >= 0) {
  934. hd44780_charmap_t localval;
  935. // found
  936. memcpy_P(&localval, copy_address, sizeof(localval));
  937. lcd.write(localval.idx);
  938. if (max_length >= 2 && localval.idx2 > 0) {
  939. lcd.write(localval.idx2);
  940. return 2;
  941. }
  942. return 1;
  943. }
  944. // Not found, print '?' instead
  945. lcd.write((uint8_t)'?');
  946. return 1;
  947. }
  948. /**
  949. * @brief Draw a UTF-8 string
  950. *
  951. * @param utf8_str : the UTF-8 string
  952. * @param cb_read_byte : the callback function to read one byte from the utf8_str (from RAM or ROM)
  953. * @param max_length : the pixel length of the string allowed (or number of slots in HD44780)
  954. *
  955. * @return the number of pixels advanced
  956. *
  957. * Draw a UTF-8 string
  958. */
  959. static int lcd_put_u8str_max_cb(const char * utf8_str, read_byte_cb_t cb_read_byte, const pixel_len_t max_length) {
  960. pixel_len_t ret = 0;
  961. const uint8_t *p = (uint8_t *)utf8_str;
  962. while (ret < max_length) {
  963. wchar_t ch = 0;
  964. p = get_utf8_value_cb(p, cb_read_byte, &ch);
  965. if (!ch) break;
  966. ret += lcd_put_wchar_max(ch, max_length - ret);
  967. }
  968. return (int)ret;
  969. }
  970. int lcd_put_u8str_max(const char * utf8_str, const pixel_len_t max_length) {
  971. return lcd_put_u8str_max_cb(utf8_str, read_byte_ram, max_length);
  972. }
  973. int lcd_put_u8str_max_P(PGM_P utf8_pstr, const pixel_len_t max_length) {
  974. return lcd_put_u8str_max_cb(utf8_pstr, read_byte_rom, max_length);
  975. }
  976. #if ENABLED(DEBUG_LCDPRINT)
  977. int test_hd44780_charmap(hd44780_charmap_t *data, size_t size, char *name, char flg_show_contents) {
  978. int ret;
  979. size_t idx = 0;
  980. hd44780_charmap_t preval = {0, 0, 0};
  981. hd44780_charmap_t pinval = {0, 0, 0};
  982. char flg_error = 0;
  983. int i;
  984. TRACE("Test %s\n", name);
  985. for (i = 0; i < size; i ++) {
  986. memcpy_P(&pinval, &(data[i]), sizeof(pinval));
  987. if (flg_show_contents) {
  988. #if 1
  989. TRACE("[% 4d] % 6" PRIu32 "(0x%04" PRIX32 ") --> 0x%02X,0x%02X%s\n", i, pinval.uchar, pinval.uchar, (unsigned int)(pinval.idx), (unsigned int)(pinval.idx2), (preval.uchar < pinval.uchar?"":" <--- ERROR"));
  990. #else
  991. TRACE("[% 4d]", i);
  992. TRACE("% 6" PRIu32 "(0x%04" PRIX32 "),", pinval.uchar, pinval.uchar);
  993. TRACE("0x%02X,", (unsigned int)(pinval.idx));
  994. TRACE("0x%02X,", (unsigned int)(pinval.idx2));
  995. TRACE("%s", (preval.uchar < pinval.uchar?"":" <--- ERROR"));
  996. #endif
  997. }
  998. if (preval.uchar >= pinval.uchar) {
  999. flg_error = 1;
  1000. //TRACE("Error: out of order in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar);
  1001. //return -1;
  1002. }
  1003. memcpy(&preval, &pinval, sizeof(pinval));
  1004. ret = pf_bsearch_r((void *)data, size, pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx);
  1005. if (ret < 0) {
  1006. flg_error = 1;
  1007. TRACE("Error: not found item in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar);
  1008. //return -1;
  1009. }
  1010. if (idx != i) {
  1011. flg_error = 1;
  1012. TRACE("Error: wrong index found item in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar);
  1013. //return -1;
  1014. }
  1015. }
  1016. if (flg_error) {
  1017. TRACE("\nError: in array %s\n\n", name);
  1018. return -1;
  1019. }
  1020. TRACE("\nPASS array %s\n\n", name);
  1021. return 0;
  1022. }
  1023. int test_hd44780_charmap_all() {
  1024. int flg_error = 0;
  1025. if (test_hd44780_charmap(g_hd44780_charmap_device, COUNT(g_hd44780_charmap_device), "g_hd44780_charmap_device", 0) < 0) {
  1026. flg_error = 1;
  1027. test_hd44780_charmap(g_hd44780_charmap_device, COUNT(g_hd44780_charmap_device), "g_hd44780_charmap_device", 1);
  1028. }
  1029. if (test_hd44780_charmap(g_hd44780_charmap_common, COUNT(g_hd44780_charmap_common), "g_hd44780_charmap_common", 0) < 0) {
  1030. flg_error = 1;
  1031. test_hd44780_charmap(g_hd44780_charmap_common, COUNT(g_hd44780_charmap_common), "g_hd44780_charmap_common", 1);
  1032. }
  1033. if (flg_error) {
  1034. TRACE("\nFAILED in hd44780 tests!\n");
  1035. return -1;
  1036. }
  1037. TRACE("\nPASS in hd44780 tests.\n");
  1038. return 0;
  1039. }
  1040. #endif // DEBUG_LCDPRINT
  1041. #endif // HAS_MARLINUI_HD44780