Switch to 2.0 branch (#1152)
* Adapt boards to v2 partition tables * fix esp log error * fix display style * reset emotion after download assets * fix compiling * update assets default url * Add user only tools * Add image cache * smaller cache and buffer, more heap * use MAIN_EVENT_CLOCK_TICK to avoid audio glitches * bump to 2.0.0 * fix compiling errors --------- Co-authored-by: Xiaoxia <terrence.huang@tenclass.com>
This commit is contained in:
@ -98,7 +98,7 @@ mkdir main/boards/my-custom-board
|
||||
"sdkconfig_append": [
|
||||
// 额外需要的编译配置
|
||||
"CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/8m.csv\""
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v2/8m.csv\""
|
||||
]
|
||||
}
|
||||
]
|
||||
@ -132,8 +132,8 @@ mkdir main/boards/my-custom-board
|
||||
#define TAG "MyCustomBoard"
|
||||
|
||||
// 声明字体
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class MyCustomBoard : public WifiBoard {
|
||||
private:
|
||||
@ -213,11 +213,7 @@ private:
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT,
|
||||
DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y,
|
||||
DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
// MCP Tools 初始化
|
||||
@ -236,6 +232,12 @@ public:
|
||||
GetBacklight()->SetBrightness(100);
|
||||
}
|
||||
|
||||
// 动态加载资源文件(包括字体、唤醒词、表情包)
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
// 获取音频编解码器
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static Es8311AudioCodec audio_codec(
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
#define TAG "atk_dnesp32s3_box"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
|
||||
@ -244,15 +244,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
#else
|
||||
.emoji_font = DISPLAY_HEIGHT >= 240 ? font_emoji_64_init() : font_emoji_32_init(),
|
||||
#endif
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
@ -274,6 +266,11 @@ public:
|
||||
InitializeButtons();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
/* 根据探测结果初始化编解码器 */
|
||||
if (es8311_detected_) {
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
#define TAG "atk_dnesp32s3_box0"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class atk_dnesp32s3_box0 : public WifiBoard {
|
||||
@ -326,11 +326,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
.emoji_font = DISPLAY_HEIGHT >= 240 ? font_emoji_64_init() : font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
public:
|
||||
@ -348,6 +344,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static Es8311AudioCodec audio_codec(
|
||||
i2c_bus_,
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
#define TAG "atk_dnesp32s3_box2_4g"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class atk_dnesp32s3_box2_4g : public DualNetworkBoard {
|
||||
@ -413,11 +413,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
.emoji_font = DISPLAY_HEIGHT >= 240 ? font_emoji_64_init() : font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
public:
|
||||
@ -433,6 +429,11 @@ public:
|
||||
InitializeBoardPowerManager();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static Es8389AudioCodec audio_codec(
|
||||
i2c_bus_,
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
#define TAG "atk_dnesp32s3_box2_wifi"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class atk_dnesp32s3_box2_wifi : public WifiBoard {
|
||||
@ -393,11 +393,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
.emoji_font = DISPLAY_HEIGHT >= 240 ? font_emoji_64_init() : font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
public:
|
||||
@ -412,6 +408,11 @@ public:
|
||||
InitializeBoardPowerManager();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static Es8389AudioCodec audio_codec(
|
||||
i2c_bus_,
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#define TAG "atk_dnesp32s3"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class XL9555 : public I2cDevice {
|
||||
@ -132,15 +132,7 @@ private:
|
||||
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
#else
|
||||
.emoji_font = DISPLAY_HEIGHT >= 240 ? font_emoji_64_init() : font_emoji_32_init(),
|
||||
#endif
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
// 初始化摄像头:ov2640;
|
||||
@ -209,6 +201,11 @@ public:
|
||||
InitializeCamera();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
return &led;
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
#define TAG "atk_dnesp32s3m_4g"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
class atk_dnesp32s3m_4g : public Ml307Board {
|
||||
@ -168,11 +168,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4});
|
||||
}
|
||||
|
||||
public:
|
||||
@ -190,6 +186,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_32);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
return &led;
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#define TAG "atk_dnesp32s3m_wifi"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
class atk_dnesp32s3m_wifi : public WifiBoard {
|
||||
@ -178,11 +178,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4});
|
||||
}
|
||||
|
||||
public:
|
||||
@ -200,6 +196,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_32);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
return &led;
|
||||
|
||||
@ -22,7 +22,7 @@ idf.py menuconfig
|
||||
分别配置如下选项:
|
||||
|
||||
- `Xiaozhi Assistant` → `Board Type` → 选择 `AtomEchoS3R`
|
||||
- `Partition Table` → `Custom partition CSV file` → 删除原有内容,输入 `partitions/v1/8m.csv`
|
||||
- `Partition Table` → `Custom partition CSV file` → 删除原有内容,输入 `partitions/v2/8m.csv`
|
||||
- `Serial flasher config` → `Flash size` → 选择 `8 MB`
|
||||
- `Component config` → `ESP PSRAM` → `Support for external, SPI-connected RAM` → `SPI RAM config` → 选择 `Octal Mode PSRAM`
|
||||
|
||||
|
||||
@ -71,6 +71,11 @@ public:
|
||||
InitializeButtons();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_WAKENET);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static Es8311AudioCodec audio_codec(
|
||||
i2c_bus_,
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
"name": "atom-echos3r",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/8m.csv\""
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v2/8m.csv\""
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@ -33,7 +33,7 @@ Serial flasher config -> Flash size -> 8 MB
|
||||
**修改分区表:**
|
||||
|
||||
```
|
||||
Partition Table -> Custom partition CSV file -> partitions/v1/8m.csv
|
||||
Partition Table -> Custom partition CSV file -> partitions/v2/8m.csv
|
||||
```
|
||||
|
||||
**关闭片外 PSRAM:**
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#define TAG "AtomS3+EchoBase"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
static const gc9a01_lcd_init_cmd_t gc9107_lcd_init_cmds[] = {
|
||||
@ -179,11 +179,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(io_handle, panel_handle,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4});
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
@ -207,6 +203,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_32);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static Es8311AudioCodec audio_codec(
|
||||
i2c_bus_,
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
"CONFIG_SPIRAM=n",
|
||||
"CONFIG_USE_AFE=n",
|
||||
"CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/8m.csv\""
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v2/8m.csv\""
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@ -32,7 +32,7 @@ idf.py menuconfig
|
||||
|
||||
- `Xiaozhi Assistant` → `Board Type` → 选择 `AtomS3R CAM/M12 + Echo Base`
|
||||
- `Xiaozhi Assistant` → `IoT Protocol` → 选择 `MCP协议` 可开启摄像头识别功能
|
||||
- `Partition Table` → `Custom partition CSV file` → 删除原有内容,输入 `partitions/v1/8m.csv`
|
||||
- `Partition Table` → `Custom partition CSV file` → 删除原有内容,输入 `partitions/v2/8m.csv`
|
||||
- `Serial flasher config` → `Flash size` → 选择 `8 MB`
|
||||
|
||||
按 `S` 保存,按 `Q` 退出。
|
||||
|
||||
@ -169,6 +169,11 @@ public:
|
||||
InitializePi4ioe();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_WAKENET);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static Es8311AudioCodec audio_codec(
|
||||
i2c_bus_,
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
"name": "atoms3r-cam-m12-echo-base",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/8m.csv\""
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v2/8m.csv\""
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@ -27,7 +27,7 @@ Serial flasher config -> Flash size -> 8 MB
|
||||
**修改分区表:**
|
||||
|
||||
```
|
||||
Partition Table -> Custom partition CSV file -> partitions/v1/8m.csv
|
||||
Partition Table -> Custom partition CSV file -> partitions/v2/8m.csv
|
||||
```
|
||||
|
||||
**修改 psram 配置:**
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#define PI4IOE_REG_IO_OUT 0x05
|
||||
#define PI4IOE_REG_IO_PULLUP 0x0D
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
class Pi4ioe : public I2cDevice {
|
||||
@ -114,6 +114,7 @@ private:
|
||||
Display* display_ = nullptr;
|
||||
Button boot_button_;
|
||||
bool is_echo_base_connected_ = false;
|
||||
|
||||
void InitializeI2c() {
|
||||
// Initialize I2C peripheral
|
||||
i2c_master_bus_config_t i2c_bus_cfg = {
|
||||
@ -255,11 +256,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(io_handle, panel_handle,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4});
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
@ -285,6 +282,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_32);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static Es8311AudioCodec audio_codec(
|
||||
i2c_bus_,
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
"name": "atoms3r-echo-base",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/8m.csv\""
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v2/8m.csv\""
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@ -125,11 +125,7 @@ private:
|
||||
#endif
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_14_1,
|
||||
.icon_font = &font_awesome_14_1,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_14_1, &font_awesome_14_1, new Twemoji32()});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
#define TAG "CompactMl307Board"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_14_1);
|
||||
LV_FONT_DECLARE(font_puhui_basic_14_1);
|
||||
LV_FONT_DECLARE(font_awesome_14_1);
|
||||
|
||||
class CompactMl307Board : public DualNetworkBoard {
|
||||
@ -93,7 +93,7 @@ private:
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel_, true));
|
||||
|
||||
display_ = new OledDisplay(panel_io_, panel_, DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y,
|
||||
{&font_puhui_14_1, &font_awesome_14_1});
|
||||
{&font_puhui_basic_14_1, &font_awesome_14_1});
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
@ -171,6 +171,11 @@ public:
|
||||
InitializeTools();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_14_1);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
return &led;
|
||||
|
||||
@ -60,7 +60,7 @@ static const gc9a01_lcd_init_cmd_t gc9107_lcd_init_cmds[] = {
|
||||
|
||||
#define TAG "CompactWifiBoardLCD"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
class CompactWifiBoardLCD : public WifiBoard {
|
||||
@ -125,15 +125,7 @@ private:
|
||||
#endif
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
#else
|
||||
.emoji_font = DISPLAY_HEIGHT >= 240 ? font_emoji_64_init() : font_emoji_32_init(),
|
||||
#endif
|
||||
});
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4});
|
||||
}
|
||||
|
||||
|
||||
@ -166,6 +158,11 @@ public:
|
||||
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_32);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
return &led;
|
||||
|
||||
@ -61,7 +61,7 @@ static const gc9a01_lcd_init_cmd_t gc9107_lcd_init_cmds[] = {
|
||||
|
||||
#define TAG "CompactWifiBoardS3Cam"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
class CompactWifiBoardS3Cam : public WifiBoard {
|
||||
@ -127,15 +127,7 @@ private:
|
||||
#endif
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
#else
|
||||
.emoji_font = DISPLAY_HEIGHT >= 240 ? font_emoji_64_init() : font_emoji_32_init(),
|
||||
#endif
|
||||
});
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4});
|
||||
}
|
||||
|
||||
void InitializeCamera() {
|
||||
@ -191,6 +183,11 @@ public:
|
||||
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
return &led;
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
#define TAG "CompactWifiBoard"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_14_1);
|
||||
LV_FONT_DECLARE(font_puhui_basic_14_1);
|
||||
LV_FONT_DECLARE(font_awesome_14_1);
|
||||
|
||||
class CompactWifiBoard : public WifiBoard {
|
||||
@ -102,7 +102,7 @@ private:
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel_, true));
|
||||
|
||||
display_ = new OledDisplay(panel_io_, panel_, DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y,
|
||||
{&font_puhui_14_1, &font_awesome_14_1});
|
||||
{&font_puhui_basic_14_1, &font_awesome_14_1});
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
@ -168,6 +168,11 @@ public:
|
||||
InitializeTools();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_14_1);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
return &led;
|
||||
|
||||
@ -66,7 +66,7 @@ Led* Board::GetLed() {
|
||||
return &led;
|
||||
}
|
||||
|
||||
std::string Board::GetJson() {
|
||||
std::string Board::GetSystemInfoJson() {
|
||||
/*
|
||||
{
|
||||
"version": 2,
|
||||
@ -159,4 +159,8 @@ std::string Board::GetJson() {
|
||||
// Close the JSON object
|
||||
json += R"(})";
|
||||
return json;
|
||||
}
|
||||
|
||||
Assets* Board::GetAssets() {
|
||||
return nullptr;
|
||||
}
|
||||
@ -11,6 +11,8 @@
|
||||
#include "led/led.h"
|
||||
#include "backlight.h"
|
||||
#include "camera.h"
|
||||
#include "assets.h"
|
||||
|
||||
|
||||
void* create_board();
|
||||
class AudioCodec;
|
||||
@ -46,10 +48,11 @@ public:
|
||||
virtual void StartNetwork() = 0;
|
||||
virtual const char* GetNetworkStateIcon() = 0;
|
||||
virtual bool GetBatteryLevel(int &level, bool& charging, bool& discharging);
|
||||
virtual std::string GetJson();
|
||||
virtual std::string GetSystemInfoJson();
|
||||
virtual void SetPowerSaveMode(bool enabled) = 0;
|
||||
virtual std::string GetBoardJson() = 0;
|
||||
virtual std::string GetDeviceStatusJson() = 0;
|
||||
virtual Assets* GetAssets();
|
||||
};
|
||||
|
||||
#define DECLARE_BOARD(BOARD_CLASS_NAME) \
|
||||
|
||||
@ -23,48 +23,6 @@ Esp32Camera::Esp32Camera(const camera_config_t& config) {
|
||||
if (s->id.PID == GC0308_PID) {
|
||||
s->set_hmirror(s, 0); // 这里控制摄像头镜像 写1镜像 写0不镜像
|
||||
}
|
||||
|
||||
// 初始化预览图片的内存
|
||||
memset(&preview_image_, 0, sizeof(preview_image_));
|
||||
preview_image_.header.magic = LV_IMAGE_HEADER_MAGIC;
|
||||
preview_image_.header.cf = LV_COLOR_FORMAT_RGB565;
|
||||
preview_image_.header.flags = 0;
|
||||
|
||||
switch (config.frame_size) {
|
||||
case FRAMESIZE_SVGA:
|
||||
preview_image_.header.w = 800;
|
||||
preview_image_.header.h = 600;
|
||||
break;
|
||||
case FRAMESIZE_VGA:
|
||||
preview_image_.header.w = 640;
|
||||
preview_image_.header.h = 480;
|
||||
break;
|
||||
case FRAMESIZE_QVGA:
|
||||
preview_image_.header.w = 320;
|
||||
preview_image_.header.h = 240;
|
||||
break;
|
||||
case FRAMESIZE_128X128:
|
||||
preview_image_.header.w = 128;
|
||||
preview_image_.header.h = 128;
|
||||
break;
|
||||
case FRAMESIZE_240X240:
|
||||
preview_image_.header.w = 240;
|
||||
preview_image_.header.h = 240;
|
||||
break;
|
||||
default:
|
||||
ESP_LOGE(TAG, "Unsupported frame size: %d, image preview will not be shown", config.frame_size);
|
||||
preview_image_.data_size = 0;
|
||||
preview_image_.data = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
preview_image_.header.stride = preview_image_.header.w * 2;
|
||||
preview_image_.data_size = preview_image_.header.w * preview_image_.header.h * 2;
|
||||
preview_image_.data = (uint8_t*)heap_caps_malloc(preview_image_.data_size, MALLOC_CAP_SPIRAM);
|
||||
if (preview_image_.data == nullptr) {
|
||||
ESP_LOGE(TAG, "Failed to allocate memory for preview image");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Esp32Camera::~Esp32Camera() {
|
||||
@ -72,10 +30,6 @@ Esp32Camera::~Esp32Camera() {
|
||||
esp_camera_fb_return(fb_);
|
||||
fb_ = nullptr;
|
||||
}
|
||||
if (preview_image_.data) {
|
||||
heap_caps_free((void*)preview_image_.data);
|
||||
preview_image_.data = nullptr;
|
||||
}
|
||||
esp_camera_deinit();
|
||||
}
|
||||
|
||||
@ -105,27 +59,33 @@ bool Esp32Camera::Capture() {
|
||||
auto end_time = esp_timer_get_time();
|
||||
ESP_LOGI(TAG, "Camera captured %d frames in %d ms", frames_to_get, int((end_time - start_time) / 1000));
|
||||
|
||||
// 如果预览图片 buffer 为空,则跳过预览
|
||||
// 但仍返回 true,因为此时图像可以上传至服务器
|
||||
if (preview_image_.data_size == 0) {
|
||||
ESP_LOGW(TAG, "Skip preview because of unsupported frame size");
|
||||
return true;
|
||||
}
|
||||
if (preview_image_.data == nullptr) {
|
||||
ESP_LOGE(TAG, "Preview image data is not initialized");
|
||||
return true;
|
||||
}
|
||||
// 显示预览图片
|
||||
auto display = Board::GetInstance().GetDisplay();
|
||||
if (display != nullptr) {
|
||||
// Create a new preview image
|
||||
auto img_dsc = (lv_img_dsc_t*)heap_caps_calloc(1, sizeof(lv_img_dsc_t), MALLOC_CAP_8BIT);
|
||||
img_dsc->header.magic = LV_IMAGE_HEADER_MAGIC;
|
||||
img_dsc->header.cf = LV_COLOR_FORMAT_RGB565;
|
||||
img_dsc->header.flags = 0;
|
||||
img_dsc->header.w = fb_->width;
|
||||
img_dsc->header.h = fb_->height;
|
||||
img_dsc->header.stride = fb_->width * 2;
|
||||
img_dsc->data_size = fb_->width * fb_->height * 2;
|
||||
img_dsc->data = (uint8_t*)heap_caps_malloc(img_dsc->data_size, MALLOC_CAP_SPIRAM);
|
||||
if (img_dsc->data == nullptr) {
|
||||
ESP_LOGE(TAG, "Failed to allocate memory for preview image");
|
||||
heap_caps_free(img_dsc);
|
||||
return false;
|
||||
}
|
||||
|
||||
auto src = (uint16_t*)fb_->buf;
|
||||
auto dst = (uint16_t*)preview_image_.data;
|
||||
auto dst = (uint16_t*)img_dsc->data;
|
||||
size_t pixel_count = fb_->len / 2;
|
||||
for (size_t i = 0; i < pixel_count; i++) {
|
||||
// 交换每个16位字内的字节
|
||||
dst[i] = __builtin_bswap16(src[i]);
|
||||
}
|
||||
display->SetPreviewImage(&preview_image_);
|
||||
display->SetPreviewImage(img_dsc);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -188,14 +148,14 @@ bool Esp32Camera::SetVFlip(bool enabled) {
|
||||
*/
|
||||
std::string Esp32Camera::Explain(const std::string& question) {
|
||||
if (explain_url_.empty()) {
|
||||
return "{\"success\": false, \"message\": \"Image explain URL or token is not set\"}";
|
||||
throw std::runtime_error("Image explain URL or token is not set");
|
||||
}
|
||||
|
||||
// 创建局部的 JPEG 队列, 40 entries is about to store 512 * 40 = 20480 bytes of JPEG data
|
||||
QueueHandle_t jpeg_queue = xQueueCreate(40, sizeof(JpegChunk));
|
||||
if (jpeg_queue == nullptr) {
|
||||
ESP_LOGE(TAG, "Failed to create JPEG queue");
|
||||
return "{\"success\": false, \"message\": \"Failed to create JPEG queue\"}";
|
||||
throw std::runtime_error("Failed to create JPEG queue");
|
||||
}
|
||||
|
||||
// We spawn a thread to encode the image to JPEG
|
||||
@ -238,7 +198,7 @@ std::string Esp32Camera::Explain(const std::string& question) {
|
||||
}
|
||||
}
|
||||
vQueueDelete(jpeg_queue);
|
||||
return "{\"success\": false, \"message\": \"Failed to connect to explain URL\"}";
|
||||
throw std::runtime_error("Failed to connect to explain URL");
|
||||
}
|
||||
|
||||
{
|
||||
@ -291,7 +251,7 @@ std::string Esp32Camera::Explain(const std::string& question) {
|
||||
|
||||
if (http->GetStatusCode() != 200) {
|
||||
ESP_LOGE(TAG, "Failed to upload photo, status code: %d", http->GetStatusCode());
|
||||
return "{\"success\": false, \"message\": \"Failed to upload photo\"}";
|
||||
throw std::runtime_error("Failed to upload photo");
|
||||
}
|
||||
|
||||
std::string result = http->ReadAll();
|
||||
|
||||
@ -19,7 +19,6 @@ struct JpegChunk {
|
||||
class Esp32Camera : public Camera {
|
||||
private:
|
||||
camera_fb_t* fb_ = nullptr;
|
||||
lv_img_dsc_t preview_image_;
|
||||
std::string explain_url_;
|
||||
std::string explain_token_;
|
||||
std::thread encoder_thread_;
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
#define TAG "DF-K10"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class Df_K10Board : public WifiBoard {
|
||||
@ -104,6 +104,7 @@ private:
|
||||
ESP_LOGE(TAG, "Set direction failed: %s", esp_err_to_name(ret));
|
||||
}
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
instance_ = this;
|
||||
|
||||
@ -234,11 +235,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
// 物联网初始化,添加对 AI 可见设备
|
||||
@ -258,7 +255,12 @@ public:
|
||||
InitializeCamera();
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
return led_strip_;
|
||||
}
|
||||
|
||||
|
||||
@ -69,6 +69,12 @@ class DfrobotEsp32S3AiCam : public WifiBoard {
|
||||
InitializeCamera();
|
||||
}
|
||||
|
||||
// Wakenet model only
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_WAKENET);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static GpioLed led(BUILTIN_LED_GPIO, 0);
|
||||
return &led;
|
||||
|
||||
@ -123,6 +123,11 @@ public:
|
||||
InitializeButtons();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_WAKENET);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static GpioLed led(BUILTIN_LED_GPIO, 1);
|
||||
return &led;
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#define TAG "DuChatX"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
class DuChatX : public WifiBoard {
|
||||
@ -102,11 +102,7 @@ private:
|
||||
esp_lcd_panel_swap_xy(panel_, DISPLAY_SWAP_XY);
|
||||
esp_lcd_panel_mirror(panel_, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);
|
||||
display_ = new SpiLcdDisplay(panel_io, panel_,DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y,DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = DISPLAY_HEIGHT >= 240 ? font_emoji_64_init() : font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4});
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
@ -130,6 +126,11 @@ public:
|
||||
InitializePowerManager();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_32);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led *GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
return &led;
|
||||
|
||||
@ -562,11 +562,8 @@ private:
|
||||
|
||||
#if USE_LVGL_DEFAULT
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY, {
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
});
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{&font_puhui_20_4, &font_awesome_20_4, new Twemoji64()});
|
||||
#else
|
||||
display_ = new anim::EmoteDisplay(panel, panel_io);
|
||||
#endif
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
{
|
||||
"name": "electron-bot",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/16m.csv\""
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@ -74,11 +74,7 @@ private:
|
||||
display_ = new ElectronEmojiDisplay(io_handle, panel_handle, DISPLAY_WIDTH, DISPLAY_HEIGHT,
|
||||
DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X,
|
||||
DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
});
|
||||
{&font_puhui_20_4, &font_awesome_20_4, new Twemoji64()});
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
|
||||
@ -51,9 +51,9 @@ const ElectronEmojiDisplay::EmotionMap ElectronEmojiDisplay::emotion_maps_[] = {
|
||||
ElectronEmojiDisplay::ElectronEmojiDisplay(esp_lcd_panel_io_handle_t panel_io,
|
||||
esp_lcd_panel_handle_t panel, int width, int height,
|
||||
int offset_x, int offset_y, bool mirror_x, bool mirror_y,
|
||||
bool swap_xy, DisplayFonts fonts)
|
||||
bool swap_xy, DisplayStyle style)
|
||||
: SpiLcdDisplay(panel_io, panel, width, height, offset_x, offset_y, mirror_x, mirror_y, swap_xy,
|
||||
fonts),
|
||||
style),
|
||||
emotion_gif_(nullptr) {
|
||||
SetupGifContainer();
|
||||
}
|
||||
@ -144,27 +144,4 @@ void ElectronEmojiDisplay::SetChatMessage(const char* role, const char* content)
|
||||
lv_obj_remove_flag(chat_message_label_, LV_OBJ_FLAG_HIDDEN);
|
||||
|
||||
ESP_LOGI(TAG, "设置聊天消息 [%s]: %s", role, content);
|
||||
}
|
||||
|
||||
void ElectronEmojiDisplay::SetIcon(const char* icon) {
|
||||
if (!icon) {
|
||||
return;
|
||||
}
|
||||
|
||||
DisplayLockGuard lock(this);
|
||||
|
||||
if (chat_message_label_ != nullptr) {
|
||||
std::string icon_message = std::string(icon) + " ";
|
||||
|
||||
if (strcmp(icon, FONT_AWESOME_DOWNLOAD) == 0) {
|
||||
icon_message += "正在升级...";
|
||||
} else {
|
||||
icon_message += "系统状态";
|
||||
}
|
||||
|
||||
lv_label_set_text(chat_message_label_, icon_message.c_str());
|
||||
lv_obj_remove_flag(chat_message_label_, LV_OBJ_FLAG_HIDDEN);
|
||||
|
||||
ESP_LOGI(TAG, "设置图标: %s", icon);
|
||||
}
|
||||
}
|
||||
@ -23,7 +23,7 @@ public:
|
||||
*/
|
||||
ElectronEmojiDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel,
|
||||
int width, int height, int offset_x, int offset_y, bool mirror_x,
|
||||
bool mirror_y, bool swap_xy, DisplayFonts fonts);
|
||||
bool mirror_y, bool swap_xy, DisplayStyle style);
|
||||
|
||||
virtual ~ElectronEmojiDisplay() = default;
|
||||
|
||||
@ -33,9 +33,6 @@ public:
|
||||
// 重写聊天消息设置方法
|
||||
virtual void SetChatMessage(const char* role, const char* content) override;
|
||||
|
||||
// 重写图标设置方法
|
||||
virtual void SetIcon(const char* icon) override;
|
||||
|
||||
private:
|
||||
void SetupGifContainer();
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
#define TAG "EspBox3Board"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
// Init ili9341 by custom cmd
|
||||
@ -130,15 +130,7 @@ private:
|
||||
esp_lcd_panel_disp_on_off(panel, true);
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
#else
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
#endif
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
public:
|
||||
@ -150,6 +142,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static BoxAudioCodec audio_codec(
|
||||
i2c_bus_,
|
||||
|
||||
@ -3,7 +3,9 @@
|
||||
"builds": [
|
||||
{
|
||||
"name": "esp-box-lite",
|
||||
"sdkconfig_append": ["CONFIG_SOC_ADC_SUPPORTED=y"]
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_SOC_ADC_SUPPORTED=y"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#define TAG "EspBoxBoardLite"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
/* ADC Buttons */
|
||||
@ -192,15 +192,7 @@ private:
|
||||
esp_lcd_panel_disp_on_off(panel, true);
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
#else
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
#endif
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
public:
|
||||
@ -221,6 +213,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static BoxAudioCodecLite audio_codec(
|
||||
i2c_bus_,
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
#define TAG "EspBoxBoard"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
// Init ili9341 by custom cmd
|
||||
@ -130,15 +130,7 @@ private:
|
||||
esp_lcd_panel_disp_on_off(panel, true);
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
#else
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
#endif
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
public:
|
||||
@ -150,6 +142,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static BoxAudioCodec audio_codec(
|
||||
i2c_bus_,
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
#define TAG "ESP_S3_LCD_EV_Board_2"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_30_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_30_4);
|
||||
LV_FONT_DECLARE(font_awesome_30_4);
|
||||
|
||||
class ESP_S3_LCD_EV_Board_2 : public WifiBoard {
|
||||
@ -127,12 +127,9 @@ private:
|
||||
display_ = new RgbLcdDisplay(panel_io, panel_handle,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X,
|
||||
DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_30_4,
|
||||
.icon_font = &font_awesome_30_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
});
|
||||
{&font_puhui_basic_30_4, &font_awesome_30_4});
|
||||
}
|
||||
|
||||
void InitializeCodecI2c() {
|
||||
// Initialize I2C peripheral
|
||||
i2c_master_bus_config_t i2c_bus_cfg = {
|
||||
@ -211,8 +208,11 @@ public:
|
||||
InitializeTouch();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_30_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
//es7210用作音频采集
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static BoxAudioCodec audio_codec(
|
||||
i2c_bus_,
|
||||
@ -230,8 +230,6 @@ public:
|
||||
return &audio_codec;
|
||||
}
|
||||
|
||||
|
||||
|
||||
virtual Display* GetDisplay() override {
|
||||
return display_;
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
#define TAG "ESP_S3_LCD_EV_Board"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_30_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_30_4);
|
||||
LV_FONT_DECLARE(font_awesome_30_4);
|
||||
|
||||
class ESP_S3_LCD_EV_Board : public WifiBoard {
|
||||
@ -127,12 +127,9 @@ private:
|
||||
display_ = new RgbLcdDisplay(panel_io, panel_handle,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X,
|
||||
DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_30_4,
|
||||
.icon_font = &font_awesome_30_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
});
|
||||
{&font_puhui_basic_30_4, &font_awesome_30_4});
|
||||
}
|
||||
|
||||
void InitializeCodecI2c() {
|
||||
// Initialize I2C peripheral
|
||||
i2c_master_bus_config_t i2c_bus_cfg = {
|
||||
@ -180,8 +177,11 @@ public:
|
||||
InitializeRGB_GC9503V_Display();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_30_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
//es7210用作音频采集
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static BoxAudioCodec audio_codec(
|
||||
codec_i2c_bus_,
|
||||
@ -199,8 +199,6 @@ public:
|
||||
return &audio_codec;
|
||||
}
|
||||
|
||||
|
||||
|
||||
virtual Display* GetDisplay() override {
|
||||
return display_;
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#define TAG "esp_sparkbot"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class SparkBotEs8311AudioCodec : public Es8311AudioCodec {
|
||||
@ -121,11 +121,7 @@ private:
|
||||
esp_lcd_panel_disp_on_off(panel, true);
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
void InitializeCamera() {
|
||||
@ -279,6 +275,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static SparkBotEs8311AudioCodec audio_codec(i2c_bus_, I2C_NUM_0, AUDIO_INPUT_SAMPLE_RATE, AUDIO_OUTPUT_SAMPLE_RATE,
|
||||
AUDIO_I2S_GPIO_MCLK, AUDIO_I2S_GPIO_BCLK, AUDIO_I2S_GPIO_WS, AUDIO_I2S_GPIO_DOUT, AUDIO_I2S_GPIO_DIN,
|
||||
|
||||
@ -195,6 +195,11 @@ public:
|
||||
InitializeButtons();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_WAKENET);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static CircularStrip led(LED_PIN, 1);
|
||||
return &led;
|
||||
|
||||
@ -123,18 +123,10 @@ void InitializePowerManager() {
|
||||
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_14_1,
|
||||
.icon_font = &font_awesome_14_1,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_14_1, &font_awesome_14_1, new Twemoji32()});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void InitializeButtons() {
|
||||
|
||||
boot_button_.OnClick([this]() {
|
||||
power_save_timer_->WakeUp();
|
||||
auto& app = Application::GetInstance();
|
||||
@ -149,7 +141,6 @@ void InitializePowerManager() {
|
||||
std::string wake_word="你好小智";
|
||||
Application::GetInstance().WakeWordInvoke(wake_word);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// 物联网初始化,添加对 AI 可见设备
|
||||
@ -169,8 +160,7 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override
|
||||
{
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static NoAudioCodecSimplex audio_codec(AUDIO_INPUT_SAMPLE_RATE, AUDIO_OUTPUT_SAMPLE_RATE,
|
||||
AUDIO_I2S_SPK_GPIO_BCLK, AUDIO_I2S_SPK_GPIO_LRCK, AUDIO_I2S_SPK_GPIO_DOUT, AUDIO_I2S_MIC_GPIO_SCK, AUDIO_I2S_MIC_GPIO_WS, AUDIO_I2S_MIC_GPIO_DIN);
|
||||
return &audio_codec;
|
||||
|
||||
@ -125,11 +125,7 @@ private:
|
||||
#endif
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_14_1,
|
||||
.icon_font = &font_awesome_14_1,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_14_1, &font_awesome_14_1, new Twemoji32()});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
#define TAG "WaveshareEsp32s3TouchAMOLED1inch8"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_30_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_30_4);
|
||||
LV_FONT_DECLARE(font_awesome_30_4);
|
||||
|
||||
class Pmic : public Axp2101 {
|
||||
@ -87,15 +87,7 @@ public:
|
||||
bool swap_xy)
|
||||
: SpiLcdDisplay(io_handle, panel_handle,
|
||||
width, height, offset_x, offset_y, mirror_x, mirror_y, swap_xy,
|
||||
{
|
||||
.text_font = &font_puhui_30_4,
|
||||
.icon_font = &font_awesome_30_4,
|
||||
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
#else
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
#endif
|
||||
}) {
|
||||
{&font_puhui_basic_30_4, &font_awesome_30_4}) {
|
||||
DisplayLockGuard lock(this);
|
||||
lv_obj_set_style_pad_left(status_bar_, LV_HOR_RES * 0.1, 0);
|
||||
lv_obj_set_style_pad_right(status_bar_, LV_HOR_RES * 0.1, 0);
|
||||
@ -308,6 +300,11 @@ public:
|
||||
InitializeTools();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_30_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static Es8311AudioCodec audio_codec(codec_i2c_bus_, I2C_NUM_0, AUDIO_INPUT_SAMPLE_RATE, AUDIO_OUTPUT_SAMPLE_RATE,
|
||||
AUDIO_I2S_GPIO_MCLK, AUDIO_I2S_GPIO_BCLK, AUDIO_I2S_GPIO_WS, AUDIO_I2S_GPIO_DOUT, AUDIO_I2S_GPIO_DIN,
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
#define TAG "waveshare_lcd_1_46"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
|
||||
@ -48,11 +48,7 @@ public:
|
||||
bool swap_xy)
|
||||
: SpiLcdDisplay(io_handle, panel_handle,
|
||||
width, height, offset_x, offset_y, mirror_x, mirror_y, swap_xy,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
}) {
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4}) {
|
||||
DisplayLockGuard lock(this);
|
||||
lv_display_add_event_cb(display_, rounder_event_cb, LV_EVENT_INVALIDATE_AREA, NULL);
|
||||
}
|
||||
@ -160,6 +156,7 @@ private:
|
||||
// gpio_set_level(PWR_Control_PIN, false);
|
||||
gpio_set_level(PWR_Control_PIN, true);
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
instance_ = this;
|
||||
InitializeButtonsCustom();
|
||||
@ -224,6 +221,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static NoAudioCodecSimplex audio_codec(AUDIO_INPUT_SAMPLE_RATE, AUDIO_OUTPUT_SAMPLE_RATE,
|
||||
AUDIO_I2S_SPK_GPIO_BCLK, AUDIO_I2S_SPK_GPIO_LRCK, AUDIO_I2S_SPK_GPIO_DOUT, I2S_STD_SLOT_LEFT, AUDIO_I2S_MIC_GPIO_SCK, AUDIO_I2S_MIC_GPIO_WS, AUDIO_I2S_MIC_GPIO_DIN, I2S_STD_SLOT_RIGHT); // I2S_STD_SLOT_LEFT / I2S_STD_SLOT_RIGHT / I2S_STD_SLOT_BOTH
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#define LCD_OPCODE_READ_CMD (0x0BULL)
|
||||
#define LCD_OPCODE_WRITE_COLOR (0x32ULL)
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
static const st77916_lcd_init_cmd_t vendor_specific_init_new[] = {
|
||||
@ -359,11 +359,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
});
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4});
|
||||
}
|
||||
|
||||
void InitializeButtonsCustom() {
|
||||
@ -434,6 +430,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static NoAudioCodecSimplex audio_codec(AUDIO_INPUT_SAMPLE_RATE, AUDIO_OUTPUT_SAMPLE_RATE,
|
||||
AUDIO_I2S_SPK_GPIO_BCLK, AUDIO_I2S_SPK_GPIO_LRCK, AUDIO_I2S_SPK_GPIO_DOUT, I2S_STD_SLOT_BOTH, AUDIO_I2S_MIC_GPIO_SCK, AUDIO_I2S_MIC_GPIO_WS, AUDIO_I2S_MIC_GPIO_DIN, I2S_STD_SLOT_RIGHT); // I2S_STD_SLOT_LEFT / I2S_STD_SLOT_RIGHT / I2S_STD_SLOT_BOTH
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#define LCD_OPCODE_READ_CMD (0x0BULL)
|
||||
#define LCD_OPCODE_WRITE_COLOR (0x32ULL)
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
static const st77916_lcd_init_cmd_t vendor_specific_init_new[] = {
|
||||
@ -356,11 +356,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
});
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4});
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
@ -384,6 +380,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static NoAudioCodecSimplex audio_codec(AUDIO_INPUT_SAMPLE_RATE, AUDIO_OUTPUT_SAMPLE_RATE,
|
||||
AUDIO_I2S_SPK_GPIO_BCLK, AUDIO_I2S_SPK_GPIO_LRCK, AUDIO_I2S_SPK_GPIO_DOUT, I2S_STD_SLOT_LEFT, AUDIO_I2S_MIC_GPIO_SCK, AUDIO_I2S_MIC_GPIO_WS, AUDIO_I2S_MIC_GPIO_DIN, I2S_STD_SLOT_RIGHT); // I2S_STD_SLOT_LEFT / I2S_STD_SLOT_RIGHT / I2S_STD_SLOT_BOTH
|
||||
|
||||
@ -30,8 +30,8 @@
|
||||
#define TAG "waveshare_lcd_3_5"
|
||||
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
|
||||
class Pmic : public Axp2101 {
|
||||
@ -304,11 +304,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
@ -354,6 +350,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static Es8311AudioCodec audio_codec(i2c_bus_, I2C_NUM_0, AUDIO_INPUT_SAMPLE_RATE, AUDIO_OUTPUT_SAMPLE_RATE,
|
||||
AUDIO_I2S_GPIO_MCLK, AUDIO_I2S_GPIO_BCLK, AUDIO_I2S_GPIO_WS, AUDIO_I2S_GPIO_DOUT, AUDIO_I2S_GPIO_DIN,
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
#define TAG "esp32s3_korvo2_v3"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
// Init ili9341 by custom cmd
|
||||
@ -190,11 +190,7 @@ private:
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel, true));
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
void InitializeSt7789Display() {
|
||||
@ -228,11 +224,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
void InitializeCamera() {
|
||||
@ -285,6 +277,11 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static BoxAudioCodec audio_codec(
|
||||
i2c_bus_,
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
#define TAG "GenJuTech_s3_1_54TFT"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class SparkBotEs8311AudioCodec : public Es8311AudioCodec {
|
||||
@ -201,11 +201,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
public:
|
||||
@ -223,6 +219,10 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
4. 点击 VSCode 右下角提示,生成 [compile_commands.json] 文件;
|
||||
5. 设置目标设备为 `[esp32s3] -> [JTAG]`;
|
||||
6. 打开 **SDK Configuration Editor**;
|
||||
7. 配置自定义分区表路径为:`partitions/v1/16m.csv`;
|
||||
7. 配置自定义分区表路径为:`partitions/v2/16m.csv`;
|
||||
8. 设置 **Board Type** 为 **九川科技**;
|
||||
9. 保存配置并开始编译。
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#define BOARD_TAG "JiuchuanDevBoard"
|
||||
#define __USER_GPIO_PWRDOWN__
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
// 自定义LCD显示器类,用于圆形屏幕适配
|
||||
@ -41,8 +41,8 @@ public:
|
||||
bool mirror_x,
|
||||
bool mirror_y,
|
||||
bool swap_xy,
|
||||
DisplayFonts fonts)
|
||||
: SpiLcdDisplay(io_handle, panel_handle, width, height, offset_x, offset_y, mirror_x, mirror_y, swap_xy, fonts)
|
||||
DisplayStyle style)
|
||||
: SpiLcdDisplay(io_handle, panel_handle, width, height, offset_x, offset_y, mirror_x, mirror_y, swap_xy, style)
|
||||
{
|
||||
|
||||
DisplayLockGuard lock(this);
|
||||
@ -316,15 +316,7 @@ private:
|
||||
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);
|
||||
display_ = new CustomLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
#else
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
#endif
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
public:
|
||||
@ -343,6 +335,11 @@ public:
|
||||
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
return &led;
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#define TAG "KevinBoxBoard"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_14_1);
|
||||
LV_FONT_DECLARE(font_puhui_basic_14_1);
|
||||
LV_FONT_DECLARE(font_awesome_14_1);
|
||||
|
||||
class KevinBoxBoard : public Ml307Board {
|
||||
@ -116,7 +116,7 @@ private:
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel_, true));
|
||||
|
||||
display_ = new OledDisplay(panel_io_, panel_, DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y,
|
||||
{&font_puhui_14_1, &font_awesome_14_1});
|
||||
{&font_puhui_basic_14_1, &font_awesome_14_1});
|
||||
}
|
||||
|
||||
void InitializeCodecI2c() {
|
||||
@ -188,6 +188,11 @@ public:
|
||||
|
||||
InitializeButtons();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_14_1);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
#define TAG "KevinBoxBoard"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_14_1);
|
||||
LV_FONT_DECLARE(font_puhui_basic_14_1);
|
||||
LV_FONT_DECLARE(font_awesome_14_1);
|
||||
|
||||
|
||||
@ -146,7 +146,7 @@ private:
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel_, true));
|
||||
|
||||
display_ = new OledDisplay(panel_io_, panel_, DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y,
|
||||
{&font_puhui_14_1, &font_awesome_14_1});
|
||||
{&font_puhui_basic_14_1, &font_awesome_14_1});
|
||||
}
|
||||
|
||||
void InitializeCodecI2c() {
|
||||
@ -244,6 +244,11 @@ public:
|
||||
InitializePowerSaveTimer();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_14_1);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
return &led;
|
||||
|
||||
@ -75,6 +75,11 @@ public:
|
||||
esp_efuse_write_field_bit(ESP_EFUSE_VDD_SPI_AS_GPIO);
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_WAKENET_SMALL);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
return led_strip_;
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
#define TAG "kevin-sp-v3"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
|
||||
@ -85,11 +85,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
void InitializeCamera() {
|
||||
@ -135,7 +131,11 @@ public:
|
||||
InitializeCamera();
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
#define TAG "kevin-sp-v4"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class KEVIN_SP_V4Board : public WifiBoard {
|
||||
@ -25,6 +25,7 @@ private:
|
||||
LcdDisplay* display_;
|
||||
i2c_master_bus_handle_t codec_i2c_bus_;
|
||||
Esp32Camera* camera_;
|
||||
|
||||
void InitializeCodecI2c() {
|
||||
// Initialize I2C peripheral
|
||||
i2c_master_bus_config_t i2c_bus_cfg = {
|
||||
@ -98,11 +99,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
void InitializeCamera() {
|
||||
@ -149,7 +146,11 @@ public:
|
||||
InitializeCamera();
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
#define TAG "Yuying_313lcd"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_30_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_30_4);
|
||||
LV_FONT_DECLARE(font_awesome_30_4);
|
||||
|
||||
class Yuying_313lcd : public WifiBoard {
|
||||
@ -104,12 +104,9 @@ private:
|
||||
display_ = new RgbLcdDisplay(panel_io, panel_handle,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X,
|
||||
DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_30_4,
|
||||
.icon_font = &font_awesome_30_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
});
|
||||
{&font_puhui_basic_30_4, &font_awesome_30_4});
|
||||
}
|
||||
|
||||
void InitializeCodecI2c() {
|
||||
// Initialize I2C peripheral
|
||||
i2c_master_bus_config_t i2c_bus_cfg = {
|
||||
@ -150,6 +147,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_30_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static Es8311AudioCodec audio_codec(codec_i2c_bus_, I2C_NUM_0, AUDIO_INPUT_SAMPLE_RATE, AUDIO_OUTPUT_SAMPLE_RATE,
|
||||
AUDIO_I2S_GPIO_MCLK, AUDIO_I2S_GPIO_BCLK, AUDIO_I2S_GPIO_WS, AUDIO_I2S_GPIO_DOUT, AUDIO_I2S_GPIO_DIN,
|
||||
|
||||
@ -18,8 +18,9 @@
|
||||
#define BOARD_STM8_ADDR 17
|
||||
#define BOARD_STM8_CMD 4
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class labplus_ledong_v2 : public WifiBoard {
|
||||
private:
|
||||
i2c_master_bus_handle_t i2c_bus_;
|
||||
@ -119,15 +120,7 @@ private:
|
||||
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
#else
|
||||
.emoji_font = DISPLAY_HEIGHT >= 240 ? font_emoji_64_init() : font_emoji_32_init(),
|
||||
#endif
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
public:
|
||||
@ -139,6 +132,11 @@ public:
|
||||
GetBacklight()->SetBrightness(100);
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
return &led;
|
||||
|
||||
@ -15,8 +15,9 @@
|
||||
|
||||
#define TAG "mpython_v3"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class mpython_v3 : public WifiBoard {
|
||||
private:
|
||||
i2c_master_bus_handle_t i2c_bus_;
|
||||
@ -99,15 +100,7 @@ private:
|
||||
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
#else
|
||||
.emoji_font = DISPLAY_HEIGHT >= 240 ? font_emoji_64_init() : font_emoji_32_init(),
|
||||
#endif
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
public:
|
||||
@ -119,6 +112,11 @@ public:
|
||||
GetBacklight()->SetBrightness(100);
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
return &led;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
"name": "lichuang-c3-dev",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/8m.csv\"",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v2/8m.csv\"",
|
||||
"CONFIG_USE_ESP_WAKE_WORD=y",
|
||||
"CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y"
|
||||
]
|
||||
|
||||
@ -14,8 +14,8 @@
|
||||
|
||||
#define TAG "LichuangC3DevBoard"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class LichuangC3DevBoard : public WifiBoard {
|
||||
private:
|
||||
@ -92,11 +92,7 @@ private:
|
||||
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
public:
|
||||
@ -108,6 +104,11 @@ public:
|
||||
GetBacklight()->SetBrightness(100);
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static Es8311AudioCodec audio_codec(
|
||||
codec_i2c_bus_,
|
||||
|
||||
@ -4,7 +4,8 @@
|
||||
{
|
||||
"name": "lichuang-dev",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_USE_DEVICE_AEC=y"
|
||||
"CONFIG_USE_DEVICE_AEC=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v2/16m.csv\""
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#define TAG "LichuangDevBoard"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class Pca9557 : public I2cDevice {
|
||||
@ -158,15 +158,7 @@ private:
|
||||
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
#else
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
#endif
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
void InitializeTouch()
|
||||
@ -251,6 +243,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static CustomAudioCodec audio_codec(
|
||||
i2c_bus_,
|
||||
|
||||
@ -18,8 +18,8 @@
|
||||
|
||||
#define TAG "LilygoTCameraPlusS3Board"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class Cst816x : public I2cDevice {
|
||||
public:
|
||||
@ -208,11 +208,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
@ -290,6 +286,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec *GetAudioCodec() override {
|
||||
static Tcamerapluss3AudioCodec audio_codec(
|
||||
AUDIO_INPUT_SAMPLE_RATE,
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#define TAG "LilygoTCircleS3Board"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
class Cst816x : public I2cDevice {
|
||||
@ -186,11 +186,7 @@ private:
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X,
|
||||
DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4});
|
||||
|
||||
gpio_config_t config;
|
||||
config.pin_bit_mask = BIT64(DISPLAY_BL);
|
||||
@ -228,6 +224,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_32);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec *GetAudioCodec() override {
|
||||
static Tcircles3AudioCodec audio_codec(
|
||||
AUDIO_INPUT_SAMPLE_RATE,
|
||||
|
||||
@ -16,8 +16,8 @@
|
||||
|
||||
#define TAG "LilygoTDisplays3ProMVSRLoraBoard"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class Cst2xxse : public I2cDevice {
|
||||
public:
|
||||
@ -210,11 +210,7 @@ private:
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X,
|
||||
DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
|
||||
gpio_config_t config;
|
||||
config.pin_bit_mask = BIT64(DISPLAY_BL);
|
||||
@ -253,6 +249,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec *GetAudioCodec() override {
|
||||
static Tdisplays3promvsrloraAudioCodec audio_codec(
|
||||
AUDIO_INPUT_SAMPLE_RATE,
|
||||
|
||||
@ -1,22 +1,18 @@
|
||||
# 使用说明
|
||||
|
||||
|
||||
1. 设置编译目标为 esp32s3
|
||||
**编译**
|
||||
|
||||
```shell
|
||||
idf.py set-target esp32s3
|
||||
```bash
|
||||
python ./scripts/release.py m5stack-core-s3
|
||||
```
|
||||
|
||||
2. 修改配置
|
||||
如需手动编译,请参考 `m5stack-core-s3/config.json` 修改 menuconfig 对应选项。
|
||||
|
||||
```shell
|
||||
cp main/boards/m5stack-core-s3/sdkconfig.cores3 sdkconfig
|
||||
```
|
||||
**烧录**
|
||||
|
||||
3. 编译烧录程序
|
||||
|
||||
```shell
|
||||
idf.py build flash monitor
|
||||
```bash
|
||||
idf.py flash
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#define TAG "M5StackCoreS3Board"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class Pmic : public Axp2101 {
|
||||
@ -295,15 +295,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
#else
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
#endif
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
void InitializeCamera() {
|
||||
@ -350,6 +342,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static CoreS3AudioCodec audio_codec(i2c_bus_,
|
||||
AUDIO_INPUT_SAMPLE_RATE,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -22,7 +22,7 @@
|
||||
|
||||
#define TAG "M5StackTab5Board"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_30_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_30_4);
|
||||
LV_FONT_DECLARE(font_awesome_30_4);
|
||||
|
||||
|
||||
@ -44,8 +44,7 @@ LV_FONT_DECLARE(font_awesome_30_4);
|
||||
|
||||
class Pi4ioe1 : public I2cDevice {
|
||||
public:
|
||||
Pi4ioe1(i2c_master_bus_handle_t i2c_bus, uint8_t addr) : I2cDevice(i2c_bus, addr)
|
||||
{
|
||||
Pi4ioe1(i2c_master_bus_handle_t i2c_bus, uint8_t addr) : I2cDevice(i2c_bus, addr) {
|
||||
WriteReg(PI4IO_REG_CHIP_RESET, 0xFF);
|
||||
uint8_t data = ReadReg(PI4IO_REG_CHIP_RESET);
|
||||
WriteReg(PI4IO_REG_IO_DIR, 0b01111111); // 0: input 1: output
|
||||
@ -60,8 +59,7 @@ public:
|
||||
|
||||
class Pi4ioe2 : public I2cDevice {
|
||||
public:
|
||||
Pi4ioe2(i2c_master_bus_handle_t i2c_bus, uint8_t addr) : I2cDevice(i2c_bus, addr)
|
||||
{
|
||||
Pi4ioe2(i2c_master_bus_handle_t i2c_bus, uint8_t addr) : I2cDevice(i2c_bus, addr) {
|
||||
WriteReg(PI4IO_REG_CHIP_RESET, 0xFF);
|
||||
uint8_t data = ReadReg(PI4IO_REG_CHIP_RESET);
|
||||
WriteReg(PI4IO_REG_IO_DIR, 0b10111001); // 0: input 1: output
|
||||
@ -84,8 +82,7 @@ private:
|
||||
Pi4ioe2* pi4ioe2_;
|
||||
esp_lcd_touch_handle_t touch_ = nullptr;
|
||||
|
||||
void InitializeI2c()
|
||||
{
|
||||
void InitializeI2c() {
|
||||
// Initialize I2C peripheral
|
||||
i2c_master_bus_config_t i2c_bus_cfg = {
|
||||
.i2c_port = (i2c_port_t)1,
|
||||
@ -102,8 +99,7 @@ private:
|
||||
ESP_ERROR_CHECK(i2c_new_master_bus(&i2c_bus_cfg, &i2c_bus_));
|
||||
}
|
||||
|
||||
void I2cDetect()
|
||||
{
|
||||
void I2cDetect() {
|
||||
uint8_t address;
|
||||
printf(" 0 1 2 3 4 5 6 7 8 9 a b c d e f\r\n");
|
||||
for (int i = 0; i < 128; i += 16) {
|
||||
@ -124,15 +120,13 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
void InitializePi4ioe()
|
||||
{
|
||||
void InitializePi4ioe() {
|
||||
ESP_LOGI(TAG, "Init I/O Exapander PI4IOE");
|
||||
pi4ioe1_ = new Pi4ioe1(i2c_bus_, 0x43);
|
||||
pi4ioe2_ = new Pi4ioe2(i2c_bus_, 0x44);
|
||||
}
|
||||
|
||||
void InitializeButtons()
|
||||
{
|
||||
void InitializeButtons() {
|
||||
boot_button_.OnClick([this]() {
|
||||
auto& app = Application::GetInstance();
|
||||
if (app.GetDeviceState() == kDeviceStateStarting && !WifiStation::GetInstance().IsConnected()) {
|
||||
@ -191,8 +185,7 @@ private:
|
||||
ESP_ERROR_CHECK(spi_bus_initialize(SPI3_HOST, &buscfg, SPI_DMA_CH_AUTO));
|
||||
}
|
||||
|
||||
void InitializeIli9881cDisplay()
|
||||
{
|
||||
void InitializeIli9881cDisplay() {
|
||||
esp_lcd_panel_io_handle_t panel_io = nullptr;
|
||||
esp_lcd_panel_handle_t panel = nullptr;
|
||||
|
||||
@ -223,7 +216,7 @@ private:
|
||||
ESP_ERROR_CHECK(esp_lcd_new_panel_io_dbi(mipi_dsi_bus, &dbi_config, &panel_io));
|
||||
|
||||
ESP_LOGI(TAG, "Install LCD driver of ili9881c");
|
||||
esp_lcd_dpi_panel_config_t dpi_config = {.virtual_channel = 0,
|
||||
esp_lcd_dpi_panel_config_t dpi_config = {.virtual_channel = 0,
|
||||
.dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT,
|
||||
.dpi_clock_freq_mhz = 60,
|
||||
.pixel_format = LCD_COLOR_PIXEL_FORMAT_RGB565,
|
||||
@ -269,16 +262,11 @@ private:
|
||||
|
||||
display_ = new MipiLcdDisplay(panel_io, panel, DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X,
|
||||
DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_30_4,
|
||||
.icon_font = &font_awesome_30_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
});
|
||||
{&font_puhui_basic_30_4, &font_awesome_30_4});
|
||||
}
|
||||
|
||||
public:
|
||||
M5StackTab5Board() : boot_button_(BOOT_BUTTON_GPIO)
|
||||
{
|
||||
M5StackTab5Board() : boot_button_(BOOT_BUTTON_GPIO) {
|
||||
InitializeI2c();
|
||||
I2cDetect();
|
||||
InitializePi4ioe();
|
||||
@ -288,8 +276,12 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override
|
||||
{
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_30_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static Tab5AudioCodec audio_codec(i2c_bus_,
|
||||
AUDIO_INPUT_SAMPLE_RATE,
|
||||
AUDIO_OUTPUT_SAMPLE_RATE,
|
||||
@ -305,13 +297,11 @@ public:
|
||||
return &audio_codec;
|
||||
}
|
||||
|
||||
virtual Display* GetDisplay() override
|
||||
{
|
||||
virtual Display* GetDisplay() override {
|
||||
return display_;
|
||||
}
|
||||
|
||||
virtual Backlight* GetBacklight() override
|
||||
{
|
||||
virtual Backlight* GetBacklight() override {
|
||||
static PwmBacklight backlight(DISPLAY_BACKLIGHT_PIN, DISPLAY_BACKLIGHT_OUTPUT_INVERT);
|
||||
return &backlight;
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#define TAG "magiclick_2p4"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
class NV3023Display : public SpiLcdDisplay {
|
||||
@ -27,11 +27,7 @@ public:
|
||||
NV3023Display(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel,
|
||||
int width, int height, int offset_x, int offset_y, bool mirror_x, bool mirror_y, bool swap_xy)
|
||||
: SpiLcdDisplay(panel_io, panel, width, height, offset_x, offset_y, mirror_x, mirror_y, swap_xy,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
}) {
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4}) {
|
||||
|
||||
DisplayLockGuard lock(this);
|
||||
// 只需要覆盖颜色相关的样式
|
||||
@ -233,7 +229,11 @@ public:
|
||||
InitializeSpi();
|
||||
InitializeNv3023Display();
|
||||
GetBacklight()->RestoreBrightness();
|
||||
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_32);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
#define TAG "magiclick_2p5"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
class GC9107Display : public SpiLcdDisplay {
|
||||
@ -30,11 +30,7 @@ public:
|
||||
GC9107Display(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel,
|
||||
int width, int height, int offset_x, int offset_y, bool mirror_x, bool mirror_y, bool swap_xy)
|
||||
: SpiLcdDisplay(panel_io, panel, width, height, offset_x, offset_y, mirror_x, mirror_y, swap_xy,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
}) {
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4}) {
|
||||
}
|
||||
};
|
||||
|
||||
@ -292,6 +288,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_32);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static CircularStrip led(BUILTIN_LED_GPIO, BUILTIN_LED_NUM);
|
||||
return &led;
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#define TAG "magiclick_c3_v2"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
class GC9107Display : public SpiLcdDisplay {
|
||||
@ -27,11 +27,7 @@ public:
|
||||
GC9107Display(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel,
|
||||
int width, int height, int offset_x, int offset_y, bool mirror_x, bool mirror_y, bool swap_xy)
|
||||
: SpiLcdDisplay(panel_io, panel, width, height, offset_x, offset_y, mirror_x, mirror_y, swap_xy,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
}) {
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4}) {
|
||||
|
||||
DisplayLockGuard lock(this);
|
||||
// 只需要覆盖颜色相关的样式
|
||||
@ -215,6 +211,11 @@ public:
|
||||
esp_efuse_write_field_bit(ESP_EFUSE_VDD_SPI_AS_GPIO);
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_32);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
return &led;
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
#define TAG "magiclick_c3"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
class NV3023Display : public SpiLcdDisplay {
|
||||
@ -25,11 +25,7 @@ public:
|
||||
NV3023Display(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel,
|
||||
int width, int height, int offset_x, int offset_y, bool mirror_x, bool mirror_y, bool swap_xy)
|
||||
: SpiLcdDisplay(panel_io, panel, width, height, offset_x, offset_y, mirror_x, mirror_y, swap_xy,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
}) {
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4}) {
|
||||
|
||||
DisplayLockGuard lock(this);
|
||||
// 只需要覆盖颜色相关的样式
|
||||
@ -173,6 +169,11 @@ public:
|
||||
esp_efuse_write_field_bit(ESP_EFUSE_VDD_SPI_AS_GPIO);
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_32);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
return &led;
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
#define TAG "MINSI_K08_DUAL"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class MINSI_K08_DUAL : public DualNetworkBoard {
|
||||
@ -126,15 +126,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
#else
|
||||
.emoji_font = DISPLAY_HEIGHT >= 240 ? font_emoji_64_init() : font_emoji_32_init(),
|
||||
#endif
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
@ -213,6 +205,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
return &led;
|
||||
|
||||
@ -56,7 +56,7 @@ Component config -> ESP PSRAM -> SPI RAM config -> Mode (QUAD/OCT) -> QUAD Mode
|
||||
|
||||
```
|
||||
Serial flasher config -> Flash size -> 8 MB
|
||||
Partition Table -> Custom partition CSV file -> partitions/v1/8m.csv
|
||||
Partition Table -> Custom partition CSV file -> partitions/v2/8m.csv
|
||||
```
|
||||
|
||||
**编译:**
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_SPIRAM_MODE_QUAD=y",
|
||||
"CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/8m.csv\"",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v2/8m.csv\"",
|
||||
"CONFIG_LCD_ST7735_128X160=y"
|
||||
]
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#define TAG "MIXGO_NOVA"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
|
||||
@ -127,11 +127,7 @@ private:
|
||||
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4});
|
||||
}
|
||||
|
||||
public:
|
||||
@ -148,6 +144,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_32);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static CircularStrip led(BUILTIN_LED_GPIO, 4);
|
||||
return &led;
|
||||
|
||||
@ -22,7 +22,7 @@ Serial flasher config -> Flash size -> 8 MB
|
||||
### 分区表配置:
|
||||
|
||||
```
|
||||
Partition Table -> Custom partition CSV file -> partitions/v1/8m.csv
|
||||
Partition Table -> Custom partition CSV file -> partitions/v2/8m.csv
|
||||
```
|
||||
|
||||
### 开发板选择:
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
"name": "movecall-cuican-esp32s3",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/8m.csv\"",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v2/8m.csv\"",
|
||||
"CONFIG_COMPILER_OPTIMIZATION_SIZE=y"
|
||||
]
|
||||
}
|
||||
|
||||
@ -20,8 +20,8 @@
|
||||
|
||||
#define TAG "MovecallCuicanESP32S3"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class MovecallCuicanESP32S3 : public WifiBoard {
|
||||
private:
|
||||
@ -80,11 +80,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(io_handle, panel_handle,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
@ -106,6 +102,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led_strip(BUILTIN_LED_GPIO);
|
||||
return &led_strip;
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
#define TAG "MovecallMojiESP32S3"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
|
||||
@ -36,11 +36,7 @@ public:
|
||||
bool mirror_y,
|
||||
bool swap_xy)
|
||||
: SpiLcdDisplay(io_handle, panel_handle, width, height, offset_x, offset_y, mirror_x, mirror_y, swap_xy,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
}) {
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4}) {
|
||||
|
||||
DisplayLockGuard lock(this);
|
||||
// 由于屏幕是圆的,所以状态栏需要增加左右内边距
|
||||
@ -106,11 +102,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(io_handle, panel_handle,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_20_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
});
|
||||
{&font_puhui_basic_20_4, &font_awesome_20_4});
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
@ -132,6 +124,11 @@ public:
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led_strip(BUILTIN_LED_GPIO);
|
||||
return &led_strip;
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
{
|
||||
"name": "otto-robot",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/16m.csv\""
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@ -51,9 +51,9 @@ const OttoEmojiDisplay::EmotionMap OttoEmojiDisplay::emotion_maps_[] = {
|
||||
|
||||
OttoEmojiDisplay::OttoEmojiDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel,
|
||||
int width, int height, int offset_x, int offset_y, bool mirror_x,
|
||||
bool mirror_y, bool swap_xy, DisplayFonts fonts)
|
||||
bool mirror_y, bool swap_xy, DisplayStyle style)
|
||||
: SpiLcdDisplay(panel_io, panel, width, height, offset_x, offset_y, mirror_x, mirror_y, swap_xy,
|
||||
fonts),
|
||||
style),
|
||||
emotion_gif_(nullptr) {
|
||||
SetupGifContainer();
|
||||
};
|
||||
@ -146,26 +146,3 @@ void OttoEmojiDisplay::SetChatMessage(const char* role, const char* content) {
|
||||
|
||||
ESP_LOGI(TAG, "设置聊天消息 [%s]: %s", role, content);
|
||||
}
|
||||
|
||||
void OttoEmojiDisplay::SetIcon(const char* icon) {
|
||||
if (!icon) {
|
||||
return;
|
||||
}
|
||||
|
||||
DisplayLockGuard lock(this);
|
||||
|
||||
if (chat_message_label_ != nullptr) {
|
||||
std::string icon_message = std::string(icon) + " ";
|
||||
|
||||
if (strcmp(icon, FONT_AWESOME_DOWNLOAD) == 0) {
|
||||
icon_message += "正在升级...";
|
||||
} else {
|
||||
icon_message += "系统状态";
|
||||
}
|
||||
|
||||
lv_label_set_text(chat_message_label_, icon_message.c_str());
|
||||
lv_obj_remove_flag(chat_message_label_, LV_OBJ_FLAG_HIDDEN);
|
||||
|
||||
ESP_LOGI(TAG, "设置图标: %s", icon);
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ public:
|
||||
*/
|
||||
OttoEmojiDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel, int width,
|
||||
int height, int offset_x, int offset_y, bool mirror_x, bool mirror_y,
|
||||
bool swap_xy, DisplayFonts fonts);
|
||||
bool swap_xy, DisplayStyle style);
|
||||
|
||||
virtual ~OttoEmojiDisplay() = default;
|
||||
|
||||
@ -26,9 +26,6 @@ public:
|
||||
// 重写聊天消息设置方法
|
||||
virtual void SetChatMessage(const char* role, const char* content) override;
|
||||
|
||||
// 添加SetIcon方法声明
|
||||
virtual void SetIcon(const char* icon) override;
|
||||
|
||||
private:
|
||||
void SetupGifContainer();
|
||||
|
||||
|
||||
@ -79,11 +79,7 @@ private:
|
||||
display_ = new OttoEmojiDisplay(
|
||||
panel_io, panel, DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y,
|
||||
DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = DISPLAY_HEIGHT >= 240 ? font_emoji_64_init() : font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_16_4, &font_awesome_16_4, new Twemoji64()});
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
|
||||
@ -29,7 +29,7 @@ watcher 中一些额外的配置项如下,需要在menuconfig 中选择.
|
||||
```
|
||||
CONFIG_BOARD_TYPE_SENSECAP_WATCHER=y
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/v1/32m.csv"
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/v2/32m.csv"
|
||||
CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y
|
||||
CONFIG_ESPTOOLPY_FLASH_MODE_AUTO_DETECT=n
|
||||
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
|
||||
|
||||
@ -29,7 +29,7 @@ There are some additional configuration options for the watcher. Please select t
|
||||
```
|
||||
CONFIG_BOARD_TYPE_SENSECAP_WATCHER=y
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/v1/32m.csv"
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/v2/32m.csv"
|
||||
CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y
|
||||
CONFIG_ESPTOOLPY_FLASH_MODE_AUTO_DETECT=n
|
||||
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
"name": "sensecap-watcher",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/32m.csv\"",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v2/32m.csv\"",
|
||||
"CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y",
|
||||
"CONFIG_ESPTOOLPY_FLASH_MODE_AUTO_DETECT=n",
|
||||
"CONFIG_IDF_EXPERIMENTAL_FEATURES=y",
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
"name": "sensecap-watcher-en",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/32m.csv\"",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v2/32m.csv\"",
|
||||
"CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y",
|
||||
"CONFIG_ESPTOOLPY_FLASH_MODE_AUTO_DETECT=n",
|
||||
"CONFIG_IDF_EXPERIMENTAL_FEATURES=y",
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
#define TAG "sensecap_watcher"
|
||||
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_30_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_30_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
class CustomLcdDisplay : public SpiLcdDisplay {
|
||||
@ -48,14 +48,10 @@ class CustomLcdDisplay : public SpiLcdDisplay {
|
||||
bool mirror_y,
|
||||
bool swap_xy)
|
||||
: SpiLcdDisplay(io_handle, panel_handle, width, height, offset_x, offset_y, mirror_x, mirror_y, swap_xy,
|
||||
{
|
||||
.text_font = &font_puhui_30_4,
|
||||
.icon_font = &font_awesome_20_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
}) {
|
||||
{&font_puhui_basic_30_4, &font_awesome_20_4}) {
|
||||
|
||||
DisplayLockGuard lock(this);
|
||||
lv_obj_set_size(status_bar_, LV_HOR_RES, fonts_.text_font->line_height * 2 + 10);
|
||||
lv_obj_set_size(status_bar_, LV_HOR_RES, style_.text_font->line_height * 2 + 10);
|
||||
lv_obj_set_style_layout(status_bar_, LV_LAYOUT_NONE, 0);
|
||||
lv_obj_set_style_pad_top(status_bar_, 10, 0);
|
||||
lv_obj_set_style_pad_bottom(status_bar_, 1, 0);
|
||||
@ -63,9 +59,9 @@ class CustomLcdDisplay : public SpiLcdDisplay {
|
||||
// 针对圆形屏幕调整位置
|
||||
// network battery mute //
|
||||
// status //
|
||||
lv_obj_align(battery_label_, LV_ALIGN_TOP_MID, -2.5*fonts_.icon_font->line_height, 0);
|
||||
lv_obj_align(network_label_, LV_ALIGN_TOP_MID, -0.5*fonts_.icon_font->line_height, 0);
|
||||
lv_obj_align(mute_label_, LV_ALIGN_TOP_MID, 1.5*fonts_.icon_font->line_height, 0);
|
||||
lv_obj_align(battery_label_, LV_ALIGN_TOP_MID, -2.5 * style_.icon_font->line_height, 0);
|
||||
lv_obj_align(network_label_, LV_ALIGN_TOP_MID, -0.5 * style_.icon_font->line_height, 0);
|
||||
lv_obj_align(mute_label_, LV_ALIGN_TOP_MID, 1.5 * style_.icon_font->line_height, 0);
|
||||
|
||||
lv_obj_align(status_label_, LV_ALIGN_BOTTOM_MID, 0, 0);
|
||||
lv_obj_set_flex_grow(status_label_, 0);
|
||||
@ -537,6 +533,11 @@ public:
|
||||
InitializeCamera();
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_30_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static SensecapAudioCodec audio_codec(
|
||||
i2c_bus_,
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
#define TAG "Spotpear_ESP32_S3_1_28_BOX"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
|
||||
@ -81,11 +81,7 @@ public:
|
||||
bool mirror_y,
|
||||
bool swap_xy)
|
||||
: SpiLcdDisplay(io_handle, panel_handle, width, height, offset_x, offset_y, mirror_x, mirror_y, swap_xy,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_64_init(),
|
||||
}) {
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4}) {
|
||||
|
||||
DisplayLockGuard lock(this);
|
||||
// 由于屏幕是圆的,所以状态栏需要增加左右内边距
|
||||
@ -285,6 +281,11 @@ public:
|
||||
}
|
||||
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_64);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led(BUILTIN_LED_GPIO);
|
||||
return &led;
|
||||
|
||||
@ -28,10 +28,7 @@
|
||||
|
||||
#define TAG "Spotpear_esp32_s3_lcd_1_54"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_20_4);
|
||||
LV_FONT_DECLARE(font_awesome_20_4);
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
class Cst816d : public I2cDevice {
|
||||
@ -254,11 +251,7 @@ private:
|
||||
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4});
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
@ -290,6 +283,11 @@ public:
|
||||
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_32);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
static SingleLed led_strip(BUILTIN_LED_GPIO);
|
||||
return &led_strip;
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
#define TAG "SURFERC3114TFT"
|
||||
|
||||
LV_FONT_DECLARE(font_puhui_16_4);
|
||||
LV_FONT_DECLARE(font_puhui_basic_16_4);
|
||||
LV_FONT_DECLARE(font_awesome_16_4);
|
||||
|
||||
class SurferC3114TFT : public WifiBoard {
|
||||
@ -147,11 +147,7 @@ private:
|
||||
esp_lcd_panel_mirror(panel_, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);
|
||||
display_ = new SpiLcdDisplay(panel_io_, panel_,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
|
||||
{
|
||||
.text_font = &font_puhui_16_4,
|
||||
.icon_font = &font_awesome_16_4,
|
||||
.emoji_font = font_emoji_32_init(),
|
||||
});
|
||||
{&font_puhui_basic_16_4, &font_awesome_16_4});
|
||||
}
|
||||
|
||||
public:
|
||||
@ -170,6 +166,11 @@ public:
|
||||
esp_efuse_write_field_bit(ESP_EFUSE_VDD_SPI_AS_GPIO);
|
||||
}
|
||||
|
||||
virtual Assets* GetAssets() override {
|
||||
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_32);
|
||||
return &assets;
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
static Es8311AudioCodec audio_codec(
|
||||
codec_i2c_bus_,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user