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