tttt / TextLCD
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TextLCD_Config.h Source File

TextLCD_Config.h

00001 /* mbed TextLCD Library, for LCDs based on HD44780 controllers
00002  * Copyright (c) 2014, WH
00003  *               2014, v01: WH, Extracted from TextLCD.h as of v14
00004  *               2014, v02: WH, Added AC780 support, added I2C expander modules, fixed setBacklight() for inverted logic modules. Fixed bug in LCD_SPI_N define
00005  *               2014, v03: WH, Added LCD_SPI_N_3_8 define for ST7070
00006  *               2015, v04: WH, Added support for alternative fonttables (eg PCF21XX)
00007  *               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 
00008  *               2015, v06: WH, Performance improvement I2C portexpander
00009  *               2015, v07: WH, Fixed Adafruit I2C/SPI portexpander pinmappings, fixed SYDZ Backlight
00010  *               2015, v08: WH, Added defines to reduce memory footprint (eg LCD_ICON), added some I2C portexpander defines 
00011  *
00012  * Permission is hereby granted, free of charge, to any person obtaining a copy
00013  * of this software and associated documentation files (the "Software"), to deal
00014  * in the Software without restriction, including without limitation the rights
00015  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00016  * copies of the Software, and to permit persons to whom the Software is
00017  * furnished to do so, subject to the following conditions:
00018  *
00019  * The above copyright notice and this permission notice shall be included in
00020  * all copies or substantial portions of the Software.
00021  *
00022  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00023  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00024  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00025  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00026  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00027  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00028  * THE SOFTWARE.
00029  */
00030 #ifndef MBED_TEXTLCDCONFIG_H
00031 #define MBED_TEXTLCDCONFIG_H
00032 
00033 //Select hardware interface options to reduce memory footprint (multiple options allowed)
00034 #define LCD_I2C        1           /* I2C Expander PCF8574/MCP23008 */
00035 #define LCD_SPI        1           /* SPI Expander SN74595          */
00036 #define LCD_I2C_N      1           /* Native I2C bus     */
00037 #define LCD_SPI_N      1           /* Native SPI bus     */
00038 #define LCD_SPI_N_3_8  1           /* Native SPI bus     */
00039 #define LCD_SPI_N_3_9  1           /* Native SPI bus     */
00040 #define LCD_SPI_N_3_10 1           /* Native SPI bus     */
00041 #define LCD_SPI_N_3_16 1           /* Native SPI bus     */
00042 #define LCD_SPI_N_3_24 1           /* Native SPI bus     */
00043 
00044 //Select options to reduce memory footprint (multiple options allowed)
00045 #define LCD_UDC        1           /* Enable predefined UDC example*/
00046 #define LCD_PRINTF     1           /* Enable Stream implementation */
00047 #define LCD_ICON       1           /* Enable Icon implementation -2.0K codesize*/
00048 #define LCD_ORIENT     1           /* Enable Orientation switch implementation -0.9K codesize*/
00049 #define LCD_BIGFONT    1           /* Enable Big Font implementation -0.6K codesize */
00050 #define LCD_INVERT     1           /* Enable display Invert implementation -0.5K codesize*/
00051 #define LCD_POWER      1           /* Enable Power control implementation -0.1K codesize*/
00052 #define LCD_BLINK      1           /* Enable UDC and Icon Blink control implementation -0.8K codesize*/
00053 
00054 //Select option to activate default fonttable or alternatively use conversion for specific controller versions (eg PCF2116C, PCF2119R)
00055 #define LCD_DEF_FONT   1
00056 
00057 //Pin Defines for I2C PCF8574/PCF8574A or MCP23008 and SPI 74595 bus expander interfaces
00058 //Different commercially available LCD portexpanders use different wiring conventions.
00059 //LCD and serial portexpanders should be wired according to the tables below.
00060 //
00061 //Select Serial Port Expander Hardware module (one option only)
00062 #define DEFAULT        0
00063 #define ADAFRUIT       0
00064 #define DFROBOT        0
00065 #define LCM1602        0
00066 #define YWROBOT        1
00067 #define GYLCD          0
00068 #define MJKDZ          0
00069 #define SYDZ           0
00070 #define WIDEHK         0
00071 #define LCDPLUG        0
00072 
00073 #if (DEFAULT==1)
00074 //Definitions for default (WH) mapping between serial port expander pins and LCD controller
00075 //This hardware supports the I2C bus expander (PCF8574/PCF8574A or MCP23008) and SPI bus expander (74595) interfaces
00076 //See https://mbed.org/cookbook/Text-LCD-Enhanced
00077 //
00078 //Note: LCD RW pin must be connected to GND
00079 //      E2 is used for LCD40x4 (second controller)
00080 //      BL may be used to control backlight
00081 
00082 //I2C bus expander (PCF8574/PCF8574A or MCP23008) interface
00083 #define LCD_BUS_I2C_D4 (1 << 0)
00084 #define LCD_BUS_I2C_D5 (1 << 1)
00085 #define LCD_BUS_I2C_D6 (1 << 2)
00086 #define LCD_BUS_I2C_D7 (1 << 3)
00087 #define LCD_BUS_I2C_RS (1 << 4)
00088 #define LCD_BUS_I2C_E  (1 << 5)
00089 #define LCD_BUS_I2C_E2 (1 << 6)
00090 #define LCD_BUS_I2C_BL (1 << 7)
00091 
00092 #define LCD_BUS_I2C_RW (1 << 6)
00093 
00094 //SPI bus expander (74595) interface, same as I2C 
00095 #define LCD_BUS_SPI_D4 LCD_BUS_I2C_D4
00096 #define LCD_BUS_SPI_D5 LCD_BUS_I2C_D5
00097 #define LCD_BUS_SPI_D6 LCD_BUS_I2C_D6
00098 #define LCD_BUS_SPI_D7 LCD_BUS_I2C_D7
00099 #define LCD_BUS_SPI_RS LCD_BUS_I2C_RS
00100 #define LCD_BUS_SPI_E  LCD_BUS_I2C_E
00101 #define LCD_BUS_SPI_E2 LCD_BUS_I2C_E2
00102 #define LCD_BUS_SPI_BL LCD_BUS_I2C_BL
00103 
00104 #define LCD_BUS_SPI_RW LCD_BUS_I2C_RW
00105 
00106 //Select I2C Portexpander type (one option only)
00107 #define PCF8574        1
00108 #define MCP23008       0
00109 
00110 //Inverted Backlight control
00111 #define BACKLIGHT_INV  0
00112 #endif
00113 
00114 #if (ADAFRUIT==1)
00115 //Definitions for Adafruit i2cspilcdbackpack mapping between serial port expander pins and LCD controller
00116 //This hardware supports both an I2C expander (MCP23008) and an SPI expander (74595) selectable by a jumper.
00117 //Slaveaddress may be set by solderbridges (default 0x40). SDA/SCL has pullup Resistors onboard.
00118 //See http://www.ladyada.net/products/i2cspilcdbackpack
00119 //
00120 //Note: LCD RW pin must be kept LOW
00121 //      E2 is not available on this hardware and so it does not support LCD40x4 (second controller)
00122 //      BL is used to control backlight
00123 //Note: The pinmappings are different for the MCP23008 and the 74595!
00124 
00125 //I2C bus expander (MCP23008) interface
00126 #define LCD_BUS_I2C_0  (1 << 0)
00127 #define LCD_BUS_I2C_RS (1 << 1)
00128 #define LCD_BUS_I2C_E  (1 << 2)
00129 #define LCD_BUS_I2C_D4 (1 << 3)
00130 #define LCD_BUS_I2C_D5 (1 << 4)
00131 #define LCD_BUS_I2C_D6 (1 << 5)
00132 #define LCD_BUS_I2C_D7 (1 << 6)
00133 #define LCD_BUS_I2C_BL (1 << 7)
00134 
00135 #define LCD_BUS_I2C_E2 (1 << 0)
00136 #define LCD_BUS_I2C_RW (1 << 0)
00137 
00138 //SPI bus expander (74595) interface
00139 #define LCD_BUS_SPI_0  (1 << 0)
00140 #define LCD_BUS_SPI_RS (1 << 1)
00141 #define LCD_BUS_SPI_E  (1 << 2)
00142 #define LCD_BUS_SPI_D7 (1 << 3)
00143 #define LCD_BUS_SPI_D6 (1 << 4)
00144 #define LCD_BUS_SPI_D5 (1 << 5)
00145 #define LCD_BUS_SPI_D4 (1 << 6)
00146 #define LCD_BUS_SPI_BL (1 << 7)
00147 
00148 #define LCD_BUS_SPI_E2 (1 << 0)
00149 #define LCD_BUS_SPI_RW (1 << 0)
00150 
00151 //Force I2C portexpander type
00152 #define PCF8574        0
00153 #define MCP23008       1
00154 
00155 //Inverted Backlight control
00156 #define BACKLIGHT_INV  0
00157 #endif
00158 
00159 #if (DFROBOT==1)
00160 //Definitions for DFROBOT LCD2004 Module mapping between serial port expander pins and LCD controller
00161 //This hardware uses PCF8574 and is different from earlier/different Arduino I2C LCD displays
00162 //Slaveaddress hardwired to 0x4E. SDA/SCL has pullup Resistors onboard.
00163 //See http://arduino-info.wikispaces.com/LCD-Blue-I2C
00164 //
00165 //Definitions for DFROBOT V1.1 
00166 //This hardware uses PCF8574. Slaveaddress may be set by jumpers (default 0x40).
00167 //SDA/SCL has pullup Resistors onboard and features a voltage level converter 3V3 <-> 5V.
00168 //See http://www.dfrobot.com/index.php?route=product/product&product_id=135
00169 //
00170 //
00171 //Note: LCD RW pin must be kept LOW
00172 //      E2 is not available on default Arduino hardware and so it does not support LCD40x4 (second controller)
00173 //      BL is used to control backlight
00174 
00175 //I2C bus expander PCF8574 interface
00176 #define LCD_BUS_I2C_RS (1 << 0)
00177 #define LCD_BUS_I2C_RW (1 << 1)
00178 #define LCD_BUS_I2C_E  (1 << 2)
00179 #define LCD_BUS_I2C_BL (1 << 3)
00180 #define LCD_BUS_I2C_D4 (1 << 4)
00181 #define LCD_BUS_I2C_D5 (1 << 5)
00182 #define LCD_BUS_I2C_D6 (1 << 6)
00183 #define LCD_BUS_I2C_D7 (1 << 7)
00184 
00185 #define LCD_BUS_I2C_E2 (1 << 1)
00186 
00187 //SPI bus expander (74595) interface, same as I2C
00188 #define LCD_BUS_SPI_RS LCD_BUS_I2C_RS
00189 #define LCD_BUS_SPI_RW LCD_BUS_I2C_RW
00190 #define LCD_BUS_SPI_E  LCD_BUS_I2C_E
00191 #define LCD_BUS_SPI_BL LCD_BUS_I2C_BL
00192 #define LCD_BUS_SPI_D4 LCD_BUS_I2C_D4
00193 #define LCD_BUS_SPI_D5 LCD_BUS_I2C_D5
00194 #define LCD_BUS_SPI_D6 LCD_BUS_I2C_D6
00195 #define LCD_BUS_SPI_D7 LCD_BUS_I2C_D7
00196 
00197 #define LCD_BUS_SPI_E2 LCD_BUS_I2C_E2
00198 
00199 
00200 //Force I2C portexpander type
00201 #define PCF8574        1
00202 #define MCP23008       0
00203 
00204 //Inverted Backlight control
00205 #define BACKLIGHT_INV  0
00206 #endif
00207 
00208 #if ((YWROBOT==1) || (LCM1602==1))
00209 //Definitions for YWROBOT LCM1602 V1 Module mapping between serial port expander pins and LCD controller. 
00210 //Very similar to DFROBOT. Also marked as 'Funduino'. This hardware uses PCF8574.
00211 //Slaveaddress may be set by solderbridges (default 0x4E). SDA/SCL has no pullup Resistors onboard.
00212 //See http://arduino-info.wikispaces.com/LCD-Blue-I2C
00213 //
00214 //Note: LCD RW pin must be kept LOW
00215 //      E2 is not available on default hardware and so it does not support LCD40x4 (second controller)
00216 //      BL is used to control backlight.
00217 
00218 //I2C bus expander PCF8574 interface
00219 #define LCD_BUS_I2C_RS (1 << 0)
00220 #define LCD_BUS_I2C_RW (1 << 1)
00221 #define LCD_BUS_I2C_E  (1 << 2)
00222 #define LCD_BUS_I2C_BL (1 << 3)
00223 #define LCD_BUS_I2C_D4 (1 << 4)
00224 #define LCD_BUS_I2C_D5 (1 << 5)
00225 #define LCD_BUS_I2C_D6 (1 << 6)
00226 #define LCD_BUS_I2C_D7 (1 << 7)
00227 
00228 #define LCD_BUS_I2C_E2 (1 << 1)
00229 
00230 //SPI bus expander (74595) interface, same as I2C
00231 #define LCD_BUS_SPI_RS LCD_BUS_I2C_RS
00232 #define LCD_BUS_SPI_RW LCD_BUS_I2C_RW
00233 #define LCD_BUS_SPI_E  LCD_BUS_I2C_E
00234 #define LCD_BUS_SPI_BL LCD_BUS_I2C_BL
00235 #define LCD_BUS_SPI_D4 LCD_BUS_I2C_D4
00236 #define LCD_BUS_SPI_D5 LCD_BUS_I2C_D5
00237 #define LCD_BUS_SPI_D6 LCD_BUS_I2C_D6
00238 #define LCD_BUS_SPI_D7 LCD_BUS_I2C_D7
00239 
00240 #define LCD_BUS_SPI_E2 LCD_BUS_I2C_E2
00241 
00242 //Force I2C portexpander type
00243 #define PCF8574        1
00244 #define MCP23008       0
00245 
00246 //Inverted Backlight control
00247 #define BACKLIGHT_INV  1
00248 #endif
00249 
00250 #if ((GYLCD==1) || (MJKDZ==1))
00251 //Definitions for Arduino-IIC-LCD GY-LCD-V1, for GY-IICLCD and for MJKDZ Module mapping between serial port expander pins and LCD controller. 
00252 //Very similar to DFROBOT. This hardware uses PCF8574.
00253 //Slaveaddress may be set by solderbridges (default 0x4E). SDA/SCL has pullup Resistors onboard.
00254 //See http://arduino-info.wikispaces.com/LCD-Blue-I2C
00255 //
00256 //Note: LCD RW pin must be kept LOW
00257 //      E2 is not available on default hardware and so it does not support LCD40x4 (second controller)
00258 //      BL is used to control backlight, reverse logic: Low turns on Backlight. This is handled in setBacklight()
00259 
00260 //I2C bus expander PCF8574 interface
00261 #define LCD_BUS_I2C_D4 (1 << 0)
00262 #define LCD_BUS_I2C_D5 (1 << 1)
00263 #define LCD_BUS_I2C_D6 (1 << 2)
00264 #define LCD_BUS_I2C_D7 (1 << 3)
00265 #define LCD_BUS_I2C_E  (1 << 4)
00266 #define LCD_BUS_I2C_RW (1 << 5)
00267 #define LCD_BUS_I2C_RS (1 << 6)
00268 #define LCD_BUS_I2C_BL (1 << 7)
00269 
00270 #define LCD_BUS_I2C_E2 (1 << 5)
00271 
00272 //SPI bus expander (74595) interface
00273 #define LCD_BUS_SPI_D4 LCD_BUS_I2C_D4
00274 #define LCD_BUS_SPI_D5 LCD_BUS_I2C_D5
00275 #define LCD_BUS_SPI_D6 LCD_BUS_I2C_D6
00276 #define LCD_BUS_SPI_D7 LCD_BUS_I2C_D7
00277 #define LCD_BUS_SPI_E  LCD_BUS_I2C_E
00278 #define LCD_BUS_SPI_RW LCD_BUS_I2C_RW
00279 #define LCD_BUS_SPI_RS LCD_BUS_I2C_RS
00280 #define LCD_BUS_SPI_BL LCD_BUS_I2C_BL
00281 
00282 #define LCD_BUS_SPI_E2 LCD_BUS_I2C_E2
00283 
00284 //Force I2C portexpander type
00285 #define PCF8574        1
00286 #define MCP23008       0
00287 
00288 //Force Inverted Backlight control
00289 #define BACKLIGHT_INV  1
00290 #endif
00291 
00292 #if (SYDZ==1)
00293 //Definitions for SYDZ Module mapping between serial port expander pins and LCD controller. 
00294 //Very similar to DFROBOT. This hardware uses PCF8574A.
00295 //Slaveaddress may be set by switches (default 0x70). SDA/SCL has pullup Resistors onboard.
00296 //See ebay
00297 //
00298 //Note: LCD RW pin must be kept LOW
00299 //      E2 is not available on default hardware and so it does not support LCD40x4 (second controller)
00300 //      BL is used to control backlight
00301 
00302 //I2C bus expander PCF8574A interface
00303 #define LCD_BUS_I2C_RS (1 << 0)
00304 #define LCD_BUS_I2C_RW (1 << 1)
00305 #define LCD_BUS_I2C_E  (1 << 2)
00306 #define LCD_BUS_I2C_BL (1 << 3)
00307 #define LCD_BUS_I2C_D4 (1 << 4)
00308 #define LCD_BUS_I2C_D5 (1 << 5)
00309 #define LCD_BUS_I2C_D6 (1 << 6)
00310 #define LCD_BUS_I2C_D7 (1 << 7)
00311 
00312 #define LCD_BUS_I2C_E2 (1 << 1)
00313 
00314 //SPI bus expander (74595) interface, same as I2C
00315 #define LCD_BUS_SPI_RS LCD_BUS_I2C_RS
00316 #define LCD_BUS_SPI_RW LCD_BUS_I2C_RW
00317 #define LCD_BUS_SPI_E  LCD_BUS_I2C_E
00318 #define LCD_BUS_SPI_BL LCD_BUS_I2C_BL
00319 #define LCD_BUS_SPI_D4 LCD_BUS_I2C_D4
00320 #define LCD_BUS_SPI_D5 LCD_BUS_I2C_D5
00321 #define LCD_BUS_SPI_D6 LCD_BUS_I2C_D6
00322 #define LCD_BUS_SPI_D7 LCD_BUS_I2C_D7
00323 
00324 #define LCD_BUS_SPI_E2 LCD_BUS_I2C_E2
00325 
00326 //Force I2C portexpander type
00327 #define PCF8574        1
00328 #define MCP23008       0
00329 
00330 //Force Inverted Backlight control
00331 #define BACKLIGHT_INV  0
00332 #endif
00333 
00334 #if (WIDEHK==1)
00335 //Definitions for WIDE.HK I2C backpack mapping between serial port expander pins and LCD controller
00336 //This hardware uses an MCP23008 I2C expander.
00337 //Slaveaddress is hardcoded at 0x4E. SDA/SCL has pullup Resistors onboard (3k3).
00338 //See http://www.wide.hk
00339 //
00340 //Note: LCD RW pin must be kept LOW
00341 //      E2 is not available on this hardware and so it does not support LCD40x4 (second controller)
00342 //      BL is used to control backlight
00343 //
00344 
00345 //I2C bus expander (MCP23008) interface
00346 #define LCD_BUS_I2C_D4 (1 << 0)
00347 #define LCD_BUS_I2C_D5 (1 << 1)
00348 #define LCD_BUS_I2C_D6 (1 << 2)
00349 #define LCD_BUS_I2C_D7 (1 << 3)
00350 #define LCD_BUS_I2C_RS (1 << 4)
00351 #define LCD_BUS_I2C_RW (1 << 5)
00352 #define LCD_BUS_I2C_BL (1 << 6)
00353 #define LCD_BUS_I2C_E  (1 << 7)
00354 
00355 #define LCD_BUS_I2C_E2 (1 << 5)
00356 
00357 //SPI bus expander (74595) interface, same as I2C
00358 #define LCD_BUS_SPI_D4 LCD_BUS_I2C_D4
00359 #define LCD_BUS_SPI_D5 LCD_BUS_I2C_D5
00360 #define LCD_BUS_SPI_D6 LCD_BUS_I2C_D6
00361 #define LCD_BUS_SPI_D7 LCD_BUS_I2C_D7
00362 #define LCD_BUS_SPI_RS LCD_BUS_I2C_RS
00363 #define LCD_BUS_SPI_RW LCD_BUS_I2C_RW
00364 #define LCD_BUS_SPI_BL LCD_BUS_I2C_BL
00365 #define LCD_BUS_SPI_E  LCD_BUS_I2C_E
00366 
00367 #define LCD_BUS_SPI_E2 LCD_BUS_I2C_E2
00368 
00369 //Force I2C portexpander type
00370 #define PCF8574        0
00371 #define MCP23008       1
00372 
00373 //Inverted Backlight control
00374 #define BACKLIGHT_INV  0
00375 #endif
00376 
00377 #if (LCDPLUG==1)
00378 //Definitions for Jeelabs LCD_Plug I2C backpack mapping between serial port expander pins and LCD controller
00379 //This hardware uses an MCP23008 I2C expander.
00380 //Slaveaddress is hardcoded at 0x48. SDA/SCL has no pullup Resistors onboard.
00381 //See http://jeelabs.net/projects/hardware/wiki/lcd_plug
00382 //
00383 //Note: LCD RW pin must be kept LOW
00384 //      E2 is available on a plug and so it does support LCD40x4 (second controller)
00385 //      BL is used to control backlight
00386 //
00387 
00388 //I2C bus expander (MCP23008) interface
00389 #define LCD_BUS_I2C_D4 (1 << 0)
00390 #define LCD_BUS_I2C_D5 (1 << 1)
00391 #define LCD_BUS_I2C_D6 (1 << 2)
00392 #define LCD_BUS_I2C_D7 (1 << 3)
00393 #define LCD_BUS_I2C_RS (1 << 4)
00394 #define LCD_BUS_I2C_E2 (1 << 5)
00395 #define LCD_BUS_I2C_E  (1 << 6)
00396 #define LCD_BUS_I2C_BL (1 << 7)
00397 
00398 #define LCD_BUS_I2C_RW (1 << 5)
00399 
00400 //SPI bus expander (74595) interface, same as I2C
00401 #define LCD_BUS_SPI_D4 LCD_BUS_I2C_D4
00402 #define LCD_BUS_SPI_D5 LCD_BUS_I2C_D5
00403 #define LCD_BUS_SPI_D6 LCD_BUS_I2C_D6
00404 #define LCD_BUS_SPI_D7 LCD_BUS_I2C_D7
00405 #define LCD_BUS_SPI_RS LCD_BUS_I2C_RS
00406 #define LCD_BUS_SPI_E2 LCD_BUS_I2C_E2
00407 #define LCD_BUS_SPI_E  LCD_BUS_I2C_E
00408 #define LCD_BUS_SPI_BL LCD_BUS_I2C_BL
00409 
00410 #define LCD_BUS_SPI_RW LCD_BUS_I2C_RW
00411 
00412 //Force I2C portexpander type
00413 #define PCF8574        0
00414 #define MCP23008       1
00415 
00416 //Inverted Backlight control
00417 #define BACKLIGHT_INV  0
00418 #endif
00419 
00420 
00421 //Bitpattern Defines for I2C PCF8574/PCF8574A, MCP23008 and SPI 74595 Bus expanders
00422 //Don't change!
00423 #define LCD_BUS_I2C_MSK (LCD_BUS_I2C_D4 | LCD_BUS_I2C_D5 | LCD_BUS_I2C_D6 | LCD_BUS_I2C_D7)
00424 #if (BACKLIGHT_INV == 1)
00425 #define LCD_BUS_I2C_DEF (0x00 | LCD_BUS_I2C_BL)
00426 #else
00427 #define LCD_BUS_I2C_DEF  0x00
00428 #endif
00429 
00430 #define LCD_BUS_SPI_MSK (LCD_BUS_SPI_D4 | LCD_BUS_SPI_D5 | LCD_BUS_SPI_D6 | LCD_BUS_SPI_D7)
00431 #if (BACKLIGHT_INV == 1)
00432 #define LCD_BUS_SPI_DEF (0x00 | LCD_BUS_SPI_BL)
00433 #else
00434 #define LCD_BUS_SPI_DEF  0x00
00435 #endif
00436 
00437 
00438 /* PCF8574/PCF8574A I2C portexpander slave address */
00439 #define PCF8574_SA0    0x40
00440 #define PCF8574_SA1    0x42
00441 #define PCF8574_SA2    0x44
00442 #define PCF8574_SA3    0x46
00443 #define PCF8574_SA4    0x48
00444 #define PCF8574_SA5    0x4A
00445 #define PCF8574_SA6    0x4C
00446 #define PCF8574_SA7    0x4E
00447 
00448 #define PCF8574A_SA0   0x70
00449 #define PCF8574A_SA1   0x72
00450 #define PCF8574A_SA2   0x74
00451 #define PCF8574A_SA3   0x76
00452 #define PCF8574A_SA4   0x78
00453 #define PCF8574A_SA5   0x7A
00454 #define PCF8574A_SA6   0x7C
00455 #define PCF8574A_SA7   0x7E
00456 
00457 /* MCP23008 I2C portexpander slave address */
00458 #define MCP23008_SA0   0x40
00459 #define MCP23008_SA1   0x42
00460 #define MCP23008_SA2   0x44
00461 #define MCP23008_SA3   0x46
00462 #define MCP23008_SA4   0x48
00463 #define MCP23008_SA5   0x4A
00464 #define MCP23008_SA6   0x4C
00465 #define MCP23008_SA7   0x4E
00466 
00467 /* MCP23008 I2C portexpander internal registers */
00468 #define IODIR          0x00
00469 #define IPOL           0x01
00470 #define GPINTEN        0x02
00471 #define DEFVAL         0x03
00472 #define INTCON         0x04
00473 #define IOCON          0x05
00474 #define GPPU           0x06
00475 #define INTF           0x07
00476 #define INTCAP         0x08
00477 #define GPIO           0x09
00478 #define OLAT           0x0A
00479 
00480 /* ST7032i I2C slave address */
00481 #define ST7032_SA      0x7C
00482 
00483 /* ST7036i I2C slave address */
00484 #define ST7036_SA0     0x78
00485 #define ST7036_SA1     0x7A
00486 #define ST7036_SA2     0x7C
00487 #define ST7036_SA3     0x7E
00488 
00489 /* ST7066_ACM I2C slave address, Added for ACM1602 module  */
00490 #define ST7066_SA0     0xA0
00491 
00492 /* PCF21XX I2C slave address */
00493 #define PCF21XX_SA0    0x74
00494 #define PCF21XX_SA1    0x76
00495 
00496 /* AIP31068 I2C slave address */
00497 #define AIP31068_SA    0x7C
00498 
00499 /* SSD1803 I2C slave address */
00500 #define SSD1803_SA0    0x78
00501 #define SSD1803_SA1    0x7A
00502 
00503 /* US2066/SSD1311 I2C slave address */
00504 #define US2066_SA0     0x78
00505 #define US2066_SA1     0x7A
00506 
00507 /* AC780 I2C slave address */
00508 #define AC780_SA0      0x78
00509 #define AC780_SA1      0x7A
00510 #define AC780_SA2      0x7C
00511 #define AC780_SA3      0x7E
00512 
00513 //Some native I2C controllers dont support ACK. Set define to '0' to allow code to proceed even without ACK
00514 //#define LCD_I2C_ACK    0
00515 #define LCD_I2C_ACK    1
00516 
00517 
00518 // Contrast setting, 6 significant bits (only supported for controllers with extended features)
00519 // Voltage Multiplier setting, 2 or 3 significant bits (only supported for controllers with extended features)
00520 #define LCD_DEF_CONTRAST    0x20
00521 
00522 //ST7032 EastRising ERC1602FS-4 display
00523 //Contrast setting 6 significant bits
00524 //Voltage Multiplier setting 3 significant bits
00525 #define LCD_ST7032_CONTRAST 0x28 
00526 #define LCD_ST7032_RAB      0x04
00527 
00528 //ST7036 EA DOGM1603 display
00529 //Contrast setting 6 significant bits
00530 //Voltage Multiplier setting 3 significant bits
00531 #define LCD_ST7036_CONTRAST 0x28
00532 #define LCD_ST7036_RAB      0x04
00533 
00534 //SSD1803 EA DOGM204 display
00535 //Contrast setting 6 significant bits
00536 //Voltage Multiplier setting 3 significant bits
00537 #define LCD_SSD1_CONTRAST   0x28
00538 #define LCD_SSD1_RAB        0x06
00539 
00540 //US2066/SSD1311 EastRising ER-OLEDM2002-4 display
00541 //Contrast setting 8 significant bits, use 6 for compatibility
00542 #define LCD_US20_CONTRAST   0x3F
00543 //#define LCD_US20_CONTRAST   0x1F
00544 
00545 //PCF2113, PCF2119 display
00546 //Contrast setting 6 significant bits
00547 //Voltage Multiplier setting 2 significant bits
00548 #define LCD_PCF2_CONTRAST   0x20
00549 #define LCD_PCF2_S12        0x02
00550 
00551 //PT6314 VFD display
00552 //Contrast setting 2 significant bits, use 6 for compatibility
00553 #define LCD_PT63_CONTRAST   0x3F
00554 
00555 
00556 #endif //MBED_TEXTLCDCONFIG_H