Skip to content

Add SH1107 for 128x64/32 OLED featherwings #760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 42 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ab3284e
Add SH1107 for 128x64/32 OLED featherwings
tyeth Jun 19, 2025
e0d6535
Add 128x32 OLED featherwings as SSD1306
tyeth Jun 19, 2025
650a59b
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
d2560fa
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
75546b0
Update WipperSnapper_I2C.h
tyeth Jun 19, 2025
137c4a9
Update WipperSnapper_I2C.h
tyeth Jun 19, 2025
8fa6396
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
61da902
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
b92a6e1
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
f90da36
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
879a8ed
Update WipperSnapper_I2C.cpp - clang
tyeth Jun 19, 2025
95e594d
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
54ecd0f
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
475a6fe
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
9e645a4
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
3f1eb14
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
a655219
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
d58d386
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
def567c
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
5efebb8
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
658949a
Update build-clang-doxy.yml - optional single board build
tyeth Jun 19, 2025
44be678
CORRECT IFS
tyeth Jun 19, 2025
b69363f
update if to be echo step
tyeth Jun 19, 2025
1fcf794
Return false if unwanted board
tyeth Jun 19, 2025
10442e5
Update build-clang-doxy.yml
tyeth Jun 19, 2025
0b3eadf
Update failure modes
tyeth Jun 19, 2025
0936ed7
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
d23c52e
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
5cd7b1c
Update WipperSnapper_I2C_Driver_Out_Sh1107.h
tyeth Jun 19, 2025
1f8c689
Add logging around OLEDs
tyeth Jun 20, 2025
ae54a28
Ha, forgot I renamed the func calls
tyeth Jun 20, 2025
5e3950b
Signature correction
tyeth Jun 20, 2025
09d305c
Add 64x32 OLEDs (SH1107)
tyeth Jun 20, 2025
2851e81
clang format
tyeth Jun 20, 2025
0bec5c2
doxygen
tyeth Jun 20, 2025
70abb6e
Swap 64x32 to SSD1306
tyeth Jun 20, 2025
7ce2b17
Add 32x64 SSD1306
tyeth Jun 20, 2025
6779646
SSD1306: don't call begin again on i2c (2nd bus)
tyeth Jun 23, 2025
8c8c5c2
Set Rotation for 128x64 OLED featherwing
tyeth Jun 24, 2025
6ab5a6f
Separate out rotation for future usage and add notes
tyeth Jun 24, 2025
518eac9
add rotation to ConfigureSSD1306 func for SH1107
tyeth Jun 24, 2025
c6dbb2b
clang format
tyeth Jun 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/build-clang-doxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ name: WipperSnapper Build CI

