Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
18 changes: 11 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "echokit"
version = "0.2.2"
version = "0.3.0"
authors = ["csh <458761603@qq.com>"]
edition = "2021"
resolver = "2"
Expand All @@ -26,7 +26,7 @@ experimental = ["esp-idf-svc/experimental"]

boards = ["voice_interrupt"]
_no_default = []
box = ["_no_default", "voice_interrupt"]
box = ["_no_default", "voice_interrupt", "custom_ui"]
cube = ["_no_default", "voice_interrupt"]
cube2 = ["_no_default", "voice_interrupt"]
nfc_cube2 = ["cube2", "mfrc522", "exio"]
Expand All @@ -38,6 +38,7 @@ extra_server = []
i2c = []

voice_interrupt = []
custom_ui = []

[dependencies]
log = "0.4"
Expand All @@ -53,14 +54,17 @@ serde_json = "1.0"
rmp-serde = "1"

esp32-nimble = "0.11.1"
# embedded-websocket = { version = "0.9.4" }

# UI libraries
embedded-graphics = "0.8.1"
embedded-text = "0.7.2"
# async-io = "2.4.0"

u8g2-fonts = { version = "0.6.0", features = ["embedded_graphics_textstyle"] }
tinygif = "0.0.4"
# futures-lite = "2.6.0"
image = { version = "0.25.6", default-features = false, features = [
"png",
"gif",
"webp",
] }


futures-util = { version = "0.3.31", features = ["sink"] }
# futures-sink = "0.3.31"
Expand Down
Binary file added assets/96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/avatar.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lm_320x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/xx.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 11 additions & 6 deletions components/hal_driver/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

static const char *TAG = "LCD";
esp_lcd_panel_handle_t panel_handle = NULL; /* LCD句柄 */
uint16_t *lcd_dma_buffer = NULL;

uint32_t g_back_color = 0xFFFF;
lcd_obj_t lcd_dev;

Expand Down Expand Up @@ -129,23 +131,23 @@ void lcd_color_fill(uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey, uint16_t
uint16_t height = ey - sy;
uint32_t buf_index = 0;

uint16_t *buffer = heap_caps_malloc(width * sizeof(uint16_t), MALLOC_CAP_INTERNAL);
// uint16_t *buffer = heap_caps_malloc(width * sizeof(uint16_t), MALLOC_CAP_INTERNAL);

for (uint16_t y_index = 0; y_index < height; y_index++)
{
for (uint16_t x_index = 0; x_index < width; x_index++)
{
buffer[x_index] = color[buf_index];
lcd_dma_buffer[x_index] = color[buf_index];
buf_index++;
}

for (uint16_t i = 0; i < width; i += 80)
{
esp_lcd_panel_draw_bitmap(panel_handle, sx + i, sy + y_index, sx + i + 80, sy + y_index + 1, &buffer[i]);
esp_lcd_panel_draw_bitmap(panel_handle, sx + i, sy + y_index, sx + i + 80, sy + y_index + 1, &lcd_dma_buffer[i]);
}
}
/* 释放内存 */
heap_caps_free(buffer);
// heap_caps_free(buffer);
}

/**
Expand Down Expand Up @@ -284,7 +286,8 @@ void lcd_init(lcd_cfg_t lcd_config)
},
.bus_width = 8,
.max_transfer_bytes = lcd_dev.pwidth * lcd_dev.pheight * sizeof(uint16_t),
.psram_trans_align = 64,
// .psram_trans_align = 64,
.dma_burst_size = 64,
.sram_trans_align = 4,
};
ESP_ERROR_CHECK(esp_lcd_new_i80_bus(&bus_config, &i80_bus)); /* 新建80并口总线 */
Expand All @@ -293,7 +296,7 @@ void lcd_init(lcd_cfg_t lcd_config)
/* 80并口配置 */
.cs_gpio_num = lcd_dev.cs,
.pclk_hz = (10 * 1000 * 1000),
.trans_queue_depth = 10,
.trans_queue_depth = 15,
.dc_levels = {
.dc_idle_level = 0,
.dc_cmd_level = 0,
Expand Down Expand Up @@ -327,4 +330,6 @@ void lcd_init(lcd_cfg_t lcd_config)
ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel_handle, true)); /* 启动屏幕 */
lcd_clear(WHITE); /* 默认填充白色 */
LCD_BL(1); /* 打开背光 */

lcd_dma_buffer = esp_lcd_i80_alloc_draw_buffer(io_handle, lcd_dev.pwidth * sizeof(uint16_t), MALLOC_CAP_DMA);
}
1 change: 1 addition & 0 deletions components/hal_driver/lcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ typedef struct _lcd_config_t
/* 导出相关变量 */
extern lcd_obj_t lcd_dev;
extern esp_lcd_panel_handle_t panel_handle; /* LCD句柄 */
extern uint16_t *lcd_dma_buffer;
/* lcd相关函数 */
void lcd_init(lcd_cfg_t lcd_config); /* 初始化lcd */
void lcd_clear(uint16_t color); /* 清除屏幕 */
Expand Down
2 changes: 1 addition & 1 deletion sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ CONFIG_BT_ENABLED=y
CONFIG_BT_BLE_ENABLED=y
CONFIG_BT_BLUEDROID_ENABLED=n
CONFIG_BT_NIMBLE_ENABLED=y
CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=7000
#CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=7000

#CONFIG_BT_NIMBLE_NVS_PERSIST=y

Expand Down
Loading