Version 6 of dooropener

Dependents:   Opener-6

Fork of TextLCD by Wim Huiskamp

Committer:
Martin1000
Date:
Mon Apr 16 12:07:16 2018 +0000
Revision:
42:b6b021d760d7
Parent:
37:ce348c002929
Version 6 of door opener

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
wim 34:e5a0dcb43ecc 8 *
wim 34:e5a0dcb43ecc 9 * Permission is hereby granted, free of charge, to any person obtaining a copy
wim 34:e5a0dcb43ecc 10 * of this software and associated documentation files (the "Software"), to deal
wim 34:e5a0dcb43ecc 11 * in the Software without restriction, including without limitation the rights
wim 34:e5a0dcb43ecc 12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
wim 34:e5a0dcb43ecc 13 * copies of the Software, and to permit persons to whom the Software is
wim 34:e5a0dcb43ecc 14 * furnished to do so, subject to the following conditions:
wim 34:e5a0dcb43ecc 15 *
wim 34:e5a0dcb43ecc 16 * The above copyright notice and this permission notice shall be included in
wim 34:e5a0dcb43ecc 17 * all copies or substantial portions of the Software.
wim 34:e5a0dcb43ecc 18 *
wim 34:e5a0dcb43ecc 19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
wim 34:e5a0dcb43ecc 20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
wim 34:e5a0dcb43ecc 21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
wim 34:e5a0dcb43ecc 22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
wim 34:e5a0dcb43ecc 23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
wim 34:e5a0dcb43ecc 24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
wim 34:e5a0dcb43ecc 25 * THE SOFTWARE.
wim 34:e5a0dcb43ecc 26 */
wim 34:e5a0dcb43ecc 27 #ifndef MBED_TEXTLCDCONFIG_H
wim 34:e5a0dcb43ecc 28 #define MBED_TEXTLCDCONFIG_H
wim 34:e5a0dcb43ecc 29
wim 34:e5a0dcb43ecc 30 //Select hardware interface options to reduce memory footprint (multiple options allowed)
wim 34:e5a0dcb43ecc 31 #define LCD_I2C 1 /* I2C Expander PCF8574/MCP23008 */
wim 34:e5a0dcb43ecc 32 #define LCD_SPI 1 /* SPI Expander SN74595 */
wim 34:e5a0dcb43ecc 33 #define LCD_I2C_N 1 /* Native I2C bus */
wim 35:311be6444a39 34 #define LCD_SPI_N 1 /* Native SPI bus */
wim 36:9f5f86dfd44a 35 #define LCD_SPI_N_3_8 1 /* Native SPI bus */
wim 34:e5a0dcb43ecc 36 #define LCD_SPI_N_3_9 1 /* Native SPI bus */
wim 34:e5a0dcb43ecc 37 #define LCD_SPI_N_3_10 1 /* Native SPI bus */
wim 34:e5a0dcb43ecc 38 #define LCD_SPI_N_3_16 1 /* Native SPI bus */
wim 34:e5a0dcb43ecc 39 #define LCD_SPI_N_3_24 1 /* Native SPI bus */
wim 35:311be6444a39 40
wim 34:e5a0dcb43ecc 41 //Select options to reduce memory footprint (multiple options allowed)
wim 34:e5a0dcb43ecc 42 #define LCD_UDC 1 /* Enable predefined UDC example*/
wim 34:e5a0dcb43ecc 43 #define LCD_PRINTF 1 /* Enable Stream implementation */
wim 34:e5a0dcb43ecc 44
wim 37:ce348c002929 45 //Select option to activate default fonttable or alternatively use conversion for specific controller versions (eg PCF2119C)
wim 37:ce348c002929 46 #define LCD_DEFAULT_FONT 1
wim 37:ce348c002929 47
wim 34:e5a0dcb43ecc 48 //Pin Defines for I2C PCF8574/PCF8574A or MCP23008 and SPI 74595 bus expander interfaces
wim 37:ce348c002929 49 //Different commercially available LCD portexpanders use different wiring conventions.
wim 37:ce348c002929 50 //LCD and serial portexpanders should be wired according to the tables below.
wim 34:e5a0dcb43ecc 51 //
wim 37:ce348c002929 52 //Select Serial Port Expander Hardware module (one option only)
wim 34:e5a0dcb43ecc 53 #define DEFAULT 1
wim 34:e5a0dcb43ecc 54 #define ADAFRUIT 0
wim 34:e5a0dcb43ecc 55 #define DFROBOT 0
wim 35:311be6444a39 56 #define YWROBOT 0
wim 35:311be6444a39 57 #define GYLCD 0
wim 35:311be6444a39 58 #define SYDZ 0
wim 34:e5a0dcb43ecc 59
wim 34:e5a0dcb43ecc 60 #if (DEFAULT==1)
wim 34:e5a0dcb43ecc 61 //Definitions for default (WH) mapping between serial port expander pins and LCD controller
wim 34:e5a0dcb43ecc 62 //This hardware supports the I2C bus expander (PCF8574/PCF8574A or MCP23008) and SPI bus expander (74595) interfaces
wim 34:e5a0dcb43ecc 63 //See https://mbed.org/cookbook/Text-LCD-Enhanced
wim 34:e5a0dcb43ecc 64 //
wim 34:e5a0dcb43ecc 65 //Note: LCD RW pin must be connected to GND
wim 34:e5a0dcb43ecc 66 // E2 is used for LCD40x4 (second controller)
wim 34:e5a0dcb43ecc 67 // BL may be used to control backlight
Martin1000 42:b6b021d760d7 68
Martin1000 42:b6b021d760d7 69
Martin1000 42:b6b021d760d7 70
Martin1000 42:b6b021d760d7 71
Martin1000 42:b6b021d760d7 72
Martin1000 42:b6b021d760d7 73
Martin1000 42:b6b021d760d7 74
wim 34:e5a0dcb43ecc 75 #define D_LCD_PIN_D4 0
wim 34:e5a0dcb43ecc 76 #define D_LCD_PIN_D5 1
wim 34:e5a0dcb43ecc 77 #define D_LCD_PIN_D6 2
wim 34:e5a0dcb43ecc 78 #define D_LCD_PIN_D7 3
wim 34:e5a0dcb43ecc 79 #define D_LCD_PIN_RS 4
wim 34:e5a0dcb43ecc 80 #define D_LCD_PIN_E 5
wim 34:e5a0dcb43ecc 81 #define D_LCD_PIN_E2 6
wim 34:e5a0dcb43ecc 82 #define D_LCD_PIN_BL 7
wim 34:e5a0dcb43ecc 83
wim 34:e5a0dcb43ecc 84 #define D_LCD_PIN_RW D_LCD_PIN_E2
wim 34:e5a0dcb43ecc 85
wim 34:e5a0dcb43ecc 86 //Select I2C Portexpander type (one option only)
wim 34:e5a0dcb43ecc 87 #define PCF8574 1
wim 34:e5a0dcb43ecc 88 #define MCP23008 0
wim 35:311be6444a39 89
wim 35:311be6444a39 90 //Inverted Backlight control
wim 35:311be6444a39 91 #define BACKLIGHT_INV 0
wim 34:e5a0dcb43ecc 92 #endif
wim 34:e5a0dcb43ecc 93
wim 34:e5a0dcb43ecc 94 #if (ADAFRUIT==1)
wim 34:e5a0dcb43ecc 95 //Definitions for Adafruit i2cspilcdbackpack mapping between serial port expander pins and LCD controller
wim 34:e5a0dcb43ecc 96 //This hardware supports both an I2C expander (MCP23008) and an SPI expander (74595) selectable by a jumper.
wim 35:311be6444a39 97 //Slaveaddress may be set by solderbridges (default 0x40). SDA/SCL has pullup Resistors onboard.
wim 34:e5a0dcb43ecc 98 //See http://www.ladyada.net/products/i2cspilcdbackpack
wim 34:e5a0dcb43ecc 99 //
wim 34:e5a0dcb43ecc 100 //Note: LCD RW pin must be kept LOW
wim 34:e5a0dcb43ecc 101 // E2 is not available on this hardware and so it does not support LCD40x4 (second controller)
wim 34:e5a0dcb43ecc 102 // BL is used to control backlight
wim 34:e5a0dcb43ecc 103 #define D_LCD_PIN_0 0
wim 34:e5a0dcb43ecc 104 #define D_LCD_PIN_RS 1
wim 34:e5a0dcb43ecc 105 #define D_LCD_PIN_E 2
wim 34:e5a0dcb43ecc 106 #define D_LCD_PIN_D4 3
wim 34:e5a0dcb43ecc 107 #define D_LCD_PIN_D5 4
wim 34:e5a0dcb43ecc 108 #define D_LCD_PIN_D6 5
wim 34:e5a0dcb43ecc 109 #define D_LCD_PIN_D7 6
wim 34:e5a0dcb43ecc 110 #define D_LCD_PIN_BL 7
wim 34:e5a0dcb43ecc 111
wim 34:e5a0dcb43ecc 112 #define D_LCD_PIN_E2 D_LCD_PIN_0
wim 34:e5a0dcb43ecc 113
wim 34:e5a0dcb43ecc 114 //Force I2C portexpander type
wim 34:e5a0dcb43ecc 115 #define PCF8574 0
wim 34:e5a0dcb43ecc 116 #define MCP23008 1
wim 35:311be6444a39 117
wim 35:311be6444a39 118 //Inverted Backlight control
wim 35:311be6444a39 119 #define BACKLIGHT_INV 0
wim 34:e5a0dcb43ecc 120 #endif
wim 34:e5a0dcb43ecc 121
wim 34:e5a0dcb43ecc 122 #if (DFROBOT==1)
wim 34:e5a0dcb43ecc 123 //Definitions for DFROBOT LCD2004 Module mapping between serial port expander pins and LCD controller
wim 34:e5a0dcb43ecc 124 //This hardware uses PCF8574 and is different from earlier/different Arduino I2C LCD displays
wim 35:311be6444a39 125 //Slaveaddress hardwired to 0x4E. SDA/SCL has pullup Resistors onboard.
wim 35:311be6444a39 126 //See http://arduino-info.wikispaces.com/LCD-Blue-I2C
wim 35:311be6444a39 127 //
wim 35:311be6444a39 128 //Definitions for DFROBOT V1.1
wim 35:311be6444a39 129 //This hardware uses PCF8574. Slaveaddress may be set by jumpers (default 0x40).
wim 35:311be6444a39 130 //SDA/SCL has pullup Resistors onboard and features a voltage level converter 3V3 <-> 5V.
wim 35:311be6444a39 131 //See http://www.dfrobot.com/index.php?route=product/product&product_id=135
wim 35:311be6444a39 132 //
wim 35:311be6444a39 133 //
wim 35:311be6444a39 134 //Note: LCD RW pin must be kept LOW
wim 35:311be6444a39 135 // E2 is not available on default Arduino hardware and so it does not support LCD40x4 (second controller)
wim 35:311be6444a39 136 // BL is used to control backlight
wim 35:311be6444a39 137 #define D_LCD_PIN_RS 0
wim 35:311be6444a39 138 #define D_LCD_PIN_RW 1
wim 35:311be6444a39 139 #define D_LCD_PIN_E 2
wim 35:311be6444a39 140 #define D_LCD_PIN_BL 3
wim 35:311be6444a39 141 #define D_LCD_PIN_D4 4
wim 35:311be6444a39 142 #define D_LCD_PIN_D5 5
wim 35:311be6444a39 143 #define D_LCD_PIN_D6 6
wim 35:311be6444a39 144 #define D_LCD_PIN_D7 7
wim 35:311be6444a39 145
wim 35:311be6444a39 146 #define D_LCD_PIN_E2 D_LCD_PIN_RW
wim 35:311be6444a39 147
wim 35:311be6444a39 148 //Force I2C portexpander type
wim 35:311be6444a39 149 #define PCF8574 1
wim 35:311be6444a39 150 #define MCP23008 0
wim 35:311be6444a39 151
wim 35:311be6444a39 152 //Inverted Backlight control
wim 35:311be6444a39 153 #define BACKLIGHT_INV 0
wim 35:311be6444a39 154 #endif
wim 35:311be6444a39 155
wim 35:311be6444a39 156 #if (YWROBOT==1)
wim 35:311be6444a39 157 //Definitions for YWROBOT LCM1602 V1 Module mapping between serial port expander pins and LCD controller.
wim 35:311be6444a39 158 //Very similar to DFROBOT. This hardware uses PCF8574.
wim 35:311be6444a39 159 //Slaveaddress may be set by solderbridges (default 0x4E). SDA/SCL has no pullup Resistors onboard.
wim 34:e5a0dcb43ecc 160 //See http://arduino-info.wikispaces.com/LCD-Blue-I2C
wim 34:e5a0dcb43ecc 161 //
wim 34:e5a0dcb43ecc 162 //Note: LCD RW pin must be kept LOW
wim 35:311be6444a39 163 // E2 is not available on default hardware and so it does not support LCD40x4 (second controller)
wim 34:e5a0dcb43ecc 164 // BL is used to control backlight, reverse logic: Low turns on Backlight. This is handled in setBacklight()
wim 34:e5a0dcb43ecc 165 #define D_LCD_PIN_RS 0
wim 34:e5a0dcb43ecc 166 #define D_LCD_PIN_RW 1
wim 34:e5a0dcb43ecc 167 #define D_LCD_PIN_E 2
wim 34:e5a0dcb43ecc 168 #define D_LCD_PIN_BL 3
wim 34:e5a0dcb43ecc 169 #define D_LCD_PIN_D4 4
wim 34:e5a0dcb43ecc 170 #define D_LCD_PIN_D5 5
wim 34:e5a0dcb43ecc 171 #define D_LCD_PIN_D6 6
wim 34:e5a0dcb43ecc 172 #define D_LCD_PIN_D7 7
wim 34:e5a0dcb43ecc 173
wim 34:e5a0dcb43ecc 174 #define D_LCD_PIN_E2 D_LCD_PIN_RW
wim 34:e5a0dcb43ecc 175
wim 34:e5a0dcb43ecc 176 //Force I2C portexpander type
wim 34:e5a0dcb43ecc 177 #define PCF8574 1
wim 34:e5a0dcb43ecc 178 #define MCP23008 0
wim 35:311be6444a39 179
wim 35:311be6444a39 180 //Inverted Backlight control
wim 35:311be6444a39 181 #define BACKLIGHT_INV 0
wim 34:e5a0dcb43ecc 182 #endif
wim 34:e5a0dcb43ecc 183
wim 35:311be6444a39 184 #if (GYLCD==1)
wim 35:311be6444a39 185 //Definitions for Arduino-IIC-LCD GY-LCD-V1 Module mapping between serial port expander pins and LCD controller.
wim 35:311be6444a39 186 //Very similar to DFROBOT. This hardware uses PCF8574.
wim 35:311be6444a39 187 //Slaveaddress may be set by solderbridges (default 0x4E). SDA/SCL has pullup Resistors onboard.
wim 35:311be6444a39 188 //See http://arduino-info.wikispaces.com/LCD-Blue-I2C
wim 35:311be6444a39 189 //
wim 35:311be6444a39 190 //Note: LCD RW pin must be kept LOW
wim 35:311be6444a39 191 // E2 is not available on default hardware and so it does not support LCD40x4 (second controller)
wim 35:311be6444a39 192 // BL is used to control backlight, reverse logic: Low turns on Backlight. This is handled in setBacklight()
wim 35:311be6444a39 193 #define D_LCD_PIN_D4 0
wim 35:311be6444a39 194 #define D_LCD_PIN_D5 1
wim 35:311be6444a39 195 #define D_LCD_PIN_D6 2
wim 35:311be6444a39 196 #define D_LCD_PIN_D7 3
wim 35:311be6444a39 197 #define D_LCD_PIN_EN 4
wim 35:311be6444a39 198 #define D_LCD_PIN_RW 5
wim 35:311be6444a39 199 #define D_LCD_PIN_RS 6
wim 35:311be6444a39 200 #define D_LCD_PIN_BL 7
wim 35:311be6444a39 201
wim 35:311be6444a39 202 #define D_LCD_PIN_E2 D_LCD_PIN_RW
wim 35:311be6444a39 203
wim 35:311be6444a39 204 //Force I2C portexpander type
wim 35:311be6444a39 205 #define PCF8574 1
wim 35:311be6444a39 206 #define MCP23008 0
wim 35:311be6444a39 207
wim 35:311be6444a39 208 //Force Inverted Backlight control
wim 35:311be6444a39 209 #define BACKLIGHT_INV 1
wim 35:311be6444a39 210 #endif
wim 35:311be6444a39 211
wim 35:311be6444a39 212 #if (SYDZ==1)
wim 35:311be6444a39 213 //Definitions for SYDZ Module mapping between serial port expander pins and LCD controller.
wim 35:311be6444a39 214 //Very similar to DFROBOT. This hardware uses PCF8574A and uses inverted Backlight control
wim 35:311be6444a39 215 //Slaveaddress may be set by switches (default 0x40). SDA/SCL has pullup Resistors onboard.
wim 35:311be6444a39 216 //See ebay
wim 35:311be6444a39 217 //
wim 35:311be6444a39 218 //Note: LCD RW pin must be kept LOW
wim 35:311be6444a39 219 // E2 is not available on default hardware and so it does not support LCD40x4 (second controller)
wim 35:311be6444a39 220 // BL is used to control backlight, reverse logic: Low turns on Backlight. This is handled in setBacklight()
wim 35:311be6444a39 221 #define D_LCD_PIN_RS 0
wim 35:311be6444a39 222 #define D_LCD_PIN_RW 1
wim 35:311be6444a39 223 #define D_LCD_PIN_E 2
wim 35:311be6444a39 224 #define D_LCD_PIN_BL 3
wim 35:311be6444a39 225 #define D_LCD_PIN_D4 4
wim 35:311be6444a39 226 #define D_LCD_PIN_D5 5
wim 35:311be6444a39 227 #define D_LCD_PIN_D6 6
wim 35:311be6444a39 228 #define D_LCD_PIN_D7 7
wim 35:311be6444a39 229
wim 35:311be6444a39 230 #define D_LCD_PIN_E2 D_LCD_PIN_RW
wim 35:311be6444a39 231
wim 35:311be6444a39 232 //Force I2C portexpander type
wim 35:311be6444a39 233 #define PCF8574 1
wim 35:311be6444a39 234 #define MCP23008 0
wim 35:311be6444a39 235
wim 35:311be6444a39 236 //Force Inverted Backlight control
wim 35:311be6444a39 237 #define BACKLIGHT_INV 1
wim 35:311be6444a39 238 #endif
wim 34:e5a0dcb43ecc 239
wim 34:e5a0dcb43ecc 240 //Bitpattern Defines for I2C PCF8574/PCF8574A, MCP23008 and SPI 74595 Bus expanders
wim 37:ce348c002929 241 //Don't change!
wim 34:e5a0dcb43ecc 242 //
Martin1000 42:b6b021d760d7 243
Martin1000 42:b6b021d760d7 244 /*
Martin1000 42:b6b021d760d7 245 / Achtung: geänderter Header für sunfounder 20 * 4 Display!
Martin1000 42:b6b021d760d7 246
Martin1000 42:b6b021d760d7 247 #define LCD_BUS_I2C_D4 (1 << 4)
Martin1000 42:b6b021d760d7 248 #define LCD_BUS_I2C_D5 (1 << 5)
Martin1000 42:b6b021d760d7 249 #define LCD_BUS_I2C_D6 (1 << 6)
Martin1000 42:b6b021d760d7 250 #define LCD_BUS_I2C_D7 (1 << 7)
Martin1000 42:b6b021d760d7 251 #define LCD_BUS_I2C_RS (1 << 0)
Martin1000 42:b6b021d760d7 252 #define LCD_BUS_I2C_E (1 << 2)
Martin1000 42:b6b021d760d7 253 #define LCD_BUS_I2C_E2 (1 << 1)
Martin1000 42:b6b021d760d7 254 #define LCD_BUS_I2C_BL (1 << 3)
Martin1000 42:b6b021d760d7 255
Martin1000 42:b6b021d760d7 256 #define LCD_BUS_I2C_RW (1 << 1)
Martin1000 42:b6b021d760d7 257
Martin1000 42:b6b021d760d7 258 */
Martin1000 42:b6b021d760d7 259
Martin1000 42:b6b021d760d7 260
Martin1000 42:b6b021d760d7 261
Martin1000 42:b6b021d760d7 262 /* Original
Martin1000 42:b6b021d760d7 263
wim 34:e5a0dcb43ecc 264 #define D_LCD_D4 (1<<D_LCD_PIN_D4)
wim 34:e5a0dcb43ecc 265 #define D_LCD_D5 (1<<D_LCD_PIN_D5)
wim 34:e5a0dcb43ecc 266 #define D_LCD_D6 (1<<D_LCD_PIN_D6)
wim 34:e5a0dcb43ecc 267 #define D_LCD_D7 (1<<D_LCD_PIN_D7)
wim 34:e5a0dcb43ecc 268 #define D_LCD_RS (1<<D_LCD_PIN_RS)
wim 34:e5a0dcb43ecc 269 #define D_LCD_E (1<<D_LCD_PIN_E)
wim 34:e5a0dcb43ecc 270 #define D_LCD_E2 (1<<D_LCD_PIN_E2)
wim 34:e5a0dcb43ecc 271 #define D_LCD_BL (1<<D_LCD_PIN_BL)
Martin1000 42:b6b021d760d7 272
Martin1000 42:b6b021d760d7 273 */
Martin1000 42:b6b021d760d7 274 // Kopie
Martin1000 42:b6b021d760d7 275
Martin1000 42:b6b021d760d7 276 #define D_LCD_D4 (1<< 4)
Martin1000 42:b6b021d760d7 277 #define D_LCD_D5 (1<< 5)
Martin1000 42:b6b021d760d7 278 #define D_LCD_D6 (1<< 6)
Martin1000 42:b6b021d760d7 279 #define D_LCD_D7 (1<< 7)
Martin1000 42:b6b021d760d7 280 #define D_LCD_RS (1<< 0)
Martin1000 42:b6b021d760d7 281 #define D_LCD_E (1<< 2)
Martin1000 42:b6b021d760d7 282 #define D_LCD_E2 (1<< 1)
Martin1000 42:b6b021d760d7 283 #define D_LCD_BL (1<< 3)
Martin1000 42:b6b021d760d7 284
Martin1000 42:b6b021d760d7 285
Martin1000 42:b6b021d760d7 286 #define D_LCD_RW (1<< 1)
wim 34:e5a0dcb43ecc 287
wim 34:e5a0dcb43ecc 288 #define D_LCD_BUS_MSK (D_LCD_D4 | D_LCD_D5 | D_LCD_D6 | D_LCD_D7)
wim 34:e5a0dcb43ecc 289 #define D_LCD_BUS_DEF 0x00
wim 34:e5a0dcb43ecc 290
wim 34:e5a0dcb43ecc 291 /* PCF8574/PCF8574A I2C portexpander slave address */
wim 34:e5a0dcb43ecc 292 #define PCF8574_SA0 0x40
wim 34:e5a0dcb43ecc 293 #define PCF8574_SA1 0x42
wim 34:e5a0dcb43ecc 294 #define PCF8574_SA2 0x44
wim 34:e5a0dcb43ecc 295 #define PCF8574_SA3 0x46
wim 34:e5a0dcb43ecc 296 #define PCF8574_SA4 0x48
wim 34:e5a0dcb43ecc 297 #define PCF8574_SA5 0x4A
wim 34:e5a0dcb43ecc 298 #define PCF8574_SA6 0x4C
wim 34:e5a0dcb43ecc 299 #define PCF8574_SA7 0x4E
wim 34:e5a0dcb43ecc 300
wim 34:e5a0dcb43ecc 301 #define PCF8574A_SA0 0x70
wim 34:e5a0dcb43ecc 302 #define PCF8574A_SA1 0x72
wim 34:e5a0dcb43ecc 303 #define PCF8574A_SA2 0x74
wim 34:e5a0dcb43ecc 304 #define PCF8574A_SA3 0x76
wim 34:e5a0dcb43ecc 305 #define PCF8574A_SA4 0x78
wim 34:e5a0dcb43ecc 306 #define PCF8574A_SA5 0x7A
wim 34:e5a0dcb43ecc 307 #define PCF8574A_SA6 0x7C
wim 34:e5a0dcb43ecc 308 #define PCF8574A_SA7 0x7E
wim 34:e5a0dcb43ecc 309
wim 34:e5a0dcb43ecc 310 /* MCP23008 I2C portexpander slave address */
wim 34:e5a0dcb43ecc 311 #define MCP23008_SA0 0x40
wim 34:e5a0dcb43ecc 312 #define MCP23008_SA1 0x42
wim 34:e5a0dcb43ecc 313 #define MCP23008_SA2 0x44
wim 34:e5a0dcb43ecc 314 #define MCP23008_SA3 0x46
wim 34:e5a0dcb43ecc 315 #define MCP23008_SA4 0x48
wim 34:e5a0dcb43ecc 316 #define MCP23008_SA5 0x4A
wim 34:e5a0dcb43ecc 317 #define MCP23008_SA6 0x4C
wim 34:e5a0dcb43ecc 318 #define MCP23008_SA7 0x4E
wim 34:e5a0dcb43ecc 319
wim 34:e5a0dcb43ecc 320 /* MCP23008 I2C portexpander internal registers */
wim 34:e5a0dcb43ecc 321 #define IODIR 0x00
wim 34:e5a0dcb43ecc 322 #define IPOL 0x01
wim 34:e5a0dcb43ecc 323 #define GPINTEN 0x02
wim 34:e5a0dcb43ecc 324 #define DEFVAL 0x03
wim 34:e5a0dcb43ecc 325 #define INTCON 0x04
wim 34:e5a0dcb43ecc 326 #define IOCON 0x05
wim 34:e5a0dcb43ecc 327 #define GPPU 0x06
wim 34:e5a0dcb43ecc 328 #define INTF 0x07
wim 34:e5a0dcb43ecc 329 #define INTCAP 0x08
wim 34:e5a0dcb43ecc 330 #define GPIO 0x09
wim 34:e5a0dcb43ecc 331 #define OLAT 0x0A
wim 34:e5a0dcb43ecc 332
wim 34:e5a0dcb43ecc 333 /* ST7032i I2C slave address */
wim 34:e5a0dcb43ecc 334 #define ST7032_SA 0x7C
wim 34:e5a0dcb43ecc 335
wim 34:e5a0dcb43ecc 336 /* ST7036i I2C slave address */
wim 34:e5a0dcb43ecc 337 #define ST7036_SA0 0x78
wim 34:e5a0dcb43ecc 338 #define ST7036_SA1 0x7A
wim 34:e5a0dcb43ecc 339 #define ST7036_SA2 0x7C
wim 34:e5a0dcb43ecc 340 #define ST7036_SA3 0x7E
wim 34:e5a0dcb43ecc 341
wim 37:ce348c002929 342 /* ST7066_ACM I2C slave address, Added for ACM1602 module */
wim 37:ce348c002929 343 #define ST7066_SA0 0xA0
wim 37:ce348c002929 344
wim 34:e5a0dcb43ecc 345 /* PCF21XX I2C slave address */
wim 34:e5a0dcb43ecc 346 #define PCF21XX_SA0 0x74
wim 34:e5a0dcb43ecc 347 #define PCF21XX_SA1 0x76
wim 34:e5a0dcb43ecc 348
wim 34:e5a0dcb43ecc 349 /* AIP31068 I2C slave address */
wim 34:e5a0dcb43ecc 350 #define AIP31068_SA 0x7C
wim 34:e5a0dcb43ecc 351
wim 34:e5a0dcb43ecc 352 /* SSD1803 I2C slave address */
wim 34:e5a0dcb43ecc 353 #define SSD1803_SA0 0x78
wim 34:e5a0dcb43ecc 354 #define SSD1803_SA1 0x7A
wim 34:e5a0dcb43ecc 355
wim 34:e5a0dcb43ecc 356 /* US2066/SSD1311 I2C slave address */
wim 34:e5a0dcb43ecc 357 #define US2066_SA0 0x78
wim 34:e5a0dcb43ecc 358 #define US2066_SA1 0x7A
wim 34:e5a0dcb43ecc 359
wim 34:e5a0dcb43ecc 360 /* AC780 I2C slave address */
wim 34:e5a0dcb43ecc 361 #define AC780_SA0 0x78
wim 34:e5a0dcb43ecc 362 #define AC780_SA1 0x7A
wim 34:e5a0dcb43ecc 363 #define AC780_SA2 0x7C
wim 34:e5a0dcb43ecc 364 #define AC780_SA3 0x7E
wim 34:e5a0dcb43ecc 365
wim 34:e5a0dcb43ecc 366 //Some native I2C controllers dont support ACK. Set define to '0' to allow code to proceed even without ACK
wim 34:e5a0dcb43ecc 367 //#define LCD_I2C_ACK 0
wim 34:e5a0dcb43ecc 368 #define LCD_I2C_ACK 1
wim 34:e5a0dcb43ecc 369
wim 34:e5a0dcb43ecc 370
wim 34:e5a0dcb43ecc 371 // Contrast setting, 6 significant bits (only supported for controllers with extended features)
wim 34:e5a0dcb43ecc 372 // Voltage Multiplier setting, 2 or 3 significant bits (only supported for controllers with extended features)
wim 34:e5a0dcb43ecc 373 #define LCD_DEF_CONTRAST 0x20
wim 34:e5a0dcb43ecc 374
wim 34:e5a0dcb43ecc 375 //ST7032 EastRising ERC1602FS-4 display
wim 34:e5a0dcb43ecc 376 //Contrast setting 6 significant bits
wim 34:e5a0dcb43ecc 377 //Voltage Multiplier setting 3 significant bits
wim 37:ce348c002929 378 #define LCD_ST7032_CONTRAST 0x28
wim 34:e5a0dcb43ecc 379 #define LCD_ST7032_RAB 0x04
wim 34:e5a0dcb43ecc 380
wim 34:e5a0dcb43ecc 381 //ST7036 EA DOGM1603 display
wim 34:e5a0dcb43ecc 382 //Contrast setting 6 significant bits
wim 34:e5a0dcb43ecc 383 //Voltage Multiplier setting 3 significant bits
wim 34:e5a0dcb43ecc 384 #define LCD_ST7036_CONTRAST 0x28
wim 34:e5a0dcb43ecc 385 #define LCD_ST7036_RAB 0x04
wim 34:e5a0dcb43ecc 386
wim 34:e5a0dcb43ecc 387 //SSD1803 EA DOGM204 display
wim 34:e5a0dcb43ecc 388 //Contrast setting 6 significant bits
wim 34:e5a0dcb43ecc 389 //Voltage Multiplier setting 3 significant bits
wim 34:e5a0dcb43ecc 390 #define LCD_SSD1_CONTRAST 0x28
wim 34:e5a0dcb43ecc 391 #define LCD_SSD1_RAB 0x06
wim 34:e5a0dcb43ecc 392
wim 34:e5a0dcb43ecc 393 //US2066/SSD1311 EastRising ER-OLEDM2002-4 display
wim 34:e5a0dcb43ecc 394 //Contrast setting 8 significant bits, use 6 for compatibility
wim 34:e5a0dcb43ecc 395 #define LCD_US20_CONTRAST 0x3F
wim 34:e5a0dcb43ecc 396 //#define LCD_US20_CONTRAST 0x1F
wim 34:e5a0dcb43ecc 397
wim 34:e5a0dcb43ecc 398 //PCF2113, PCF2119 display
wim 34:e5a0dcb43ecc 399 //Contrast setting 6 significant bits
wim 34:e5a0dcb43ecc 400 //Voltage Multiplier setting 2 significant bits
wim 34:e5a0dcb43ecc 401 #define LCD_PCF2_CONTRAST 0x20
wim 34:e5a0dcb43ecc 402 #define LCD_PCF2_S12 0x02
wim 34:e5a0dcb43ecc 403
wim 34:e5a0dcb43ecc 404 //PT6314 VFD display
wim 34:e5a0dcb43ecc 405 //Contrast setting 2 significant bits, use 6 for compatibility
wim 34:e5a0dcb43ecc 406 #define LCD_PT63_CONTRAST 0x3F
wim 34:e5a0dcb43ecc 407
wim 34:e5a0dcb43ecc 408
wim 34:e5a0dcb43ecc 409 #endif //MBED_TEXTLCDCONFIG_H