on:
workflow_dispatch:
inputs:
board:
description: 'Build ONLY this board (must match a matrix entry exactly, or leave empty for all)'
required: false
default: ''
pull_request:
workflow_call:
secrets:
Expand All @@ -15,13 +20,21 @@ jobs:
build-esp32sx-esptool:
name: 🏗️ESP32-Sx(lvgl)
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
arduino-platform: ["funhouse_noota"]
include:
- offset: "0x1000"
steps:
- name: "skip if unwanted"
if: |
github.event_name == 'workflow_dispatch' &&
github.event.inputs.board != '' &&
matrix.arduino-platform != github.event.inputs.board
run: |
echo "don't build this one!"; exit 1
- uses: actions/setup-python@v5
with:
python-version: "3.x"
Expand Down Expand Up @@ -174,6 +187,7 @@ jobs:
build-esp32sx:
name: 🏗️ESP32-Sx
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
Expand All @@ -194,6 +208,13 @@ jobs:
"qtpy_esp32s3_n4r2",
]
steps:
- name: "skip if unwanted"
if: |
github.event_name == 'workflow_dispatch' &&
github.event.inputs.board != '' &&
matrix.arduino-platform != github.event.inputs.board
run: |
echo "don't build this one!"; exit 1
- uses: actions/setup-python@v5
with:
python-version: "3.x"
Expand Down Expand Up @@ -278,6 +299,7 @@ jobs:
build-esp32:
name: 🏗️ESP32/Cx
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
Expand All @@ -299,6 +321,13 @@ jobs:
- offset: "0x0"
arduino-platform: "wippersnapper_feather_esp32c6"
steps:
- name: "skip if unwanted"
if: |
github.event_name == 'workflow_dispatch' &&
github.event.inputs.board != '' &&
matrix.arduino-platform != github.event.inputs.board
run: |
echo "don't build this one!"; exit 1
- uses: actions/setup-python@v5
with:
python-version: "3.x"
Expand Down Expand Up @@ -419,6 +448,7 @@ jobs:
build-samd:
name: 🏗️SAMD
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
Expand All @@ -429,6 +459,13 @@ jobs:
"metro_m4_airliftlite_tinyusb",
]
steps:
- name: "skip if unwanted"
if: |
github.event_name == 'workflow_dispatch' &&
github.event.inputs.board != '' &&
matrix.arduino-platform != github.event.inputs.board
run: |
echo "don't build this one!"; exit 1
- uses: actions/setup-python@v5
with:
python-version: "3.x"
Expand Down Expand Up @@ -498,11 +535,19 @@ jobs:
build-rp2040:
name: 🏗️RP2040
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
arduino-platform: ["picow_rp2040_tinyusb", "picow_rp2350_tinyusb"]
steps:
- name: "skip if unwanted"
if: |
github.event_name == 'workflow_dispatch' &&
github.event.inputs.board != '' &&
matrix.arduino-platform != github.event.inputs.board
run: |
echo "don't build this one!"; exit 1
- uses: actions/setup-python@v5
with:
python-version: "3.x"
Expand Down Expand Up @@ -569,11 +614,19 @@ jobs:
build-esp8266:
name: 🏗️ESP8266
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
arduino-platform: ["feather_esp8266"]
steps:
- name: "skip if unwanted"
if: |
github.event_name == 'workflow_dispatch' &&
github.event.inputs.board != '' &&
matrix.arduino-platform != github.event.inputs.board
run: |
echo "don't build this one!"; exit 1
- uses: actions/setup-python@v5
with:
python-version: "3.x"
Expand Down Expand Up @@ -647,6 +700,7 @@ jobs:
build-esp32sx-dev:
name: 🏗️ESP32-Sx(DEV)
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
Expand All @@ -662,6 +716,13 @@ jobs:
"metro_esp32s3_debug",
]
steps:
- name: "skip if unwanted"
if: |
github.event_name == 'workflow_dispatch' &&
github.event.inputs.board != '' &&
matrix.arduino-platform != github.event.inputs.board
run: |
echo "don't build this one!"; exit 1
- uses: actions/setup-python@v5
with:
python-version: "3.x"
Expand Down Expand Up @@ -746,6 +807,7 @@ jobs:
build-esp32-dev:
name: 🏗️ESP32/Cx(DEV)
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
Expand All @@ -758,6 +820,13 @@ jobs:
- offset: "0x0"
arduino-platform: "wippersnapper_feather_esp32c6_debug"
steps:
- name: "skip if unwanted"
if: |
github.event_name == 'workflow_dispatch' &&
github.event.inputs.board != '' &&
matrix.arduino-platform != github.event.inputs.board
run: |
echo "don't build this one!"; exit 1
- uses: actions/setup-python@v5
with:
python-version: "3.x"
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ paragraph=Arduino application for Adafruit.io WipperSnapper
category=Communication
url=https://github.com/adafruit/Adafruit_Wippersnapper_Arduino
architectures=*
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
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
1 change: 1 addition & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ lib_deps =
adafruit/Adafruit LiquidCrystal
adafruit/Adafruit LED Backpack Library
adafruit/Adafruit PM25 AQI Sensor
adafruit/Adafruit SH110X
adafruit/Adafruit SSD1306
https://github.com/pstolarz/OneWireNg.git
https://github.com/milesburton/Arduino-Temperature-Control-Library.git
Expand Down
36 changes: 34 additions & 2 deletions src/components/i2c/WipperSnapper_I2C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,38 @@ bool WipperSnapper_Component_I2C::initI2CDevice(
}
_drivers_out.push_back(_sevenSeg);
WS_DEBUG_PRINTLN("7-Segement LED Matrix Initialized Successfully!");
} else if (strcmp("oled128x32default", msgDeviceInitReq->i2c_device_name) ==
} else if (strcmp("oled128x64wingdefault",
msgDeviceInitReq->i2c_device_name) == 0 ||
strcmp("oled128x64winglarge", msgDeviceInitReq->i2c_device_name) ==
0) {
WS_DEBUG_PRINTLN("SH1107 display detected!");
_sh1107 = new WipperSnapper_I2C_Driver_Out_SH1107(this->_i2c, i2cAddress);
WS_DEBUG_PRINTLN("Configuring SH1107 display...");
_sh1107->ConfigureSH1107(
(uint8_t)msgDeviceInitReq->i2c_output_add.config.ssd1306_config.width,
(uint8_t)msgDeviceInitReq->i2c_output_add.config.ssd1306_config.height,
(uint8_t)
msgDeviceInitReq->i2c_output_add.config.ssd1306_config.text_size,
90); // fixed as currently the only screen is 128x64 featherwing which
// needs a rotation of 1 / 90degrees, and constructor w/h swap.
if (!_sh1107->begin()) {
WS_DEBUG_PRINTLN("ERROR: Failed to initialize sh1107!");
_busStatusResponse =
wippersnapper_i2c_v1_BusResponse_BUS_RESPONSE_DEVICE_INIT_FAIL;
return false;
}
WS_DEBUG_PRINTLN("SH1107 display configured successfully!");
_drivers_out.push_back(_sh1107);
WS_DEBUG_PRINTLN("SH1107 display initialized Successfully!");
} else if (strcmp("oled32x64large", msgDeviceInitReq->i2c_device_name) == 0 ||
strcmp("oled64x32default", msgDeviceInitReq->i2c_device_name) ==
0 ||
strcmp("oled64x32large", msgDeviceInitReq->i2c_device_name) == 0 ||
strcmp("oled128x32wingdefault",
msgDeviceInitReq->i2c_device_name) == 0 ||
strcmp("oled128x32winglarge", msgDeviceInitReq->i2c_device_name) ==
0 ||
strcmp("oled128x32default", msgDeviceInitReq->i2c_device_name) ==
0 ||
strcmp("oled128x32large", msgDeviceInitReq->i2c_device_name) ==
0 ||
Expand All @@ -896,7 +927,8 @@ bool WipperSnapper_Component_I2C::initI2CDevice(
(uint8_t)msgDeviceInitReq->i2c_output_add.config.ssd1306_config.width,
(uint8_t)msgDeviceInitReq->i2c_output_add.config.ssd1306_config.height,
(uint8_t)
msgDeviceInitReq->i2c_output_add.config.ssd1306_config.text_size);
msgDeviceInitReq->i2c_output_add.config.ssd1306_config.text_size,
0); // TODO: add rotation to protobuf and IO UI for adapted max len
if (!_ssd1306->begin()) {
WS_DEBUG_PRINTLN("ERROR: Failed to initialize ssd1306!");
_busStatusResponse =
Expand Down
2 changes: 2 additions & 0 deletions src/components/i2c/WipperSnapper_I2C.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include "drivers/WipperSnapper_I2C_Driver_Out_7Seg.h"
#include "drivers/WipperSnapper_I2C_Driver_Out_CharLcd.h"
#include "drivers/WipperSnapper_I2C_Driver_Out_QuadAlphaNum.h"
#include "drivers/WipperSnapper_I2C_Driver_Out_Sh1107.h"
#include "drivers/WipperSnapper_I2C_Driver_Out_Ssd1306.h"
#include "drivers/WipperSnapper_I2C_Driver_PCT2075.h"
#include "drivers/WipperSnapper_I2C_Driver_PM25.h"
Expand Down Expand Up @@ -204,6 +205,7 @@ class WipperSnapper_Component_I2C {
WipperSnapper_I2C_Driver_Out_QuadAlphaNum *_quadAlphaNum = nullptr;
WipperSnapper_I2C_Driver_Out_CharLcd *_charLcd = nullptr;
WipperSnapper_I2C_Driver_Out_7Seg *_sevenSeg = nullptr;
WipperSnapper_I2C_Driver_Out_SH1107 *_sh1107 = nullptr;
WipperSnapper_I2C_Driver_Out_Ssd1306 *_ssd1306 = nullptr;
};
extern Wippersnapper WS;
Expand Down
4 changes: 3 additions & 1 deletion src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ class WipperSnapper_I2C_Driver_Out : public WipperSnapper_I2C_Driver {
The height of the display in pixels.
@param text_size
The display's text size.
@param rotation
The rotation of the display in degrees, default is 0.
*/
virtual void ConfigureSSD1306(uint8_t width, uint8_t height,
uint8_t text_size) {
uint8_t text_size, uint8_t rotation = 0) {
// noop
}

Expand Down
Loading
Loading