Skip to content
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
110 changes: 84 additions & 26 deletions components/lcd/esp_lcd_ssd1681/esp_lcd_panel_ssd1681.c

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions components/lcd/esp_lcd_ssd1681/esp_lcd_ssd1681_commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@
#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-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
// the address counter is updated in the X direction
// AM = 0, the address counter is updated in the X direction
// 000 - Y decrement, X decrement
#define SSD1681_PARAM_DATA_ENTRY_MODE_0 0x00
// 001 – Y decrement, X increment
#define SSD1681_PARAM_DATA_ENTRY_MODE_1 0x01
// 010 - Y increment, X decrement
#define SSD1681_PARAM_DATA_ENTRY_MODE_2 0x02
// 011 - Y increment, X increment
// AM = 1, the address counter is updated in the Y direction
#define SSD1681_PARAM_DATA_ENTRY_MODE_3 0x03
// AM = 1, the address counter is updated in the Y direction
// 100 - Y decrement, X decrement
#define SSD1681_PARAM_DATA_ENTRY_MODE_4 0x04
// 101 – Y decrement, X increment
Expand Down
12 changes: 9 additions & 3 deletions components/lcd/esp_lcd_ssd1681/examples/epaper_demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This example shows how to use SSD1681 e-paper display driver from Component mana
### Hardware Required

* An ESP development board
* An SSD1681 e-paper panel, with SPI interface
* An SSD1681 or SSD1680 e-paper panel, with SPI interface
* An USB cable for power supply and programming

### Hardware Connection
Expand Down Expand Up @@ -42,7 +42,9 @@ The GPIO number used by this example can be changed in [main.c](main/main.c).
### Software configuration

- Change all the `EXAMPLE_PIN` macro definition according to your hardware connection.
- If you are not using waveshare 1.54 inch V2 e-paper panel, please use the waveform lut provided by your panel vendor instead of using the demo built-in ones, or just simply comment the `epaper_panel_set_custom_lut` call and use the panel built-in waveform lut.
- Select the display model in esp_lcd_panel_ssd1681.h. Supported displays are 1.54 inch 200x200 and 2.7 inch 176x264. The 2.7 inch display has a SSD1680 controller.
- If you are not using waveshare 1.54 inch V2 e-paper panel, please use the waveform lut provided by your panel vendor instead of using the demo built-in ones, or just simply comment out the `epaper_panel_set_custom_lut` call and use the panel built-in waveform lut.
NOTE: Waveshare and GooDisplay epaper displays can default to use built-in LUT.

### Build and Flash

Expand Down Expand Up @@ -72,7 +74,10 @@ I (720) epaper_demo_plain: Drawing bitmap...
...
```

## Show Custom Bitmap
## Show Test Images

Images are found in img_bitmap.c and bitmaps_176x264.c. If you want to test other size panels you should make your own bitmap image files.
Choosing the display (see Software COnfiguration) also selects an appropriate test image.

As you could see from the demo, each bitmap is stored as an array. If you want to display your custom image, you need to convert your image to a bitmap array first.

Expand All @@ -87,6 +92,7 @@ You could convert your image to bitmap array by the following steps:
- Do not select the `Output in big-endian format` option.
- Click `Convert` and you get a `.c` file containing the bitmap array.

Programs image2cpp or img2cpp can generate bitmap.c files from JPEG or PNG inputs.
There are plenty of software alternative with such functionality, please pay attention to the scan mode if you prefer to use them.

The driver writes bitmap array to the vram in the sequence below by default:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
idf_component_register(SRCS "main.c" "img_bitmap.c"
idf_component_register(SRCS "bitmaps_176x264.c" "main.c" "img_bitmap.c"
INCLUDE_DIRS "")
1,110 changes: 1,110 additions & 0 deletions components/lcd/esp_lcd_ssd1681/examples/epaper_demo/main/bitmaps_176x264.c

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ const uint8_t BITMAP_200_200[] = { /* 0X00,0X01,0XC8,0X00,0XC8,0X00, */
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X01, 0X80, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X01, 0X80, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X01, 0XFF,
0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X01,
0XFF,
0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF,
0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ extern "C" {
extern const uint8_t BITMAP_200_200[];
extern const uint8_t BITMAP_128_64[];
extern const uint8_t BITMAP_64_128[];

extern const uint8_t BITMAP_176_264[];
extern const uint8_t BITMAP_264_176[];
extern const uint8_t TEXT_176_264[];
#ifdef __cplusplus
}
#endif
Loading