Skip to content

Add SH1106 driver, 64px layout support and configurable display settings#11

Open
mlodedrwale wants to merge 6 commits into031devstudios:masterfrom
mlodedrwale:SH1106
Open

Add SH1106 driver, 64px layout support and configurable display settings#11
mlodedrwale wants to merge 6 commits into031devstudios:masterfrom
mlodedrwale:SH1106

Conversation

@mlodedrwale
Copy link

@mlodedrwale mlodedrwale commented Nov 16, 2025

Pull Request

Summary

This PR adds SH1106 driver support, introduces a 64 px layout variant, and refactors the display configuration so it can be locally overridden via my_config.h (which is kept out of version control via .gitignore).

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Code refactoring

Changes Made

  • Added Sh1106Driver implementation alongside the existing SSD1306 support.
  • Integrated SH1106 into the display abstraction so the active driver is selected via DISPLAY_CONTROLLER.
  • Added support for 64 px tall displays:
    • Introduced DISPLAY_HEIGHT_64.
    • Hooked up the ClassicLayout64 so it is used when DISPLAY_HEIGHT is set to the 64 px option.
    • Kept 32 px behaviour unchanged for backward compatibility.
  • Centralised display-related constants in config.h:
    • DISPLAY_WIDTH
    • DISPLAY_HEIGHT_32, DISPLAY_HEIGHT_64
    • DISPLAY_CONTROLLER_SSD1306, DISPLAY_CONTROLLER_SH1106
    • default DISPLAY_CONTROLLER and DISPLAY_HEIGHT guarded with #ifndef.
  • Added an optional my_config.h override mechanism:
    • my_config.h is included at the end of config.h if present (using a conditional include).
    • Any of the display-related macros can be overridden there for local setups.
    • my_config.h is added to .gitignore so local configuration does not leak into the repo.
  • Example my_config.h usage:
    #pragma once
    
    #define DISPLAY_CONTROLLER DISPLAY_CONTROLLER_SH1106
    #define DISPLAY_HEIGHT     DISPLAY_HEIGHT_64
    

Testing

  • I have tested this change on actual hardware
  • I have tested the web interface (if applicable)
  • I have verified WiFi functionality works correctly
  • I have tested with different coffee scale configurations

Hardware Tested On

  • ESP32-S3 SuperMini
  • SH1106, 128×64 – using the new Sh1106Driver and 64 px layout.
  • SH1106, 128×32 – using the new Sh1106Driver and 32 px layout. On 64px height display, using half of it
  • SSD1306, 128×32 – using the existing SSD1306 driver and 32 px layout.

Screenshots (if applicable)

image

Checklist

  • My code follows the existing code style
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if needed)
  • My changes generate no new compiler warnings
  • I have tested that existing functionality still works

Additional Notes

Any additional information, context, or concerns about this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant