Removed white space at EOL, added some EOLs at EOF

Many code editors are set to do this automatically now, so it ends up being annoying to scrape back out of commits to keep them easily reviewable.

Also added '.DS_Store' and 'build' entries to .gitignore
This commit is contained in:
Rop Gonggrijp 2021-04-28 11:15:00 +02:00
parent 7b571a7fc7
commit 00dd1504d9
8 changed files with 48 additions and 42 deletions

6
.gitignore vendored
View file

@ -50,3 +50,9 @@ modules.order
Module.symvers Module.symvers
Mkfile.old Mkfile.old
dkms.conf dkms.conf
# MacOS
.DS_Store
# ESP-IDF build dir
build

View file

@ -68,7 +68,7 @@ void EVE_get_cmdoffset(void);
/* commands to operate on memory: */ /* commands to operate on memory: */
void EVE_cmd_memzero(uint32_t ptr, uint32_t num); void EVE_cmd_memzero(uint32_t ptr, uint32_t num);
void EVE_cmd_memset(uint32_t ptr, uint8_t value, uint32_t num); void EVE_cmd_memset(uint32_t ptr, uint8_t value, uint32_t num);
void EVE_cmd_memwrite(uint32_t dest, uint32_t num, const uint8_t *data); void EVE_cmd_memwrite(uint32_t dest, uint32_t num, const uint8_t *data);
void EVE_cmd_memcpy(uint32_t dest, uint32_t src, uint32_t num); void EVE_cmd_memcpy(uint32_t dest, uint32_t src, uint32_t num);
#if FT81X_FULL #if FT81X_FULL

View file

@ -250,7 +250,7 @@ void TFT_bitmap_display(void)
EVE_cmd_dl(TAG(0)); EVE_cmd_dl(TAG(0));
EVE_cmd_dl(DL_DISPLAY); /* instruct the graphics processor to show the list */ EVE_cmd_dl(DL_DISPLAY); /* instruct the graphics processor to show the list */
EVE_cmd_dl(CMD_SWAP); /* make this list active */ EVE_cmd_dl(CMD_SWAP); /* make this list active */
EVE_end_cmd_burst(); /* stop writing to the cmd-fifo */ EVE_end_cmd_burst(); /* stop writing to the cmd-fifo */
@ -273,7 +273,7 @@ void FT81x_init(void)
#endif #endif
spi_acquire(); spi_acquire();
if(EVE_init()) if(EVE_init())
{ {
tft_active = 1; tft_active = 1;
@ -284,7 +284,7 @@ void FT81x_init(void)
EVE_cmd_memset(SCREEN_BITMAP_ADDR, BLACK, SCREEN_BUFFER_SIZE); // clear screen buffer EVE_cmd_memset(SCREEN_BITMAP_ADDR, BLACK, SCREEN_BUFFER_SIZE); // clear screen buffer
EVE_cmd_execute(); EVE_cmd_execute();
TFT_bitmap_display(); // set DL for fullscreen bitmap display TFT_bitmap_display(); // set DL for fullscreen bitmap display
} }
@ -326,4 +326,4 @@ void TFT_WriteBitmap(uint8_t* Bitmap, uint16_t X, uint16_t Y, uint16_t Width, ui
void FT81x_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * color_map) void FT81x_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * color_map)
{ {
TFT_WriteBitmap((uint8_t*)color_map, area->x1, area->y1, lv_area_get_width(area), lv_area_get_height(area)); TFT_WriteBitmap((uint8_t*)color_map, area->x1, area->y1, lv_area_get_width(area), lv_area_get_height(area));
} }

View file

