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.

ultralcd_HD44780.h 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. /**
  24. * Implementation of the LCD display routines for a Hitachi HD44780 display.
  25. * These are the most common LCD character displays.
  26. */
  27. #include "../../inc/MarlinConfig.h"
  28. #if LCD_HEIGHT > 3
  29. #include "../../libs/duration_t.h"
  30. #endif
  31. ////////////////////////////////////
  32. // Setup button and encode mappings for each panel (into 'buttons' variable
  33. //
  34. // This is just to map common functions (across different panels) onto the same
  35. // macro name. The mapping is independent of whether the button is directly connected or
  36. // via a shift/i2c register.
  37. ////////////////////////////////////
  38. // Create LCD class instance and chipset-specific information
  39. #if ENABLED(LCD_I2C_TYPE_PCF8575)
  40. // NOTE: These are register-mapped pins on the PCF8575 controller, not Arduino pins.
  41. #define LCD_I2C_PIN_BL 3
  42. #define LCD_I2C_PIN_EN 2
  43. #define LCD_I2C_PIN_RW 1
  44. #define LCD_I2C_PIN_RS 0
  45. #define LCD_I2C_PIN_D4 4
  46. #define LCD_I2C_PIN_D5 5
  47. #define LCD_I2C_PIN_D6 6
  48. #define LCD_I2C_PIN_D7 7
  49. #include <Wire.h>
  50. #include <LCD.h>
  51. #include <LiquidCrystal_I2C.h>
  52. #define LCD_CLASS LiquidCrystal_I2C
  53. #elif ENABLED(LCD_I2C_TYPE_MCP23017)
  54. // For the LED indicators (which may be mapped to different events in update_indicators())
  55. #define LCD_HAS_STATUS_INDICATORS
  56. #define LED_A 0x04 //100
  57. #define LED_B 0x02 //010
  58. #define LED_C 0x01 //001
  59. #include <Wire.h>
  60. #include <LiquidTWI2.h>
  61. #define LCD_CLASS LiquidTWI2
  62. #elif ENABLED(LCD_I2C_TYPE_MCP23008)
  63. #include <Wire.h>
  64. #include <LiquidTWI2.h>
  65. #define LCD_CLASS LiquidTWI2
  66. #elif ENABLED(LCD_I2C_TYPE_PCA8574)
  67. #include <LiquidCrystal_I2C.h>
  68. #define LCD_CLASS LiquidCrystal_I2C
  69. #elif ENABLED(SR_LCD_2W_NL)
  70. // 2 wire Non-latching LCD SR from:
  71. // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
  72. // extern "C" void __cxa_pure_virtual() { while (1); }
  73. #include <LCD.h>
  74. #include <LiquidCrystal_SR.h>
  75. #define LCD_CLASS LiquidCrystal_SR
  76. #elif ENABLED(SR_LCD_3W_NL)
  77. //NewLiquidCrystal was not working for me, but this worked first try
  78. //https://github.com/mikeshub/SailfishLCD
  79. //uses the code directly from Sailfish
  80. #include <SailfishLCD.h>
  81. #define LCD_CLASS LiquidCrystalSerial
  82. #elif ENABLED(LCM1602)
  83. #include <Wire.h>
  84. #include <LCD.h>
  85. #include <LiquidCrystal_I2C.h>
  86. #define LCD_CLASS LiquidCrystal_I2C
  87. #else
  88. // Standard directly connected LCD implementations
  89. #include <LiquidCrystal.h>
  90. #define LCD_CLASS LiquidCrystal
  91. #endif
  92. #include "../fontutils.h"
  93. #include "../lcdprint.h"