/** * Marlin 3D Printer Firmware * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef ULTRALCD_COMMON_HD44780_H #define ULTRALCD_COMMON_HD44780_H /** * Implementation of the LCD display routines for a Hitachi HD44780 display. * These are the most common LCD character displays. */ #include "../inc/MarlinConfig.h" #if LCD_HEIGHT > 3 #include "../libs/duration_t.h" #endif #if ENABLED(AUTO_BED_LEVELING_UBL) #include "../feature/bedlevel/ubl/ubl.h" #if ENABLED(ULTIPANEL) #define ULTRA_X_PIXELS_PER_CHAR 5 #define ULTRA_Y_PIXELS_PER_CHAR 8 #define ULTRA_COLUMNS_FOR_MESH_MAP 7 #define ULTRA_ROWS_FOR_MESH_MAP 4 #define N_USER_CHARS 8 #define TOP_LEFT _BV(0) #define TOP_RIGHT _BV(1) #define LOWER_LEFT _BV(2) #define LOWER_RIGHT _BV(3) #endif #endif #include extern volatile uint8_t buttons; //an extended version of the last checked buttons in a bit array. //////////////////////////////////// // Setup button and encode mappings for each panel (into 'buttons' variable // // This is just to map common functions (across different panels) onto the same // macro name. The mapping is independent of whether the button is directly connected or // via a shift/i2c register. #if ENABLED(ULTIPANEL) // // Setup other button mappings of each panel // #if ENABLED(LCD_I2C_VIKI) #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) // button and encoder bit positions within 'buttons' #define B_LE (BUTTON_LEFT< #include #include #define LCD_CLASS LiquidCrystal_I2C #elif ENABLED(LCD_I2C_TYPE_MCP23017) // For the LED indicators (which may be mapped to different events in lcd_implementation_update_indicators()) #define LED_A 0x04 //100 #define LED_B 0x02 //010 #define LED_C 0x01 //001 #define LCD_HAS_STATUS_INDICATORS #include #include #define LCD_CLASS LiquidTWI2 #elif ENABLED(LCD_I2C_TYPE_MCP23008) #include #include #define LCD_CLASS LiquidTWI2 #elif ENABLED(LCD_I2C_TYPE_PCA8574) #include #define LCD_CLASS LiquidCrystal_I2C // 2 wire Non-latching LCD SR from: // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection #elif ENABLED(SR_LCD_2W_NL) extern "C" void __cxa_pure_virtual() { while (1); } #include #include #define LCD_CLASS LiquidCrystal_SR #elif ENABLED(LCM1602) #include #include #include #define LCD_CLASS LiquidCrystal_I2C #else // Standard directly connected LCD implementations #include #define LCD_CLASS LiquidCrystal #endif #include "fontutils.h" #include "lcdprint.h" #if ENABLED(LCD_PROGRESS_BAR) #define LCD_STR_PROGRESS "\x03\x04\x05" #endif enum HD44780CharSet : char { CHARSET_MENU, CHARSET_INFO, CHARSET_BOOT }; #endif // ULTRALCD_COMMON_HD44780_H