@ -173,7 +173,7 @@ void GC9A01_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * colo
uint8_t data[4]; uint8_t data[4];
/*Column addresses*/ /*Column addresses*/
GC9A01_send_cmd(0x2A); //0x2A GC9A01_send_cmd(0x2A); //0x2A
data[0] = (area->x1 >> 8) & 0xFF; data[0] = (area->x1 >> 8) & 0xFF;
data[1] = area->x1 & 0xFF; data[1] = area->x1 & 0xFF;
data[2] = (area->x2 >> 8) & 0xFF; data[2] = (area->x2 >> 8) & 0xFF;
@ -181,7 +181,7 @@ void GC9A01_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * colo
GC9A01_send_data(data, 4); GC9A01_send_data(data, 4);
/*Page addresses*/ /*Page addresses*/
GC9A01_send_cmd(0x2B); //0x2B GC9A01_send_cmd(0x2B); //0x2B
data[0] = (area->y1 >> 8) & 0xFF; data[0] = (area->y1 >> 8) & 0xFF;
data[1] = area->y1 & 0xFF; data[1] = area->y1 & 0xFF;
data[2] = (area->y2 >> 8) & 0xFF; data[2] = (area->y2 >> 8) & 0xFF;
@ -189,7 +189,7 @@ void GC9A01_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * colo
GC9A01_send_data(data, 4); GC9A01_send_data(data, 4);
/*Memory write*/ /*Memory write*/
GC9A01_send_cmd(0x2C); //0x2C GC9A01_send_cmd(0x2C); //0x2C
uint32_t size = lv_area_get_width(area) * lv_area_get_height(area); uint32_t size = lv_area_get_width(area) * lv_area_get_height(area);
@ -217,7 +217,7 @@ void GC9A01_sleep_in()
{ {
uint8_t data[] = {0x08}; uint8_t data[] = {0x08};
GC9A01_send_cmd(0x10); //0x10 Enter Sleep Mode GC9A01_send_cmd(0x10); //0x10 Enter Sleep Mode
GC9A01_send_data(&data, 1); GC9A01_send_data(&data, 1);
} }
void GC9A01_sleep_out() void GC9A01_sleep_out()

View file

@ -744,11 +744,11 @@ menu "LVGL TFT Display controller"
config LV_DISP_ST7789_SOFT_RESET config LV_DISP_ST7789_SOFT_RESET
bool "Soft reset - use software reset instead of reset pin" bool "Soft reset - use software reset instead of reset pin"
depends on LV_TFT_DISPLAY_CONTROLLER_ST7789 depends on LV_TFT_DISPLAY_CONTROLLER_ST7789
default n default n
help help
Use software reset and ignores configured reset pin (some hardware does not use a reset pin). Use software reset and ignores configured reset pin (some hardware does not use a reset pin).
endmenu endmenu
# menu will be visible only when LV_PREDEFINED_DISPLAY_NONE is y # menu will be visible only when LV_PREDEFINED_DISPLAY_NONE is y

View file

@ -73,9 +73,9 @@ static uint8_t il3820_lut_initial[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}; };
static uint8_t il3820_lut_default[] = { static uint8_t il3820_lut_default[] = {
0x10, 0x18, 0x18, 0x08, 0x18, 0x18, 0x10, 0x18, 0x18, 0x08, 0x18, 0x18,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x13, 0x14, 0x44, 0x12, 0x00, 0x00, 0x13, 0x14, 0x44, 0x12,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}; };
@ -113,7 +113,7 @@ void il3820_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_m
uint8_t *buffer = (uint8_t*) color_map; uint8_t *buffer = (uint8_t*) color_map;
uint16_t x_addr_counter = 0; uint16_t x_addr_counter = 0;
uint16_t y_addr_counter = 0; uint16_t y_addr_counter = 0;
/* Configure entry mode */ /* Configure entry mode */
il3820_write_cmd(IL3820_CMD_ENTRY_MODE, &il3820_scan_mode, 1); il3820_write_cmd(IL3820_CMD_ENTRY_MODE, &il3820_scan_mode, 1);
@ -131,7 +131,7 @@ void il3820_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_m
il3820_set_cursor(x_addr_counter, y_addr_counter); il3820_set_cursor(x_addr_counter, y_addr_counter);
il3820_send_cmd(IL3820_CMD_WRITE_RAM); il3820_send_cmd(IL3820_CMD_WRITE_RAM);
/* Write the pixel data to graphic RAM, linelen bytes at the time. */ /* Write the pixel data to graphic RAM, linelen bytes at the time. */
for(size_t row = 0; row <= (EPD_PANEL_HEIGHT - 1); row++){ for(size_t row = 0; row <= (EPD_PANEL_HEIGHT - 1); row++){
il3820_send_data(buffer, linelen); il3820_send_data(buffer, linelen);
@ -139,7 +139,7 @@ void il3820_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_m
} }
il3820_set_window(0, EPD_PANEL_WIDTH - 1, 0, EPD_PANEL_HEIGHT - 1); il3820_set_window(0, EPD_PANEL_WIDTH - 1, 0, EPD_PANEL_HEIGHT - 1);
il3820_update_display(); il3820_update_display();
/* IMPORTANT!!! /* IMPORTANT!!!
@ -152,7 +152,7 @@ void il3820_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_m
* BIT_SET(byte_index, bit_index) clears the bit_index pixel at byte_index of * BIT_SET(byte_index, bit_index) clears the bit_index pixel at byte_index of
* the display buffer. * the display buffer.
* BIT_CLEAR(byte_index, bit_index) sets the bit_index pixel at the byte_index * BIT_CLEAR(byte_index, bit_index) sets the bit_index pixel at the byte_index
* of the display buffer. */ * of the display buffer. */
void il3820_set_px_cb(lv_disp_drv_t * disp_drv, uint8_t* buf, void il3820_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, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y,
lv_color_t color, lv_opa_t opa) lv_color_t color, lv_opa_t opa)
@ -217,7 +217,7 @@ void il3820_init(void)
/* Software reset */ /* Software reset */
il3820_write_cmd(IL3820_CMD_SW_RESET, NULL, 0); il3820_write_cmd(IL3820_CMD_SW_RESET, NULL, 0);
/* Busy wait for the BUSY signal to go low */ /* Busy wait for the BUSY signal to go low */
il3820_waitbusy(IL3820_WAIT); il3820_waitbusy(IL3820_WAIT);
@ -245,10 +245,10 @@ void il3820_init(void)
// allow partial updates now // allow partial updates now
il3820_partial = true; il3820_partial = true;
/* Update LUT */ /* Update LUT */
il3820_write_cmd(IL3820_CMD_UPDATE_LUT, il3820_lut_default, sizeof(il3820_lut_default)); il3820_write_cmd(IL3820_CMD_UPDATE_LUT, il3820_lut_default, sizeof(il3820_lut_default));
/* Clear control memory and update */ /* Clear control memory and update */
il3820_clear_cntlr_mem(IL3820_CMD_WRITE_RAM, true); il3820_clear_cntlr_mem(IL3820_CMD_WRITE_RAM, true);
} }
@ -257,10 +257,10 @@ void il3820_init(void)
void il3820_sleep_in(void) void il3820_sleep_in(void)
{ {
uint8_t data[] = {0x01}; uint8_t data[] = {0x01};
/* Wait for the BUSY signal to go low */ /* Wait for the BUSY signal to go low */
il3820_waitbusy(IL3820_WAIT); il3820_waitbusy(IL3820_WAIT);
il3820_write_cmd(IL3820_CMD_SLEEP_MODE, data, 1); il3820_write_cmd(IL3820_CMD_SLEEP_MODE, data, 1);
} }
@ -270,15 +270,15 @@ static void il3820_waitbusy(int wait_ms)
int i = 0; int i = 0;
vTaskDelay(10 / portTICK_RATE_MS); // 10ms delay vTaskDelay(10 / portTICK_RATE_MS); // 10ms delay
for(i = 0; i < (wait_ms * 10); i++) { for(i = 0; i < (wait_ms * 10); i++) {
if(gpio_get_level(IL3820_BUSY_PIN) != IL3820_BUSY_LEVEL) { if(gpio_get_level(IL3820_BUSY_PIN) != IL3820_BUSY_LEVEL) {
return; return;
} }
vTaskDelay(10 / portTICK_RATE_MS); vTaskDelay(10 / portTICK_RATE_MS);
} }
ESP_LOGE( TAG, "busy exceeded %dms", i*10 ); ESP_LOGE( TAG, "busy exceeded %dms", i*10 );
} }
@ -294,10 +294,10 @@ static inline void il3820_data_mode(void)
gpio_set_level(IL3820_DC_PIN, 1); gpio_set_level(IL3820_DC_PIN, 1);
} }
static inline void il3820_write_cmd(uint8_t cmd, uint8_t *data, size_t len) static inline void il3820_write_cmd(uint8_t cmd, uint8_t *data, size_t len)
{ {
disp_wait_for_pending_transactions(); disp_wait_for_pending_transactions();
il3820_command_mode(); il3820_command_mode();
disp_spi_send_data(&cmd, 1); disp_spi_send_data(&cmd, 1);
@ -308,10 +308,10 @@ static inline void il3820_write_cmd(uint8_t cmd, uint8_t *data, size_t len)
} }
/* Send cmd to the display */ /* Send cmd to the display */
static inline void il3820_send_cmd(uint8_t cmd) static inline void il3820_send_cmd(uint8_t cmd)
{ {
disp_wait_for_pending_transactions(); disp_wait_for_pending_transactions();
il3820_command_mode(); il3820_command_mode();
disp_spi_send_data(&cmd, 1); disp_spi_send_data(&cmd, 1);
} }
@ -320,14 +320,14 @@ static inline void il3820_send_cmd(uint8_t cmd)
static void il3820_send_data(uint8_t *data, uint16_t length) static void il3820_send_data(uint8_t *data, uint16_t length)
{ {
disp_wait_for_pending_transactions(); disp_wait_for_pending_transactions();
il3820_data_mode(); il3820_data_mode();
disp_spi_send_colors(data, length); disp_spi_send_colors(data, length);
} }
/* Specify the start/end positions of the window address in the X and Y /* Specify the start/end positions of the window address in the X and Y
* directions by an address unit. * directions by an address unit.
* *
* @param sx: X Start position. * @param sx: X Start position.
* @param ex: X End position. * @param ex: X End position.
* @param ys: Y Start position. * @param ys: Y Start position.
@ -336,7 +336,7 @@ static void il3820_send_data(uint8_t *data, uint16_t length)
static inline void il3820_set_window( uint16_t sx, uint16_t ex, uint16_t ys, uint16_t ye) static inline void il3820_set_window( uint16_t sx, uint16_t ex, uint16_t ys, uint16_t ye)
{ {
uint8_t tmp[4] = {0}; uint8_t tmp[4] = {0};
tmp[0] = sx / 8; tmp[0] = sx / 8;
tmp[1] = ex / 8; tmp[1] = ex / 8;
@ -384,7 +384,7 @@ static void il3820_update_display(void)
} else { } else {
tmp = (IL3820_CTRL2_ENABLE_CLK | IL3820_CTRL2_ENABLE_ANALOG | IL3820_CTRL2_TO_PATTERN); tmp = (IL3820_CTRL2_ENABLE_CLK | IL3820_CTRL2_ENABLE_ANALOG | IL3820_CTRL2_TO_PATTERN);
} }
il3820_write_cmd(IL3820_CMD_UPDATE_CTRL2, &tmp, 1); il3820_write_cmd(IL3820_CMD_UPDATE_CTRL2, &tmp, 1);
il3820_write_cmd(IL3820_CMD_MASTER_ACTIVATION, NULL, 0); il3820_write_cmd(IL3820_CMD_MASTER_ACTIVATION, NULL, 0);
@ -400,10 +400,10 @@ static void il3820_clear_cntlr_mem(uint8_t ram_cmd, bool update)
/* Arrays used by SPI must be word alligned */ /* Arrays used by SPI must be word alligned */
WORD_ALIGNED_ATTR uint8_t clear_page[IL3820_COLUMNS]; WORD_ALIGNED_ATTR uint8_t clear_page[IL3820_COLUMNS];
memset(clear_page, 0xff, sizeof clear_page); memset(clear_page, 0xff, sizeof clear_page);
/* Configure entry mode */ /* Configure entry mode */
il3820_write_cmd(IL3820_CMD_ENTRY_MODE, &il3820_scan_mode, 1); il3820_write_cmd(IL3820_CMD_ENTRY_MODE, &il3820_scan_mode, 1);
/* Configure the window */ /* Configure the window */
il3820_set_window(0, EPD_PANEL_WIDTH - 1, 0, EPD_PANEL_HEIGHT - 1); il3820_set_window(0, EPD_PANEL_WIDTH - 1, 0, EPD_PANEL_HEIGHT - 1);

