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.

HAL_LCD_class_defines.h 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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 "../../inc/MarlinConfig.h"
  24. // use this file to create the public interface for device drivers that are NOT in the U8G library
  25. extern u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_sw_spi;
  26. extern u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_hw_spi;
  27. class U8GLIB_64128N_2X_HAL : public U8GLIB {
  28. public:
  29. U8GLIB_64128N_2X_HAL() : U8GLIB() { }
  30. U8GLIB_64128N_2X_HAL(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) { init(sck, mosi, cs, a0, reset); }
  31. U8GLIB_64128N_2X_HAL(pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) { init(cs, a0, reset); }
  32. void init(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) {
  33. U8GLIB::init(&u8g_dev_st7565_64128n_HAL_2x_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset);
  34. }
  35. void init(pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) {
  36. U8GLIB::init(&u8g_dev_st7565_64128n_HAL_2x_hw_spi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset);
  37. }
  38. };
  39. extern u8g_dev_t u8g_dev_st7920_128x64_HAL_4x_sw_spi;
  40. extern u8g_dev_t u8g_dev_st7920_128x64_HAL_4x_hw_spi;
  41. class U8GLIB_ST7920_128X64_4X_HAL : public U8GLIB {
  42. public:
  43. U8GLIB_ST7920_128X64_4X_HAL() : U8GLIB() { }
  44. U8GLIB_ST7920_128X64_4X_HAL(pin_t sck, pin_t mosi, pin_t cs, pin_t reset = U8G_PIN_NONE) { init(sck, mosi, cs, reset); }
  45. U8GLIB_ST7920_128X64_4X_HAL(pin_t cs, pin_t reset = U8G_PIN_NONE) { init(cs, reset); }
  46. void init(pin_t sck, pin_t mosi, pin_t cs, pin_t reset = U8G_PIN_NONE) {
  47. U8GLIB::init(&u8g_dev_st7920_128x64_HAL_4x_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset); // a0 = U8G_PIN_NONE
  48. }
  49. void init(pin_t cs, pin_t reset = U8G_PIN_NONE) {
  50. U8GLIB::init(&u8g_dev_st7920_128x64_HAL_4x_hw_spi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset); // a0 = U8G_PIN_NONE
  51. }
  52. };
  53. //
  54. // AVR version uses ultralcd_st7920_u8glib_rrd_AVR.cpp
  55. // HAL version uses u8g_dev_st7920_128x64_HAL.cpp
  56. //
  57. extern u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi;
  58. class U8GLIB_ST7920_128X64_RRD : public U8GLIB {
  59. public:
  60. U8GLIB_ST7920_128X64_RRD() : U8GLIB() { }
  61. U8GLIB_ST7920_128X64_RRD(pin_t sck, pin_t mosi, pin_t cs, pin_t reset = U8G_PIN_NONE) { init(sck, mosi, cs, reset); }
  62. void init(pin_t sck, pin_t mosi, pin_t cs, pin_t reset = U8G_PIN_NONE) {
  63. U8GLIB::init(&u8g_dev_st7920_128x64_rrd_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset); // a0 = U8G_PIN_NONE
  64. }
  65. };
  66. extern u8g_dev_t u8g_dev_sh1106_128x64_2x_i2c_2_wire;
  67. class U8GLIB_SH1106_128X64_2X_I2C_2_WIRE : public U8GLIB {
  68. public:
  69. U8GLIB_SH1106_128X64_2X_I2C_2_WIRE() : U8GLIB() { }
  70. U8GLIB_SH1106_128X64_2X_I2C_2_WIRE(uint8_t options) { init(options); }
  71. void init(uint8_t options = U8G_I2C_OPT_NONE) { U8GLIB::init(&u8g_dev_sh1106_128x64_2x_i2c_2_wire, options); }
  72. };
  73. extern u8g_dev_t u8g_dev_ssd1306_128x64_2x_i2c_2_wire;
  74. class U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE : public U8GLIB {
  75. public:
  76. U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE() : U8GLIB() { }
  77. U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE(uint8_t options) { init(options); }
  78. void init(uint8_t options = U8G_I2C_OPT_NONE) { U8GLIB::init(&u8g_dev_ssd1306_128x64_2x_i2c_2_wire, options); }
  79. };
  80. //
  81. // Very basic support for 320x240 TFT screen
  82. // Tested on MKS Robin TFT_V2.0 with ST7789V controller
  83. //
  84. extern u8g_dev_t u8g_dev_tft_320x240_upscale_from_128x64;
  85. class U8GLIB_TFT_320X240_UPSCALE_FROM_128X64 : public U8GLIB {
  86. public:
  87. U8GLIB_TFT_320X240_UPSCALE_FROM_128X64() : U8GLIB() { }
  88. U8GLIB_TFT_320X240_UPSCALE_FROM_128X64(uint8_t cs, uint8_t rs, uint8_t reset = U8G_PIN_NONE) { init(cs, rs, reset); }
  89. void init(uint8_t cs, uint8_t rs, uint8_t reset = U8G_PIN_NONE) { U8GLIB::init(&u8g_dev_tft_320x240_upscale_from_128x64, cs, rs, reset); }
  90. };
  91. extern u8g_dev_t u8g_dev_uc1701_mini12864_HAL_2x_sw_spi, u8g_dev_uc1701_mini12864_HAL_2x_hw_spi;
  92. class U8GLIB_MINI12864_2X_HAL : public U8GLIB {
  93. public:
  94. U8GLIB_MINI12864_2X_HAL() : U8GLIB() { }
  95. U8GLIB_MINI12864_2X_HAL(uint8_t sck, uint8_t mosi, uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE) { init(sck, mosi, cs, a0, reset); }
  96. U8GLIB_MINI12864_2X_HAL(uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE) { init(cs, a0, reset); }
  97. void init(uint8_t sck, uint8_t mosi, uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE) {
  98. U8GLIB::init(&u8g_dev_uc1701_mini12864_HAL_2x_sw_spi, sck, mosi, cs, a0, reset);
  99. }
  100. void init(uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE) {
  101. U8GLIB::init(&u8g_dev_uc1701_mini12864_HAL_2x_hw_spi, cs, a0, reset);
  102. }
  103. };
  104. extern u8g_dev_t u8g_dev_ssd1309_sw_spi;
  105. extern u8g_dev_t u8g_dev_ssd1309_hw_spi;
  106. class U8GLIB_SSD1309_128X64_HAL : public U8GLIB {
  107. public:
  108. U8GLIB_SSD1309_128X64_HAL() : U8GLIB() { }
  109. U8GLIB_SSD1309_128X64_HAL(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) { init(sck, mosi, cs, a0, reset); }
  110. U8GLIB_SSD1309_128X64_HAL(pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) { init(cs, a0, reset); }
  111. void init(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) {
  112. U8GLIB::init(&u8g_dev_ssd1309_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset);
  113. }
  114. void init(pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) {
  115. U8GLIB::init(&u8g_dev_ssd1309_hw_spi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset);
  116. }
  117. };