Justin Howard / Mbed 2 deprecated AdaFruit_RGBLCD

Dependencies:   AdaFruit_RGBLCDShield MCP23017 mbed RTclock

Dependents:   SX1276_GPS

Fork of MCP_test by Wim Huiskamp

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers lcdadafruit.cpp Source File

lcdadafruit.cpp

00001 #include "mbed.h"
00002 #include "lcdadafruit.h"
00003 
00004 LCDadafruit::LCDadafruit(I2C & in_cI2C)
00005     : LCD(in_cI2C)
00006     , m_cMCP(in_cI2C, 0x20 << 1)
00007     , m_cLCD(m_cMCP)
00008 {
00009     m_cLCD.begin(16,2);
00010 }
00011 
00012 int LCDadafruit::_putc(int in_nValue)
00013 {
00014     return m_cLCD._putc(in_nValue);
00015 }
00016 
00017 void LCDadafruit::clear()
00018 {
00019     m_cLCD.clear();
00020 }
00021 
00022 uint8_t LCDadafruit::columns()
00023 {
00024     return 16;
00025 }
00026 
00027 void LCDadafruit::createChar(uint8_t location, uint8_t charmap[])
00028 {
00029     m_cLCD.createChar(location,charmap);
00030 }
00031 
00032 void LCDadafruit::home()
00033 {
00034     m_cLCD.home();
00035 }
00036 
00037 uint8_t LCDadafruit::rows()
00038 {
00039     return 2;
00040 }
00041 
00042 void LCDadafruit::setCursor(uint8_t in_nX, uint8_t in_nY)
00043 {
00044     m_cLCD.setCursor(in_nX,in_nY);
00045 }
00046 
00047 void LCDadafruit::showBlink(bool in_bShow)
00048 {
00049     if (in_bShow) m_cLCD.blink(); else m_cLCD.noBlink();    
00050 }
00051 
00052 void LCDadafruit::showCursor(bool in_bShow)
00053 {
00054     if (in_bShow) m_cLCD.cursor(); else m_cLCD.noCursor();
00055 }
00056 
00057 void LCDadafruit::showDisplay(bool in_bShow)
00058 {
00059     if (in_bShow) m_cLCD.display(); else m_cLCD.noDisplay();
00060 }