Skip to content

Commit 13bfecf

Browse files
authored
Merge pull request #760 from adafruit/sh1107
Add SH1107 for 128x64/32 OLED featherwings
2 parents a89218c + c3bc7a8 commit 13bfecf

9 files changed

+336
-15
lines changed

.github/workflows/build-clang-doxy.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ name: WipperSnapper Build CI
55

66
on:
77
workflow_dispatch:
8+
inputs:
9+
board:
10+
description: 'Build ONLY this board (must match a matrix entry exactly, or leave empty for all)'
11+
required: false
12+
default: ''
813
pull_request:
914
workflow_call:
1015
secrets:
@@ -15,13 +20,21 @@ jobs:
1520
build-esp32sx-esptool:
1621
name: 🏗️ESP32-Sx(lvgl)
1722
runs-on: ubuntu-latest
23+
continue-on-error: true
1824
strategy:
1925
fail-fast: false
2026
matrix:
2127
arduino-platform: ["funhouse_noota"]
2228
include:
2329
- offset: "0x1000"
2430
steps:
31+
- name: "skip if unwanted"
32+
if: |
33+
github.event_name == 'workflow_dispatch' &&
34+
github.event.inputs.board != '' &&
35+
matrix.arduino-platform != github.event.inputs.board
36+
run: |
37+
echo "don't build this one!"; exit 1
2538
- uses: actions/setup-python@v5
2639
with:
2740
python-version: "3.x"
@@ -174,6 +187,7 @@ jobs:
174187
build-esp32sx:
175188
name: 🏗️ESP32-Sx
176189
runs-on: ubuntu-latest
190+
continue-on-error: true
177191
strategy:
178192
fail-fast: false
179193
matrix:
@@ -194,6 +208,13 @@ jobs:
194208
"qtpy_esp32s3_n4r2",
195209
]
196210
steps:
211+
- name: "skip if unwanted"
212+
if: |
213+
github.event_name == 'workflow_dispatch' &&
214+
github.event.inputs.board != '' &&
215+
matrix.arduino-platform != github.event.inputs.board
216+
run: |
217+
echo "don't build this one!"; exit 1
197218
- uses: actions/setup-python@v5
198219
with:
199220
python-version: "3.x"
@@ -278,6 +299,7 @@ jobs:
278299
build-esp32:
279300
name: 🏗️ESP32/Cx
280301
runs-on: ubuntu-latest
302+
continue-on-error: true
281303
strategy:
282304
fail-fast: false
283305
matrix:
@@ -299,6 +321,13 @@ jobs:
299321
- offset: "0x0"
300322
arduino-platform: "wippersnapper_feather_esp32c6"
301323
steps:
324+
- name: "skip if unwanted"
325+
if: |
326+
github.event_name == 'workflow_dispatch' &&
327+
github.event.inputs.board != '' &&
328+
matrix.arduino-platform != github.event.inputs.board
329+
run: |
330+
echo "don't build this one!"; exit 1
302331
- uses: actions/setup-python@v5
303332
with:
304333
python-version: "3.x"
@@ -419,6 +448,7 @@ jobs:
419448
build-samd:
420449
name: 🏗️SAMD
421450
runs-on: ubuntu-latest
451+
continue-on-error: true
422452
strategy:
423453
fail-fast: false
424454
matrix:
@@ -429,6 +459,13 @@ jobs:
429459
"metro_m4_airliftlite_tinyusb",
430460
]
431461
steps:
462+
- name: "skip if unwanted"
463+
if: |
464+
github.event_name == 'workflow_dispatch' &&
465+
github.event.inputs.board != '' &&
466+
matrix.arduino-platform != github.event.inputs.board
467+
run: |
468+
echo "don't build this one!"; exit 1
432469
- uses: actions/setup-python@v5
433470
with:
434471
python-version: "3.x"
@@ -498,11 +535,19 @@ jobs:
498535
build-rp2040:
499536
name: 🏗️RP2040
500537
runs-on: ubuntu-latest
538+
continue-on-error: true
501539
strategy:
502540
fail-fast: false
503541
matrix:
504542
arduino-platform: ["picow_rp2040_tinyusb", "picow_rp2350_tinyusb"]
505543
steps:
544+
- name: "skip if unwanted"
545+
if: |
546+
github.event_name == 'workflow_dispatch' &&
547+
github.event.inputs.board != '' &&
548+
matrix.arduino-platform != github.event.inputs.board
549+
run: |
550+
echo "don't build this one!"; exit 1
506551
- uses: actions/setup-python@v5
507552
with:
508553
python-version: "3.x"
@@ -569,11 +614,19 @@ jobs:
569614
build-esp8266:
570615
name: 🏗️ESP8266
571616
runs-on: ubuntu-latest
617+
continue-on-error: true
572618
strategy:
573619
fail-fast: false
574620
matrix:
575621
arduino-platform: ["feather_esp8266"]
576622
steps:
623+
- name: "skip if unwanted"
624+
if: |
625+
github.event_name == 'workflow_dispatch' &&
626+
github.event.inputs.board != '' &&
627+
matrix.arduino-platform != github.event.inputs.board
628+
run: |
629+
echo "don't build this one!"; exit 1
577630
- uses: actions/setup-python@v5
578631
with:
579632
python-version: "3.x"
@@ -647,6 +700,7 @@ jobs:
647700
build-esp32sx-dev:
648701
name: 🏗️ESP32-Sx(DEV)
649702
runs-on: ubuntu-latest
703+
continue-on-error: true
650704
strategy:
651705
fail-fast: false
652706
matrix:
@@ -662,6 +716,13 @@ jobs:
662716
"metro_esp32s3_debug",
663717
]
664718
steps:
719+
- name: "skip if unwanted"
720+
if: |
721+
github.event_name == 'workflow_dispatch' &&
722+
github.event.inputs.board != '' &&
723+
matrix.arduino-platform != github.event.inputs.board
724+
run: |
725+
echo "don't build this one!"; exit 1
665726
- uses: actions/setup-python@v5
666727
with:
667728
python-version: "3.x"
@@ -746,6 +807,7 @@ jobs:
746807
build-esp32-dev:
747808
name: 🏗️ESP32/Cx(DEV)
748809
runs-on: ubuntu-latest
810+
continue-on-error: true
749811
strategy:
750812
fail-fast: false
751813
matrix:
@@ -758,6 +820,13 @@ jobs:
758820
- offset: "0x0"
759821
arduino-platform: "wippersnapper_feather_esp32c6_debug"
760822
steps:
823+
- name: "skip if unwanted"
824+
if: |
825+
github.event_name == 'workflow_dispatch' &&
826+
github.event.inputs.board != '' &&
827+
matrix.arduino-platform != github.event.inputs.board
828+
run: |
829+
echo "don't build this one!"; exit 1
761830
- uses: actions/setup-python@v5
762831
with:
763832
python-version: "3.x"

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name=Adafruit WipperSnapper
2-
version=1.0.0-beta.103
2+
version=1.0.0-beta.104
33
author=Adafruit
44
maintainer=Adafruit <adafruitio@adafruit.com>
55
sentence=Arduino application for Adafruit.io WipperSnapper
66
paragraph=Arduino application for Adafruit.io WipperSnapper
77
category=Communication
88
url=https://github.com/adafruit/Adafruit_Wippersnapper_Arduino
99
architectures=*
10-
depends=SdFat - Adafruit Fork, Adafruit NeoPixel, Adafruit SPIFlash, ArduinoJson, Adafruit DotStar, Adafruit HDC302x, Adafruit INA219, Adafruit INA260 Library, Adafruit LTR329 and LTR303, Adafruit LTR390 Library, Adafruit MCP3421, Adafruit NAU7802 Library, Adafruit SleepyDog Library, Adafruit TMP117, Adafruit TinyUSB Library, Adafruit AHTX0, Adafruit BME280 Library, Adafruit BMP280 Library, Adafruit BMP3XX Library, Adafruit DPS310, Adafruit DS248x, Adafruit SCD30, Adafruit SGP30 Sensor, Adafruit SGP40 Sensor, Sensirion I2C SCD4x, Sensirion I2C SEN5X, Sensirion I2C SEN66, arduino-sht, Adafruit Si7021 Library, Adafruit MQTT Library, Adafruit MS8607, Adafruit MCP9808 Library, Adafruit MCP9600 Library, Adafruit MPL115A2, Adafruit MPRLS Library, Adafruit TSL2591 Library, Adafruit_VL53L0X, Adafruit VL53L1X, STM32duino VL53L4CD, STM32duino VL53L4CX, Adafruit_VL6180X, Adafruit PM25 AQI Sensor, Adafruit VCNL4020 Library, Adafruit VCNL4040, Adafruit VCNL4200 Library, Adafruit VEML7700 Library, Adafruit LC709203F, Adafruit LPS2X, Adafruit LPS28, Adafruit LPS35HW, Adafruit seesaw Library, Adafruit BME680 Library, Adafruit MAX1704X, Adafruit ADT7410 Library, Adafruit HTS221, Adafruit HTU21DF Library, Adafruit HTU31D Library, Adafruit PCT2075, hp_BH1750, ENS160 - Adafruit Fork, Adafruit BusIO, Adafruit Unified Sensor, Sensirion Core, Adafruit GFX Library, Adafruit LED Backpack Library, Adafruit LiquidCrystal, Adafruit SSD1306
10+
depends=SdFat - Adafruit Fork, Adafruit NeoPixel, Adafruit SPIFlash, ArduinoJson, Adafruit DotStar, Adafruit HDC302x, Adafruit INA219, Adafruit INA260 Library, Adafruit LTR329 and LTR303, Adafruit LTR390 Library, Adafruit MCP3421, Adafruit NAU7802 Library, Adafruit SleepyDog Library, Adafruit TMP117, Adafruit TinyUSB Library, Adafruit AHTX0, Adafruit BME280 Library, Adafruit BMP280 Library, Adafruit BMP3XX Library, Adafruit DPS310, Adafruit DS248x, Adafruit SCD30, Adafruit SGP30 Sensor, Adafruit SGP40 Sensor, Sensirion I2C SCD4x, Sensirion I2C SEN5X, Sensirion I2C SEN66, arduino-sht, Adafruit Si7021 Library, Adafruit MQTT Library, Adafruit MS8607, Adafruit MCP9808 Library, Adafruit MCP9600 Library, Adafruit MPL115A2, Adafruit MPRLS Library, Adafruit TSL2591 Library, Adafruit_VL53L0X, Adafruit VL53L1X, STM32duino VL53L4CD, STM32duino VL53L4CX, Adafruit_VL6180X, Adafruit PM25 AQI Sensor, Adafruit VCNL4020 Library, Adafruit VCNL4040, Adafruit VCNL4200 Library, Adafruit VEML7700 Library, Adafruit LC709203F, Adafruit LPS2X, Adafruit LPS28, Adafruit LPS35HW, Adafruit seesaw Library, Adafruit BME680 Library, Adafruit MAX1704X, Adafruit ADT7410 Library, Adafruit HTS221, Adafruit HTU21DF Library, Adafruit HTU31D Library, Adafruit PCT2075, hp_BH1750, ENS160 - Adafruit Fork, Adafruit BusIO, Adafruit Unified Sensor, Sensirion Core, Adafruit GFX Library, Adafruit LED Backpack Library, Adafruit LiquidCrystal, Adafruit SH110X, Adafruit SSD1306

