Remove TAG from LVGL log API

The filename is appended at the beginning of the log output by default, we don't need to do it.
This commit is contained in:
C47D 2021-10-22 18:41:47 -05:00
parent 9c886307b2
commit a0e915eebc
17 changed files with 58 additions and 82 deletions

View file

@ -57,8 +57,6 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR TH
#include "soc/soc_memory_layout.h" #include "soc/soc_memory_layout.h"
#include "disp_spi.h" #include "disp_spi.h"
#define TAG_LOG "FT81X: "
/* data structure for SPI reading that has (optional) space for inserted dummy byte */ /* data structure for SPI reading that has (optional) space for inserted dummy byte */
typedef struct _spi_read_data { typedef struct _spi_read_data {
#if defined(DISP_SPI_FULL_DUPLEX) #if defined(DISP_SPI_FULL_DUPLEX)
@ -871,13 +869,13 @@ uint8_t EVE_init(void)
/* The most reliable DIO/QIO switching point is after EVE start up but before reading the ChipID. */ /* The most reliable DIO/QIO switching point is after EVE start up but before reading the ChipID. */
#if defined(DISP_SPI_TRANS_MODE_DIO) #if defined(DISP_SPI_TRANS_MODE_DIO)
LV_LOG_INFO(TAG_LOG, "Switching to DIO mode"); LV_LOG_INFO("Switching to DIO mode");
DELAY_MS(20); /* different boards may take a different delay but this generally seems to work */ DELAY_MS(20); /* different boards may take a different delay but this generally seems to work */
EVE_memWrite16(REG_SPI_WIDTH, SPI_WIDTH_DIO); EVE_memWrite16(REG_SPI_WIDTH, SPI_WIDTH_DIO);
SPIInherentSendFlags = DISP_SPI_MODE_DIO | DISP_SPI_MODE_DIOQIO_ADDR; SPIInherentSendFlags = DISP_SPI_MODE_DIO | DISP_SPI_MODE_DIOQIO_ADDR;
SPIDummyReadBits = 4; /* Esp32 DMA SPI transaction dummy_bits works more like clock cycles, so in DIO 4 dummy_bits == 8 total bits */ SPIDummyReadBits = 4; /* Esp32 DMA SPI transaction dummy_bits works more like clock cycles, so in DIO 4 dummy_bits == 8 total bits */
#elif defined(DISP_SPI_TRANS_MODE_QIO) #elif defined(DISP_SPI_TRANS_MODE_QIO)
LV_LOG_INFO(TAG_LOG, "Switching to QIO mode"); LV_LOG_INFO("Switching to QIO mode");
DELAY_MS(20); /* different boards may take a different delay but this generally seems to work */ DELAY_MS(20); /* different boards may take a different delay but this generally seems to work */
EVE_memWrite16(REG_SPI_WIDTH, SPI_WIDTH_QIO); EVE_memWrite16(REG_SPI_WIDTH, SPI_WIDTH_QIO);
SPIInherentSendFlags = DISP_SPI_MODE_QIO | DISP_SPI_MODE_DIOQIO_ADDR; SPIInherentSendFlags = DISP_SPI_MODE_QIO | DISP_SPI_MODE_DIOQIO_ADDR;
@ -893,7 +891,7 @@ uint8_t EVE_init(void)
timeout++; timeout++;
if(timeout > 400) if(timeout > 400)
{ {
LV_LOG_WARN(TAG_LOG, "Failed to read ChipID...aborting initialization."); LV_LOG_WARN("Failed to read ChipID...aborting initialization.");
return 0; return 0;
} }
} }
@ -905,7 +903,7 @@ uint8_t EVE_init(void)
timeout++; timeout++;
if(timeout > 50) /* experimental, 10 was the lowest value to get the BT815 started with, the touch-controller was the last to get out of reset */ if(timeout > 50) /* experimental, 10 was the lowest value to get the BT815 started with, the touch-controller was the last to get out of reset */
{ {
LV_LOG_WARN(TAG_LOG, "Failed to read CPU status...aborting initialization."); LV_LOG_WARN("Failed to read CPU status...aborting initialization.");
return 0; return 0;
} }
} }

View file

