Move fonts / assets definition from main/boards to CMakeLists.txt (#1174)

* update surfer-c3-1.14tft font size

* Move fonts / assets definition from main/boards to CMakeLists.txt

* fix c3 compiling errors

---------

Co-authored-by: Xiaoxia <terrence.huang@tenclass.com>
This commit is contained in:
Xiaoxia
2025-09-08 17:30:18 +08:00
committed by GitHub
parent 897239e997
commit d04b08133f
111 changed files with 1193 additions and 1673 deletions

View File

@@ -29,11 +29,6 @@
#define TAG "waveshare_lcd_3_5"
LV_FONT_DECLARE(font_puhui_basic_20_4);
LV_FONT_DECLARE(font_awesome_20_4);
class Pmic : public Axp2101 {
public:
Pmic(i2c_master_bus_handle_t i2c_bus, uint8_t addr) : Axp2101(i2c_bus, addr) {
@@ -66,7 +61,6 @@ class Pmic : public Axp2101 {
}
};
typedef struct {
int cmd; /*<! The specific LCD command */
const void *data; /*<! Buffer that holds the command specific data */
@@ -82,7 +76,6 @@ typedef struct {
uint16_t init_cmds_size; /*<! Number of commands in above array */
} st7796_vendor_config_t;
st7796_lcd_init_cmd_t st7796_lcd_init_cmds[] = {
{0x11, (uint8_t []){ 0x00 }, 0, 120},
@@ -106,7 +99,6 @@ st7796_lcd_init_cmd_t st7796_lcd_init_cmds[] = {
{0x29, (uint8_t []){ 0x00 }, 0, 0},
};
class CustomBoard : public WifiBoard {
private:
Button boot_button_;
@@ -291,8 +283,7 @@ private:
panel_config.vendor_config = &st7796_vendor_config;
ESP_ERROR_CHECK(esp_lcd_new_panel_st7789(panel_io, &panel_config, &panel));
esp_lcd_panel_reset(panel);
esp_lcd_panel_init(panel);
@@ -300,11 +291,8 @@ 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,
{&font_puhui_basic_20_4, &font_awesome_20_4});
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
}
void InitializeButtons() {
@@ -350,11 +338,6 @@ 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,