Make I2C address configurable for HD44780 LCD variations

Also add a basic README with some pointers on how to connect and configure the LCDs
This commit is contained in:
Tony Corbett G0WFV
2016-06-30 20:10:30 +01:00
parent ef0ebb4d49
commit ce367f73cb
7 changed files with 72 additions and 8 deletions

View File

@@ -130,6 +130,7 @@ m_tftSerialBrightness(50U),
m_hd44780Rows(2U),
m_hd44780Columns(16U),
m_hd44780Pins(),
m_hd44780i2cAddress,
m_hd44780PWM(false),
m_hd44780PWMPin(),
m_hd44780PWMBright(),
@@ -438,6 +439,8 @@ bool CConf::read()
m_hd44780Rows = (unsigned int)::atoi(value);
else if (::strcmp(key, "Columns") == 0)
m_hd44780Columns = (unsigned int)::atoi(value);
else if (::strcmp(key, "I2CAddress") == 0)
m_hd44780i2cAddress = value;
else if (::strcmp(key, "PWM") == 0)
m_hd44780PWM = ::atoi(value) == 1;
else if (::strcmp(key, "PWMPin") == 0)
@@ -889,6 +892,11 @@ std::vector<unsigned int> CConf::getHD44780Pins() const
return m_hd44780Pins;
}
std::string CConf::getHD44780i2cAddress() const
{
return m_hd44780i2cAddress;
}
bool CConf::getHD44780PWM() const
{
return m_hd44780PWM;