@ -16,7 +16,6 @@
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#define TAG "GC9A01: "
/********************** /**********************
* TYPEDEFS * TYPEDEFS
@ -126,7 +125,7 @@ void GC9A01_init(void)
vTaskDelay(100 / portTICK_RATE_MS); vTaskDelay(100 / portTICK_RATE_MS);
#endif #endif
LV_LOG_INFO(TAG "Initialization."); LV_LOG_INFO("Initialization.");
//Send all the commands //Send all the commands
uint16_t cmd = 0; uint16_t cmd = 0;
@ -226,7 +225,7 @@ static void GC9A01_set_orientation(uint8_t orientation)
"PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED" "PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED"
}; };
LV_LOG_INFO(TAG "Display orientation: %s", orientation_str[orientation]); LV_LOG_INFO("Display orientation: %s", orientation_str[orientation]);
#if defined CONFIG_LV_PREDEFINED_DISPLAY_M5STACK #if defined CONFIG_LV_PREDEFINED_DISPLAY_M5STACK
const uint8_t data[] = {0x68, 0x68, 0x08, 0x08}; const uint8_t data[] = {0x68, 0x68, 0x08, 0x08};
@ -236,7 +235,7 @@ static void GC9A01_set_orientation(uint8_t orientation)
const uint8_t data[] = {0x08, 0xC8, 0x68, 0xA8}; const uint8_t data[] = {0x08, 0xC8, 0x68, 0xA8};
#endif #endif
LV_LOG_INFO(TAG "0x36 command value: 0x%02X", data[orientation]); LV_LOG_INFO("0x36 command value: 0x%02X", data[orientation]);
GC9A01_send_cmd(0x36); GC9A01_send_cmd(0x36);
GC9A01_send_data((void *) &data[orientation], 1); GC9A01_send_data((void *) &data[orientation], 1);

View file

@ -24,8 +24,6 @@
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#define TAG "HX8357: "
#define MADCTL_MY 0x80 ///< Bottom to top #define MADCTL_MY 0x80 ///< Bottom to top
#define MADCTL_MX 0x40 ///< Right to left #define MADCTL_MX 0x40 ///< Right to left
#define MADCTL_MV 0x20 ///< Reverse Mode #define MADCTL_MV 0x20 ///< Reverse Mode
@ -173,7 +171,7 @@ void hx8357_init(void)
vTaskDelay(120 / portTICK_RATE_MS); vTaskDelay(120 / portTICK_RATE_MS);
#endif #endif
LV_LOG_INFO(TAG, "Initialization."); LV_LOG_INFO("Initialization.");
//Send all the commands //Send all the commands
const uint8_t *addr = (displayType == HX8357B) ? initb : initd; const uint8_t *addr = (displayType == HX8357B) ? initb : initd;

View file

@ -38,7 +38,6 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR TH
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#define TAG "IL3820: "
/** /**
* SSD1673, SSD1608 compatible EPD controller driver. * SSD1673, SSD1608 compatible EPD controller driver.
@ -278,7 +277,7 @@ static void il3820_waitbusy(int wait_ms)
vTaskDelay(10 / portTICK_RATE_MS); vTaskDelay(10 / portTICK_RATE_MS);
} }
LV_LOG_ERROR( TAG, "busy exceeded %dms", i*10 ); LV_LOG_ERROR("Busy exceeded %dms", i*10 );
} }
/* Set DC signal to command mode */ /* Set DC signal to command mode */

View file

