forked from xiaozhi/xiaozhi-esp32
SH1106 Supported (#416)
* SH1106 Supported * OLED_SSD1306_128X64_SH1106 -> OLED_SH1106_128X64
This commit is contained in:
@@ -166,6 +166,8 @@ choice DISPLAY_OLED_TYPE
|
|||||||
bool "SSD1306, 分辨率128*32"
|
bool "SSD1306, 分辨率128*32"
|
||||||
config OLED_SSD1306_128X64
|
config OLED_SSD1306_128X64
|
||||||
bool "SSD1306, 分辨率128*64"
|
bool "SSD1306, 分辨率128*64"
|
||||||
|
config OLED_SH1106_128X64
|
||||||
|
bool "SH1106, 分辨率128*64"
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
choice DISPLAY_LCD_TYPE
|
choice DISPLAY_LCD_TYPE
|
||||||
|
|||||||
@@ -15,6 +15,10 @@
|
|||||||
#include <esp_lcd_panel_ops.h>
|
#include <esp_lcd_panel_ops.h>
|
||||||
#include <esp_lcd_panel_vendor.h>
|
#include <esp_lcd_panel_vendor.h>
|
||||||
|
|
||||||
|
#ifdef SH1106
|
||||||
|
#include <esp_lcd_panel_sh1106.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define TAG "CompactWifiBoard"
|
#define TAG "CompactWifiBoard"
|
||||||
|
|
||||||
LV_FONT_DECLARE(font_puhui_14_1);
|
LV_FONT_DECLARE(font_puhui_14_1);
|
||||||
@@ -76,7 +80,11 @@ private:
|
|||||||
};
|
};
|
||||||
panel_config.vendor_config = &ssd1306_config;
|
panel_config.vendor_config = &ssd1306_config;
|
||||||
|
|
||||||
|
#ifdef SH1106
|
||||||
|
ESP_ERROR_CHECK(esp_lcd_new_panel_sh1106(panel_io_, &panel_config, &panel_));
|
||||||
|
#else
|
||||||
ESP_ERROR_CHECK(esp_lcd_new_panel_ssd1306(panel_io_, &panel_config, &panel_));
|
ESP_ERROR_CHECK(esp_lcd_new_panel_ssd1306(panel_io_, &panel_config, &panel_));
|
||||||
|
#endif
|
||||||
ESP_LOGI(TAG, "SSD1306 driver installed");
|
ESP_LOGI(TAG, "SSD1306 driver installed");
|
||||||
|
|
||||||
// Reset the display
|
// Reset the display
|
||||||
|
|||||||
@@ -42,6 +42,9 @@
|
|||||||
#define DISPLAY_HEIGHT 32
|
#define DISPLAY_HEIGHT 32
|
||||||
#elif CONFIG_OLED_SSD1306_128X64
|
#elif CONFIG_OLED_SSD1306_128X64
|
||||||
#define DISPLAY_HEIGHT 64
|
#define DISPLAY_HEIGHT 64
|
||||||
|
#elif CONFIG_OLED_SH1106_128X64
|
||||||
|
#define DISPLAY_HEIGHT 64
|
||||||
|
#define SH1106
|
||||||
#else
|
#else
|
||||||
#error "未选择 OLED 屏幕类型"
|
#error "未选择 OLED 屏幕类型"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ dependencies:
|
|||||||
lvgl/lvgl: "~9.2.2"
|
lvgl/lvgl: "~9.2.2"
|
||||||
esp_lvgl_port: "~2.4.4"
|
esp_lvgl_port: "~2.4.4"
|
||||||
espressif/esp_io_expander_tca95xx_16bit: "^2.0.0"
|
espressif/esp_io_expander_tca95xx_16bit: "^2.0.0"
|
||||||
|
tny-robotics/sh1106-esp-idf: ^1.0.0
|
||||||
## Required IDF version
|
## Required IDF version
|
||||||
idf:
|
idf:
|
||||||
version: ">=5.3"
|
version: ">=5.3"
|
||||||
|
|||||||
Reference in New Issue
Block a user