Skip to content

Commit

Permalink
Feature: Add support for ST7567 GM12864I-59N Display
Browse files Browse the repository at this point in the history
  • Loading branch information
tbnobody committed Jan 26, 2024
1 parent a5cc0a4 commit 4e669d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/Display_Graphic.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enum DisplayType_t {
SSD1306,
SH1106,
SSD1309,
ST7567_GM12864I_59N,
DisplayType_Max,
};

Expand Down
4 changes: 4 additions & 0 deletions src/Display_Graphic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ std::map<DisplayType_t, std::function<U8G2*(uint8_t, uint8_t, uint8_t, uint8_t)>
{ DisplayType_t::SSD1306, [](uint8_t reset, uint8_t clock, uint8_t data, uint8_t cs) { return new U8G2_SSD1306_128X64_NONAME_F_HW_I2C(U8G2_R0, reset, clock, data); } },
{ DisplayType_t::SH1106, [](uint8_t reset, uint8_t clock, uint8_t data, uint8_t cs) { return new U8G2_SH1106_128X64_NONAME_F_HW_I2C(U8G2_R0, reset, clock, data); } },
{ DisplayType_t::SSD1309, [](uint8_t reset, uint8_t clock, uint8_t data, uint8_t cs) { return new U8G2_SSD1309_128X64_NONAME0_F_HW_I2C(U8G2_R0, reset, clock, data); } },
{ DisplayType_t::ST7567_GM12864I_59N, [](uint8_t reset, uint8_t clock, uint8_t data, uint8_t cs) { return new U8G2_ST7567_ENH_DG128064I_F_HW_I2C(U8G2_R0, reset, clock, data); } },
};

// Language defintion, respect order in languages[] and translation lists
Expand Down Expand Up @@ -50,6 +51,9 @@ void DisplayGraphicClass::init(Scheduler& scheduler, const DisplayType_t type, c
if (isValidDisplay()) {
auto constructor = display_types[_display_type];
_display = constructor(reset, clk, data, cs);
if (_display_type == DisplayType_t::ST7567_GM12864I_59N) {
_display->setI2CAddress(0x3F << 1);
}
_display->begin();
setContrast(DISPLAY_CONTRAST);
setStatus(true);
Expand Down

0 comments on commit 4e669d8

Please sign in to comment.