SSD1306 display rotation support and fix for #421 (#422)

* Update Circle develop branch

for SSD1306 display rotation support

https://github.com/probonopd/MiniDexed/discussions/412

* Implements rotation and mirroring options for SSD1306 displays (only). (#420)

Requires an update to circle (PR submitted to develop branch)

Co-authored-by: diyelectromusic <68612569+diyelectromusic@users.noreply.github.com>

* circle-stdlib e318f89

Needed to support Circle develop

* Fix for Issue 421 - circle sound drivers have moved to their own subdirectory and library.

* Updated to keep in step with updates from the original in circle-stdlib.

* git checkout circle-newlib 48bf91d 

Needed for circle ec09d7e

Co-authored-by: probonopd <probonopd@users.noreply.github.com>
pull/405/merge
Kevin 1 year ago committed by GitHub
parent a51859bb32
commit fcea41ead3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      .github/workflows/build.yml
  2. 1
      src/Rules.mk
  3. 6
      src/circle_stdlib_app.h
  4. 12
      src/config.cpp
  5. 4
      src/config.h
  6. 6
      src/minidexed.cpp
  7. 2
      src/minidexed.h
  8. 2
      src/minidexed.ini
  9. 4
      src/userinterface.cpp

@ -20,11 +20,17 @@ jobs:
run: |
set -ex
git submodule update --init --recursive
- name: Use Circle develop branch for WM8960 and i2c display support until it is merged upstream
- name: Use Circle develop branch for SSD1306 display rotation support until it is merged upstream
run: |
set -ex
cd circle-stdlib/
git checkout e318f89 # Needed to support Circle develop?
cd -
cd circle-stdlib/libs/circle
git checkout 646c362 # develop
git checkout ec09d7e # develop
cd -
cd circle-stdlib/libs/circle-newlib
git checkout 48bf91d # needed for circle ec09d7e
cd -
- name: Install toolchains
run: |

@ -23,6 +23,7 @@ LIBS += \
$(CIRCLEHOME)/addon/SDCard/libsdcard.a \
$(CIRCLEHOME)/lib/usb/libusb.a \
$(CIRCLEHOME)/lib/input/libinput.a \
$(CIRCLEHOME)/lib/sound/libsound.a \
$(CIRCLEHOME)/addon/fatfs/libfatfs.a \
$(CIRCLEHOME)/lib/fs/libfs.a \
$(CIRCLEHOME)/lib/sched/libsched.a \

@ -214,8 +214,10 @@ public:
return false;
}
// Initialize newlib stdio with a reference to Circle's file system and console
CGlueStdioInit (mFileSystem, mConsole);
// Initialize newlib stdio with a reference to Circle's console
// (Remove mFileSystem as a parameter to mirror change in circle-stdlib's
// commit "Remove obsolete FATFS-related code", dated Dec 2022)
CGlueStdioInit (mConsole);
mLogger.Write (GetKernelName (), LogNotice, "Compile time: " __DATE__ " " __TIME__);

@ -85,6 +85,8 @@ void CConfig::Load (void)
m_nSSD1306LCDI2CAddress = m_Properties.GetNumber ("SSD1306LCDI2CAddress", 0);
m_nSSD1306LCDWidth = m_Properties.GetNumber ("SSD1306LCDWidth", 128);
m_nSSD1306LCDHeight = m_Properties.GetNumber ("SSD1306LCDHeight", 32);
m_bSSD1306LCDRotate = m_Properties.GetNumber ("SSD1306LCDRotate", 0) != 0;
m_bSSD1306LCDMirror = m_Properties.GetNumber ("SSD1306LCDMirror", 0) != 0;
m_nLCDColumns = m_Properties.GetNumber ("LCDColumns", 16);
m_nLCDRows = m_Properties.GetNumber ("LCDRows", 2);
@ -237,6 +239,16 @@ unsigned CConfig::GetSSD1306LCDHeight (void) const
return m_nSSD1306LCDHeight;
}
bool CConfig::GetSSD1306LCDRotate (void) const
{
return m_bSSD1306LCDRotate;
}
bool CConfig::GetSSD1306LCDMirror (void) const
{
return m_bSSD1306LCDMirror;
}
unsigned CConfig::GetLCDColumns (void) const
{
return m_nLCDColumns;

@ -94,6 +94,8 @@ public:
unsigned GetSSD1306LCDI2CAddress (void) const;
unsigned GetSSD1306LCDWidth (void) const;
unsigned GetSSD1306LCDHeight (void) const;
bool GetSSD1306LCDRotate (void) const;
bool GetSSD1306LCDMirror (void) const;
unsigned GetLCDColumns (void) const;
unsigned GetLCDRows (void) const;
@ -169,6 +171,8 @@ private:
unsigned m_nSSD1306LCDI2CAddress;
unsigned m_nSSD1306LCDWidth;
unsigned m_nSSD1306LCDHeight;
bool m_bSSD1306LCDRotate;
bool m_bSSD1306LCDMirror;
unsigned m_nLCDColumns;
unsigned m_nLCDRows;

@ -20,9 +20,9 @@
#include "minidexed.h"
#include <circle/logger.h>
#include <circle/memory.h>
#include <circle/pwmsoundbasedevice.h>
#include <circle/i2ssoundbasedevice.h>
#include <circle/hdmisoundbasedevice.h>
#include <circle/sound/pwmsoundbasedevice.h>
#include <circle/sound/i2ssoundbasedevice.h>
#include <circle/sound/hdmisoundbasedevice.h>
#include <circle/gpiopin.h>
#include <string.h>
#include <stdio.h>

@ -37,7 +37,7 @@
#include <circle/gpiomanager.h>
#include <circle/i2cmaster.h>
#include <circle/multicore.h>
#include <circle/soundbasedevice.h>
#include <circle/sound/soundbasedevice.h>
#include <circle/spinlock.h>
#include "common.h"
#include "effect_mixer.hpp"

@ -35,6 +35,8 @@ LCDI2CAddress=0x00
SSD1306LCDI2CAddress=0x0
SSD1306LCDWidth=128
SSD1306LCDHeight=32
SSD1306LCDRotate=0
SSD1306LCDMirror=0
# Default is 16x2 display (e.g. HD44780)
LCDColumns=16

@ -58,7 +58,9 @@ bool CUserInterface::Initialize (void)
unsigned i2caddr = m_pConfig->GetLCDI2CAddress ();
unsigned ssd1306addr = m_pConfig->GetSSD1306LCDI2CAddress ();
if (ssd1306addr != 0) {
m_pSSD1306 = new CSSD1306Device (m_pConfig->GetSSD1306LCDWidth (), m_pConfig->GetSSD1306LCDHeight (), m_pI2CMaster, ssd1306addr);
m_pSSD1306 = new CSSD1306Device (m_pConfig->GetSSD1306LCDWidth (), m_pConfig->GetSSD1306LCDHeight (),
m_pI2CMaster, ssd1306addr,
m_pConfig->GetSSD1306LCDRotate (), m_pConfig->GetSSD1306LCDMirror ());
LOGDBG ("LCD: SSD1306");
if (!m_pSSD1306->Initialize ())
{

Loading…
Cancel
Save