lcd: remove i2c context from LCD base class

This commit removes the I2C context from the LCD base class and moves
it into each of the drivers.

In addition, the createChar() virtual function was removed from the
base class, as it directly used the now non-existant i2c context, and
it would not work on anything other than hd44780 based controllers and
displays anyway. Also, it is likely the capability itself, as well as
the data required to implement it, is going to be different from
device to device.

createChar() has been added to the Lcm1602 driver which can support it.

While doing this work, the LCD base class m_name is now set appropriately
in the driver constructors.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Jon Trulson
2015-07-09 13:54:49 -06:00
committed by Mihai Tudor Panu
parent 56f7e97536
commit 1647f572ff
10 changed files with 84 additions and 36 deletions

View File

@ -25,6 +25,7 @@
#pragma once
#include <string>
#include <mraa/i2c.hpp>
#include "lcd.h"
#include "ssd.h"
@ -108,5 +109,8 @@ class SSD1308 : public LCD
mraa_result_t writeChar(uint8_t value);
mraa_result_t setNormalDisplay();
mraa_result_t setAddressingMode(displayAddressingMode mode);
int m_lcd_control_address;
mraa::I2c m_i2c_lcd_control;
};
}