View file

@ -60,8 +60,8 @@ void ili9486_init(void)
{0xE0, {0x0F, 0x1F, 0x1C, 0x0C, 0x0F, 0x08, 0x48, 0x98, 0x37, 0x0A, 0x13, 0x04, 0x11, 0x0D, 0x00}, 15}, {0xE0, {0x0F, 0x1F, 0x1C, 0x0C, 0x0F, 0x08, 0x48, 0x98, 0x37, 0x0A, 0x13, 0x04, 0x11, 0x0D, 0x00}, 15},
{0XE1, {0x0F, 0x32, 0x2E, 0x0B, 0x0D, 0x05, 0x47, 0x75, 0x37, 0x06, 0x10, 0x03, 0x24, 0x20, 0x00}, 15}, {0XE1, {0x0F, 0x32, 0x2E, 0x0B, 0x0D, 0x05, 0x47, 0x75, 0x37, 0x06, 0x10, 0x03, 0x24, 0x20, 0x00}, 15},
{0x20, {0}, 0}, /* display inversion OFF */ {0x20, {0}, 0}, /* display inversion OFF */
{0x36, {0x48}, 1}, {0x36, {0x48}, 1},
{0x29, {0}, 0x80}, /* display on */ {0x29, {0}, 0x80}, /* display on */
{0x00, {0}, 0xff}, {0x00, {0}, 0xff},
}; };
@ -140,7 +140,7 @@ void ili9486_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * col
ili9486_send_cmd(0x2C); ili9486_send_cmd(0x2C);
size = lv_area_get_width(area) * lv_area_get_height(area); size = lv_area_get_width(area) * lv_area_get_height(area);
ili9486_send_color((void*) color_map, size * 2); ili9486_send_color((void*) color_map, size * 2);
} }