@ -16,8 +16,6 @@
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#define TAG "ILI9163C: "
// ILI9163C specific commands used in init // ILI9163C specific commands used in init
#define ILI9163C_NOP 0x00 #define ILI9163C_NOP 0x00
#define ILI9163C_SWRESET 0x01 #define ILI9163C_SWRESET 0x01
@ -108,7 +106,7 @@ static void ili9163c_reset(void);
void ili9163c_init(void) void ili9163c_init(void)
{ {
LV_LOG_INFO(TAG, "Init"); LV_LOG_INFO("Init");
lcd_init_cmd_t ili_init_cmds[] = { lcd_init_cmd_t ili_init_cmds[] = {
{ILI9163C_SWRESET, {0}, 0x80}, // Software reset, 0 args, w/delay 120ms {ILI9163C_SWRESET, {0}, 0x80}, // Software reset, 0 args, w/delay 120ms
@ -228,7 +226,7 @@ static void ili9163c_set_orientation(uint8_t orientation)
const char *orientation_str[] = { const char *orientation_str[] = {
"PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED"}; "PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED"};
LV_LOG_INFO(TAG, "Display orientation: %s", orientation_str[orientation]); LV_LOG_INFO("Display orientation: %s", orientation_str[orientation]);
uint8_t data[] = {0x48, 0x88, 0xA8, 0x68}; uint8_t data[] = {0x48, 0x88, 0xA8, 0x68};

View file

@ -14,7 +14,6 @@
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#define TAG "ILI9341"
#define END_OF_CMD_MARKER 0xFFU #define END_OF_CMD_MARKER 0xFFU
#define MEMORY_ACCESS_CONTROL_REG 0x36U #define MEMORY_ACCESS_CONTROL_REG 0x36U

View file

@ -15,7 +15,6 @@
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#define TAG "ILI9481: "
/********************** /**********************
* TYPEDEFS * TYPEDEFS
@ -86,7 +85,7 @@ void ili9481_init(void)
vTaskDelay(100 / portTICK_RATE_MS); vTaskDelay(100 / portTICK_RATE_MS);
#endif #endif
LV_LOG_INFO(TAG "Initialization."); LV_LOG_INFO("Initialization.");
// Exit sleep // Exit sleep
ili9481_send_cmd(0x01); /* Software reset */ ili9481_send_cmd(0x01); /* Software reset */
@ -115,7 +114,7 @@ void ili9481_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * col
uint8_t *mybuf; uint8_t *mybuf;
do { do {
mybuf = (uint8_t *) heap_caps_malloc(3 * size * sizeof(uint8_t), MALLOC_CAP_DMA); mybuf = (uint8_t *) heap_caps_malloc(3 * size * sizeof(uint8_t), MALLOC_CAP_DMA);
if (mybuf == NULL) LV_LOG_WARN(TAG "Could not allocate enough DMA memory!"); if (mybuf == NULL) LV_LOG_WARN("Could not allocate enough DMA memory!");
} while (mybuf == NULL); } while (mybuf == NULL);
uint32_t LD = 0; uint32_t LD = 0;
@ -194,7 +193,7 @@ static void ili9481_set_orientation(uint8_t orientation)
"PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED" "PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED"
}; };
LV_LOG_INFO(TAG "Display orientation: %s", orientation_str[orientation]); LV_LOG_INFO("Display orientation: %s", orientation_str[orientation]);
uint8_t data[] = {0x48, 0x4B, 0x28, 0x2B}; uint8_t data[] = {0x48, 0x4B, 0x28, 0x2B};
ili9481_send_cmd(ILI9481_CMD_MEMORY_ACCESS_CONTROL); ili9481_send_cmd(ILI9481_CMD_MEMORY_ACCESS_CONTROL);

View file

@ -15,7 +15,6 @@
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#define TAG "ILI9486: "
/********************** /**********************
* TYPEDEFS * TYPEDEFS
@ -79,7 +78,7 @@ void ili9486_init(void)
vTaskDelay(100 / portTICK_RATE_MS); vTaskDelay(100 / portTICK_RATE_MS);
#endif #endif
LV_LOG_INFO(TAG, "ILI9486 Initialization."); LV_LOG_INFO("ILI9486 Initialization.");
//Send all the commands //Send all the commands
uint16_t cmd = 0; uint16_t cmd = 0;
@ -170,11 +169,11 @@ static void ili9486_set_orientation(uint8_t orientation)
"PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED" "PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED"
}; };
LV_LOG_INFO(TAG, "Display orientation: %s", orientation_str[orientation]); LV_LOG_INFO("Display orientation: %s", orientation_str[orientation]);
const uint8_t data[] = {0x48, 0x88, 0x28, 0xE8}; const uint8_t data[] = {0x48, 0x88, 0x28, 0xE8};
LV_LOG_INFO(TAG, "0x36 command value: 0x%02X", data[orientation]); LV_LOG_INFO("0x36 command value: 0x%02X", data[orientation]);
ili9486_send_cmd(0x36); ili9486_send_cmd(0x36);
ili9486_send_data((void *) &data[orientation], 1); ili9486_send_data((void *) &data[orientation], 1);

View file

@ -16,7 +16,6 @@
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#define TAG "ILI9488: "
/********************** /**********************
* TYPEDEFS * TYPEDEFS
@ -89,7 +88,7 @@ void ili9488_init(void)
vTaskDelay(100 / portTICK_RATE_MS); vTaskDelay(100 / portTICK_RATE_MS);
#endif #endif
LV_LOG_INFO(TAG, "ILI9488 initialization."); LV_LOG_INFO("ILI9488 initialization.");
// Exit sleep // Exit sleep
ili9488_send_cmd(0x01); /* Software reset */ ili9488_send_cmd(0x01); /* Software reset */
@ -118,7 +117,7 @@ void ili9488_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * col
uint8_t *mybuf; uint8_t *mybuf;
do { do {
mybuf = (uint8_t *) heap_caps_malloc(3 * size * sizeof(uint8_t), MALLOC_CAP_DMA); mybuf = (uint8_t *) heap_caps_malloc(3 * size * sizeof(uint8_t), MALLOC_CAP_DMA);
if (mybuf == NULL) LV_LOG_WARN(TAG, "Could not allocate enough DMA memory!"); if (mybuf == NULL) LV_LOG_WARN("Could not allocate enough DMA memory!");
} while (mybuf == NULL); } while (mybuf == NULL);
uint32_t LD = 0; uint32_t LD = 0;
@ -199,11 +198,11 @@ static void ili9488_set_orientation(uint8_t orientation)
"PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED" "PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED"
}; };
LV_LOG_INFO(TAG, "Display orientation: %s", orientation_str[orientation]); LV_LOG_INFO("Display orientation: %s", orientation_str[orientation]);
const uint8_t data[] = {0x48, 0x88, 0x28, 0xE8}; const uint8_t data[] = {0x48, 0x88, 0x28, 0xE8};
LV_LOG_INFO(TAG, "0x36 command value: 0x%02X", data[orientation]); LV_LOG_INFO("0x36 command value: 0x%02X", data[orientation]);
ili9488_send_cmd(0x36); ili9488_send_cmd(0x36);
ili9488_send_data((void *) &data[orientation], 1); ili9488_send_data((void *) &data[orientation], 1);

