Trying i2c LCD using TextLCD library

Fork of TextLCD by Wim Huiskamp

Committer:
rtandil
Date:
Mon Apr 10 07:48:10 2017 +0000
Revision:
42:9585a1cce408
Parent:
37:ce348c002929
First try

Who changed what in which revision?

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