HD44780 PWM backlight control

This commit is contained in:
Tony Corbett
2016-05-01 16:59:43 +01:00
parent c54336c330
commit 414a1df408
6 changed files with 162 additions and 6 deletions

View File

@@ -110,6 +110,10 @@ m_tftSerialBrightness(50U),
m_hd44780Rows(2U),
m_hd44780Columns(16U),
m_hd44780Pins(),
m_hd44780PWM(),
m_hd44780PWMPin(),
m_hd44780PWMBright(),
m_hd44780PWMDim(),
m_nextionSize(),
m_nextionPort(),
m_nextionBrightness(50U)
@@ -340,6 +344,17 @@ bool CConf::read()
m_hd44780Rows = (unsigned int)::atoi(value);
else if (::strcmp(key, "Columns") == 0)
m_hd44780Columns = (unsigned int)::atoi(value);
// WFV
else if (::strcmp(key, "PWM") == 0)
m_hd44780PWM = (unsigned int)::atoi(value);
else if (::strcmp(key, "PWMPin") == 0)
m_hd44780PWMPin = (unsigned int)::atoi(value);
else if (::strcmp(key, "PWMBright") == 0)
m_hd44780PWMBright = (unsigned int)::atoi(value);
else if (::strcmp(key, "PWMDim") == 0)
m_hd44780PWMDim = (unsigned int)::atoi(value);
else if (::strcmp(key, "Pins") == 0) {
char* p = ::strtok(value, ",\r\n");
while (p != NULL) {
@@ -683,6 +698,27 @@ std::vector<unsigned int> CConf::getHD44780Pins() const
return m_hd44780Pins;
}
// WFV
unsigned int CConf::getHD44780PWM() const
{
return m_hd44780PWM;
}
unsigned int CConf::getHD44780PWMPin() const
{
return m_hd44780PWMPin;
}
unsigned int CConf::getHD44780PWMBright() const
{
return m_hd44780PWMBright;
}
unsigned int CConf::getHD44780PWMDim() const
{
return m_hd44780PWMDim;
}
std::string CConf::getNextionSize() const
{
return m_nextionSize;