mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 06:55:52 +08:00
HD44780 PWM backlight control
This commit is contained in:
36
Conf.cpp
36
Conf.cpp
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user