diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index e0d912256..a060c52bc 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -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: @@ -15,6 +20,7 @@ jobs: build-esp32sx-esptool: name: 🏗️ESP32-Sx(lvgl) runs-on: ubuntu-latest + continue-on-error: true strategy: fail-fast: false matrix: @@ -22,6 +28,13 @@ jobs: 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" @@ -174,6 +187,7 @@ jobs: build-esp32sx: name: 🏗️ESP32-Sx runs-on: ubuntu-latest + continue-on-error: true strategy: fail-fast: false matrix: @@ -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" @@ -278,6 +299,7 @@ jobs: build-esp32: name: 🏗️ESP32/Cx runs-on: ubuntu-latest + continue-on-error: true strategy: fail-fast: false matrix: @@ -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" @@ -419,6 +448,7 @@ jobs: build-samd: name: 🏗️SAMD runs-on: ubuntu-latest + continue-on-error: true strategy: fail-fast: false matrix: @@ -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" @@ -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" @@ -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" @@ -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: @@ -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" @@ -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: @@ -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" diff --git a/library.properties b/library.properties index 77037f3b6..f1c5af030 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Adafruit WipperSnapper -version=1.0.0-beta.103 +version=1.0.0-beta.104 author=Adafruit maintainer=Adafruit sentence=Arduino application for Adafruit.io WipperSnapper @@ -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 diff --git a/platformio.ini b/platformio.ini index bddb00c06..61578b052 100644 --- a/platformio.ini +++ b/platformio.ini @@ -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 diff --git a/src/Wippersnapper.h b/src/Wippersnapper.h index 0ad167d74..f7fde4f98 100644 --- a/src/Wippersnapper.h +++ b/src/Wippersnapper.h @@ -142,7 +142,7 @@ #endif #define WS_VERSION \ - "1.0.0-beta.103" ///< WipperSnapper app. version (semver-formatted) + "1.0.0-beta.104" ///< WipperSnapper app. version (semver-formatted) // Reserved Adafruit IO MQTT topics #define TOPIC_IO_THROTTLE "/throttle" ///< Adafruit IO Throttle MQTT Topic diff --git a/src/components/i2c/WipperSnapper_I2C.cpp b/src/components/i2c/WipperSnapper_I2C.cpp index 6f58f4c27..556040d47 100644 --- a/src/components/i2c/WipperSnapper_I2C.cpp +++ b/src/components/i2c/WipperSnapper_I2C.cpp @@ -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("fthrwingoled128x64", msgDeviceInitReq->i2c_device_name) == + 0 || + strcmp("fthrwingoled128x64lg", + 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, + OLED_128X64_WING_ROTATION_90); // fixed as currently the only screen is + // 128x64wing (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("fthrwingoled128x32", msgDeviceInitReq->i2c_device_name) == + 0 || + strcmp("fthrwingoled128x32lg", + msgDeviceInitReq->i2c_device_name) == 0 || + strcmp("oled128x32default", msgDeviceInitReq->i2c_device_name) == 0 || strcmp("oled128x32large", msgDeviceInitReq->i2c_device_name) == 0 || diff --git a/src/components/i2c/WipperSnapper_I2C.h b/src/components/i2c/WipperSnapper_I2C.h index 1c17de10a..b9cddd0f4 100644 --- a/src/components/i2c/WipperSnapper_I2C.h +++ b/src/components/i2c/WipperSnapper_I2C.h @@ -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" @@ -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; diff --git a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out.h b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out.h index e806a0dab..c92debec7 100644 --- a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out.h +++ b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out.h @@ -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 } diff --git a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_Sh1107.h b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_Sh1107.h new file mode 100644 index 000000000..1ef27e450 --- /dev/null +++ b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_Sh1107.h @@ -0,0 +1,208 @@ +/*! + * @file WipperSnapper_I2C_Driver_Out_SH1107.h + * + * Device driver for a SH1107 OLED Display + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing + * products from Adafruit! + * + * Copyright (c) Tyeth Gundry for Adafruit Industries 2025 + * + * MIT license, all text here must be included in any redistribution. + * + */ + +#ifndef WIPPERSNAPPER_I2C_DRIVER_OUT_SH1107_H +#define WIPPERSNAPPER_I2C_DRIVER_OUT_SH1107_H + +#include "WipperSnapper_I2C_Driver_Out.h" +#include +#include +#include + +#define WS_SH1107_DEFAULT_WIDTH \ + 128 ///< Default width for a sh1107 128x64 display +#define WS_SH1107_DEFAULT_HEIGHT \ + 64 ///< Default height for a sh1107 128x64 display + +#define OLED_128X64_WING_WIDTH 128 ///< Width of the 128x64 OLED FeatherWing +#define OLED_128X64_WING_HEIGHT 64 ///< Height of the 128x64 OLED FeatherWing +#define OLED_128X64_WING_ROTATION_90 1 ///< Rotation of OLED FeatherWing 0-3 + +/*! + @brief Class that provides a driver interface for a SH1107 + OLED Display +*/ +class WipperSnapper_I2C_Driver_Out_SH1107 + : public WipperSnapper_I2C_Driver_Out { + +public: + /*******************************************************************************/ + /*! + @brief Constructor for an SH1107 OLED display. + @param i2c + The I2C interface. + @param sensorAddress + 7-bit device address. + */ + /*******************************************************************************/ + WipperSnapper_I2C_Driver_Out_SH1107(TwoWire *i2c, uint16_t sensorAddress) + : WipperSnapper_I2C_Driver_Out(i2c, sensorAddress) { + _i2c = i2c; + _sensorAddress = sensorAddress; + _width = WS_SH1107_DEFAULT_WIDTH; + _height = WS_SH1107_DEFAULT_HEIGHT; + } + + /*! + @brief Destructor for a SH1107 OLED display. + */ + ~WipperSnapper_I2C_Driver_Out_SH1107() { + if (_display != nullptr) { + _display->clearDisplay(); + _display->display(); + _display->oled_command(SH110X_DISPLAYOFF); + delete _display; + _display = nullptr; + } + } + + /*! + @brief Initializes the SH1107 display and begins I2C. + @returns True if initialized successfully, False otherwise. + */ + bool begin() { + if (_width == OLED_128X64_WING_WIDTH && + _height == OLED_128X64_WING_HEIGHT && + _rotation == OLED_128X64_WING_ROTATION_90) { + // featherwing needs to be rotated 90 degrees and swap w/h ctor args + _display = new Adafruit_SH1107(_height, _width, _i2c); + } else { + _display = new Adafruit_SH1107(_width, _height, _i2c); + } + if (!_display->begin(_sensorAddress, true)) + return false; + + // Clear the buffer. + _display->clearDisplay(); + _display->display(); + _display->setRotation(_rotation); // 0-3, not degrees for SH1107 + + // Configure the text size and color + _display->setTextSize(_text_sz); + _display->setTextColor(SH110X_WHITE); + _display->setCursor(0, 0); + // Clear the buffer + _display->clearDisplay(); + _display->display(); + return true; + } + + /*! + @brief Configures a SH1107 OLED display. Must be called before driver + begin() + @param width + The width of the display in pixels. + @param height + The height of the display in pixels. + @param text_size + The magnification factor for the text size. + @param rotation + The rotation of the display in degrees, default is 0. + */ + void ConfigureSH1107(uint8_t width, uint8_t height, uint8_t text_size, + uint8_t rotation) { + _width = width; + _height = height; + _text_sz = text_size; + _rotation = + rotation % 90; // SH1107 requires rotation to be 0-3, not degrees + } + /*! + @brief Configures a SSD1306 OLED display. Must be called before driver + begin() - This is a fake function to match the SSD1306 interface. + @param width + The width of the display in pixels. + @param height + The height of the display in pixels. + @param text_size + The magnification factor for the text size. + @param rotation + The rotation of the display in degrees, default is 0. + */ + void ConfigureSSD1306(uint8_t width, uint8_t height, uint8_t text_size, + uint8_t rotation) { + // This is a SH1107, not a SSD1306, so we don't need to do anything here. + ConfigureSH1107(width, height, text_size, rotation); + } + + /*! + @brief Writes a message to the SH1107 display. + @param message + The message to be displayed. + */ + void WriteMessageSH1107(const char *message) { + if (_display == nullptr) + return; + // Start with a fresh display buffer + // and settings + int16_t y_idx = 0; + _display->clearDisplay(); + _display->setTextSize(_text_sz); + _display->setTextColor(SH110X_WHITE); + _display->setCursor(0, y_idx); + _display->display(); + + // Calculate the line height based on the text size (NOTE: base height is + // 8px) + int16_t line_height = 8 * _text_sz; + uint16_t c_idx = 0; + size_t msg_size = strlen(message); + for (size_t i = 0; i < msg_size && c_idx < msg_size; i++) { + if (message[i] == '\\' && i + 1 < msg_size && + (message[i + 1] == 'n' || message[i + 1] == 'r')) { + // Handle \r\n sequence as a single newline + if (message[i + 1] == 'r' && i + 3 < msg_size && + message[i + 2] == '\\' && message[i + 3] == 'n') { + // Skip to the next line + y_idx += line_height; + _display->setCursor(0, y_idx); + i += 3; + } else if (message[i + 1] == 'n') { + // Skip to the next line + y_idx += line_height; + _display->setCursor(0, y_idx); + i++; + } + } else if (message[i] == 0xC2 && message[i + 1] == 0xB0) { + _display->write(char(248)); + _display->display(); + i++; + } else { + _display->print(message[i]); + _display->display(); + } + } + } + + /*! + @brief Writes a message to the fake "SSD1306" SH1107 display. + @param message + The message to be displayed. + */ + void WriteMessageSSD1306(const char *message) { + // This is a SH1107, not a SSD1306, so we just call the SH1107 write + WriteMessageSH1107(message); + } + +protected: + Adafruit_SH1107 *_display = + nullptr; ///< Pointer to the Adafruit_SH1107 object + uint8_t _width; ///< Width of the display in pixels + uint8_t _height; ///< Height of the display in pixels + uint8_t _rotation; ///< Rotation of the display (0-3) + uint8_t _text_sz; ///< Text size of the display +}; + +#endif // WIPPERSNAPPER_I2C_DRIVER_OUT_SH1107_H diff --git a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_Ssd1306.h b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_Ssd1306.h index 40bfd95bb..454a5852f 100644 --- a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_Ssd1306.h +++ b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_Ssd1306.h @@ -20,8 +20,10 @@ #include #include -#define DEFAULT_WIDTH 128 ///< Default width for a ssd1306 128x64 display -#define DEFAULT_HEIGHT 64 ///< Default height for a ssd1306 128x64 display +#define WS_SSD1306_DEFAULT_WIDTH \ + 128 ///< Default width for a ssd1306 128x64 display +#define WS_SSD1306_DEFAULT_HEIGHT \ + 64 ///< Default height for a ssd1306 128x64 display /*! @brief Class that provides a driver interface for a SSD1306 @@ -44,8 +46,8 @@ class WipperSnapper_I2C_Driver_Out_Ssd1306 : WipperSnapper_I2C_Driver_Out(i2c, sensorAddress) { _i2c = i2c; _sensorAddress = sensorAddress; - _width = DEFAULT_WIDTH; - _height = DEFAULT_HEIGHT; + _width = WS_SSD1306_DEFAULT_WIDTH; + _height = WS_SSD1306_DEFAULT_HEIGHT; } /*! @@ -70,7 +72,8 @@ class WipperSnapper_I2C_Driver_Out_Ssd1306 _display = new Adafruit_SSD1306(_width, _height, _i2c); if (!_display->begin(SSD1306_SWITCHCAPVCC, _sensorAddress)) return false; - // Configure the text size and color + // Configure the rotation, text size and color + _display->setRotation(_rotation); _display->setTextSize(_text_sz); _display->setTextColor(SSD1306_WHITE); // Use full 256 char 'Code Page 437' font @@ -90,11 +93,15 @@ class WipperSnapper_I2C_Driver_Out_Ssd1306 The height of the display in pixels. @param text_size The magnification factor for the text size. + @param rotation + The rotation of the display in degrees, default is 0. */ - void ConfigureSSD1306(uint8_t width, uint8_t height, uint8_t text_size) { + void ConfigureSSD1306(uint8_t width, uint8_t height, uint8_t text_size, + uint8_t rotation = 0) { _width = width; _height = height; _text_sz = text_size; + _rotation = rotation; } /*! @@ -149,10 +156,11 @@ class WipperSnapper_I2C_Driver_Out_Ssd1306 protected: Adafruit_SSD1306 *_display = - nullptr; ///< Pointer to the Adafruit_SSD1306 object - uint8_t _width; ///< Width of the display in pixels - uint8_t _height; ///< Height of the display in pixels - uint8_t _text_sz; ///< Text size of the display + nullptr; ///< Pointer to the Adafruit_SSD1306 object + uint8_t _width; ///< Width of the display in pixels + uint8_t _height; ///< Height of the display in pixels + uint8_t _rotation; ///< Rotation of the display in degrees + uint8_t _text_sz; ///< Text size of the display }; #endif // WIPPERSNAPPER_I2C_DRIVER_OUT_SSD1306_H \ No newline at end of file