|
1 | | -#include "wifi_board.h" |
2 | | -#include "audio_codecs/no_audio_codec.h" |
3 | | -#include "display/lcd_display.h" |
4 | | -#include "system_reset.h" |
5 | | -#include "application.h" |
6 | | -#include "button.h" |
7 | | -#include "config.h" |
8 | | -#include "iot/thing_manager.h" |
9 | | -#include "led/single_led.h" |
10 | | - |
11 | | -#include <wifi_station.h> |
12 | | -#include <esp_log.h> |
13 | | -#include <driver/i2c_master.h> |
14 | | -#include <esp_lcd_panel_vendor.h> |
15 | | -#include <esp_lcd_panel_io.h> |
16 | | -#include <esp_lcd_panel_ops.h> |
17 | | -#include <driver/spi_common.h> |
18 | | - |
19 | | -#if defined(LCD_TYPE_ILI9341_SERIAL) |
20 | | -#include "esp_lcd_ili9341.h" |
21 | | -#endif |
22 | | - |
23 | | -#if defined(LCD_TYPE_GC9A01_SERIAL) |
24 | | -#include "esp_lcd_gc9a01.h" |
25 | | -static const gc9a01_lcd_init_cmd_t gc9107_lcd_init_cmds[] = { |
26 | | - // {cmd, { data }, data_size, delay_ms} |
27 | | - {0xfe, (uint8_t[]){0x00}, 0, 0}, |
28 | | - {0xef, (uint8_t[]){0x00}, 0, 0}, |
29 | | - {0xb0, (uint8_t[]){0xc0}, 1, 0}, |
30 | | - {0xb1, (uint8_t[]){0x80}, 1, 0}, |
31 | | - {0xb2, (uint8_t[]){0x27}, 1, 0}, |
32 | | - {0xb3, (uint8_t[]){0x13}, 1, 0}, |
33 | | - {0xb6, (uint8_t[]){0x19}, 1, 0}, |
34 | | - {0xb7, (uint8_t[]){0x05}, 1, 0}, |
35 | | - {0xac, (uint8_t[]){0xc8}, 1, 0}, |
36 | | - {0xab, (uint8_t[]){0x0f}, 1, 0}, |
37 | | - {0x3a, (uint8_t[]){0x05}, 1, 0}, |
38 | | - {0xb4, (uint8_t[]){0x04}, 1, 0}, |
39 | | - {0xa8, (uint8_t[]){0x08}, 1, 0}, |
40 | | - {0xb8, (uint8_t[]){0x08}, 1, 0}, |
41 | | - {0xea, (uint8_t[]){0x02}, 1, 0}, |
42 | | - {0xe8, (uint8_t[]){0x2A}, 1, 0}, |
43 | | - {0xe9, (uint8_t[]){0x47}, 1, 0}, |
44 | | - {0xe7, (uint8_t[]){0x5f}, 1, 0}, |
45 | | - {0xc6, (uint8_t[]){0x21}, 1, 0}, |
46 | | - {0xc7, (uint8_t[]){0x15}, 1, 0}, |
47 | | - {0xf0, |
48 | | - (uint8_t[]){0x1D, 0x38, 0x09, 0x4D, 0x92, 0x2F, 0x35, 0x52, 0x1E, 0x0C, |
49 | | - 0x04, 0x12, 0x14, 0x1f}, |
50 | | - 14, 0}, |
51 | | - {0xf1, |
52 | | - (uint8_t[]){0x16, 0x40, 0x1C, 0x54, 0xA9, 0x2D, 0x2E, 0x56, 0x10, 0x0D, |
53 | | - 0x0C, 0x1A, 0x14, 0x1E}, |
54 | | - 14, 0}, |
55 | | - {0xf4, (uint8_t[]){0x00, 0x00, 0xFF}, 3, 0}, |
56 | | - {0xba, (uint8_t[]){0xFF, 0xFF}, 2, 0}, |
57 | | -}; |
58 | | -#endif |
59 | | - |
60 | | -#define TAG "CompactWifiBoardLCD" |
61 | | - |
62 | | -LV_FONT_DECLARE(font_puhui_16_4); |
63 | | -LV_FONT_DECLARE(font_awesome_16_4); |
64 | | - |
65 | | -class CompactWifiBoardLCD : public WifiBoard { |
66 | | -private: |
67 | | - |
68 | | - Button boot_button_; |
69 | | - LcdDisplay* display_; |
70 | | - |
71 | | - void InitializeSpi() { |
72 | | - spi_bus_config_t buscfg = {}; |
73 | | - buscfg.mosi_io_num = DISPLAY_MOSI_PIN; |
74 | | - buscfg.miso_io_num = GPIO_NUM_NC; |
75 | | - buscfg.sclk_io_num = DISPLAY_CLK_PIN; |
76 | | - buscfg.quadwp_io_num = GPIO_NUM_NC; |
77 | | - buscfg.quadhd_io_num = GPIO_NUM_NC; |
78 | | - buscfg.max_transfer_sz = DISPLAY_WIDTH * DISPLAY_HEIGHT * sizeof(uint16_t); |
79 | | - ESP_ERROR_CHECK(spi_bus_initialize(SPI3_HOST, &buscfg, SPI_DMA_CH_AUTO)); |
80 | | - } |
81 | | - |
82 | | - void InitializeLcdDisplay() { |
83 | | - esp_lcd_panel_io_handle_t panel_io = nullptr; |
84 | | - esp_lcd_panel_handle_t panel = nullptr; |
85 | | - // 液晶屏控制IO初始化 |
86 | | - ESP_LOGD(TAG, "Install panel IO"); |
87 | | - esp_lcd_panel_io_spi_config_t io_config = {}; |
88 | | - io_config.cs_gpio_num = DISPLAY_CS_PIN; |
89 | | - io_config.dc_gpio_num = DISPLAY_DC_PIN; |
90 | | - io_config.spi_mode = DISPLAY_SPI_MODE; |
91 | | - io_config.pclk_hz = 40 * 1000 * 1000; |
92 | | - io_config.trans_queue_depth = 10; |
93 | | - io_config.lcd_cmd_bits = 8; |
94 | | - io_config.lcd_param_bits = 8; |
95 | | - ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi(SPI3_HOST, &io_config, &panel_io)); |
96 | | - |
97 | | - // 初始化液晶屏驱动芯片 |
98 | | - ESP_LOGD(TAG, "Install LCD driver"); |
99 | | - esp_lcd_panel_dev_config_t panel_config = {}; |
100 | | - panel_config.reset_gpio_num = DISPLAY_RST_PIN; |
101 | | - panel_config.rgb_ele_order = DISPLAY_RGB_ORDER; |
102 | | - panel_config.bits_per_pixel = 16; |
103 | | -#if defined(LCD_TYPE_ILI9341_SERIAL) |
104 | | - ESP_ERROR_CHECK(esp_lcd_new_panel_ili9341(panel_io, &panel_config, &panel)); |
105 | | -#elif defined(LCD_TYPE_GC9A01_SERIAL) |
106 | | - ESP_ERROR_CHECK(esp_lcd_new_panel_gc9a01(panel_io, &panel_config, &panel)); |
107 | | - gc9a01_vendor_config_t gc9107_vendor_config = { |
108 | | - .init_cmds = gc9107_lcd_init_cmds, |
109 | | - .init_cmds_size = sizeof(gc9107_lcd_init_cmds) / sizeof(gc9a01_lcd_init_cmd_t), |
110 | | - }; |
111 | | -#else |
112 | | - ESP_ERROR_CHECK(esp_lcd_new_panel_st7789(panel_io, &panel_config, &panel)); |
113 | | -#endif |
114 | | - |
115 | | - esp_lcd_panel_reset(panel); |
116 | | - |
117 | | - |
118 | | - esp_lcd_panel_init(panel); |
119 | | - esp_lcd_panel_invert_color(panel, DISPLAY_INVERT_COLOR); |
120 | | - esp_lcd_panel_swap_xy(panel, DISPLAY_SWAP_XY); |
121 | | - esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y); |
122 | | -#ifdef LCD_TYPE_GC9A01_SERIAL |
123 | | - panel_config.vendor_config = &gc9107_vendor_config; |
124 | | -#endif |
125 | | - display_ = new SpiLcdDisplay(panel_io, panel, |
126 | | - DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY, |
127 | | - { |
128 | | - .text_font = &font_puhui_16_4, |
129 | | - .icon_font = &font_awesome_16_4, |
130 | | - .emoji_font = DISPLAY_HEIGHT >= 240 ? font_emoji_64_init() : font_emoji_32_init(), |
131 | | - }); |
132 | | - } |
133 | | - |
134 | | - |
135 | | - |
136 | | - void InitializeButtons() { |
137 | | - boot_button_.OnClick([this]() { |
138 | | - auto& app = Application::GetInstance(); |
139 | | - if (app.GetDeviceState() == kDeviceStateStarting && !WifiStation::GetInstance().IsConnected()) { |
140 | | - ResetWifiConfiguration(); |
141 | | - } |
142 | | - app.ToggleChatState(); |
143 | | - }); |
144 | | - } |
145 | | - |
146 | | - // 物联网初始化,添加对 AI 可见设备 |
147 | | - void InitializeIot() { |
148 | | - auto& thing_manager = iot::ThingManager::GetInstance(); |
149 | | - thing_manager.AddThing(iot::CreateThing("Speaker")); |
150 | | -#if DISPLAY_BACKLIGHT_PIN != GPIO_NUM_NC |
151 | | - thing_manager.AddThing(iot::CreateThing("Backlight")); |
152 | | -#endif |
153 | | - } |
154 | | - |
155 | | -public: |
156 | | - CompactWifiBoardLCD() : |
157 | | - boot_button_(BOOT_BUTTON_GPIO) { |
158 | | - InitializeSpi(); |
159 | | - InitializeLcdDisplay(); |
160 | | - InitializeButtons(); |
161 | | - InitializeIot(); |
162 | | - |
163 | | -#if DISPLAY_BACKLIGHT_PIN != GPIO_NUM_NC |
164 | | - GetBacklight()->RestoreBrightness(); |
165 | | -#endif |
166 | | - } |
167 | | - |
168 | | - virtual Led* GetLed() override { |
169 | | - static SingleLed led(BUILTIN_LED_GPIO); |
170 | | - return &led; |
171 | | - } |
172 | | - |
173 | | - virtual AudioCodec* GetAudioCodec() override { |
174 | | -#ifdef AUDIO_I2S_METHOD_SIMPLEX |
175 | | - static NoAudioCodecSimplex audio_codec(AUDIO_INPUT_SAMPLE_RATE, AUDIO_OUTPUT_SAMPLE_RATE, |
176 | | - 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); |
177 | | -#else |
178 | | - static NoAudioCodecDuplex audio_codec(AUDIO_INPUT_SAMPLE_RATE, AUDIO_OUTPUT_SAMPLE_RATE, |
179 | | - AUDIO_I2S_GPIO_BCLK, AUDIO_I2S_GPIO_WS, AUDIO_I2S_GPIO_DOUT, AUDIO_I2S_GPIO_DIN); |
180 | | -#endif |
181 | | - return &audio_codec; |
182 | | - } |
183 | | - |
184 | | - virtual Display* GetDisplay() override { |
185 | | - return display_; |
186 | | - } |
187 | | - |
188 | | -#if DISPLAY_BACKLIGHT_PIN != GPIO_NUM_NC |
189 | | - virtual Backlight* GetBacklight() override { |
190 | | - static PwmBacklight backlight(DISPLAY_BACKLIGHT_PIN, DISPLAY_BACKLIGHT_OUTPUT_INVERT); |
191 | | - return &backlight; |
192 | | - } |
193 | | -#endif |
194 | | -}; |
195 | | - |
196 | | -DECLARE_BOARD(CompactWifiBoardLCD); |
| 1 | +#include "wifi_board.h" |
| 2 | +#include "audio_codecs/no_audio_codec.h" |
| 3 | +#include "display/lcd_display.h" |
| 4 | +#include "system_reset.h" |
| 5 | +#include "application.h" |
| 6 | +#include "button.h" |
| 7 | +#include "config.h" |
| 8 | +#include "iot/thing_manager.h" |
| 9 | +#include "led/single_led.h" |
| 10 | + |
| 11 | +#include <wifi_station.h> |
| 12 | +#include <esp_log.h> |
| 13 | +#include <driver/i2c_master.h> |
| 14 | +#include <esp_lcd_panel_vendor.h> |
| 15 | +#include <esp_lcd_panel_io.h> |
| 16 | +#include <esp_lcd_panel_ops.h> |
| 17 | +#include <driver/spi_common.h> |
| 18 | + |
| 19 | +#if defined(LCD_TYPE_ILI9341_SERIAL) |
| 20 | +#include "esp_lcd_ili9341.h" |
| 21 | +#endif |
| 22 | + |
| 23 | +#if defined(LCD_TYPE_GC9A01_SERIAL) |
| 24 | +#include "esp_lcd_gc9a01.h" |
| 25 | +static const gc9a01_lcd_init_cmd_t gc9107_lcd_init_cmds[] = { |
| 26 | + // {cmd, { data }, data_size, delay_ms} |
| 27 | + {0xfe, (uint8_t[]){0x00}, 0, 0}, |
| 28 | + {0xef, (uint8_t[]){0x00}, 0, 0}, |
| 29 | + {0xb0, (uint8_t[]){0xc0}, 1, 0}, |
| 30 | + {0xb1, (uint8_t[]){0x80}, 1, 0}, |
| 31 | + {0xb2, (uint8_t[]){0x27}, 1, 0}, |
| 32 | + {0xb3, (uint8_t[]){0x13}, 1, 0}, |
| 33 | + {0xb6, (uint8_t[]){0x19}, 1, 0}, |
| 34 | + {0xb7, (uint8_t[]){0x05}, 1, 0}, |
| 35 | + {0xac, (uint8_t[]){0xc8}, 1, 0}, |
| 36 | + {0xab, (uint8_t[]){0x0f}, 1, 0}, |
| 37 | + {0x3a, (uint8_t[]){0x05}, 1, 0}, |
| 38 | + {0xb4, (uint8_t[]){0x04}, 1, 0}, |
| 39 | + {0xa8, (uint8_t[]){0x08}, 1, 0}, |
| 40 | + {0xb8, (uint8_t[]){0x08}, 1, 0}, |
| 41 | + {0xea, (uint8_t[]){0x02}, 1, 0}, |
| 42 | + {0xe8, (uint8_t[]){0x2A}, 1, 0}, |
| 43 | + {0xe9, (uint8_t[]){0x47}, 1, 0}, |
| 44 | + {0xe7, (uint8_t[]){0x5f}, 1, 0}, |
| 45 | + {0xc6, (uint8_t[]){0x21}, 1, 0}, |
| 46 | + {0xc7, (uint8_t[]){0x15}, 1, 0}, |
| 47 | + {0xf0, |
| 48 | + (uint8_t[]){0x1D, 0x38, 0x09, 0x4D, 0x92, 0x2F, 0x35, 0x52, 0x1E, 0x0C, |
| 49 | + 0x04, 0x12, 0x14, 0x1f}, |
| 50 | + 14, 0}, |
| 51 | + {0xf1, |
| 52 | + (uint8_t[]){0x16, 0x40, 0x1C, 0x54, 0xA9, 0x2D, 0x2E, 0x56, 0x10, 0x0D, |
| 53 | + 0x0C, 0x1A, 0x14, 0x1E}, |
| 54 | + 14, 0}, |
| 55 | + {0xf4, (uint8_t[]){0x00, 0x00, 0xFF}, 3, 0}, |
| 56 | + {0xba, (uint8_t[]){0xFF, 0xFF}, 2, 0}, |
| 57 | +}; |
| 58 | +#endif |
| 59 | + |
| 60 | +#define TAG "CompactWifiBoardLCD" |
| 61 | + |
| 62 | +LV_FONT_DECLARE(font_puhui_16_4); |
| 63 | +LV_FONT_DECLARE(font_awesome_16_4); |
| 64 | + |
| 65 | +class CompactWifiBoardLCD : public WifiBoard { |
| 66 | +private: |
| 67 | + |
| 68 | + Button boot_button_; |
| 69 | + LcdDisplay* display_; |
| 70 | + |
| 71 | + void InitializeSpi() { |
| 72 | + spi_bus_config_t buscfg = {}; |
| 73 | + buscfg.mosi_io_num = DISPLAY_MOSI_PIN; |
| 74 | + buscfg.miso_io_num = GPIO_NUM_NC; |
| 75 | + buscfg.sclk_io_num = DISPLAY_CLK_PIN; |
| 76 | + buscfg.quadwp_io_num = GPIO_NUM_NC; |
| 77 | + buscfg.quadhd_io_num = GPIO_NUM_NC; |
| 78 | + buscfg.max_transfer_sz = DISPLAY_WIDTH * DISPLAY_HEIGHT * sizeof(uint16_t); |
| 79 | + ESP_ERROR_CHECK(spi_bus_initialize(SPI3_HOST, &buscfg, SPI_DMA_CH_AUTO)); |
| 80 | + } |
| 81 | + |
| 82 | + void InitializeLcdDisplay() { |
| 83 | + esp_lcd_panel_io_handle_t panel_io = nullptr; |
| 84 | + esp_lcd_panel_handle_t panel = nullptr; |
| 85 | + // 液晶屏控制IO初始化 |
| 86 | + ESP_LOGD(TAG, "Install panel IO"); |
| 87 | + esp_lcd_panel_io_spi_config_t io_config = {}; |
| 88 | + io_config.cs_gpio_num = DISPLAY_CS_PIN; |
| 89 | + io_config.dc_gpio_num = DISPLAY_DC_PIN; |
| 90 | + io_config.spi_mode = DISPLAY_SPI_MODE; |
| 91 | + io_config.pclk_hz = 40 * 1000 * 1000; |
| 92 | + io_config.trans_queue_depth = 10; |
| 93 | + io_config.lcd_cmd_bits = 8; |
| 94 | + io_config.lcd_param_bits = 8; |
| 95 | + ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi(SPI3_HOST, &io_config, &panel_io)); |
| 96 | + |
| 97 | + // 初始化液晶屏驱动芯片 |
| 98 | + ESP_LOGD(TAG, "Install LCD driver"); |
| 99 | + esp_lcd_panel_dev_config_t panel_config = {}; |
| 100 | + panel_config.reset_gpio_num = DISPLAY_RST_PIN; |
| 101 | + panel_config.rgb_ele_order = DISPLAY_RGB_ORDER; |
| 102 | + panel_config.bits_per_pixel = 16; |
| 103 | +#if defined(LCD_TYPE_ILI9341_SERIAL) |
| 104 | + ESP_ERROR_CHECK(esp_lcd_new_panel_ili9341(panel_io, &panel_config, &panel)); |
| 105 | +#elif defined(LCD_TYPE_GC9A01_SERIAL) |
| 106 | + ESP_ERROR_CHECK(esp_lcd_new_panel_gc9a01(panel_io, &panel_config, &panel)); |
| 107 | + gc9a01_vendor_config_t gc9107_vendor_config = { |
| 108 | + .init_cmds = gc9107_lcd_init_cmds, |
| 109 | + .init_cmds_size = sizeof(gc9107_lcd_init_cmds) / sizeof(gc9a01_lcd_init_cmd_t), |
| 110 | + }; |
| 111 | +#else |
| 112 | + ESP_ERROR_CHECK(esp_lcd_new_panel_st7789(panel_io, &panel_config, &panel)); |
| 113 | +#endif |
| 114 | + |
| 115 | + esp_lcd_panel_reset(panel); |
| 116 | + |
| 117 | + |
| 118 | + esp_lcd_panel_init(panel); |
| 119 | + esp_lcd_panel_invert_color(panel, DISPLAY_INVERT_COLOR); |
| 120 | + esp_lcd_panel_swap_xy(panel, DISPLAY_SWAP_XY); |
| 121 | + esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y); |
| 122 | +#ifdef LCD_TYPE_GC9A01_SERIAL |
| 123 | + panel_config.vendor_config = &gc9107_vendor_config; |
| 124 | +#endif |
| 125 | + display_ = new SpiLcdDisplay(panel_io, panel, |
| 126 | + DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY, |
| 127 | + { |
| 128 | + .text_font = &font_puhui_16_4, |
| 129 | + .icon_font = &font_awesome_16_4, |
| 130 | + .emoji_font = DISPLAY_HEIGHT >= 240 ? font_emoji_64_init() : font_emoji_32_init(), |
| 131 | + }); |
| 132 | + } |
| 133 | + |
| 134 | + |
| 135 | + |
| 136 | + void InitializeButtons() { |
| 137 | + boot_button_.OnClick([this]() { |
| 138 | + auto& app = Application::GetInstance(); |
| 139 | + if (app.GetDeviceState() == kDeviceStateStarting && !WifiStation::GetInstance().IsConnected()) { |
| 140 | + ResetWifiConfiguration(); |
| 141 | + } |
| 142 | + app.ToggleChatState(); |
| 143 | + }); |
| 144 | + } |
| 145 | + |
| 146 | + // 物联网初始化,添加对 AI 可见设备 |
| 147 | + void InitializeIot() { |
| 148 | + auto& thing_manager = iot::ThingManager::GetInstance(); |
| 149 | + thing_manager.AddThing(iot::CreateThing("Speaker")); |
| 150 | + thing_manager.AddThing(iot::CreateThing("Lamp")); |
| 151 | + if (DISPLAY_BACKLIGHT_PIN != GPIO_NUM_NC) { |
| 152 | + thing_manager.AddThing(iot::CreateThing("Backlight")); |
| 153 | + } |
| 154 | + } |
| 155 | + |
| 156 | +public: |
| 157 | + CompactWifiBoardLCD() : |
| 158 | + boot_button_(BOOT_BUTTON_GPIO) { |
| 159 | + InitializeSpi(); |
| 160 | + InitializeLcdDisplay(); |
| 161 | + InitializeButtons(); |
| 162 | + InitializeIot(); |
| 163 | + if (DISPLAY_BACKLIGHT_PIN != GPIO_NUM_NC) { |
| 164 | + GetBacklight()->RestoreBrightness(); |
| 165 | + } |
| 166 | + |
| 167 | + } |
| 168 | + |
| 169 | + virtual Led* GetLed() override { |
| 170 | + static SingleLed led(BUILTIN_LED_GPIO); |
| 171 | + return &led; |
| 172 | + } |
| 173 | + |
| 174 | + virtual AudioCodec* GetAudioCodec() override { |
| 175 | +#ifdef AUDIO_I2S_METHOD_SIMPLEX |
| 176 | + static NoAudioCodecSimplex audio_codec(AUDIO_INPUT_SAMPLE_RATE, AUDIO_OUTPUT_SAMPLE_RATE, |
| 177 | + 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); |
| 178 | +#else |
| 179 | + static NoAudioCodecDuplex audio_codec(AUDIO_INPUT_SAMPLE_RATE, AUDIO_OUTPUT_SAMPLE_RATE, |
| 180 | + AUDIO_I2S_GPIO_BCLK, AUDIO_I2S_GPIO_WS, AUDIO_I2S_GPIO_DOUT, AUDIO_I2S_GPIO_DIN); |
| 181 | +#endif |
| 182 | + return &audio_codec; |
| 183 | + } |
| 184 | + |
| 185 | + virtual Display* GetDisplay() override { |
| 186 | + return display_; |
| 187 | + } |
| 188 | + |
| 189 | + virtual Backlight* GetBacklight() override { |
| 190 | + if (DISPLAY_BACKLIGHT_PIN != GPIO_NUM_NC) { |
| 191 | + static PwmBacklight backlight(DISPLAY_BACKLIGHT_PIN, DISPLAY_BACKLIGHT_OUTPUT_INVERT); |
| 192 | + return &backlight; |
| 193 | + } |
| 194 | + return nullptr; |
| 195 | + } |
| 196 | +}; |
| 197 | + |
| 198 | +DECLARE_BOARD(CompactWifiBoardLCD); |
0 commit comments