mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 23:45:49 +08:00
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:
8
Conf.cpp
8
Conf.cpp
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user