My Marlin configs for Fabrikator Mini and CTC i3 Pro B
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

constants.h 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. /***************
  2. * constants.h *
  3. ***************/
  4. /****************************************************************************
  5. * Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
  6. * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
  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. * To view a copy of the GNU General Public License, go to the following *
  19. * location: <http://www.gnu.org/licenses/>. *
  20. ****************************************************************************/
  21. /****************************************************************************
  22. * This header defines constants and commands for the FTDI FT810 LCD Driver *
  23. * chip. *
  24. ****************************************************************************/
  25. #pragma once
  26. // OPTIONS
  27. namespace FTDI {
  28. constexpr uint16_t OPT_3D = 0x0000;
  29. constexpr uint16_t OPT_RGB565 = 0x0000;
  30. constexpr uint16_t OPT_MONO = 0x0001;
  31. constexpr uint16_t OPT_NODL = 0x0002;
  32. constexpr uint16_t OPT_FLAT = 0x0100;
  33. constexpr uint16_t OPT_SIGNED = 0x0100;
  34. constexpr uint16_t OPT_CENTERX = 0x0200;
  35. constexpr uint16_t OPT_CENTERY = 0x0400;
  36. constexpr uint16_t OPT_CENTER = (OPT_CENTERX | OPT_CENTERY);
  37. constexpr uint16_t OPT_RIGHTX = 0x0800;
  38. constexpr uint16_t OPT_NOBACK = 0x1000;
  39. constexpr uint16_t OPT_NOTICKS = 0x2000;
  40. constexpr uint16_t OPT_NOHM = 0x4000;
  41. constexpr uint16_t OPT_NOPOINTER = 0x4000;
  42. constexpr uint16_t OPT_NOSECS = 0x8000;
  43. constexpr uint16_t OPT_NOHANDS = (OPT_NOPOINTER | OPT_NOSECS);
  44. }
  45. namespace FTDI_FT810 {
  46. constexpr uint16_t OPT_NOTEAR = 0x0004;
  47. constexpr uint16_t OPT_FULLSCREEN = 0x0008;
  48. constexpr uint16_t OPT_MEDIAFIFO = 0x0010;
  49. constexpr uint16_t OPT_SOUND = 0x0020;
  50. }
  51. // GPIO Bits
  52. namespace FTDI {
  53. constexpr uint8_t GPIO_GP0 = 1 << 0;
  54. constexpr uint8_t GPIO_GP1 = 1 << 1;
  55. constexpr uint8_t GPIO_DISP = 1 << 7;
  56. }
  57. namespace FTDI_FT810 {
  58. constexpr uint16_t GPIOX_GP0 = 1 << 0;
  59. constexpr uint16_t GPIOX_GP1 = 1 << 1;
  60. constexpr uint16_t GPIOX_DISP = 1 << 15;
  61. }
  62. // HOST COMMANDS
  63. namespace FTDI {
  64. constexpr uint8_t ACTIVE = 0x00;
  65. constexpr uint8_t STANDBY = 0x41;
  66. constexpr uint8_t SLEEP = 0x42;
  67. constexpr uint8_t PWRDOWN = 0x50;
  68. constexpr uint8_t CLKEXT = 0x44;
  69. constexpr uint8_t CLKINT = 0x48;
  70. constexpr uint8_t CORESET = 0x68;
  71. }
  72. namespace FTDI_FT800 {
  73. constexpr uint8_t CLK48M = 0x62;
  74. constexpr uint8_t CLK36M = 0x61;
  75. }
  76. namespace FTDI_FT810 {
  77. constexpr uint8_t CLKSEL = 0x61;
  78. }
  79. // DISPLAY LIST COMMANDS
  80. namespace FTDI {
  81. constexpr uint8_t ARGB1555 = 0;
  82. constexpr uint8_t L1 = 1;
  83. constexpr uint8_t L4 = 2;
  84. constexpr uint8_t L8 = 3;
  85. constexpr uint8_t RGB332 = 4;
  86. constexpr uint8_t ARGB2 = 5;
  87. constexpr uint8_t ARGB4 = 6;
  88. constexpr uint8_t RGB565 = 7;
  89. constexpr uint8_t PALETTED = 8;
  90. constexpr uint8_t TEXT8X8 = 9;
  91. constexpr uint8_t TEXTVGA = 10;
  92. constexpr uint8_t BARGRAPH = 11;
  93. constexpr uint8_t ALPHA_FUNC_NEVER = 0;
  94. constexpr uint8_t ALPHA_FUNC_LESS = 1;
  95. constexpr uint8_t ALPHA_FUNC_LEQUAL = 2;
  96. constexpr uint8_t ALPHA_FUNC_GREATER = 3;
  97. constexpr uint8_t ALPHA_FUNC_GEQUAL = 4;
  98. constexpr uint8_t ALPHA_FUNC_EQUAL = 5;
  99. constexpr uint8_t ALPHA_FUNC_NOTEQUAL = 6;
  100. constexpr uint8_t ALPHA_FUNC_ALWAYS = 7;
  101. constexpr uint8_t NEAREST = 0;
  102. constexpr uint8_t BILINEAR = 1;
  103. constexpr uint8_t BORDER = 0;
  104. constexpr uint8_t REPEAT = 1;
  105. constexpr uint8_t BLEND_FUNC_ZERO = 0;
  106. constexpr uint8_t BLEND_FUNC_ONE = 1;
  107. constexpr uint8_t BLEND_FUNC_SRC_ALPHA = 2;
  108. constexpr uint8_t BLEND_FUNC_DST_ALPHA = 3;
  109. constexpr uint8_t BLEND_FUNC_ONE_MINUS_SRC_ALPHA = 4;
  110. constexpr uint8_t BLEND_FUNC_ONE_MINUS_DST_ALPHA = 5;
  111. constexpr uint32_t COLOR_MASK_RED = 8;
  112. constexpr uint32_t COLOR_MASK_GRN = 4;
  113. constexpr uint32_t COLOR_MASK_BLU = 2;
  114. constexpr uint32_t COLOR_MASK_ALPHA = 1;
  115. constexpr uint8_t STENCIL_FUNC_NEVER = 0;
  116. constexpr uint8_t STENCIL_FUNC_LESS = 1;
  117. constexpr uint8_t STENCIL_FUNC_LEQUAL = 2;
  118. constexpr uint8_t STENCIL_FUNC_GREATER = 3;
  119. constexpr uint8_t STENCIL_FUNC_GEQUAL = 4;
  120. constexpr uint8_t STENCIL_FUNC_EQUAL = 5;
  121. constexpr uint8_t STENCIL_FUNC_NOTEQUAL = 6;
  122. constexpr uint8_t STENCIL_FUNC_ALWAYS = 7;
  123. constexpr uint8_t STENCIL_OP_ZERO = 0;
  124. constexpr uint8_t STENCIL_OP_KEEP = 1;
  125. constexpr uint8_t STENCIL_OP_REPLACE = 2;
  126. constexpr uint8_t STENCIL_OP_INCR = 3;
  127. constexpr uint8_t STENCIL_OP_DECR = 4;
  128. constexpr uint8_t STENCIL_OP_INVERT = 5;
  129. typedef enum : uint32_t {
  130. BITMAPS = 1,
  131. POINTS = 2,
  132. LINES = 3,
  133. LINE_STRIP = 4,
  134. EDGE_STRIP_R = 5,
  135. EDGE_STRIP_L = 6,
  136. EDGE_STRIP_A = 7,
  137. EDGE_STRIP_B = 8,
  138. RECTS = 9
  139. } begin_t;
  140. }
  141. namespace FTDI_FT800_DL {
  142. constexpr uint32_t ALPHA_FUNC = 0x09000000;
  143. constexpr uint32_t BEGIN = 0x1F000000;
  144. constexpr uint32_t BITMAP_HANDLE = 0x05000000;
  145. constexpr uint32_t BITMAP_LAYOUT = 0x07000000;
  146. constexpr uint32_t BITMAP_SIZE = 0x08000000;
  147. constexpr uint32_t BITMAP_SOURCE = 0x01000000;
  148. constexpr uint32_t BITMAP_TRANSFORM_A = 0x15000000;
  149. constexpr uint32_t BITMAP_TRANSFORM_B = 0x16000000;
  150. constexpr uint32_t BITMAP_TRANSFORM_C = 0x17000000;
  151. constexpr uint32_t BITMAP_TRANSFORM_D = 0x18000000;
  152. constexpr uint32_t BITMAP_TRANSFORM_E = 0x19000000;
  153. constexpr uint32_t BITMAP_TRANSFORM_F = 0x1A000000;
  154. constexpr uint32_t BLEND_FUNC = 0x0B000000;
  155. constexpr uint32_t CALL = 0x1D000000;
  156. constexpr uint32_t CELL = 0x06000000;
  157. constexpr uint32_t CLEAR = 0x26000000;
  158. constexpr uint32_t CLEAR_COLOR_BUFFER = 0x00000004;
  159. constexpr uint32_t CLEAR_STENCIL_BUFFER = 0x00000002;
  160. constexpr uint32_t CLEAR_TAG_BUFFER = 0x00000001;
  161. constexpr uint32_t CLEAR_COLOR_A = 0x0F000000;
  162. constexpr uint32_t CLEAR_COLOR_RGB = 0x02000000;
  163. constexpr uint32_t CLEAR_STENCIL = 0x11000000;
  164. constexpr uint32_t CLEAR_TAG = 0x12000000;
  165. constexpr uint32_t COLOR_A = 0x10000000;
  166. constexpr uint32_t COLOR_MASK = 0x20000000;
  167. constexpr uint32_t COLOR_RGB = 0x04000000;
  168. constexpr uint32_t DL_DISPLAY = 0x00000000;
  169. constexpr uint32_t END = 0x21000000;
  170. constexpr uint32_t JUMP = 0x1E000000;
  171. constexpr uint32_t LINE_WIDTH = 0x0E000000;
  172. constexpr uint32_t MACRO = 0x25000000;
  173. constexpr uint32_t POINT_SIZE = 0x0D000000;
  174. constexpr uint32_t RESTORE_CONTEXT = 0x23000000;
  175. constexpr uint32_t RETURN = 0x24000000;
  176. constexpr uint32_t SAVE_CONTEXT = 0x22000000;
  177. constexpr uint32_t SCISSOR_SIZE = 0x1C000000;
  178. constexpr uint32_t SCISSOR_XY = 0x1B000000;
  179. constexpr uint32_t STENCIL_FUNC = 0x0A000000;
  180. constexpr uint32_t STENCIL_MASK = 0x13000000;
  181. constexpr uint32_t STENCIL_OP = 0x0C000000;
  182. constexpr uint32_t TAG = 0x03000000;
  183. constexpr uint32_t TAG_MASK = 0x14000000;
  184. constexpr uint32_t VERTEX2F = 0x40000000;
  185. constexpr uint32_t VERTEX2II = 0x80000000;
  186. }
  187. namespace FTDI_FT810_DL {
  188. constexpr uint32_t NOP = 0x25000000;
  189. constexpr uint32_t BITMAP_LAYOUT_H = 0x28000000;
  190. constexpr uint32_t BITMAP_SIZE_H = 0x29000000;
  191. constexpr uint32_t VERTEX_FORMAT = 0x27000000;
  192. constexpr uint32_t VERTEX_TRANSLATE_X = 0x2B000000;
  193. constexpr uint32_t VERTEX_TRANSLATE_Y = 0x2C000000;
  194. }
  195. // CO-PROCESSOR ENGINE COMMANDS
  196. namespace FTDI {
  197. constexpr uint32_t CMD_DLSTART = 0xFFFFFF00;
  198. constexpr uint32_t CMD_SWAP = 0xFFFFFF01;
  199. constexpr uint32_t CMD_COLDSTART = 0xFFFFFF32;
  200. constexpr uint32_t CMD_INTERRUPT = 0xFFFFFF02;
  201. constexpr uint32_t CMD_APPEND = 0xFFFFFF1E;
  202. constexpr uint32_t CMD_REGREAD = 0xFFFFFF19;
  203. constexpr uint32_t CMD_MEMWRITE = 0xFFFFFF1A;
  204. constexpr uint32_t CMD_INFLATE = 0xFFFFFF22;
  205. constexpr uint32_t CMD_LOADIMAGE = 0xFFFFFF24;
  206. constexpr uint32_t CMD_MEMCRC = 0xFFFFFF18;
  207. constexpr uint32_t CMD_MEMZERO = 0xFFFFFF1C;
  208. constexpr uint32_t CMD_MEMSET = 0xFFFFFF1B;
  209. constexpr uint32_t CMD_MEMCPY = 0xFFFFFF1D;
  210. constexpr uint32_t CMD_BUTTON = 0xFFFFFF0D;
  211. constexpr uint32_t CMD_CLOCK = 0xFFFFFF14;
  212. constexpr uint32_t CMD_FGCOLOR = 0xFFFFFF0A;
  213. constexpr uint32_t CMD_BGCOLOR = 0xFFFFFF09;
  214. constexpr uint32_t CMD_GRADCOLOR = 0xFFFFFF34;
  215. constexpr uint32_t CMD_GAUGE = 0xFFFFFF13;
  216. constexpr uint32_t CMD_GRADIENT = 0xFFFFFF0B;
  217. constexpr uint32_t CMD_KEYS = 0xFFFFFF0E;
  218. constexpr uint32_t CMD_PROGRESS = 0xFFFFFF0F;
  219. constexpr uint32_t CMD_SCROLLBAR = 0xFFFFFF11;
  220. constexpr uint32_t CMD_SLIDER = 0xFFFFFF10;
  221. constexpr uint32_t CMD_DIAL = 0xFFFFFF2D;
  222. constexpr uint32_t CMD_TOGGLE = 0xFFFFFF12;
  223. constexpr uint32_t CMD_TEXT = 0xFFFFFF0C;
  224. constexpr uint32_t CMD_NUMBER = 0xFFFFFF2E;
  225. constexpr uint32_t CMD_LOADIDENTITY = 0xFFFFFF26;
  226. constexpr uint32_t CMD_SETMATRIX = 0xFFFFFF2A;
  227. constexpr uint32_t CMD_GETMATRIX = 0xFFFFFF33;
  228. constexpr uint32_t CMD_GETPTR = 0xFFFFFF23;
  229. constexpr uint32_t CMD_GETPROPS = 0xFFFFFF25;
  230. constexpr uint32_t CMD_SCALE = 0xFFFFFF28;
  231. constexpr uint32_t CMD_ROTATE = 0xFFFFFF29;
  232. constexpr uint32_t CMD_TRANSLATE = 0xFFFFFF27;
  233. constexpr uint32_t CMD_CALIBRATE = 0xFFFFFF15;
  234. constexpr uint32_t CMD_SPINNER = 0xFFFFFF16;
  235. constexpr uint32_t CMD_SCREENSAVER = 0xFFFFFF2F;
  236. constexpr uint32_t CMD_SKETCH = 0xFFFFFF30;
  237. constexpr uint32_t CMD_STOP = 0xFFFFFF17;
  238. constexpr uint32_t CMD_SETFONT = 0xFFFFFF2B;
  239. constexpr uint32_t CMD_TRACK = 0xFFFFFF2C;
  240. constexpr uint32_t CMD_SNAPSHOT = 0xFFFFFF1F;
  241. constexpr uint32_t CMD_LOGO = 0xFFFFFF31;
  242. }
  243. namespace FTDI_FT810 {
  244. constexpr uint32_t CMD_SETROTATE = 0xFFFFFF36;
  245. constexpr uint32_t CMD_SNAPSHOT2 = 0xFFFFFF37;
  246. constexpr uint32_t CMD_SETBASE = 0xFFFFFF38;
  247. constexpr uint32_t CMD_MEDIAFIFO = 0xFFFFFF39;
  248. constexpr uint32_t CMD_PLAYVIDEO = 0xFFFFFF3A;
  249. constexpr uint32_t CMD_SETFONT2 = 0xFFFFFF3B;
  250. constexpr uint32_t CMD_SETSCRATCH = 0xFFFFFF3C;
  251. constexpr uint32_t CMD_ROMFONT = 0xFFFFFF3F;
  252. constexpr uint32_t CMD_VIDEOSTART = 0xFFFFFF40;
  253. constexpr uint32_t CMD_VIDEOFRAME = 0xFFFFFF41;
  254. constexpr uint32_t CMD_SETBITMAP = 0xFFFFFF43;
  255. }
  256. namespace FTDI {
  257. enum effect_t : unsigned char {
  258. SILENCE = 0x00,
  259. SQUARE_WAVE = 0x01,
  260. SINE_WAVE = 0x02,
  261. SAWTOOTH_WAVE = 0x03,
  262. TRIANGLE_WAVE = 0x04,
  263. BEEPING = 0x05,
  264. ALARM = 0x06,
  265. WARBLE = 0x07,
  266. CAROUSEL = 0x08,
  267. SHORT_PIPS_1 = 0x10,
  268. SHORT_PIPS_2 = 0x11,
  269. SHORT_PIPS_3 = 0x12,
  270. SHORT_PIPS_4 = 0x13,
  271. SHORT_PIPS_5 = 0x14,
  272. SHORT_PIPS_6 = 0x15,
  273. SHORT_PIPS_7 = 0x16,
  274. SHORT_PIPS_8 = 0x17,
  275. SHORT_PIPS_9 = 0x18,
  276. SHORT_PIPS_10 = 0x19,
  277. SHORT_PIPS_11 = 0x1A,
  278. SHORT_PIPS_12 = 0x1B,
  279. SHORT_PIPS_13 = 0x1C,
  280. SHORT_PIPS_14 = 0x1D,
  281. SHORT_PIPS_15 = 0x1E,
  282. SHORT_PIPS_16 = 0x1F,
  283. DTMF_POUND = 0x23,
  284. DTMF_STAR = 0x2C,
  285. DTMF_0 = 0x30,
  286. DTMF_1 = 0x31,
  287. DTMF_2 = 0x32,
  288. DTMF_3 = 0x33,
  289. DTMF_4 = 0x34,
  290. DTMF_5 = 0x35,
  291. DTMF_6 = 0x36,
  292. DTMF_7 = 0x37,
  293. DTMF_8 = 0x38,
  294. DTMF_9 = 0x39,
  295. HARP = 0x40,
  296. XYLOPHONE = 0x41,
  297. TUBA = 0x42,
  298. GLOCKENSPIEL = 0x43,
  299. ORGAN = 0x44,
  300. TRUMPET = 0x45,
  301. PIANO = 0x46,
  302. CHIMES = 0x47,
  303. MUSIC_BOX = 0x48,
  304. BELL = 0x49,
  305. CLICK = 0x50,
  306. SWITCH = 0x51,
  307. COWBELL = 0x52,
  308. NOTCH = 0x53,
  309. HIHAT = 0x54,
  310. KICKDRUM = 0x55,
  311. POP = 0x56,
  312. CLACK = 0x57,
  313. CHACK = 0x58,
  314. MUTE = 0x60,
  315. UNMUTE = 0x61
  316. };
  317. enum note_t : unsigned char {
  318. END_SONG = 0xFF,
  319. REST = 0x00,
  320. NOTE_C1 = 0x18, // 24
  321. NOTE_C1S = 0x19,
  322. NOTE_D1 = 0x1A,
  323. NOTE_D1S = 0x1B,
  324. NOTE_E1 = 0x1C,
  325. NOTE_F1 = 0x1D,
  326. NOTE_F1S = 0x1E,
  327. NOTE_G1 = 0x1F,
  328. NOTE_G1S = 0x20,
  329. NOTE_A1 = 0x21,
  330. NOTE_A1S = 0x22,
  331. NOTE_B1 = 0x23,
  332. NOTE_C2 = 0x24, //36
  333. NOTE_C2S = 0x25,
  334. NOTE_D2 = 0x26,
  335. NOTE_D2S = 0x27,
  336. NOTE_E2 = 0x28,
  337. NOTE_F2 = 0x29,
  338. NOTE_F2S = 0x2A,
  339. NOTE_G2 = 0x2B,
  340. NOTE_G2S = 0x2C,
  341. NOTE_A2 = 0x2D,
  342. NOTE_A2S = 0x2E,
  343. NOTE_B2 = 0x2F,
  344. NOTE_C3 = 0x30,
  345. NOTE_C3S = 0x31,
  346. NOTE_D3 = 0x32,
  347. NOTE_D3S = 0x33,
  348. NOTE_E3 = 0x34,
  349. NOTE_F3 = 0x35,
  350. NOTE_F3S = 0x36,
  351. NOTE_G3 = 0x37,
  352. NOTE_G3S = 0x38,
  353. NOTE_A3 = 0x39,
  354. NOTE_A3S = 0x3A,
  355. NOTE_B3 = 0x3B,
  356. NOTE_C4 = 0x3C,
  357. NOTE_C4S = 0x3D,
  358. NOTE_D4 = 0x3E,
  359. NOTE_D4S = 0x3F,
  360. NOTE_E4 = 0x40,
  361. NOTE_F4 = 0x41,
  362. NOTE_F4S = 0x42,
  363. NOTE_G4 = 0x43,
  364. NOTE_G4S = 0x44,
  365. NOTE_A4 = 0x45,
  366. NOTE_A4S = 0x46,
  367. NOTE_B4 = 0x47,
  368. NOTE_C5 = 0x48,
  369. NOTE_C5S = 0x49,
  370. NOTE_D5 = 0x4A,
  371. NOTE_D5S = 0x4B,
  372. NOTE_E5 = 0x4C,
  373. NOTE_F5 = 0x4D,
  374. NOTE_F5S = 0x4E,
  375. NOTE_G5 = 0x4F,
  376. NOTE_G5S = 0x50,
  377. NOTE_A5 = 0x51,
  378. NOTE_A5S = 0x52,
  379. NOTE_B5 = 0x53,
  380. };
  381. }