View file

@ -50,7 +50,7 @@ static void ili9488_send_color(void * data, uint16_t length);
/********************** /**********************
* GLOBAL FUNCTIONS * GLOBAL FUNCTIONS
**********************/ **********************/
// From github.com/jeremyjh/ESP32_TFT_library // From github.com/jeremyjh/ESP32_TFT_library
// From github.com/mvturnho/ILI9488-lvgl-ESP32-WROVER-B // From github.com/mvturnho/ILI9488-lvgl-ESP32-WROVER-B
void ili9488_init(void) void ili9488_init(void)
{ {
@ -102,7 +102,7 @@ void ili9488_init(void)
// Exit sleep // Exit sleep
ili9488_send_cmd(0x01); /* Software reset */ ili9488_send_cmd(0x01); /* Software reset */
vTaskDelay(100 / portTICK_RATE_MS); vTaskDelay(100 / portTICK_RATE_MS);
//Send all the commands //Send all the commands
uint16_t cmd = 0; uint16_t cmd = 0;
while (ili_init_cmds[cmd].databytes!=0xff) { while (ili_init_cmds[cmd].databytes!=0xff) {
@ -151,7 +151,7 @@ void ili9488_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * col
(uint8_t) (area->x2 >> 8) & 0xFF, (uint8_t) (area->x2 >> 8) & 0xFF,
(uint8_t) (area->x2) & 0xFF, (uint8_t) (area->x2) & 0xFF,
}; };
/* Page addresses */ /* Page addresses */
uint8_t yb[] = { uint8_t yb[] = {
(uint8_t) (area->y1 >> 8) & 0xFF, (uint8_t) (area->y1 >> 8) & 0xFF,