/Users/fmalpartida/Documents/development/mercurial repos/SW/NewLiquidCrystal_lib/LiquidCrystal_I2C.h
// ---------------------------------------------------------------------------
// Created by Francisco Malpartida on 20/08/11.
// Copyright (C) - 2018
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License v3.0
// along with this program.
// If not, see <https://www.gnu.org/licenses/gpl-3.0.en.html>.
//
// ---------------------------------------------------------------------------
//
// Thread Safe: No
// Extendable: Yes
//
// @file LiquidCrystal_I2C.h
// This file implements a basic liquid crystal library that comes as standard
// in the Arduino SDK but using an I2C IO extension board.
//
// @brief
// This is a basic implementation of the LiquidCrystal library of the
// Arduino SDK. The original library has been reworked in such a way that
// this class implements the all methods to command an LCD based
// on the Hitachi HD44780 and compatible chipsets using I2C extension
// backpacks such as the I2CLCDextraIO with the PCF8574* I2C IO Expander ASIC.
//
// The functionality provided by this class and its base class is identical
// to the original functionality of the Arduino LiquidCrystal library.
//
//
// @author F. Malpartida - fmalpartida@gmail.com
// ---------------------------------------------------------------------------
#ifndef LiquidCrystal_I2C_h
#define LiquidCrystal_I2C_h
#include <inttypes.h>
#include <Print.h>
#include "I2CIO.h"
#include "LCD.h"
class LiquidCrystal_I2C : public LCD
{
public:
LiquidCrystal_I2C (uint8_t lcd_Addr);
// Constructor with backlight control
LiquidCrystal_I2C (uint8_t lcd_Addr, uint8_t backlighPin, t_backlightPol pol);
LiquidCrystal_I2C( uint8_t lcd_Addr, uint8_t En, uint8_t Rw, uint8_t Rs);
// Constructor with backlight control
LiquidCrystal_I2C(uint8_t lcd_Addr, uint8_t En, uint8_t Rw, uint8_t Rs,
uint8_t backlighPin, t_backlightPol pol);
LiquidCrystal_I2C(uint8_t lcd_Addr, uint8_t En, uint8_t Rw, uint8_t Rs,
uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7 );
// Constructor with backlight control
LiquidCrystal_I2C(uint8_t lcd_Addr, uint8_t En, uint8_t Rw, uint8_t Rs,
uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7,
uint8_t backlighPin, t_backlightPol pol);
virtual void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS);
virtual void send(uint8_t value, uint8_t mode);
void setBacklightPin ( uint8_t value, t_backlightPol pol );
void setBacklight ( uint8_t value );
void config (uint8_t lcd_Addr, uint8_t En, uint8_t Rw, uint8_t Rs,
uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7 );
private:
int init();
void write4bits(uint8_t value, uint8_t mode);
void pulseEnable(uint8_t);
uint8_t _Addr; // I2C Address of the IO expander
uint8_t _backlightPinMask; // Backlight IO pin mask
uint8_t _backlightStsMask; // Backlight status mask
I2CIO _i2cio; // I2CIO PCF8574* expansion module driver I2CLCDextraIO
uint8_t _En; // LCD expander word for enable pin
uint8_t _Rw; // LCD expander word for R/W pin
uint8_t _Rs; // LCD expander word for Register Select pin
uint8_t _data_pins[4]; // LCD data lines
};
#endif
I2CIO
Definition: I2CIO.h:56
LCD
Definition: LCD.h:199
LiquidCrystal_I2C::LiquidCrystal_I2C
LiquidCrystal_I2C(uint8_t lcd_Addr)
Definition: LiquidCrystal_I2C.cpp:108
LiquidCrystal_I2C::begin
virtual void begin(uint8_t cols, uint8_t rows, uint8_t charsize=LCD_5x8DOTS)
Definition: LiquidCrystal_I2C.cpp:156
LiquidCrystal_I2C::send
virtual void send(uint8_t value, uint8_t mode)
Definition: LiquidCrystal_I2C.cpp:252
LiquidCrystal_I2C
Definition: LiquidCrystal_I2C.h:50
LiquidCrystal_I2C::config
void config(uint8_t lcd_Addr, uint8_t En, uint8_t Rw, uint8_t Rs, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7)
Definition: LiquidCrystal_I2C.cpp:225
LiquidCrystal_I2C::setBacklight
void setBacklight(uint8_t value)
Definition: LiquidCrystal_I2C.cpp:179
LiquidCrystal_I2C::setBacklightPin
void setBacklightPin(uint8_t value, t_backlightPol pol)
Definition: LiquidCrystal_I2C.cpp:170