From 9ac7b0efc6896f16db5bf847c85df3aecffea226 Mon Sep 17 00:00:00 2001 From: e2002 Date: Fri, 10 Mar 2023 21:44:34 +0300 Subject: [PATCH] v0.9.045 --- README.md | 5 ++++ yoRadio/src/SSD1322/SSD1322.cpp | 1 + yoRadio/src/SSD1322/SSD1322.h | 9 ++++++- yoRadio/src/core/options.h | 2 +- yoRadio/src/displays/displaySSD1322.cpp | 36 +++++++++++++++++++++++-- 5 files changed, 49 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f04bfc7..a356045 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,8 @@ https://aliexpress.com/item/32965676064.html - or **GC9A01A** 1.28' 240x240 https://aliexpress.com/item/1005004069703494.html?sku_id=12000029869654615 - or **ILI9488** 3.5' 480x320 SPI https://aliexpress.com/item/1005001999296476.html?sku_id=12000018365356570 - or **ILI9486** (Testing mode) 3.5' 480x320 SPI https://aliexpress.com/item/1005001999296476.html?sku_id=12000018365356568 +- or **SSD1322** 2.8' 256x64 SPI https://aliexpress.com/item/1005003480981568.html +(see [Wiki](https://github.com/e2002/yoradio/wiki/Available-display-models) for more details) ##### Controls - Three tact buttons https://www.aliexpress.com/item/32907144687.html @@ -222,6 +224,9 @@ Work is in progress... --- ## Version history +#### v0.9.045 +- added support for SSD1322 256x64 2.8' OLED display https://aliexpress.com/item/1005003480981568.html + #### v0.9.022 - optimization of the display of the list of stations - now the playlist size can be changed with one parameter in the yoRadio/src/displays/conf/display_XXXX_conf.h file --> _const ScrollConfig playlistConf_ param #3 diff --git a/yoRadio/src/SSD1322/SSD1322.cpp b/yoRadio/src/SSD1322/SSD1322.cpp index b16f8ac..e34abf2 100644 --- a/yoRadio/src/SSD1322/SSD1322.cpp +++ b/yoRadio/src/SSD1322/SSD1322.cpp @@ -315,6 +315,7 @@ void Jamis_SSD1322::drawPixel(int16_t x, int16_t y, uint16_t color) { ssd1322_swap(x, y); y = HEIGHT - y - 1; break; + default: break; } buffer[(x >> 1) + (y)*WIDTH/2] &= (x % 2) ? 0xF0 : 0x0F; buffer[(x >> 1) + (y)*WIDTH/2] |= (color << (!(x & 1) * 4) ); diff --git a/yoRadio/src/SSD1322/SSD1322.h b/yoRadio/src/SSD1322/SSD1322.h index a99a0d2..4cb3650 100644 --- a/yoRadio/src/SSD1322/SSD1322.h +++ b/yoRadio/src/SSD1322/SSD1322.h @@ -33,9 +33,16 @@ #endif #include - #define BLACK 0 ///< Draw 'off' pixels #define WHITE 0xf ///< Draw 'on' pixels +#define GRAY_D 0xd +#define GRAY_B 0xb +#define GRAY_9 0x9 +#define GRAY_7 0x7 +#define GRAY_5 0x5 +#define GRAY_3 0x3 +#define GRAY_2 0x2 +#define GRAY_1 0x1 #define INVERSE 2 ///< Invert pixels #define SSD1322_DISPLAYOFF 0xAE diff --git a/yoRadio/src/core/options.h b/yoRadio/src/core/options.h index 76c8f41..144a775 100644 --- a/yoRadio/src/core/options.h +++ b/yoRadio/src/core/options.h @@ -1,7 +1,7 @@ #ifndef options_h #define options_h -#define YOVERSION "0.9.042" +#define YOVERSION "0.9.045" /******************************************************* DO NOT EDIT THIS FILE. diff --git a/yoRadio/src/displays/displaySSD1322.cpp b/yoRadio/src/displays/displaySSD1322.cpp index b0940bc..eecdfc3 100644 --- a/yoRadio/src/displays/displaySSD1322.cpp +++ b/yoRadio/src/displays/displaySSD1322.cpp @@ -12,7 +12,9 @@ #ifndef DEF_SPI_FREQ #define DEF_SPI_FREQ 16000000UL /* set it to 0 for system default */ #endif - +#ifndef SSD1322_GRAYSCALE + #define SSD1322_GRAYSCALE false +#endif const unsigned char logo [] PROGMEM= { 0x06, 0x03, 0x00, 0x0f, 0x07, 0x80, 0x1f, 0x8f, 0xc0, 0x1f, 0x8f, 0xc0, @@ -35,7 +37,37 @@ const unsigned char logo [] PROGMEM= #include "tools/utf8RusGFX.h" void DspCore::initDisplay() { -#include "tools/oledcolorfix.h" +#if !SSD1322_GRAYSCALE + #include "tools/oledcolorfix.h" +#else + config.theme.background = TFT_BG; + #if DSP_INVERT_TITLE + config.theme.meta = TFT_BG; + config.theme.metabg = GRAY_9; + config.theme.metafill = GRAY_9; + #else + config.theme.meta = GRAY_9; + config.theme.metabg = TFT_BG; + config.theme.metafill = TFT_BG; + #endif + config.theme.clock = TFT_FG; + config.theme.weather = GRAY_2; + config.theme.title1 = GRAY_B; + config.theme.title2 = GRAY_3; + config.theme.rssi = GRAY_5; + config.theme.ip = GRAY_2; + config.theme.vol = TFT_FG; + config.theme.bitrate = TFT_FG; + config.theme.digit = TFT_FG; + config.theme.buffer = TFT_FG; + config.theme.volbarout = GRAY_9; + config.theme.volbarin = GRAY_9; + config.theme.plcurrent = TFT_BG; + config.theme.plcurrentbg = GRAY_7; + config.theme.plcurrentfill = GRAY_7; + for(byte i=0;i<5;i++) config.theme.playlist[i] = GRAY_1; +#endif //!SSD1322_GRAYSCALE + begin(); cp437(true); flip();