Implementation of ST7789 display - requires updated circle with new ST7789 character driver.

pull/652/head
Kevin 11 months ago
parent 8b14855007
commit 3b171c6872
  1. 6
      src/config.cpp
  2. 6
      src/config.h
  3. 8
      src/userinterface.cpp

@ -110,6 +110,7 @@ void CConfig::Load (void)
m_nST7789Backlight = m_Properties.GetNumber ("ST7789Backlight", 0); // optional
m_nST7789Width = m_Properties.GetNumber ("ST7789Width", 240);
m_nST7789Height = m_Properties.GetNumber ("ST7789Height", 240);
m_nST7789Rotation = m_Properties.GetNumber ("ST7789Rotation", 0);
m_nLCDColumns = m_Properties.GetNumber ("LCDColumns", 16);
m_nLCDRows = m_Properties.GetNumber ("LCDRows", 2);
@ -348,6 +349,11 @@ unsigned CConfig::GetST7789Height (void) const
return m_nST7789Height;
}
unsigned CConfig::GetST7789Rotation (void) const
{
return m_nST7789Rotation;
}
unsigned CConfig::GetLCDColumns (void) const
{
return m_nLCDColumns;

@ -30,8 +30,8 @@
#define SPI_INACTIVE 255
#define SPI_CLOCK_SPEED 15000000 // Hz
#define SPI_CPOL 1 // Taken from circle sample application
#define SPI_CPHA 0
#define SPI_CPOL 0 // Taken from circle sample application
#define SPI_CPHA 0 // Apparently Mode 0 (0,0) is common...?
class CConfig // Configuration for MiniDexed
@ -118,6 +118,7 @@ public:
unsigned GetST7789Backlight (void) const;
unsigned GetST7789Width (void) const;
unsigned GetST7789Height (void) const;
unsigned GetST7789Rotation (void) const;
unsigned GetLCDColumns (void) const;
unsigned GetLCDRows (void) const;
@ -229,6 +230,7 @@ private:
unsigned m_nST7789Backlight;
unsigned m_nST7789Width;
unsigned m_nST7789Height;
unsigned m_nST7789Rotation;
unsigned m_nLCDColumns;
unsigned m_nLCDRows;

@ -79,8 +79,6 @@ bool CUserInterface::Initialize (void)
return false;
}
LOGDBG ("ST7789 Params: dc=%d, cs=%d", m_pConfig->GetST7789Data(), m_pConfig->GetST7789Select());
m_pST7789Display = new CST7789Display (m_pSPIMaster,
m_pConfig->GetST7789Data(),
m_pConfig->GetST7789Reset(),
@ -89,9 +87,9 @@ bool CUserInterface::Initialize (void)
m_pConfig->GetST7789Height(),
SPI_CPOL, SPI_CPHA, SPI_CLOCK_SPEED,
m_pConfig->GetST7789Select());
LOGDBG ("ST7789 Display OK");
if (m_pST7789Display->Initialize())
{
m_pST7789Display->SetRotation (m_pConfig->GetST7789Rotation());
m_pST7789 = new CST7789Device (m_pSPIMaster, m_pST7789Display, m_pConfig->GetLCDColumns (), m_pConfig->GetLCDRows ());
if (m_pST7789->Initialize())
{
@ -268,7 +266,7 @@ void CUserInterface::DisplayWrite (const char *pMenu, const char *pParam, const
CString Value (" ");
if (bArrowDown)
{
Value = "\x7F"; // arrow left character
Value = "<"; // arrow left character
}
Value.Append (pValue);
@ -283,7 +281,7 @@ void CUserInterface::DisplayWrite (const char *pMenu, const char *pParam, const
}
}
Value.Append ("\x7E"); // arrow right character
Value.Append (">"); // arrow right character
}
Msg.Append (Value);

Loading…
Cancel
Save