ssss

Committer:
irsanjul
Date:
Tue Aug 18 14:57:10 2020 +0000
Revision:
0:d51588bf1724
ssss

Who changed what in which revision?

UserRevisionLine numberNew contents of line
irsanjul 0:d51588bf1724 1 /* mbed TextLCD Library, for LCDs based on HD44780 controllers
irsanjul 0:d51588bf1724 2 * Copyright (c) 2014, WH
irsanjul 0:d51588bf1724 3 * 2014, v01: WH, Extracted from TextLCD.h as of v14
irsanjul 0:d51588bf1724 4 * 2014, v02: WH, Added AC780 support, added I2C expander modules, fixed setBacklight() for inverted logic modules. Fixed bug in LCD_SPI_N define
irsanjul 0:d51588bf1724 5 * 2014, v03: WH, Added LCD_SPI_N_3_8 define for ST7070
irsanjul 0:d51588bf1724 6 * 2015, v04: WH, Added support for alternative fonttables (eg PCF21XX)
irsanjul 0:d51588bf1724 7 * 2015, v05: WH, Clean up low-level _writeCommand() and _writeData(), Added support for alt fonttables (eg PCF21XX), Added ST7066_ACM for ACM1602 module, fixed contrast for ST7032
irsanjul 0:d51588bf1724 8 * 2015, v06: WH, Performance improvement I2C portexpander
irsanjul 0:d51588bf1724 9 * 2015, v07: WH, Fixed Adafruit I2C/SPI portexpander pinmappings, fixed SYDZ Backlight
irsanjul 0:d51588bf1724 10 * 2015, v08: WH, Added defines to reduce memory footprint (eg LCD_ICON), added some I2C portexpander defines
irsanjul 0:d51588bf1724 11 * 2015, v09: WH, Added defines to reduce memory footprint (LCD_TWO_CTRL, LCD_CONTRAST, LCD_UTF8_FONT),
irsanjul 0:d51588bf1724 12 * Added UTF8_2_LCD decode for Cyrilic font (By Andriy Ribalko). Added setFont()
irsanjul 0:d51588bf1724 13 *
irsanjul 0:d51588bf1724 14 * Permission is hereby granted, free of charge, to any person obtaining a copy
irsanjul 0:d51588bf1724 15 * of this software and associated documentation files (the "Software"), to deal
irsanjul 0:d51588bf1724 16 * in the Software without restriction, including without limitation the rights
irsanjul 0:d51588bf1724 17 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
irsanjul 0:d51588bf1724 18 * copies of the Software, and to permit persons to whom the Software is
irsanjul 0:d51588bf1724 19 * furnished to do so, subject to the following conditions:
irsanjul 0:d51588bf1724 20 *
irsanjul 0:d51588bf1724 21 * The above copyright notice and this permission notice shall be included in
irsanjul 0:d51588bf1724 22 * all copies or substantial portions of the Software.
irsanjul 0:d51588bf1724 23 *
irsanjul 0:d51588bf1724 24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
irsanjul 0:d51588bf1724 25 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
irsanjul 0:d51588bf1724 26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
irsanjul 0:d51588bf1724 27 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
irsanjul 0:d51588bf1724 28 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
irsanjul 0:d51588bf1724 29 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
irsanjul 0:d51588bf1724 30 * THE SOFTWARE.
irsanjul 0:d51588bf1724 31 */
irsanjul 0:d51588bf1724 32 #ifndef MBED_TEXTLCDCONFIG_H
irsanjul 0:d51588bf1724 33 #define MBED_TEXTLCDCONFIG_H
irsanjul 0:d51588bf1724 34
irsanjul 0:d51588bf1724 35 //Select hardware interface options to reduce memory footprint (multiple options allowed)
irsanjul 0:d51588bf1724 36 #define LCD_I2C 1 /* I2C Expander PCF8574/MCP23008 */
irsanjul 0:d51588bf1724 37 #define LCD_SPI 0 /* SPI Expander SN74595 */
irsanjul 0:d51588bf1724 38 #define LCD_I2C_N 0 /* Native I2C bus */
irsanjul 0:d51588bf1724 39 #define LCD_SPI_N 0 /* Native SPI bus */
irsanjul 0:d51588bf1724 40 #define LCD_SPI_N_3_8 0 /* Native SPI bus */
irsanjul 0:d51588bf1724 41 #define LCD_SPI_N_3_9 0 /* Native SPI bus */
irsanjul 0:d51588bf1724 42 #define LCD_SPI_N_3_10 0 /* Native SPI bus */
irsanjul 0:d51588bf1724 43 #define LCD_SPI_N_3_16 0 /* Native SPI bus */
irsanjul 0:d51588bf1724 44 #define LCD_SPI_N_3_24 0 /* Native SPI bus */
irsanjul 0:d51588bf1724 45
irsanjul 0:d51588bf1724 46 //Select options to reduce memory footprint (multiple options allowed)
irsanjul 0:d51588bf1724 47 #define LCD_UDC 1 /* Enable predefined UDC example*/
irsanjul 0:d51588bf1724 48 #define LCD_PRINTF 1 /* Enable Stream implementation */
irsanjul 0:d51588bf1724 49 #define LCD_ICON 1 /* Enable Icon implementation -2.0K codesize*/
irsanjul 0:d51588bf1724 50 #define LCD_ORIENT 0 /* Enable Orientation switch implementation -0.9K codesize*/
irsanjul 0:d51588bf1724 51 #define LCD_BIGFONT 0 /* Enable Big Font implementation -0.6K codesize */
irsanjul 0:d51588bf1724 52 #define LCD_INVERT 0 /* Enable display Invert implementation -0.5K codesize*/
irsanjul 0:d51588bf1724 53 #define LCD_POWER 0 /* Enable Power control implementation -0.1K codesize*/
irsanjul 0:d51588bf1724 54 #define LCD_BLINK 0 /* Enable UDC and Icon Blink control implementation -0.8K codesize*/
irsanjul 0:d51588bf1724 55 #define LCD_CONTRAST 1 /* Enable Contrast control implementation -0.9K codesize*/
irsanjul 0:d51588bf1724 56 #define LCD_TWO_CTRL 0 /* Enable LCD40x4 (two controller) implementation -0.1K codesize*/
irsanjul 0:d51588bf1724 57 #define LCD_FONTSEL 0 /* Enable runtime font select implementation using setFont -0.9K codesize*/
irsanjul 0:d51588bf1724 58
irsanjul 0:d51588bf1724 59 //Select option to activate default fonttable or alternatively use conversion for specific controller versions (eg PCF2116C, PCF2119R, SSD1803, US2066)
irsanjul 0:d51588bf1724 60 #define LCD_DEF_FONT 1 //Default HD44780 font
irsanjul 0:d51588bf1724 61 //#define LCD_C_FONT 1 //PCF21xxC font
irsanjul 0:d51588bf1724 62 //#define LCD_R_FONT 1 //PCF21xxR font
irsanjul 0:d51588bf1724 63 //#define LCD_UTF8_FONT 1 /* Enable UTF8 Support (eg Cyrillic tables) -0.4K codesize*/
irsanjul 0:d51588bf1724 64 //#define LCD_UTF8_CYR_B 1 /* Select specific UTF8 Cyrillic table (SSD1803 ROM_B) */
irsanjul 0:d51588bf1724 65
irsanjul 0:d51588bf1724 66 //Pin Defines for I2C PCF8574/PCF8574A or MCP23008 and SPI 74595 bus expander interfaces
irsanjul 0:d51588bf1724 67 //Different commercially available LCD portexpanders use different wiring conventions.
irsanjul 0:d51588bf1724 68 //LCD and serial portexpanders should be wired according to the tables below.
irsanjul 0:d51588bf1724 69 //
irsanjul 0:d51588bf1724 70 //Select Serial Port Expander Hardware module (one option only)
irsanjul 0:d51588bf1724 71 #define DEFAULT 0
irsanjul 0:d51588bf1724 72 #define ADAFRUIT 0
irsanjul 0:d51588bf1724 73 #define DFROBOT 0
irsanjul 0:d51588bf1724 74 #define LCM1602 1
irsanjul 0:d51588bf1724 75 #define YWROBOT 0
irsanjul 0:d51588bf1724 76 #define GYLCD 0
irsanjul 0:d51588bf1724 77 #define MJKDZ 0
irsanjul 0:d51588bf1724 78 #define SYDZ 0
irsanjul 0:d51588bf1724 79 #define WIDEHK 0
irsanjul 0:d51588bf1724 80 #define LCDPLUG 0
irsanjul 0:d51588bf1724 81
irsanjul 0:d51588bf1724 82 #if (DEFAULT==1)
irsanjul 0:d51588bf1724 83 //Definitions for default (WH) mapping between serial port expander pins and LCD controller
irsanjul 0:d51588bf1724 84 //This hardware supports the I2C bus expander (PCF8574/PCF8574A or MCP23008) and SPI bus expander (74595) interfaces
irsanjul 0:d51588bf1724 85 //See https://mbed.org/cookbook/Text-LCD-Enhanced
irsanjul 0:d51588bf1724 86 //
irsanjul 0:d51588bf1724 87 //Note: LCD RW pin must be connected to GND
irsanjul 0:d51588bf1724 88 // E2 is used for LCD40x4 (second controller)
irsanjul 0:d51588bf1724 89 // BL may be used to control backlight
irsanjul 0:d51588bf1724 90
irsanjul 0:d51588bf1724 91 //I2C bus expander (PCF8574/PCF8574A or MCP23008) interface
irsanjul 0:d51588bf1724 92 #define LCD_BUS_I2C_D4 (1 << 0)
irsanjul 0:d51588bf1724 93 #define LCD_BUS_I2C_D5 (1 << 1)
irsanjul 0:d51588bf1724 94 #define LCD_BUS_I2C_D6 (1 << 2)
irsanjul 0:d51588bf1724 95 #define LCD_BUS_I2C_D7 (1 << 3)
irsanjul 0:d51588bf1724 96 #define LCD_BUS_I2C_RS (1 << 4)
irsanjul 0:d51588bf1724 97 #define LCD_BUS_I2C_E (1 << 5)
irsanjul 0:d51588bf1724 98 #define LCD_BUS_I2C_E2 (1 << 6)
irsanjul 0:d51588bf1724 99 #define LCD_BUS_I2C_BL (1 << 7)
irsanjul 0:d51588bf1724 100
irsanjul 0:d51588bf1724 101 #define LCD_BUS_I2C_RW (1 << 6)
irsanjul 0:d51588bf1724 102
irsanjul 0:d51588bf1724 103 //SPI bus expander (74595) interface, same as I2C
irsanjul 0:d51588bf1724 104 #define LCD_BUS_SPI_D4 LCD_BUS_I2C_D4
irsanjul 0:d51588bf1724 105 #define LCD_BUS_SPI_D5 LCD_BUS_I2C_D5
irsanjul 0:d51588bf1724 106 #define LCD_BUS_SPI_D6 LCD_BUS_I2C_D6
irsanjul 0:d51588bf1724 107 #define LCD_BUS_SPI_D7 LCD_BUS_I2C_D7
irsanjul 0:d51588bf1724 108 #define LCD_BUS_SPI_RS LCD_BUS_I2C_RS
irsanjul 0:d51588bf1724 109 #define LCD_BUS_SPI_E LCD_BUS_I2C_E
irsanjul 0:d51588bf1724 110 #define LCD_BUS_SPI_E2 LCD_BUS_I2C_E2
irsanjul 0:d51588bf1724 111 #define LCD_BUS_SPI_BL LCD_BUS_I2C_BL
irsanjul 0:d51588bf1724 112
irsanjul 0:d51588bf1724 113 #define LCD_BUS_SPI_RW LCD_BUS_I2C_RW
irsanjul 0:d51588bf1724 114
irsanjul 0:d51588bf1724 115 //Select I2C Portexpander type (one option only)
irsanjul 0:d51588bf1724 116 #define PCF8574 1
irsanjul 0:d51588bf1724 117 #define MCP23008 0
irsanjul 0:d51588bf1724 118
irsanjul 0:d51588bf1724 119 //Inverted Backlight control
irsanjul 0:d51588bf1724 120 #define BACKLIGHT_INV 0
irsanjul 0:d51588bf1724 121 #endif
irsanjul 0:d51588bf1724 122
irsanjul 0:d51588bf1724 123 #if (ADAFRUIT==1)
irsanjul 0:d51588bf1724 124 //Definitions for Adafruit i2cspilcdbackpack mapping between serial port expander pins and LCD controller
irsanjul 0:d51588bf1724 125 //This hardware supports both an I2C expander (MCP23008) and an SPI expander (74595) selectable by a jumper.
irsanjul 0:d51588bf1724 126 //Slaveaddress may be set by solderbridges (default 0x40). SDA/SCL has pullup Resistors onboard.
irsanjul 0:d51588bf1724 127 //See http://www.ladyada.net/products/i2cspilcdbackpack
irsanjul 0:d51588bf1724 128 //
irsanjul 0:d51588bf1724 129 //Note: LCD RW pin must be kept LOW
irsanjul 0:d51588bf1724 130 // E2 is not available on this hardware and so it does not support LCD40x4 (second controller)
irsanjul 0:d51588bf1724 131 // BL is used to control backlight
irsanjul 0:d51588bf1724 132 //Note: The pinmappings are different for the MCP23008 and the 74595!
irsanjul 0:d51588bf1724 133
irsanjul 0:d51588bf1724 134 //I2C bus expander (MCP23008) interface
irsanjul 0:d51588bf1724 135 #define LCD_BUS_I2C_0 (1 << 0)
irsanjul 0:d51588bf1724 136 #define LCD_BUS_I2C_RS (1 << 1)
irsanjul 0:d51588bf1724 137 #define LCD_BUS_I2C_E (1 << 2)
irsanjul 0:d51588bf1724 138 #define LCD_BUS_I2C_D4 (1 << 3)
irsanjul 0:d51588bf1724 139 #define LCD_BUS_I2C_D5 (1 << 4)
irsanjul 0:d51588bf1724 140 #define LCD_BUS_I2C_D6 (1 << 5)
irsanjul 0:d51588bf1724 141 #define LCD_BUS_I2C_D7 (1 << 6)
irsanjul 0:d51588bf1724 142 #define LCD_BUS_I2C_BL (1 << 7)
irsanjul 0:d51588bf1724 143
irsanjul 0:d51588bf1724 144 #define LCD_BUS_I2C_E2 (1 << 0)
irsanjul 0:d51588bf1724 145 #define LCD_BUS_I2C_RW (1 << 0)
irsanjul 0:d51588bf1724 146
irsanjul 0:d51588bf1724 147 //SPI bus expander (74595) interface
irsanjul 0:d51588bf1724 148 #define LCD_BUS_SPI_0 (1 << 0)
irsanjul 0:d51588bf1724 149 #define LCD_BUS_SPI_RS (1 << 1)
irsanjul 0:d51588bf1724 150 #define LCD_BUS_SPI_E (1 << 2)
irsanjul 0:d51588bf1724 151 #define LCD_BUS_SPI_D7 (1 << 3)
irsanjul 0:d51588bf1724 152 #define LCD_BUS_SPI_D6 (1 << 4)
irsanjul 0:d51588bf1724 153 #define LCD_BUS_SPI_D5 (1 << 5)
irsanjul 0:d51588bf1724 154 #define LCD_BUS_SPI_D4 (1 << 6)
irsanjul 0:d51588bf1724 155 #define LCD_BUS_SPI_BL (1 << 7)
irsanjul 0:d51588bf1724 156
irsanjul 0:d51588bf1724 157 #define LCD_BUS_SPI_E2 (1 << 0)
irsanjul 0:d51588bf1724 158 #define LCD_BUS_SPI_RW (1 << 0)
irsanjul 0:d51588bf1724 159
irsanjul 0:d51588bf1724 160 //Force I2C portexpander type
irsanjul 0:d51588bf1724 161 #define PCF8574 0
irsanjul 0:d51588bf1724 162 #define MCP23008 1
irsanjul 0:d51588bf1724 163
irsanjul 0:d51588bf1724 164 //Inverted Backlight control
irsanjul 0:d51588bf1724 165 #define BACKLIGHT_INV 0
irsanjul 0:d51588bf1724 166 #endif
irsanjul 0:d51588bf1724 167
irsanjul 0:d51588bf1724 168 #if (DFROBOT==1)
irsanjul 0:d51588bf1724 169 //Definitions for DFROBOT LCD2004 Module mapping between serial port expander pins and LCD controller
irsanjul 0:d51588bf1724 170 //This hardware uses PCF8574 and is different from earlier/different Arduino I2C LCD displays
irsanjul 0:d51588bf1724 171 //Slaveaddress hardwired to 0x4E. SDA/SCL has pullup Resistors onboard.
irsanjul 0:d51588bf1724 172 //See http://arduino-info.wikispaces.com/LCD-Blue-I2C
irsanjul 0:d51588bf1724 173 //
irsanjul 0:d51588bf1724 174 //Definitions for DFROBOT V1.1
irsanjul 0:d51588bf1724 175 //This hardware uses PCF8574. Slaveaddress may be set by jumpers (default 0x40).
irsanjul 0:d51588bf1724 176 //SDA/SCL has pullup Resistors onboard and features a voltage level converter 3V3 <-> 5V.
irsanjul 0:d51588bf1724 177 //See http://www.dfrobot.com/index.php?route=product/product&product_id=135
irsanjul 0:d51588bf1724 178 //
irsanjul 0:d51588bf1724 179 //
irsanjul 0:d51588bf1724 180 //Note: LCD RW pin must be kept LOW
irsanjul 0:d51588bf1724 181 // E2 is not available on default Arduino hardware and so it does not support LCD40x4 (second controller)
irsanjul 0:d51588bf1724 182 // BL is used to control backlight
irsanjul 0:d51588bf1724 183
irsanjul 0:d51588bf1724 184 //I2C bus expander PCF8574 interface
irsanjul 0:d51588bf1724 185 #define LCD_BUS_I2C_RS (1 << 0)
irsanjul 0:d51588bf1724 186 #define LCD_BUS_I2C_RW (1 << 1)
irsanjul 0:d51588bf1724 187 #define LCD_BUS_I2C_E (1 << 2)
irsanjul 0:d51588bf1724 188 #define LCD_BUS_I2C_BL (1 << 3)
irsanjul 0:d51588bf1724 189 #define LCD_BUS_I2C_D4 (1 << 4)
irsanjul 0:d51588bf1724 190 #define LCD_BUS_I2C_D5 (1 << 5)
irsanjul 0:d51588bf1724 191 #define LCD_BUS_I2C_D6 (1 << 6)
irsanjul 0:d51588bf1724 192 #define LCD_BUS_I2C_D7 (1 << 7)
irsanjul 0:d51588bf1724 193
irsanjul 0:d51588bf1724 194 #define LCD_BUS_I2C_E2 (1 << 1)
irsanjul 0:d51588bf1724 195
irsanjul 0:d51588bf1724 196 //SPI bus expander (74595) interface, same as I2C
irsanjul 0:d51588bf1724 197 #define LCD_BUS_SPI_RS LCD_BUS_I2C_RS
irsanjul 0:d51588bf1724 198 #define LCD_BUS_SPI_RW LCD_BUS_I2C_RW
irsanjul 0:d51588bf1724 199 #define LCD_BUS_SPI_E LCD_BUS_I2C_E
irsanjul 0:d51588bf1724 200 #define LCD_BUS_SPI_BL LCD_BUS_I2C_BL
irsanjul 0:d51588bf1724 201 #define LCD_BUS_SPI_D4 LCD_BUS_I2C_D4
irsanjul 0:d51588bf1724 202 #define LCD_BUS_SPI_D5 LCD_BUS_I2C_D5
irsanjul 0:d51588bf1724 203 #define LCD_BUS_SPI_D6 LCD_BUS_I2C_D6
irsanjul 0:d51588bf1724 204 #define LCD_BUS_SPI_D7 LCD_BUS_I2C_D7
irsanjul 0:d51588bf1724 205
irsanjul 0:d51588bf1724 206 #define LCD_BUS_SPI_E2 LCD_BUS_I2C_E2
irsanjul 0:d51588bf1724 207
irsanjul 0:d51588bf1724 208
irsanjul 0:d51588bf1724 209 //Force I2C portexpander type
irsanjul 0:d51588bf1724 210 #define PCF8574 1
irsanjul 0:d51588bf1724 211 #define MCP23008 0
irsanjul 0:d51588bf1724 212
irsanjul 0:d51588bf1724 213 //Inverted Backlight control
irsanjul 0:d51588bf1724 214 #define BACKLIGHT_INV 0
irsanjul 0:d51588bf1724 215 #endif
irsanjul 0:d51588bf1724 216
irsanjul 0:d51588bf1724 217 #if ((YWROBOT==1) || (LCM1602==1))
irsanjul 0:d51588bf1724 218 //Definitions for YWROBOT LCM1602 V1 Module mapping between serial port expander pins and LCD controller.
irsanjul 0:d51588bf1724 219 //Very similar to DFROBOT. Also marked as 'Funduino'. This hardware uses PCF8574.
irsanjul 0:d51588bf1724 220 //Slaveaddress may be set by solderbridges (default 0x4E). SDA/SCL has no pullup Resistors onboard.
irsanjul 0:d51588bf1724 221 //See http://arduino-info.wikispaces.com/LCD-Blue-I2C
irsanjul 0:d51588bf1724 222 //
irsanjul 0:d51588bf1724 223 //Note: LCD RW pin must be kept LOW
irsanjul 0:d51588bf1724 224 // E2 is not available on default hardware and so it does not support LCD40x4 (second controller)
irsanjul 0:d51588bf1724 225 // BL is used to control backlight.
irsanjul 0:d51588bf1724 226
irsanjul 0:d51588bf1724 227 //I2C bus expander PCF8574 interface
irsanjul 0:d51588bf1724 228 #define LCD_BUS_I2C_RS (1 << 0)
irsanjul 0:d51588bf1724 229 #define LCD_BUS_I2C_RW (1 << 1)
irsanjul 0:d51588bf1724 230 #define LCD_BUS_I2C_E (1 << 2)
irsanjul 0:d51588bf1724 231 #define LCD_BUS_I2C_BL (1 << 3)
irsanjul 0:d51588bf1724 232 #define LCD_BUS_I2C_D4 (1 << 4)
irsanjul 0:d51588bf1724 233 #define LCD_BUS_I2C_D5 (1 << 5)
irsanjul 0:d51588bf1724 234 #define LCD_BUS_I2C_D6 (1 << 6)
irsanjul 0:d51588bf1724 235 #define LCD_BUS_I2C_D7 (1 << 7)
irsanjul 0:d51588bf1724 236
irsanjul 0:d51588bf1724 237 #define LCD_BUS_I2C_E2 (1 << 1)
irsanjul 0:d51588bf1724 238
irsanjul 0:d51588bf1724 239 //SPI bus expander (74595) interface, same as I2C
irsanjul 0:d51588bf1724 240 #define LCD_BUS_SPI_RS LCD_BUS_I2C_RS
irsanjul 0:d51588bf1724 241 #define LCD_BUS_SPI_RW LCD_BUS_I2C_RW
irsanjul 0:d51588bf1724 242 #define LCD_BUS_SPI_E LCD_BUS_I2C_E
irsanjul 0:d51588bf1724 243 #define LCD_BUS_SPI_BL LCD_BUS_I2C_BL
irsanjul 0:d51588bf1724 244 #define LCD_BUS_SPI_D4 LCD_BUS_I2C_D4
irsanjul 0:d51588bf1724 245 #define LCD_BUS_SPI_D5 LCD_BUS_I2C_D5
irsanjul 0:d51588bf1724 246 #define LCD_BUS_SPI_D6 LCD_BUS_I2C_D6
irsanjul 0:d51588bf1724 247 #define LCD_BUS_SPI_D7 LCD_BUS_I2C_D7
irsanjul 0:d51588bf1724 248
irsanjul 0:d51588bf1724 249 #define LCD_BUS_SPI_E2 LCD_BUS_I2C_E2
irsanjul 0:d51588bf1724 250
irsanjul 0:d51588bf1724 251 //Force I2C portexpander type
irsanjul 0:d51588bf1724 252 #define PCF8574 1
irsanjul 0:d51588bf1724 253 #define MCP23008 0
irsanjul 0:d51588bf1724 254
irsanjul 0:d51588bf1724 255 //Inverted Backlight control
irsanjul 0:d51588bf1724 256 #define BACKLIGHT_INV 0
irsanjul 0:d51588bf1724 257 #endif
irsanjul 0:d51588bf1724 258
irsanjul 0:d51588bf1724 259 #if ((GYLCD==1) || (MJKDZ==1))
irsanjul 0:d51588bf1724 260 //Definitions for Arduino-IIC-LCD GY-LCD-V1, for GY-IICLCD and for MJKDZ Module mapping between serial port expander pins and LCD controller.
irsanjul 0:d51588bf1724 261 //Very similar to DFROBOT. This hardware uses PCF8574.
irsanjul 0:d51588bf1724 262 //Slaveaddress may be set by solderbridges (default 0x4E). SDA/SCL has pullup Resistors onboard.
irsanjul 0:d51588bf1724 263 //See http://arduino-info.wikispaces.com/LCD-Blue-I2C
irsanjul 0:d51588bf1724 264 //
irsanjul 0:d51588bf1724 265 //Note: LCD RW pin must be kept LOW
irsanjul 0:d51588bf1724 266 // E2 is not available on default hardware and so it does not support LCD40x4 (second controller)
irsanjul 0:d51588bf1724 267 // BL is used to control backlight, reverse logic: Low turns on Backlight. This is handled in setBacklight()
irsanjul 0:d51588bf1724 268
irsanjul 0:d51588bf1724 269 //I2C bus expander PCF8574 interface
irsanjul 0:d51588bf1724 270 #define LCD_BUS_I2C_D4 (1 << 0)
irsanjul 0:d51588bf1724 271 #define LCD_BUS_I2C_D5 (1 << 1)
irsanjul 0:d51588bf1724 272 #define LCD_BUS_I2C_D6 (1 << 2)
irsanjul 0:d51588bf1724 273 #define LCD_BUS_I2C_D7 (1 << 3)
irsanjul 0:d51588bf1724 274 #define LCD_BUS_I2C_E (1 << 4)
irsanjul 0:d51588bf1724 275 #define LCD_BUS_I2C_RW (1 << 5)
irsanjul 0:d51588bf1724 276 #define LCD_BUS_I2C_RS (1 << 6)
irsanjul 0:d51588bf1724 277 #define LCD_BUS_I2C_BL (1 << 7)
irsanjul 0:d51588bf1724 278
irsanjul 0:d51588bf1724 279 #define LCD_BUS_I2C_E2 (1 << 5)
irsanjul 0:d51588bf1724 280
irsanjul 0:d51588bf1724 281 //SPI bus expander (74595) interface
irsanjul 0:d51588bf1724 282 #define LCD_BUS_SPI_D4 LCD_BUS_I2C_D4
irsanjul 0:d51588bf1724 283 #define LCD_BUS_SPI_D5 LCD_BUS_I2C_D5
irsanjul 0:d51588bf1724 284 #define LCD_BUS_SPI_D6 LCD_BUS_I2C_D6
irsanjul 0:d51588bf1724 285 #define LCD_BUS_SPI_D7 LCD_BUS_I2C_D7
irsanjul 0:d51588bf1724 286 #define LCD_BUS_SPI_E LCD_BUS_I2C_E
irsanjul 0:d51588bf1724 287 #define LCD_BUS_SPI_RW LCD_BUS_I2C_RW
irsanjul 0:d51588bf1724 288 #define LCD_BUS_SPI_RS LCD_BUS_I2C_RS
irsanjul 0:d51588bf1724 289 #define LCD_BUS_SPI_BL LCD_BUS_I2C_BL
irsanjul 0:d51588bf1724 290
irsanjul 0:d51588bf1724 291 #define LCD_BUS_SPI_E2 LCD_BUS_I2C_E2
irsanjul 0:d51588bf1724 292
irsanjul 0:d51588bf1724 293 //Force I2C portexpander type
irsanjul 0:d51588bf1724 294 #define PCF8574 1
irsanjul 0:d51588bf1724 295 #define MCP23008 0
irsanjul 0:d51588bf1724 296
irsanjul 0:d51588bf1724 297 //Force Inverted Backlight control
irsanjul 0:d51588bf1724 298 #define BACKLIGHT_INV 1
irsanjul 0:d51588bf1724 299 #endif
irsanjul 0:d51588bf1724 300
irsanjul 0:d51588bf1724 301 #if (SYDZ==1)
irsanjul 0:d51588bf1724 302 //Definitions for SYDZ Module mapping between serial port expander pins and LCD controller.
irsanjul 0:d51588bf1724 303 //Very similar to DFROBOT. This hardware uses PCF8574A.
irsanjul 0:d51588bf1724 304 //Slaveaddress may be set by switches (default 0x70). SDA/SCL has pullup Resistors onboard.
irsanjul 0:d51588bf1724 305 //See ebay
irsanjul 0:d51588bf1724 306 //
irsanjul 0:d51588bf1724 307 //Note: LCD RW pin must be kept LOW
irsanjul 0:d51588bf1724 308 // E2 is not available on default hardware and so it does not support LCD40x4 (second controller)
irsanjul 0:d51588bf1724 309 // BL is used to control backlight
irsanjul 0:d51588bf1724 310
irsanjul 0:d51588bf1724 311 //I2C bus expander PCF8574A interface
irsanjul 0:d51588bf1724 312 #define LCD_BUS_I2C_RS (1 << 0)
irsanjul 0:d51588bf1724 313 #define LCD_BUS_I2C_RW (1 << 1)
irsanjul 0:d51588bf1724 314 #define LCD_BUS_I2C_E (1 << 2)
irsanjul 0:d51588bf1724 315 #define LCD_BUS_I2C_BL (1 << 3)
irsanjul 0:d51588bf1724 316 #define LCD_BUS_I2C_D4 (1 << 4)
irsanjul 0:d51588bf1724 317 #define LCD_BUS_I2C_D5 (1 << 5)
irsanjul 0:d51588bf1724 318 #define LCD_BUS_I2C_D6 (1 << 6)
irsanjul 0:d51588bf1724 319 #define LCD_BUS_I2C_D7 (1 << 7)
irsanjul 0:d51588bf1724 320
irsanjul 0:d51588bf1724 321 #define LCD_BUS_I2C_E2 (1 << 1)
irsanjul 0:d51588bf1724 322
irsanjul 0:d51588bf1724 323 //SPI bus expander (74595) interface, same as I2C
irsanjul 0:d51588bf1724 324 #define LCD_BUS_SPI_RS LCD_BUS_I2C_RS
irsanjul 0:d51588bf1724 325 #define LCD_BUS_SPI_RW LCD_BUS_I2C_RW
irsanjul 0:d51588bf1724 326 #define LCD_BUS_SPI_E LCD_BUS_I2C_E
irsanjul 0:d51588bf1724 327 #define LCD_BUS_SPI_BL LCD_BUS_I2C_BL
irsanjul 0:d51588bf1724 328 #define LCD_BUS_SPI_D4 LCD_BUS_I2C_D4
irsanjul 0:d51588bf1724 329 #define LCD_BUS_SPI_D5 LCD_BUS_I2C_D5
irsanjul 0:d51588bf1724 330 #define LCD_BUS_SPI_D6 LCD_BUS_I2C_D6
irsanjul 0:d51588bf1724 331 #define LCD_BUS_SPI_D7 LCD_BUS_I2C_D7
irsanjul 0:d51588bf1724 332
irsanjul 0:d51588bf1724 333 #define LCD_BUS_SPI_E2 LCD_BUS_I2C_E2
irsanjul 0:d51588bf1724 334
irsanjul 0:d51588bf1724 335 //Force I2C portexpander type
irsanjul 0:d51588bf1724 336 #define PCF8574 1
irsanjul 0:d51588bf1724 337 #define MCP23008 0
irsanjul 0:d51588bf1724 338
irsanjul 0:d51588bf1724 339 //Force Inverted Backlight control
irsanjul 0:d51588bf1724 340 #define BACKLIGHT_INV 0
irsanjul 0:d51588bf1724 341 #endif
irsanjul 0:d51588bf1724 342
irsanjul 0:d51588bf1724 343 #if (WIDEHK==1)
irsanjul 0:d51588bf1724 344 //Definitions for WIDE.HK I2C backpack mapping between serial port expander pins and LCD controller
irsanjul 0:d51588bf1724 345 //This hardware uses an MCP23008 I2C expander.
irsanjul 0:d51588bf1724 346 //Slaveaddress is hardcoded at 0x4E. SDA/SCL has pullup Resistors onboard (3k3).
irsanjul 0:d51588bf1724 347 //See http://www.wide.hk
irsanjul 0:d51588bf1724 348 //
irsanjul 0:d51588bf1724 349 //Note: LCD RW pin must be kept LOW
irsanjul 0:d51588bf1724 350 // E2 is not available on this hardware and so it does not support LCD40x4 (second controller)
irsanjul 0:d51588bf1724 351 // BL is used to control backlight
irsanjul 0:d51588bf1724 352 //
irsanjul 0:d51588bf1724 353
irsanjul 0:d51588bf1724 354 //I2C bus expander (MCP23008) interface
irsanjul 0:d51588bf1724 355 #define LCD_BUS_I2C_D4 (1 << 0)
irsanjul 0:d51588bf1724 356 #define LCD_BUS_I2C_D5 (1 << 1)
irsanjul 0:d51588bf1724 357 #define LCD_BUS_I2C_D6 (1 << 2)
irsanjul 0:d51588bf1724 358 #define LCD_BUS_I2C_D7 (1 << 3)
irsanjul 0:d51588bf1724 359 #define LCD_BUS_I2C_RS (1 << 4)
irsanjul 0:d51588bf1724 360 #define LCD_BUS_I2C_RW (1 << 5)
irsanjul 0:d51588bf1724 361 #define LCD_BUS_I2C_BL (1 << 6)
irsanjul 0:d51588bf1724 362 #define LCD_BUS_I2C_E (1 << 7)
irsanjul 0:d51588bf1724 363
irsanjul 0:d51588bf1724 364 #define LCD_BUS_I2C_E2 (1 << 5)
irsanjul 0:d51588bf1724 365
irsanjul 0:d51588bf1724 366 //SPI bus expander (74595) interface, same as I2C
irsanjul 0:d51588bf1724 367 #define LCD_BUS_SPI_D4 LCD_BUS_I2C_D4
irsanjul 0:d51588bf1724 368 #define LCD_BUS_SPI_D5 LCD_BUS_I2C_D5
irsanjul 0:d51588bf1724 369 #define LCD_BUS_SPI_D6 LCD_BUS_I2C_D6
irsanjul 0:d51588bf1724 370 #define LCD_BUS_SPI_D7 LCD_BUS_I2C_D7
irsanjul 0:d51588bf1724 371 #define LCD_BUS_SPI_RS LCD_BUS_I2C_RS
irsanjul 0:d51588bf1724 372 #define LCD_BUS_SPI_RW LCD_BUS_I2C_RW
irsanjul 0:d51588bf1724 373 #define LCD_BUS_SPI_BL LCD_BUS_I2C_BL
irsanjul 0:d51588bf1724 374 #define LCD_BUS_SPI_E LCD_BUS_I2C_E
irsanjul 0:d51588bf1724 375
irsanjul 0:d51588bf1724 376 #define LCD_BUS_SPI_E2 LCD_BUS_I2C_E2
irsanjul 0:d51588bf1724 377
irsanjul 0:d51588bf1724 378 //Force I2C portexpander type
irsanjul 0:d51588bf1724 379 #define PCF8574 0
irsanjul 0:d51588bf1724 380 #define MCP23008 1
irsanjul 0:d51588bf1724 381
irsanjul 0:d51588bf1724 382 //Inverted Backlight control
irsanjul 0:d51588bf1724 383 #define BACKLIGHT_INV 0
irsanjul 0:d51588bf1724 384 #endif
irsanjul 0:d51588bf1724 385
irsanjul 0:d51588bf1724 386 #if (LCDPLUG==1)
irsanjul 0:d51588bf1724 387 //Definitions for Jeelabs LCD_Plug I2C backpack mapping between serial port expander pins and LCD controller
irsanjul 0:d51588bf1724 388 //This hardware uses an MCP23008 I2C expander.
irsanjul 0:d51588bf1724 389 //Slaveaddress is hardcoded at 0x48. SDA/SCL has no pullup Resistors onboard.
irsanjul 0:d51588bf1724 390 //See http://jeelabs.net/projects/hardware/wiki/lcd_plug
irsanjul 0:d51588bf1724 391 //
irsanjul 0:d51588bf1724 392 //Note: LCD RW pin must be kept LOW
irsanjul 0:d51588bf1724 393 // E2 is available on a plug and so it does support LCD40x4 (second controller)
irsanjul 0:d51588bf1724 394 // BL is used to control backlight
irsanjul 0:d51588bf1724 395 //
irsanjul 0:d51588bf1724 396
irsanjul 0:d51588bf1724 397 //I2C bus expander (MCP23008) interface
irsanjul 0:d51588bf1724 398 #define LCD_BUS_I2C_D4 (1 << 0)
irsanjul 0:d51588bf1724 399 #define LCD_BUS_I2C_D5 (1 << 1)
irsanjul 0:d51588bf1724 400 #define LCD_BUS_I2C_D6 (1 << 2)
irsanjul 0:d51588bf1724 401 #define LCD_BUS_I2C_D7 (1 << 3)
irsanjul 0:d51588bf1724 402 #define LCD_BUS_I2C_RS (1 << 4)
irsanjul 0:d51588bf1724 403 #define LCD_BUS_I2C_E2 (1 << 5)
irsanjul 0:d51588bf1724 404 #define LCD_BUS_I2C_E (1 << 6)
irsanjul 0:d51588bf1724 405 #define LCD_BUS_I2C_BL (1 << 7)
irsanjul 0:d51588bf1724 406
irsanjul 0:d51588bf1724 407 #define LCD_BUS_I2C_RW (1 << 5)
irsanjul 0:d51588bf1724 408
irsanjul 0:d51588bf1724 409 //SPI bus expander (74595) interface, same as I2C
irsanjul 0:d51588bf1724 410 #define LCD_BUS_SPI_D4 LCD_BUS_I2C_D4
irsanjul 0:d51588bf1724 411 #define LCD_BUS_SPI_D5 LCD_BUS_I2C_D5
irsanjul 0:d51588bf1724 412 #define LCD_BUS_SPI_D6 LCD_BUS_I2C_D6
irsanjul 0:d51588bf1724 413 #define LCD_BUS_SPI_D7 LCD_BUS_I2C_D7
irsanjul 0:d51588bf1724 414 #define LCD_BUS_SPI_RS LCD_BUS_I2C_RS
irsanjul 0:d51588bf1724 415 #define LCD_BUS_SPI_E2 LCD_BUS_I2C_E2
irsanjul 0:d51588bf1724 416 #define LCD_BUS_SPI_E LCD_BUS_I2C_E
irsanjul 0:d51588bf1724 417 #define LCD_BUS_SPI_BL LCD_BUS_I2C_BL
irsanjul 0:d51588bf1724 418
irsanjul 0:d51588bf1724 419 #define LCD_BUS_SPI_RW LCD_BUS_I2C_RW
irsanjul 0:d51588bf1724 420
irsanjul 0:d51588bf1724 421 //Force I2C portexpander type
irsanjul 0:d51588bf1724 422 #define PCF8574 0
irsanjul 0:d51588bf1724 423 #define MCP23008 1
irsanjul 0:d51588bf1724 424
irsanjul 0:d51588bf1724 425 //Inverted Backlight control
irsanjul 0:d51588bf1724 426 #define BACKLIGHT_INV 0
irsanjul 0:d51588bf1724 427 #endif
irsanjul 0:d51588bf1724 428
irsanjul 0:d51588bf1724 429
irsanjul 0:d51588bf1724 430 //Bitpattern Defines for I2C PCF8574/PCF8574A, MCP23008 and SPI 74595 Bus expanders
irsanjul 0:d51588bf1724 431 //Don't change!
irsanjul 0:d51588bf1724 432 #define LCD_BUS_I2C_MSK (LCD_BUS_I2C_D4 | LCD_BUS_I2C_D5 | LCD_BUS_I2C_D6 | LCD_BUS_I2C_D7)
irsanjul 0:d51588bf1724 433 #if (BACKLIGHT_INV == 1)
irsanjul 0:d51588bf1724 434 #define LCD_BUS_I2C_DEF (0x00 | LCD_BUS_I2C_BL)
irsanjul 0:d51588bf1724 435 #else
irsanjul 0:d51588bf1724 436 #define LCD_BUS_I2C_DEF 0x00
irsanjul 0:d51588bf1724 437 #endif
irsanjul 0:d51588bf1724 438
irsanjul 0:d51588bf1724 439 #define LCD_BUS_SPI_MSK (LCD_BUS_SPI_D4 | LCD_BUS_SPI_D5 | LCD_BUS_SPI_D6 | LCD_BUS_SPI_D7)
irsanjul 0:d51588bf1724 440 #if (BACKLIGHT_INV == 1)
irsanjul 0:d51588bf1724 441 #define LCD_BUS_SPI_DEF (0x00 | LCD_BUS_SPI_BL)
irsanjul 0:d51588bf1724 442 #else
irsanjul 0:d51588bf1724 443 #define LCD_BUS_SPI_DEF 0x00
irsanjul 0:d51588bf1724 444 #endif
irsanjul 0:d51588bf1724 445
irsanjul 0:d51588bf1724 446
irsanjul 0:d51588bf1724 447 /* PCF8574/PCF8574A I2C portexpander slave address */
irsanjul 0:d51588bf1724 448 #define PCF8574_SA0 0x40
irsanjul 0:d51588bf1724 449 #define PCF8574_SA1 0x42
irsanjul 0:d51588bf1724 450 #define PCF8574_SA2 0x44
irsanjul 0:d51588bf1724 451 #define PCF8574_SA3 0x46
irsanjul 0:d51588bf1724 452 #define PCF8574_SA4 0x48
irsanjul 0:d51588bf1724 453 #define PCF8574_SA5 0x4A
irsanjul 0:d51588bf1724 454 #define PCF8574_SA6 0x4C
irsanjul 0:d51588bf1724 455 #define PCF8574_SA7 0x4E
irsanjul 0:d51588bf1724 456
irsanjul 0:d51588bf1724 457 #define PCF8574A_SA0 0x70
irsanjul 0:d51588bf1724 458 #define PCF8574A_SA1 0x72
irsanjul 0:d51588bf1724 459 #define PCF8574A_SA2 0x74
irsanjul 0:d51588bf1724 460 #define PCF8574A_SA3 0x76
irsanjul 0:d51588bf1724 461 #define PCF8574A_SA4 0x78
irsanjul 0:d51588bf1724 462 #define PCF8574A_SA5 0x7A
irsanjul 0:d51588bf1724 463 #define PCF8574A_SA6 0x7C
irsanjul 0:d51588bf1724 464 #define PCF8574A_SA7 0x7E
irsanjul 0:d51588bf1724 465
irsanjul 0:d51588bf1724 466 /* MCP23008 I2C portexpander slave address */
irsanjul 0:d51588bf1724 467 #define MCP23008_SA0 0x40
irsanjul 0:d51588bf1724 468 #define MCP23008_SA1 0x42
irsanjul 0:d51588bf1724 469 #define MCP23008_SA2 0x44
irsanjul 0:d51588bf1724 470 #define MCP23008_SA3 0x46
irsanjul 0:d51588bf1724 471 #define MCP23008_SA4 0x48
irsanjul 0:d51588bf1724 472 #define MCP23008_SA5 0x4A
irsanjul 0:d51588bf1724 473 #define MCP23008_SA6 0x4C
irsanjul 0:d51588bf1724 474 #define MCP23008_SA7 0x4E
irsanjul 0:d51588bf1724 475
irsanjul 0:d51588bf1724 476 /* MCP23008 I2C portexpander internal registers */
irsanjul 0:d51588bf1724 477 #define IODIR 0x00
irsanjul 0:d51588bf1724 478 #define IPOL 0x01
irsanjul 0:d51588bf1724 479 #define GPINTEN 0x02
irsanjul 0:d51588bf1724 480 #define DEFVAL 0x03
irsanjul 0:d51588bf1724 481 #define INTCON 0x04
irsanjul 0:d51588bf1724 482 #define IOCON 0x05
irsanjul 0:d51588bf1724 483 #define GPPU 0x06
irsanjul 0:d51588bf1724 484 #define INTF 0x07
irsanjul 0:d51588bf1724 485 #define INTCAP 0x08
irsanjul 0:d51588bf1724 486 #define GPIO 0x09
irsanjul 0:d51588bf1724 487 #define OLAT 0x0A
irsanjul 0:d51588bf1724 488
irsanjul 0:d51588bf1724 489 /* ST7032i I2C slave address */
irsanjul 0:d51588bf1724 490 #define ST7032_SA 0x7C
irsanjul 0:d51588bf1724 491
irsanjul 0:d51588bf1724 492 /* ST7036i I2C slave address */
irsanjul 0:d51588bf1724 493 #define ST7036_SA0 0x78
irsanjul 0:d51588bf1724 494 #define ST7036_SA1 0x7A
irsanjul 0:d51588bf1724 495 #define ST7036_SA2 0x7C
irsanjul 0:d51588bf1724 496 #define ST7036_SA3 0x7E
irsanjul 0:d51588bf1724 497
irsanjul 0:d51588bf1724 498 /* ST7066_ACM I2C slave address, Added for ACM1602 module */
irsanjul 0:d51588bf1724 499 #define ST7066_SA0 0xA0
irsanjul 0:d51588bf1724 500
irsanjul 0:d51588bf1724 501 /* PCF21XX I2C slave address */
irsanjul 0:d51588bf1724 502 #define PCF21XX_SA0 0x74
irsanjul 0:d51588bf1724 503 #define PCF21XX_SA1 0x76
irsanjul 0:d51588bf1724 504
irsanjul 0:d51588bf1724 505 /* AIP31068 I2C slave address */
irsanjul 0:d51588bf1724 506 #define AIP31068_SA 0x7C
irsanjul 0:d51588bf1724 507
irsanjul 0:d51588bf1724 508 /* SSD1803 I2C slave address */
irsanjul 0:d51588bf1724 509 #define SSD1803_SA0 0x78
irsanjul 0:d51588bf1724 510 #define SSD1803_SA1 0x7A
irsanjul 0:d51588bf1724 511
irsanjul 0:d51588bf1724 512 /* US2066/SSD1311 I2C slave address */
irsanjul 0:d51588bf1724 513 #define US2066_SA0 0x78
irsanjul 0:d51588bf1724 514 #define US2066_SA1 0x7A
irsanjul 0:d51588bf1724 515
irsanjul 0:d51588bf1724 516 /* AC780 I2C slave address */
irsanjul 0:d51588bf1724 517 #define AC780_SA0 0x78
irsanjul 0:d51588bf1724 518 #define AC780_SA1 0x7A
irsanjul 0:d51588bf1724 519 #define AC780_SA2 0x7C
irsanjul 0:d51588bf1724 520 #define AC780_SA3 0x7E
irsanjul 0:d51588bf1724 521
irsanjul 0:d51588bf1724 522 /* SPLC792A is clone of ST7032i */
irsanjul 0:d51588bf1724 523 #define SPLC792A_SA0 0x78
irsanjul 0:d51588bf1724 524 #define SPLC792A_SA1 0x7A
irsanjul 0:d51588bf1724 525 #define SPLC792A_SA2 0x7C
irsanjul 0:d51588bf1724 526 #define SPLC792A_SA3 0x7E
irsanjul 0:d51588bf1724 527
irsanjul 0:d51588bf1724 528 //Some native I2C controllers dont support ACK. Set define to '0' to allow code to proceed even without ACK
irsanjul 0:d51588bf1724 529 //#define LCD_I2C_ACK 0
irsanjul 0:d51588bf1724 530 #define LCD_I2C_ACK 1
irsanjul 0:d51588bf1724 531
irsanjul 0:d51588bf1724 532
irsanjul 0:d51588bf1724 533 // Contrast setting, 6 significant bits (only supported for controllers with extended features)
irsanjul 0:d51588bf1724 534 // Voltage Multiplier setting, 2 or 3 significant bits (only supported for controllers with extended features)
irsanjul 0:d51588bf1724 535 #define LCD_DEF_CONTRAST 0x20
irsanjul 0:d51588bf1724 536
irsanjul 0:d51588bf1724 537 //ST7032 EastRising ERC1602FS-4 display
irsanjul 0:d51588bf1724 538 //Contrast setting 6 significant bits (0..63)
irsanjul 0:d51588bf1724 539 //Voltage Multiplier setting 3 significant bits:
irsanjul 0:d51588bf1724 540 // 0: 1.818V
irsanjul 0:d51588bf1724 541 // 1: 2.222V
irsanjul 0:d51588bf1724 542 // 2: 2.667V
irsanjul 0:d51588bf1724 543 // 3: 3.333V
irsanjul 0:d51588bf1724 544 // 4: 3.636V (ST7032 default)
irsanjul 0:d51588bf1724 545 // 5: 4.000V
irsanjul 0:d51588bf1724 546 // 6: 4.444V
irsanjul 0:d51588bf1724 547 // 7: 5.000V
irsanjul 0:d51588bf1724 548 #define LCD_ST7032_CONTRAST 0x28
irsanjul 0:d51588bf1724 549 #define LCD_ST7032_RAB 0x04
irsanjul 0:d51588bf1724 550
irsanjul 0:d51588bf1724 551 //ST7036 EA DOGM1603 display
irsanjul 0:d51588bf1724 552 //Contrast setting 6 significant bits
irsanjul 0:d51588bf1724 553 //Voltage Multiplier setting 3 significant bits
irsanjul 0:d51588bf1724 554 #define LCD_ST7036_CONTRAST 0x28
irsanjul 0:d51588bf1724 555 #define LCD_ST7036_RAB 0x04
irsanjul 0:d51588bf1724 556
irsanjul 0:d51588bf1724 557 //SSD1803 EA DOGM204 display
irsanjul 0:d51588bf1724 558 //Contrast setting 6 significant bits
irsanjul 0:d51588bf1724 559 //Voltage Multiplier setting 3 significant bits
irsanjul 0:d51588bf1724 560 #define LCD_SSD1_CONTRAST 0x28
irsanjul 0:d51588bf1724 561 #define LCD_SSD1_RAB 0x06
irsanjul 0:d51588bf1724 562
irsanjul 0:d51588bf1724 563 //US2066/SSD1311 EastRising ER-OLEDM2002-4 display
irsanjul 0:d51588bf1724 564 //Contrast setting 8 significant bits, use 6 for compatibility
irsanjul 0:d51588bf1724 565 #define LCD_US20_CONTRAST 0x3F
irsanjul 0:d51588bf1724 566 //#define LCD_US20_CONTRAST 0x1F
irsanjul 0:d51588bf1724 567
irsanjul 0:d51588bf1724 568 //PCF2113, PCF2119 display
irsanjul 0:d51588bf1724 569 //Contrast setting 6 significant bits
irsanjul 0:d51588bf1724 570 //Voltage Multiplier setting 2 significant bits
irsanjul 0:d51588bf1724 571 #define LCD_PCF2_CONTRAST 0x20
irsanjul 0:d51588bf1724 572 #define LCD_PCF2_S12 0x02
irsanjul 0:d51588bf1724 573
irsanjul 0:d51588bf1724 574 //PT6314 VFD display
irsanjul 0:d51588bf1724 575 //Contrast setting 2 significant bits, use 6 for compatibility
irsanjul 0:d51588bf1724 576 #define LCD_PT63_CONTRAST 0x3F
irsanjul 0:d51588bf1724 577
irsanjul 0:d51588bf1724 578 //SPLC792A is clone of ST7032i
irsanjul 0:d51588bf1724 579 //Contrast setting 6 significant bits (0..63)
irsanjul 0:d51588bf1724 580 //Voltage Multiplier setting 3 significant bits:
irsanjul 0:d51588bf1724 581 // 0: 1.818V
irsanjul 0:d51588bf1724 582 // 1: 2.222V
irsanjul 0:d51588bf1724 583 // 2: 2.667V
irsanjul 0:d51588bf1724 584 // 3: 3.333V (SPLC792A default)
irsanjul 0:d51588bf1724 585 // 4: 3.636V
irsanjul 0:d51588bf1724 586 // 5: 4.000V
irsanjul 0:d51588bf1724 587 // 6: 4.444V
irsanjul 0:d51588bf1724 588 // 7: 5.000V
irsanjul 0:d51588bf1724 589 #define LCD_SPLC792A_CONTRAST 0x28
irsanjul 0:d51588bf1724 590 #define LCD_SPLC792A_RAB 0x04
irsanjul 0:d51588bf1724 591
irsanjul 0:d51588bf1724 592 #endif //MBED_TEXTLCDCONFIG_H