Skip to content

Commit f3f6ba6

Browse files
mringwalC47D
authored andcommitted
Added PCD8544 to readme, addressed PR comments
1 parent 37a4d3a commit f3f6ba6

File tree

3 files changed

+27
-24
lines changed

3 files changed

+27
-24
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ swap of RGB565 color on the LVGL configuration menuconfig (it's not handled auto
3030
| RA8875 | TFT | SPI | 16: RGB565 | Yes |
3131
| SH1107 | Monochrome | SPI | 1: 1byte per pixel | No |
3232
| SSD1306 | Monochrome | I2C | 1: 1byte per pixel | No |
33+
| PCD8544 | Monochrome | SPI | 1: 1byte per pixel | No |
3334
| IL3820 | e-Paper | SPI | 1: 1byte per pixel | No |
3435
| UC8151D/ GoodDisplay GDEW0154M10 DES | e-Paper | SPI | 1: 1byte per pixel | No |
3536
| FitiPower JD79653A/ GoodDisplay GDEW0154M09 | e-Paper | SPI | 1: 1byte per pixel | No |

lvgl_tft/pcd8544.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,12 @@ void pcd8544_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t
116116

117117
uint8_t * buf = (uint8_t *) color_map;
118118

119+
// Check if the whole frame buffer can be sent in a single SPI transaction
120+
119121
if ((area->x1 == 0) && (area->y1 == 0) && (area->x2 == (disp_drv->hor_res - 1)) && (area->y2 == (disp_drv->ver_res - 1))){
120122

121-
// optimize flush of complete frame buffer in a single SPI transaction
123+
// send complete frame buffer at once.
124+
// NOTE: disp_spi_send_colors triggers lv_disp_flush_ready
122125

123126
pcd8544_send_cmd(0x40); /* set Y address */
124127
pcd8544_send_cmd(0x80); /* set X address */
@@ -134,13 +137,12 @@ void pcd8544_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t
134137
uint16_t bank;
135138
uint16_t cols_to_update = area->x2 - area->x1 + 1;
136139
for (bank = bank_start ; bank <= bank_end ; bank++ ){
137-
pcd8544_send_cmd(0x40 | bank ); /* set Y address */
140+
pcd8544_send_cmd(0x40 | bank ); /* set Y address */
138141
pcd8544_send_cmd(0x80 | area->x1 ); /* set X address */
139142
uint16_t offset = bank * disp_drv->hor_res + area->x1;
140143
pcd8544_send_data(&buf[offset], cols_to_update);
141144
}
142145

143146
lv_disp_flush_ready(disp_drv);
144-
145147
}
146148
}

lvgl_tft/pcd8544.h

+21-21
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
extern "C" {
1212
#endif
1313

14-
/*********************
15-
* INCLUDES
16-
*********************/
14+
/*********************
15+
* INCLUDES
16+
*********************/
1717
#include <stdbool.h>
1818

1919
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
@@ -22,32 +22,32 @@ extern "C" {
2222
#include "lvgl/lvgl.h"
2323
#endif
2424

25-
/*********************
26-
* DEFINES
27-
*********************/
25+
/*********************
26+
* DEFINES
27+
*********************/
2828

2929
#define PCD8544_DC CONFIG_LV_DISP_PIN_DC
3030
#define PCD8544_RST CONFIG_LV_DISP_PIN_RST
3131
#define PCD8544_BCKL CONFIG_LV_DISP_PIN_BCKL
3232

33-
/**********************
34-
* TYPEDEFS
35-
**********************/
33+
/**********************
34+
* TYPEDEFS
35+
**********************/
3636

37-
/**********************
38-
* GLOBAL PROTOTYPES
39-
**********************/
37+
/**********************
38+
* GLOBAL PROTOTYPES
39+
**********************/
4040

41-
void pcd8544_init(void);
42-
void pcd8544_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * color_map);
43-
void pcd8544_rounder(lv_disp_drv_t * disp_drv, lv_area_t *area);
44-
void pcd8544_set_px_cb(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y,
45-
lv_color_t color, lv_opa_t opa);
46-
void pcd8544_set_contrast(uint8_t contrast);
41+
void pcd8544_init(void);
42+
void pcd8544_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * color_map);
43+
void pcd8544_rounder(lv_disp_drv_t * disp_drv, lv_area_t *area);
44+
void pcd8544_set_px_cb(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y,
45+
lv_color_t color, lv_opa_t opa);
46+
void pcd8544_set_contrast(uint8_t contrast);
4747

48-
/**********************
49-
* MACROS
50-
**********************/
48+
/**********************
49+
* MACROS
50+
**********************/
5151

5252

5353
#ifdef __cplusplus

0 commit comments

Comments
 (0)