JNP3 SmartAlarm / Mbed 2 deprecated budzik

Dependencies:   TextLCD nRF24L01P mbed

Committer:
jackmax
Date:
Tue Dec 20 11:40:33 2016 +0100
Revision:
3:fc871995b3fc
zxczxc

Who changed what in which revision?

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