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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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. #pragma once
  23. #include "tft_io.h"
  24. #include "../../inc/MarlinConfig.h"
  25. #define R61505_DRVCTL_SM 0x0400
  26. #define R61505_DRVCTL_SS 0x0100 // Select the shift direction of outputs from the source driver. 0 - from S1 to S720 / 1 - from S720 to S1
  27. #define R61505_ETMOD_TRIGGER 0x8000 // 18-bit RAM when set; 16-bit RAM when not set
  28. #define R61505_ETMOD_DFM 0x4000
  29. #define R61505_ETMOD_BGR 0x1000 // RGB-BGR ORDER
  30. #define R61505_ETMOD_RGB 0x0000
  31. #define R61505_ETMOD_HWM 0x0020
  32. #define R61505_ETMOD_ORG 0x0080
  33. #define R61505_ETMOD_ID1 0x0020 // 0 - Vertical Decrement / 1 - Vertical Increment
  34. #define R61505_ETMOD_ID0 0x0010 // 0 - Horizontal Decrement / 1 - Horizontal Increment
  35. #define R61505_ETMOD_AM 0x0008 // 0 - Horizontal / 1 - Vertical
  36. #define R61505_DRVCTRL_GS 0x8000 // Gate Scan direction
  37. // MKS Robin TFT v1.1 - 320x240 ; Cable on the left side
  38. #if TFT_ROTATION == TFT_ROTATE_180
  39. #define R61505_DRVCTL_DATA 0x0000
  40. #define R61505_DRVCTRL_DATA (0x2700 | R61505_DRVCTRL_GS)
  41. #else
  42. #define R61505_DRVCTL_DATA R61505_DRVCTL_SS
  43. #define R61505_DRVCTRL_DATA 0x2700
  44. #endif
  45. // #define R61505_ETMOD_ORIENTATION IF_0((TFT_ORIENTATION) & TFT_EXCHANGE_XY, R61505_ETMOD_AM) | \
  46. // IF_0((TFT_ORIENTATION) & TFT_INVERT_X, R61505_ETMOD_ID0) | \
  47. // IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, R61505_ETMOD_ID1)
  48. #define R61505_ETMOD_ORIENTATION (R61505_ETMOD_AM | R61505_ETMOD_ID0 | R61505_ETMOD_ID1)
  49. #if !defined(TFT_COLOR) || TFT_COLOR == TFT_COLOR_BGR
  50. #define R61505_ETMOD_COLOR R61505_ETMOD_BGR
  51. #elif TFT_COLOR == TFT_COLOR_RGB
  52. #define R61505_ETMOD_COLOR R61505_ETMOD_RGB
  53. #endif
  54. #define R61505_ETMOD_DATA (R61505_ETMOD_ORIENTATION) | (R61505_ETMOD_COLOR)
  55. #define R61505_RDDID 0x00 // ID code - 0x1505
  56. #define R61505_DRVCTL 0x01 // Driver Output Control
  57. #define R61505_LCDCTL 0x02 // LCD Driving Wave Control
  58. #define R61505_ETMOD 0x03 // Entry Mode - Control the GRAM update direction
  59. #define R61505_RESIZECTL 0x04 // Resizing Control Register
  60. #define R61505_DISCTRL1 0x07 // Display Control 1
  61. #define R61505_DISCTRL2 0x08 // Display Control 2
  62. #define R61505_DISCTRL3 0x09 // Display Control 3
  63. #define R61505_DISCTRL4 0x0A // Display Control 4
  64. #define R61505_RGBCTRL1 0x0C // RGB Display Interface Control 1
  65. #define R61505_FMARKERPOS 0x0D // Frame Marker Position
  66. #define R61505_RGBCTRL2 0x0F // RGB Display Interface Control 2
  67. #define R61505_PWCTRL1 0x10 // Power Control 1
  68. #define R61505_PWCTRL2 0x11 // Power Control 2
  69. #define R61505_PWCTRL3 0x12 // Power Control 3
  70. #define R61505_PWCTRL4 0x13 // Power Control 4
  71. // With landscape screen orientation 'Horizontal' is Y and 'Vertical' is X
  72. #define R61505_HASET 0x20 // GRAM Horizontal Address Set (0-255)
  73. #define R61505_VASET 0x21 // GRAM Vertical Address Set (0-511)
  74. #define R61505_RAMWR 0x22 // Write data to GRAM
  75. #define R61505_RAMRD 0x22 // Read Data from GRAM
  76. #define R61505_PWCTRL7 0x29 // Power Control 7
  77. #define R61505_GAMCTRL1 0x30 // Gamma Control
  78. #define R61505_GAMCTRL2 0x31 // Gamma Control
  79. #define R61505_GAMCTRL3 0x32 // Gamma Control
  80. #define R61505_GAMCTRL4 0x35 // Gamma Control
  81. #define R61505_GAMCTRL5 0x36 // Gamma Control
  82. #define R61505_GAMCTRL6 0x37 // Gamma Control
  83. #define R61505_GAMCTRL7 0x38 // Gamma Control
  84. #define R61505_GAMCTRL8 0x39 // Gamma Control
  85. #define R61505_GAMCTRL9 0x3C // Gamma Control
  86. #define R61505_GAMCTRLA 0x3D // Gamma Control
  87. // With landscape screen orientation 'Horizontal' is Y and 'Vertical' is X
  88. #define R61505_HASTART 0x50 // Horizontal Address Start Position (0-255)
  89. #define R61505_HAEND 0x51 // Horizontal Address End Position (0-255)
  90. #define R61505_VASTART 0x52 // Vertical Address Start Position (0-511)
  91. #define R61505_VAEND 0x53 // Vertical Address End Position (0-511)
  92. #define R61505_DRVCTRL 0x60 // Driver Output Control
  93. #define R61505_BASE_IMAGE_CTRL 0x61 // Base Image Display Control
  94. #define R61505_VSCROLL_CTRL 0x6A // Vertical Scroll Control
  95. #define R61505_PLTPOS1 0x80 // Partial Image 1 Display Position
  96. #define R61505_PLTSTART1 0x81 // Partial Image 1 RAM Start Address
  97. #define R61505_PLTEND1 0x82 // Partial Image 1 RAM End Address
  98. #define R61505_PLTPOS2 0x83 // Partial Image 2 Display Position
  99. #define R61505_PLTSTART2 0x84 // Partial Image 2 RAM Start Address
  100. #define R61505_PLTEND2 0x85 // Partial Image 2 RAM End Address
  101. #define R61505_IFCTL1 0x90 // Panel Interface Control 1
  102. #define R61505_IFCTL2 0x92 // Panel Interface Control 2
  103. #define R61505_IFCTL3 0x93 // Panel Interface Control 3
  104. #define R61505_IFCTL4 0x95 // Panel Interface Control 4
  105. #define R61505_IFCTL5 0x97 // Panel Interface Control 5
  106. #define R61505_IFCTL6 0x98 // Panel Interface Control 6
  107. #define R61505_OSC_CTRL 0xA4 // Oscillation Control
  108. static const uint16_t r61505_init[] = {
  109. DATASIZE_16BIT,
  110. ESC_REG(R61505_DRVCTL), R61505_DRVCTL_DATA,
  111. ESC_REG(R61505_LCDCTL), 0x0700, // LCD Driving Wave Control
  112. ESC_REG(R61505_ETMOD), R61505_ETMOD_DATA,
  113. ESC_REG(R61505_RESIZECTL), 0x0000,
  114. ESC_REG(R61505_DISCTRL1), 0x0173,
  115. ESC_REG(R61505_DISCTRL2), 0x0202,
  116. ESC_REG(R61505_DISCTRL3), 0x0000,
  117. ESC_REG(R61505_DISCTRL4), 0x0000,
  118. ESC_REG(R61505_RGBCTRL1), 0x0000,
  119. ESC_REG(R61505_FMARKERPOS), 0x0000,
  120. ESC_REG(R61505_RGBCTRL2), 0x0000,
  121. ESC_REG(R61505_PWCTRL1), 0x17B0,
  122. ESC_REG(R61505_PWCTRL2), 0x0037,
  123. ESC_REG(R61505_PWCTRL3), 0x0138,
  124. ESC_REG(R61505_PWCTRL4), 0x1700,
  125. ESC_REG(R61505_PWCTRL7), 0x000D,
  126. ESC_REG(R61505_GAMCTRL1), 0x0001,
  127. ESC_REG(R61505_GAMCTRL2), 0x0606,
  128. ESC_REG(R61505_GAMCTRL3), 0x0304,
  129. ESC_REG(R61505_GAMCTRL4), 0x0103,
  130. ESC_REG(R61505_GAMCTRL5), 0x011D,
  131. ESC_REG(R61505_GAMCTRL6), 0x0404,
  132. ESC_REG(R61505_GAMCTRL7), 0x0404,
  133. ESC_REG(R61505_GAMCTRL8), 0x0404,
  134. ESC_REG(R61505_GAMCTRL9), 0x0700,
  135. ESC_REG(R61505_GAMCTRLA), 0x0A1F,
  136. ESC_REG(R61505_DRVCTRL), R61505_DRVCTRL_DATA,
  137. ESC_REG(R61505_BASE_IMAGE_CTRL), 0x0001,
  138. ESC_REG(R61505_VSCROLL_CTRL), 0x0000,
  139. ESC_REG(R61505_IFCTL1), 0x0010,
  140. ESC_REG(R61505_IFCTL2), 0x0000,
  141. ESC_REG(R61505_IFCTL3), 0x0003,
  142. ESC_REG(R61505_IFCTL4), 0x0101,
  143. ESC_REG(R61505_IFCTL5), 0x0000,
  144. ESC_REG(R61505_IFCTL6), 0x0000,
  145. ESC_END
  146. };