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.

marlinui_TFTGLCD.h 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. /**
  24. * Implementation of the LCD display routines for a TFT GLCD displays with external controller.
  25. */
  26. #include "../../inc/MarlinConfig.h"
  27. #if IS_TFTGLCD_PANEL
  28. #include "../../libs/duration_t.h"
  29. ////////////////////////////////////
  30. // Set up button and encode mappings for each panel (into 'buttons' variable)
  31. //
  32. // This is just to map common functions (across different panels) onto the same
  33. // macro name. The mapping is independent of whether the button is directly connected or
  34. // via a shift/i2c register.
  35. ////////////////////////////////////
  36. // Create LCD class instance and chipset-specific information
  37. class TFTGLCD {
  38. private:
  39. public:
  40. TFTGLCD();
  41. void clear_buffer();
  42. void clr_screen();
  43. void setCursor(uint8_t col, uint8_t row);
  44. void write(char c);
  45. void print(const char *line);
  46. void print_line();
  47. void print_screen();
  48. void redraw_screen();
  49. void setContrast(uint16_t contrast);
  50. };
  51. extern TFTGLCD lcd;
  52. #include "../fontutils.h"
  53. #include "../lcdprint.h"
  54. // Use panel encoder - free old encoder pins
  55. #undef BTN_EN1
  56. #undef BTN_EN2
  57. #undef BTN_ENC
  58. #ifndef EN_C
  59. #define EN_C 4 // for click
  60. #endif
  61. #endif // IS_TFTGLCD_PANEL