My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

lcdprint_TFTGLCD.cpp 33KB

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