Skip to content

ssd1680 support (BSP-643) #521

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 7 additions & 2 deletions components/lcd/esp_lcd_ssd1681/esp_lcd_panel_ssd1681.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ typedef struct {
bool _mirror_x;
uint8_t *_framebuffer;
bool _invert_color;
int _rows;
} epaper_panel_t;

// --- Utility functions
Expand Down Expand Up @@ -270,7 +271,11 @@ esp_lcd_new_panel_ssd1681(const esp_lcd_panel_io_handle_t io, const esp_lcd_pane
epaper_panel->busy_gpio_num = epaper_ssd1681_conf->busy_gpio_num;
epaper_panel->reset_level = panel_dev_config->flags.reset_active_high;
epaper_panel->_non_copy_mode = epaper_ssd1681_conf->non_copy_mode;
// functions
epaper_panel->_rows = epaper_ssd1681_conf->rows ?
(epaper_ssd1681_conf->rows - 1) : (SSD1681_EPD_1IN54_V2_HEIGHT - 1);
if(epaper_panel->_rows != (SSD1681_EPD_1IN54_V2_HEIGHT - 1) &&
Comment on lines +275 to +276
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(epaper_ssd1681_conf->rows - 1) : (SSD1681_EPD_1IN54_V2_HEIGHT - 1);
if(epaper_panel->_rows != (SSD1681_EPD_1IN54_V2_HEIGHT - 1) &&
(epaper_ssd1681_conf->rows) : (SSD1681_EPD_1IN54_V2_HEIGHT);
if(epaper_panel->_rows != (SSD1681_EPD_1IN54_V2_HEIGHT) &&

epaper_panel->_non_copy_mode == false)
ESP_LOGE(TAG, "Overridden row count requires non_copy_mode to be true");
epaper_panel->base.del = epaper_panel_del;
epaper_panel->base.reset = epaper_panel_reset;
epaper_panel->base.init = epaper_panel_init;
Expand Down Expand Up @@ -383,7 +388,7 @@ static esp_err_t epaper_panel_init(esp_lcd_panel_t *panel)
panel_epaper_wait_busy(panel);
// --- Driver Output Control
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(epaper_panel->io, SSD1681_CMD_OUTPUT_CTRL,
SSD1681_PARAM_OUTPUT_CTRL, 3), TAG, "SSD1681_CMD_OUTPUT_CTRL err");
SSD1681_PARAM_OUTPUT_CTRL(epaper_panel->_rows), 3), TAG, "SSD1681_CMD_OUTPUT_CTRL err");

// --- Border Waveform Control
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(epaper_panel->io, SSD1681_CMD_SET_BORDER_WAVEFORM, (uint8_t[]) {
Expand Down
3 changes: 2 additions & 1 deletion components/lcd/esp_lcd_ssd1681/esp_lcd_ssd1681_commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#define SSD1681_CMD_SWRST 0x12
// --- Driver output control
#define SSD1681_CMD_OUTPUT_CTRL 0x01
#define SSD1681_PARAM_OUTPUT_CTRL ((uint8_t[]) {0xc7, 0x00, 0x00})
// Chipset wants (total row count - 1) i.e. 250 rows = 249 here
#define SSD1681_PARAM_OUTPUT_CTRL(rows) ((uint8_t[]) {(rows) & 0xFF, (rows) >> 8, 0x00})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define SSD1681_PARAM_OUTPUT_CTRL(rows) ((uint8_t[]) {(rows) & 0xFF, (rows) >> 8, 0x00})
#define SSD1681_PARAM_OUTPUT_CTRL(rows) ((uint8_t[]) {(rows - 1) & 0xFF, (rows - 1) >> 8, 0x00})

// --- Data Entry Sequence Setting
#define SSD1681_CMD_DATA_ENTRY_MODE 0x11
// A [1:0] = ID[1:0], A[2] = AM
Expand Down
2 changes: 1 addition & 1 deletion components/lcd/esp_lcd_ssd1681/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "0.1.0~1"
version: "0.1.1"
description: ESP LCD SSD1681 e-paper driver
url: https://github.com/espressif/esp-bsp/tree/master/components/lcd/esp_lcd_ssd1681
dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ typedef struct {
int busy_gpio_num; /*!< GPIO num of the BUSY pin */
bool non_copy_mode; /*!< If the bitmap would be copied or not.
* Image rotation and mirror is limited when enabling. */
int rows; /*!< Override rows count (0 = defaults to 200 rows) */
} esp_lcd_ssd1681_config_t;

/**
Expand Down