View file

@ -33,8 +33,6 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR TH
#include "disp_spi.h" #include "disp_spi.h"
#include "jd79653a.h" #include "jd79653a.h"
#define TAG "lv_jd79653a: "
#define PIN_DC CONFIG_LV_DISP_PIN_DC #define PIN_DC CONFIG_LV_DISP_PIN_DC
#define PIN_DC_BIT ((1ULL << (uint8_t)(CONFIG_LV_DISP_PIN_DC))) #define PIN_DC_BIT ((1ULL << (uint8_t)(CONFIG_LV_DISP_PIN_DC)))
@ -187,7 +185,7 @@ static void jd79653a_spi_send_fb(uint8_t *data, size_t len)
static void jd79653a_spi_send_seq(const jd79653a_seq_t *seq, size_t len) static void jd79653a_spi_send_seq(const jd79653a_seq_t *seq, size_t len)
{ {
LV_LOG_INFO(TAG, "Writing cmd/data sequence, count %u", len); LV_LOG_INFO("Writing cmd/data sequence, count %u", len);
if (!seq || len < 1) return; if (!seq || len < 1) return;
for (size_t cmd_idx = 0; cmd_idx < len; cmd_idx++) { for (size_t cmd_idx = 0; cmd_idx < len; cmd_idx++) {
@ -243,7 +241,7 @@ static void jd79653a_load_partial_lut()
static void jd79653a_partial_in() static void jd79653a_partial_in()
{ {
LV_LOG_INFO(TAG, "Partial in!"); LV_LOG_INFO("Partial in!");
// Panel setting: accept LUT from registers instead of OTP // Panel setting: accept LUT from registers instead of OTP
#if defined (CONFIG_LV_DISPLAY_ORIENTATION_PORTRAIT_INVERTED) #if defined (CONFIG_LV_DISPLAY_ORIENTATION_PORTRAIT_INVERTED)
@ -271,7 +269,7 @@ static void jd79653a_partial_in()
static void jd79653a_partial_out() static void jd79653a_partial_out()
{ {
LV_LOG_INFO(TAG, "Partial out!"); LV_LOG_INFO("Partial out!");
// Panel setting: use LUT from OTP // Panel setting: use LUT from OTP
#if defined (CONFIG_LV_DISPLAY_ORIENTATION_PORTRAIT_INVERTED) #if defined (CONFIG_LV_DISPLAY_ORIENTATION_PORTRAIT_INVERTED)
@ -298,10 +296,10 @@ static void jd79653a_update_partial(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t
{ {
jd79653a_power_on(); jd79653a_power_on();
jd79653a_partial_in(); jd79653a_partial_in();
LV_LOG_INFO(TAG, "x1: 0x%x, x2: 0x%x, y1: 0x%x, y2: 0x%x", x1, x2, y1, y2); LV_LOG_INFO("x1: 0x%x, x2: 0x%x, y1: 0x%x, y2: 0x%x", x1, x2, y1, y2);
size_t len = ((x2 - x1 + 1) * (y2 - y1 + 1)) / 8; size_t len = ((x2 - x1 + 1) * (y2 - y1 + 1)) / 8;
LV_LOG_INFO(TAG, "Writing PARTIAL LVGL fb with len: %u", len); LV_LOG_INFO("Writing PARTIAL LVGL fb with len: %u", len);
// Set partial window // Set partial window
uint8_t ptl_setting[7] = { x1, x2, 0, y1, 0, y2, 0x01 }; uint8_t ptl_setting[7] = { x1, x2, 0, y1, 0, y2, 0x01 };
@ -317,12 +315,12 @@ static void jd79653a_update_partial(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t
len -= EPD_ROW_LEN; len -= EPD_ROW_LEN;
} }
LV_LOG_INFO(TAG, "Partial wait start"); LV_LOG_INFO("Partial wait start");
jd79653a_spi_send_cmd(0x12); jd79653a_spi_send_cmd(0x12);
jd79653a_wait_busy(0); jd79653a_wait_busy(0);
LV_LOG_INFO(TAG, "Partial updated"); LV_LOG_INFO("Partial updated");
jd79653a_partial_out(); jd79653a_partial_out();
jd79653a_power_off(); jd79653a_power_off();
} }
@ -359,7 +357,7 @@ void jd79653a_fb_set_full_color(uint8_t color)
void jd79653a_fb_full_update(uint8_t *data, size_t len) void jd79653a_fb_full_update(uint8_t *data, size_t len)
{ {
jd79653a_power_on(); jd79653a_power_on();
LV_LOG_INFO(TAG, "Performing full update, len: %u", len); LV_LOG_INFO("Performing full update, len: %u", len);
uint8_t *data_ptr = data; uint8_t *data_ptr = data;
@ -378,7 +376,7 @@ void jd79653a_fb_full_update(uint8_t *data, size_t len)
len -= EPD_ROW_LEN; len -= EPD_ROW_LEN;
} }
LV_LOG_INFO(TAG, "Rest len: %u", len); LV_LOG_INFO("Rest len: %u", len);
jd79653a_spi_send_cmd(0x12); // Issue refresh command jd79653a_spi_send_cmd(0x12); // Issue refresh command
vTaskDelay(pdMS_TO_TICKS(100)); vTaskDelay(pdMS_TO_TICKS(100));
@ -413,13 +411,13 @@ void jd79653a_lv_fb_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t
{ {
size_t len = ((area->x2 - area->x1 + 1) * (area->y2 - area->y1 + 1)) / 8; size_t len = ((area->x2 - area->x1 + 1) * (area->y2 - area->y1 + 1)) / 8;
LV_LOG_INFO(TAG, "x1: 0x%x, x2: 0x%x, y1: 0x%x, y2: 0x%x", area->x1, area->x2, area->y1, area->y2); LV_LOG_INFO("x1: 0x%x, x2: 0x%x, y1: 0x%x, y2: 0x%x", area->x1, area->x2, area->y1, area->y2);
LV_LOG_INFO(TAG, "Writing LVGL fb with len: %u, partial counter: %u", len, partial_counter); LV_LOG_INFO("Writing LVGL fb with len: %u, partial counter: %u", len, partial_counter);
uint8_t *buf = (uint8_t *) color_map; uint8_t *buf = (uint8_t *) color_map;
if (partial_counter == 0) { if (partial_counter == 0) {
LV_LOG_INFO(TAG, "Refreshing in FULL"); LV_LOG_INFO("Refreshing in FULL");
jd79653a_fb_full_update(buf, ((EPD_HEIGHT * EPD_WIDTH) / 8)); jd79653a_fb_full_update(buf, ((EPD_HEIGHT * EPD_WIDTH) / 8));
partial_counter = EPD_PARTIAL_CNT; // Reset partial counter here partial_counter = EPD_PARTIAL_CNT; // Reset partial counter here
} else { } else {
@ -445,7 +443,7 @@ void jd79653a_init()
// Initialise event group // Initialise event group
jd79653a_evts = xEventGroupCreate(); jd79653a_evts = xEventGroupCreate();
if (!jd79653a_evts) { if (!jd79653a_evts) {
LV_LOG_ERROR(TAG, "Failed when initialising event group!"); LV_LOG_ERROR("Failed when initialising event group!");
return; return;
} }
@ -465,12 +463,12 @@ void jd79653a_init()
// Dump in initialise sequence // Dump in initialise sequence
jd79653a_spi_send_seq(init_seq, EPD_SEQ_LEN(init_seq)); jd79653a_spi_send_seq(init_seq, EPD_SEQ_LEN(init_seq));
LV_LOG_INFO(TAG, "Panel init sequence sent"); LV_LOG_INFO("Panel init sequence sent");
// Check BUSY status here // Check BUSY status here
jd79653a_wait_busy(0); jd79653a_wait_busy(0);
LV_LOG_INFO(TAG, "Panel is up!"); LV_LOG_INFO("Panel is up!");
} }
static void jd79653a_reset(void) static void jd79653a_reset(void)

View file

@ -15,8 +15,6 @@
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#define TAG "RA8875 :"
#define DIV_ROUND_UP(n, d) (((n)+(d)-1)/(d)) #define DIV_ROUND_UP(n, d) (((n)+(d)-1)/(d))
#define SPI_CLOCK_SPEED_SLOW_HZ 1000000 #define SPI_CLOCK_SPEED_SLOW_HZ 1000000
@ -169,7 +167,7 @@ void ra8875_init(void)
}; };
#define INIT_CMDS_SIZE (sizeof(init_cmds)/sizeof(init_cmds[0])) #define INIT_CMDS_SIZE (sizeof(init_cmds)/sizeof(init_cmds[0]))
LV_LOG_INFO(TAG, "Initializing RA8875..."); LV_LOG_INFO("Initializing RA8875...");
// Initialize non-SPI GPIOs // Initialize non-SPI GPIOs
@ -203,7 +201,7 @@ void ra8875_init(void)
vTaskDelay(1); vTaskDelay(1);
} }
if (i == 0) { if (i == 0) {
LV_LOG_WARN(TAG, "WARNING: Memory clear timed out; RA8875 may be unresponsive."); LV_LOG_WARN("WARNING: Memory clear timed out; RA8875 may be unresponsive.");
} }
// Enable the display // Enable the display
@ -212,7 +210,7 @@ void ra8875_init(void)
void ra8875_enable_display(bool enable) void ra8875_enable_display(bool enable)
{ {
LV_LOG_INFO(TAG, "%s display.", enable ? "Enabling" : "Disabling"); LV_LOG_INFO("%s display.", enable ? "Enabling" : "Disabling");
uint8_t val = enable ? (0x80) : (0x00); uint8_t val = enable ? (0x80) : (0x00);
ra8875_write_cmd(RA8875_REG_PWRR, val); // Power and Display Control Register (PWRR) ra8875_write_cmd(RA8875_REG_PWRR, val); // Power and Display Control Register (PWRR)
} }
@ -228,14 +226,14 @@ void ra8875_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * colo
size_t linelen = (area->x2 - area->x1 + 1); size_t linelen = (area->x2 - area->x1 + 1);
uint8_t * buffer = (uint8_t*)color_map; uint8_t * buffer = (uint8_t*)color_map;
LV_LOG_INFO(TAG, "flush: %d,%d at %d,%d", area->x1, area->x2, area->y1, area->y2 ); LV_LOG_INFO("flush: %d,%d at %d,%d", area->x1, area->x2, area->y1, area->y2 );
// Get lock // Get lock
disp_spi_acquire(); disp_spi_acquire();
// Set window if needed // Set window if needed
if ((x1 != area->x1) || (x2 != area->x2)) { if ((x1 != area->x1) || (x2 != area->x2)) {
LV_LOG_INFO(TAG, "flush: set window (x1,x2): %d,%d -> %d,%d", x1, x2, area->x1, area->x2); LV_LOG_INFO("flush: set window (x1,x2): %d,%d -> %d,%d", x1, x2, area->x1, area->x2);
ra8875_set_window(area->x1, area->x2, 0, LV_VER_RES_MAX-1); ra8875_set_window(area->x1, area->x2, 0, LV_VER_RES_MAX-1);
x1 = area->x1; x1 = area->x1;
x2 = area->x2; x2 = area->x2;
@ -243,7 +241,7 @@ void ra8875_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * colo
// Set cursor if needed // Set cursor if needed
if ((x != area->x1) || (y != area->y1)) { if ((x != area->x1) || (y != area->y1)) {
LV_LOG_INFO(TAG, "flush: set cursor (x,y): %d,%d -> %d,%d", x, y, area->x1, area->y1); LV_LOG_INFO("flush: set cursor (x,y): %d,%d -> %d,%d", x, y, area->x1, area->y1);
ra8875_set_memory_write_cursor(area->x1, area->y1); ra8875_set_memory_write_cursor(area->x1, area->y1);
x = area->x1; x = area->x1;
} }

View file

@ -16,7 +16,6 @@
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#define TAG "SH1107"
/********************** /**********************
* TYPEDEFS * TYPEDEFS

View file

@ -22,8 +22,6 @@
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#define TAG "SSD1306"
#define OLED_I2C_PORT (CONFIG_LV_I2C_DISPLAY_PORT) #define OLED_I2C_PORT (CONFIG_LV_I2C_DISPLAY_PORT)
// SLA (0x3C) + WRITE_MODE (0x00) = 0x78 (0b01111000) // SLA (0x3C) + WRITE_MODE (0x00) = 0x78 (0b01111000)
#define OLED_I2C_ADDRESS 0x3C #define OLED_I2C_ADDRESS 0x3C

View file

@ -19,7 +19,6 @@
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#define TAG "ST7735S: "
#define AXP192_I2C_ADDRESS 0x34 #define AXP192_I2C_ADDRESS 0x34
/********************** /**********************
@ -114,7 +113,7 @@ void st7735s_init(void)
vTaskDelay(100 / portTICK_RATE_MS); vTaskDelay(100 / portTICK_RATE_MS);
#endif #endif
LV_LOG_INFO(TAG, "ST7735S initialization."); LV_LOG_INFO("ST7735S initialization.");
//Send all the commands //Send all the commands
uint16_t cmd = 0; uint16_t cmd = 0;
@ -210,7 +209,7 @@ static void st7735s_set_orientation(uint8_t orientation)
"PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED" "PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED"
}; };
LV_LOG_INFO(TAG, "Display orientation: %s", orientation_str[orientation]); LV_LOG_INFO("Display orientation: %s", orientation_str[orientation]);
/* /*
Portrait: 0xC8 = ST77XX_MADCTL_MX | ST77XX_MADCTL_MY | ST77XX_MADCTL_BGR Portrait: 0xC8 = ST77XX_MADCTL_MX | ST77XX_MADCTL_MY | ST77XX_MADCTL_BGR
@ -219,7 +218,7 @@ static void st7735s_set_orientation(uint8_t orientation)
*/ */
uint8_t data[] = {0xC8, 0xC8, 0xA8, 0xA8}; uint8_t data[] = {0xC8, 0xC8, 0xA8, 0xA8};
LV_LOG_INFO(TAG, "0x36 command value: 0x%02X", data[orientation]); LV_LOG_INFO("0x36 command value: 0x%02X", data[orientation]);
st7735s_send_cmd(ST7735_MADCTL); st7735s_send_cmd(ST7735_MADCTL);
st7735s_send_data((void *) &data[orientation], 1); st7735s_send_data((void *) &data[orientation], 1);
@ -231,7 +230,7 @@ static void axp192_write_byte(uint8_t addr, uint8_t data)
{ {
err = lvgl_i2c_write(CONFIG_LV_I2C_DISPLAY_PORT, AXP192_I2C_ADDRESS, addr, &data, 1); err = lvgl_i2c_write(CONFIG_LV_I2C_DISPLAY_PORT, AXP192_I2C_ADDRESS, addr, &data, 1);
if (ret != ESP_OK) { if (ret != ESP_OK) {
LV_LOG_ERROR(TAG, "AXP192 send failed. code: 0x%.2X", ret); LV_LOG_ERROR("AXP192 send failed. code: 0x%.2X", ret);
} }
} }
@ -243,7 +242,7 @@ static void axp192_init()
axp192_write_byte(0x10, 0xFF); // OLED_VPP Enable axp192_write_byte(0x10, 0xFF); // OLED_VPP Enable
axp192_write_byte(0x28, 0xCC); // Enable LDO2&LDO3, LED&TFT 3.0V axp192_write_byte(0x28, 0xCC); // Enable LDO2&LDO3, LED&TFT 3.0V
axp192_sleep_out(); axp192_sleep_out();
LV_LOG_INFO(TAG, "AXP192 initialized, power enabled for LDO2 and LDO3"); LV_LOG_INFO("AXP192 initialized, power enabled for LDO2 and LDO3");
} }
static void axp192_sleep_in() static void axp192_sleep_in()

View file

@ -12,7 +12,6 @@
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#define TAG "ST7789"
/********************** /**********************
* TYPEDEFS * TYPEDEFS

View file

@ -15,7 +15,6 @@
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#define TAG "ST7796S: "
/********************** /**********************
* TYPEDEFS * TYPEDEFS
@ -95,7 +94,7 @@ void st7796s_init(void)
vTaskDelay(100 / portTICK_RATE_MS); vTaskDelay(100 / portTICK_RATE_MS);
#endif #endif
LV_LOG_INFO(TAG, "Initialization."); LV_LOG_INFO("Initialization.");
//Send all the commands //Send all the commands
uint16_t cmd = 0; uint16_t cmd = 0;
@ -193,7 +192,7 @@ static void st7796s_set_orientation(uint8_t orientation)
const char *orientation_str[] = { const char *orientation_str[] = {
"PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED"}; "PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED"};
LV_LOG_INFO(TAG, "Display orientation: %s", orientation_str[orientation]); LV_LOG_INFO("Display orientation: %s", orientation_str[orientation]);
#if defined CONFIG_LV_PREDEFINED_DISPLAY_M5STACK #if defined CONFIG_LV_PREDEFINED_DISPLAY_M5STACK
const uint8_t data[] = {0x68, 0x68, 0x08, 0x08}; const uint8_t data[] = {0x68, 0x68, 0x08, 0x08};
@ -205,7 +204,7 @@ static void st7796s_set_orientation(uint8_t orientation)
const uint8_t data[] = {0x48, 0x88, 0x28, 0xE8}; const uint8_t data[] = {0x48, 0x88, 0x28, 0xE8};
#endif #endif
LV_LOG_INFO(TAG, "0x36 command value: 0x%02X", data[orientation]); LV_LOG_INFO("0x36 command value: 0x%02X", data[orientation]);
st7796s_send_cmd(0x36); st7796s_send_cmd(0x36);
st7796s_send_data((void *)&data[orientation], 1); st7796s_send_data((void *)&data[orientation], 1);

View file

@ -34,8 +34,6 @@
#include "disp_driver.h" #include "disp_driver.h"
#include "uc8151d.h" #include "uc8151d.h"
#define TAG "lv_uc8151d: "
#define PIN_DC CONFIG_LV_DISP_PIN_DC #define PIN_DC CONFIG_LV_DISP_PIN_DC
#define PIN_DC_BIT ((1ULL << (uint8_t)(CONFIG_LV_DISP_PIN_DC))) #define PIN_DC_BIT ((1ULL << (uint8_t)(CONFIG_LV_DISP_PIN_DC)))
@ -105,7 +103,7 @@ static void uc8151d_spi_send_fb(uint8_t *data, size_t len)
static void uc8151d_spi_send_seq(const uc8151d_seq_t *seq, size_t len) static void uc8151d_spi_send_seq(const uc8151d_seq_t *seq, size_t len)
{ {
LV_LOG_INFO(TAG, "Writing cmd/data sequence, count %u", len); LV_LOG_INFO("Writing cmd/data sequence, count %u", len);
if (!seq || len < 1) return; if (!seq || len < 1) return;
for (size_t cmd_idx = 0; cmd_idx < len; cmd_idx++) { for (size_t cmd_idx = 0; cmd_idx < len; cmd_idx++) {
@ -200,14 +198,14 @@ void uc8151d_lv_fb_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *
{ {
size_t len = ((area->x2 - area->x1 + 1) * (area->y2 - area->y1 + 1)) / 8; size_t len = ((area->x2 - area->x1 + 1) * (area->y2 - area->y1 + 1)) / 8;
LV_LOG_INFO(TAG, "x1: 0x%x, x2: 0x%x, y1: 0x%x, y2: 0x%x", area->x1, area->x2, area->y1, area->y2); LV_LOG_INFO("x1: 0x%x, x2: 0x%x, y1: 0x%x, y2: 0x%x", area->x1, area->x2, area->y1, area->y2);
LV_LOG_INFO(TAG, "Writing LVGL fb with len: %u", len); LV_LOG_INFO("Writing LVGL fb with len: %u", len);
uint8_t *buf = (uint8_t *) color_map; uint8_t *buf = (uint8_t *) color_map;
uc8151d_full_update(buf); uc8151d_full_update(buf);
lv_disp_flush_ready(drv); lv_disp_flush_ready(drv);
LV_LOG_INFO(TAG, "Ready"); LV_LOG_INFO("Ready");
} }
void uc8151d_lv_set_fb_cb(struct _disp_drv_t *disp_drv, uint8_t *buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, void uc8151d_lv_set_fb_cb(struct _disp_drv_t *disp_drv, uint8_t *buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y,
@ -219,7 +217,7 @@ void uc8151d_lv_set_fb_cb(struct _disp_drv_t *disp_drv, uint8_t *buf, lv_coord_t
if (color.full) { if (color.full) {
BIT_SET(buf[byte_index], 7 - bit_index); BIT_SET(buf[byte_index], 7 - bit_index);
} else { } else {
LV_LOG_INFO(TAG, "Clear at x: %u, y: %u", x, y); LV_LOG_INFO("Clear at x: %u, y: %u", x, y);
BIT_CLEAR(buf[byte_index], 7 - bit_index); BIT_CLEAR(buf[byte_index], 7 - bit_index);
} }
} }
@ -238,7 +236,7 @@ void uc8151d_init()
// Initialise event group // Initialise event group
uc8151d_evts = xEventGroupCreate(); uc8151d_evts = xEventGroupCreate();
if (!uc8151d_evts) { if (!uc8151d_evts) {
LV_LOG_ERROR(TAG, "Failed when initialising event group!"); LV_LOG_ERROR("Failed when initialising event group!");
return; return;
} }
@ -254,9 +252,9 @@ void uc8151d_init()
gpio_install_isr_service(0); gpio_install_isr_service(0);
gpio_isr_handler_add(PIN_BUSY, uc8151d_busy_intr, (void *) PIN_BUSY); gpio_isr_handler_add(PIN_BUSY, uc8151d_busy_intr, (void *) PIN_BUSY);
LV_LOG_INFO(TAG, "IO init finished"); LV_LOG_INFO("IO init finished");
uc8151d_panel_init(); uc8151d_panel_init();
LV_LOG_INFO(TAG, "Panel initialised"); LV_LOG_INFO("Panel initialised");
} }
static void uc8151d_reset(void) static void uc8151d_reset(void)