platformio.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ lib_deps =
8484
adafruit/Adafruit LiquidCrystal
8585
adafruit/Adafruit LED Backpack Library
8686
adafruit/Adafruit PM25 AQI Sensor
87+
adafruit/Adafruit SH110X
8788
adafruit/Adafruit SSD1306
8889
https://github.com/pstolarz/OneWireNg.git
8990
https://github.com/milesburton/Arduino-Temperature-Control-Library.git

src/Wippersnapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
#endif
143143

144144
#define WS_VERSION \
145-
"1.0.0-beta.103" ///< WipperSnapper app. version (semver-formatted)
145+
"1.0.0-beta.104" ///< WipperSnapper app. version (semver-formatted)
146146

147147
// Reserved Adafruit IO MQTT topics
148148
#define TOPIC_IO_THROTTLE "/throttle" ///< Adafruit IO Throttle MQTT Topic

src/components/i2c/WipperSnapper_I2C.cpp

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,38 @@ bool WipperSnapper_Component_I2C::initI2CDevice(
881881
}
882882
_drivers_out.push_back(_sevenSeg);
883883
WS_DEBUG_PRINTLN("7-Segement LED Matrix Initialized Successfully!");
884-
} else if (strcmp("oled128x32default", msgDeviceInitReq->i2c_device_name) ==
884+
} else if (strcmp("fthrwingoled128x64", msgDeviceInitReq->i2c_device_name) ==
885+
0 ||
886+
strcmp("fthrwingoled128x64lg",
887+
msgDeviceInitReq->i2c_device_name) == 0) {
888+
WS_DEBUG_PRINTLN("SH1107 display detected!");
889+
_sh1107 = new WipperSnapper_I2C_Driver_Out_SH1107(this->_i2c, i2cAddress);
890+
WS_DEBUG_PRINTLN("Configuring SH1107 display...");
891+
_sh1107->ConfigureSH1107(
892+
(uint8_t)msgDeviceInitReq->i2c_output_add.config.ssd1306_config.width,
893+
(uint8_t)msgDeviceInitReq->i2c_output_add.config.ssd1306_config.height,
894+
(uint8_t)
895+
msgDeviceInitReq->i2c_output_add.config.ssd1306_config.text_size,
896+
OLED_128X64_WING_ROTATION_90); // fixed as currently the only screen is
897+
// 128x64wing (needs a rotation of 1 / 90degrees and constructor w/h swap).
898+
if (!_sh1107->begin()) {
899+
WS_DEBUG_PRINTLN("ERROR: Failed to initialize sh1107!");
900+
_busStatusResponse =
901+
wippersnapper_i2c_v1_BusResponse_BUS_RESPONSE_DEVICE_INIT_FAIL;
902+
return false;
903+
}
904+
WS_DEBUG_PRINTLN("SH1107 display configured successfully!");
905+
_drivers_out.push_back(_sh1107);
906+
WS_DEBUG_PRINTLN("SH1107 display initialized Successfully!");
907+
} else if (strcmp("oled32x64large", msgDeviceInitReq->i2c_device_name) == 0 ||
908+
strcmp("oled64x32default", msgDeviceInitReq->i2c_device_name) ==
909+
0 ||
910+
strcmp("oled64x32large", msgDeviceInitReq->i2c_device_name) == 0 ||
911+
strcmp("fthrwingoled128x32", msgDeviceInitReq->i2c_device_name) ==
912+
0 ||
913+
strcmp("fthrwingoled128x32lg",
914+
msgDeviceInitReq->i2c_device_name) == 0 ||
915+
strcmp("oled128x32default", msgDeviceInitReq->i2c_device_name) ==
885916
0 ||
886917
strcmp("oled128x32large", msgDeviceInitReq->i2c_device_name) ==
887918
0 ||

src/components/i2c/WipperSnapper_I2C.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
#include "drivers/WipperSnapper_I2C_Driver_Out_7Seg.h"
5555
#include "drivers/WipperSnapper_I2C_Driver_Out_CharLcd.h"
5656
#include "drivers/WipperSnapper_I2C_Driver_Out_QuadAlphaNum.h"
57+
#include "drivers/WipperSnapper_I2C_Driver_Out_Sh1107.h"
5758
#include "drivers/WipperSnapper_I2C_Driver_Out_Ssd1306.h"
5859
#include "drivers/WipperSnapper_I2C_Driver_PCT2075.h"
5960
#include "drivers/WipperSnapper_I2C_Driver_PM25.h"
@@ -204,6 +205,7 @@ class WipperSnapper_Component_I2C {
204205
WipperSnapper_I2C_Driver_Out_QuadAlphaNum *_quadAlphaNum = nullptr;
205206
WipperSnapper_I2C_Driver_Out_CharLcd *_charLcd = nullptr;
206207
WipperSnapper_I2C_Driver_Out_7Seg *_sevenSeg = nullptr;
208+
WipperSnapper_I2C_Driver_Out_SH1107 *_sh1107 = nullptr;
207209
WipperSnapper_I2C_Driver_Out_Ssd1306 *_ssd1306 = nullptr;
208210
};
209211
extern Wippersnapper WS;

src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ class WipperSnapper_I2C_Driver_Out : public WipperSnapper_I2C_Driver {
6262
The height of the display in pixels.
6363
@param text_size
6464
The display's text size.
65+
@param rotation
66+
The rotation of the display in degrees, default is 0.
6567
*/
6668
virtual void ConfigureSSD1306(uint8_t width, uint8_t height,
67-
uint8_t text_size) {
69+
uint8_t text_size, uint8_t rotation = 0) {
6870
// noop
6971
}
7072

0 commit comments

Comments
 (0)