Skip to content

Commit d4bfd88

Browse files
committed
feat(drivers): update
1 parent 692ef53 commit d4bfd88

File tree

6 files changed

+146
-113
lines changed

6 files changed

+146
-113
lines changed

src/board/esp_panel_board.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ Board::Board():
2222
Board(BOARD_DEFAULT_CONFIG)
2323
{
2424
_flags.use_default_config = 1;
25-
#if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_CUSTOM
26-
using BacklightConfig = drivers::BacklightCustom::Config;
27-
BacklightConfig &config = std::get<BacklightConfig>(_config.backlight.config);
28-
config.user_data = this;
29-
#endif // ESP_PANEL_BOARD_BACKLIGHT_TYPE
3025
}
3126
#else
3227
Board::Board()
@@ -46,7 +41,7 @@ bool Board::init(void)
4641
ESP_UTILS_LOGI("Initialize LCD");
4742
std::shared_ptr<drivers::Bus> lcd_bus = nullptr;
4843
ESP_UTILS_CHECK_EXCEPTION_RETURN(
49-
(lcd_bus = drivers::BusFactory::create(_config.lcd.bus_type, &_config.lcd.bus_config)),
44+
(lcd_bus = drivers::BusFactory::create(_config.lcd.bus_type, _config.lcd.bus_config)),
5045
false, "Create LCD bus failed"
5146
);
5247
ESP_UTILS_CHECK_FALSE_RETURN(lcd_bus->init(), false, "LCD bus init failed");
@@ -70,9 +65,8 @@ bool Board::init(void)
7065
ESP_UTILS_LOGI("Initialize touch");
7166
std::shared_ptr<drivers::Bus> touch_bus = nullptr;
7267
ESP_UTILS_CHECK_EXCEPTION_RETURN(
73-
(touch_bus = drivers::BusFactory::create(
74-
_config.touch.bus_type, &_config.touch.bus_config
75-
)), false, "Create touch bus failed"
68+
(touch_bus = drivers::BusFactory::create(_config.touch.bus_type, _config.touch.bus_config)),
69+
false, "Create touch bus failed"
7670
);
7771
ESP_UTILS_CHECK_FALSE_RETURN(touch_bus->init(), false, "Touch bus init failed");
7872
// #if ESP_PANEL_BOARD_USE_DEFAULT && defined(ESP_PANEL_BOARD_TOUCH_CONTROLLER)
@@ -96,6 +90,15 @@ bool Board::init(void)
9690
std::shared_ptr<drivers::Backlight> backlight = nullptr;
9791
if (_config.flags.use_backlight) {
9892
ESP_UTILS_LOGI("Initialize Backlight");
93+
#if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_CUSTOM
94+
using BacklightConfig = drivers::BacklightCustom::Config;
95+
ESP_UTILS_CHECK_FALSE_RETURN(
96+
std::holds_alternative<BacklightConfig>(_config.backlight.config), false,
97+
"Backlight config is not a custom backlight config"
98+
);
99+
auto &config = std::get<BacklightConfig>(_config.backlight.config);
100+
config.user_data = this;
101+
#endif // ESP_PANEL_BOARD_BACKLIGHT_TYPE
99102
ESP_UTILS_CHECK_EXCEPTION_RETURN(
100103
(backlight = drivers::BacklightFactory::create(
101104
_config.backlight.type, &_config.backlight.config

src/board/esp_panel_board_config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace esp_panel {
2121

2222
#ifdef ESP_PANEL_BOARD_LCD_VENDOR_INIT_CMD
2323
static const esp_panel_lcd_vendor_init_cmd_t lcd_vendor_init_cmds[] = ESP_PANEL_BOARD_LCD_VENDOR_INIT_CMD();
24-
#endif
24+
#endif // ESP_PANEL_BOARD_LCD_VENDOR_INIT_CMD
2525

2626
const BoardConfig BOARD_DEFAULT_CONFIG = {
2727

src/board/esp_panel_board_config.hpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,7 @@ struct BoardConfig {
2727
/* LCD */
2828
struct {
2929
int bus_type;
30-
std::variant<
31-
drivers::BusSPI::Config,
32-
drivers::BusQSPI::Config
33-
#if SOC_LCD_RGB_SUPPORTED
34-
,drivers::BusRGB::Config
35-
#endif // SOC_LCD_RGB_SUPPORTED
36-
#if SOC_MIPI_DSI_SUPPORTED
37-
,drivers::BusDSI::Config
38-
#endif // SOC_MIPI_DSI_SUPPORTED
39-
> bus_config;
30+
drivers::BusFactory::Config bus_config;
4031
std::string device_name;
4132
drivers::LCD::Config device_config;
4233
struct {
@@ -50,10 +41,7 @@ struct BoardConfig {
5041
/* Touch */
5142
struct {
5243
int bus_type;
53-
std::variant<
54-
drivers::BusI2C::Config,
55-
drivers::BusSPI::Config
56-
> bus_config;
44+
drivers::BusFactory::Config bus_config;
5745
std::string device_name;
5846
drivers::Touch::Config device_config;
5947
struct {

src/board/espressif/ESP32_C3_LCDKIT.h

Lines changed: 112 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -9,59 +9,69 @@
99
// *INDENT-OFF*
1010

1111
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
12-
//////////////////////////// Please update the following macros to configure the LCD panel /////////////////////////////
12+
//////////////////////////// Please update the following macros to configure general panel /////////////////////////////
1313
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
14-
/* Set to 1 when using an LCD panel */
15-
#define ESP_PANEL_BOARD_DEFAULT_USE_LCD (1) // 0/1
14+
/* Panel resolution in pixels */
15+
#define ESP_PANEL_BOARD_WIDTH (240)
16+
#define ESP_PANEL_BOARD_HEIGHT (240)
1617

18+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
19+
//////////////////////////// Please update the following macros to configure the LCD panel /////////////////////////////
20+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
21+
/* Set to 1 when using a LCD panel */
22+
#define ESP_PANEL_BOARD_DEFAULT_USE_LCD (1) // 0/1
1723
#if ESP_PANEL_BOARD_DEFAULT_USE_LCD
1824
/**
19-
* LCD Controller Name.
25+
* LCD controller name.
2026
*/
21-
#define ESP_PANEL_BOARD_LCD_CONTROLLER GC9A01
22-
23-
/* LCD resolution in pixels */
24-
#define ESP_PANEL_BOARD_WIDTH (240)
25-
#define ESP_PANEL_BOARD_HEIGHT (240)
27+
#define ESP_PANEL_BOARD_LCD_CONTROLLER GC9A01
2628

27-
/* LCD Bus Settings */
28-
/**
29-
* If set to 1, the bus will skip to initialize the corresponding host. Users need to initialize the host in advance.
30-
* It is useful if other devices use the same host. Please ensure that the host is initialized only once.
31-
*/
32-
#define ESP_PANEL_BOARD_LCD_BUS_SKIP_INIT_HOST (0) // 0/1
3329
/**
34-
* LCD Bus Type.
30+
* LCD bus type.
3531
*/
36-
#define ESP_PANEL_BOARD_LCD_BUS_TYPE (ESP_PANEL_BUS_TYPE_SPI)
32+
#define ESP_PANEL_BOARD_LCD_BUS_TYPE (ESP_PANEL_BUS_TYPE_SPI)
33+
3734
/**
38-
* LCD Bus Parameters.
35+
* LCD bus parameters.
3936
*
40-
* Please refer to https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/peripherals/lcd.html and
37+
* There are different parameters for different bus types. Please only configure the parameters for the selected bus type.
38+
* For the parameters of other bus types, they will be ignored. To understand the parameters, please check
39+
* https://docs.espressif.com/projects/esp-idf/en/v5.3.1/esp32s3/api-reference/peripherals/lcd/index.html and
4140
* https://docs.espressif.com/projects/esp-iot-solution/en/latest/display/lcd/index.html for more details.
4241
*
4342
*/
4443
#if ESP_PANEL_BOARD_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_SPI
4544

46-
#define ESP_PANEL_BOARD_LCD_BUS_HOST_ID (1) // Typically set to 1
47-
#define ESP_PANEL_BOARD_LCD_SPI_IO_CS (7)
45+
/**
46+
* If set to 1, the bus will skip to initialize the corresponding host. Users need to initialize the host in advance.
47+
*
48+
* For drivers which created by this library, even if they use the same host, the host will be initialized only once.
49+
* So it is not necessary to set the macro to `1`. For other devices, please set the macro to `1` ensure that the
50+
* host is initialized only once.
51+
*
52+
*/
53+
#define ESP_PANEL_BOARD_LCD_BUS_SKIP_INIT_HOST (0) // 0/1. Typically set to 0
54+
/* For general */
55+
#define ESP_PANEL_BOARD_LCD_BUS_HOST_ID (1) // Typically set to 1
4856
#if !ESP_PANEL_BOARD_LCD_BUS_SKIP_INIT_HOST
49-
#define ESP_PANEL_BOARD_LCD_SPI_IO_SCK (1)
50-
#define ESP_PANEL_BOARD_LCD_SPI_IO_MOSI (0)
51-
#define ESP_PANEL_BOARD_LCD_SPI_IO_MISO (-1) // -1 if not used
52-
#endif
53-
#define ESP_PANEL_BOARD_LCD_SPI_IO_DC (2)
54-
#define ESP_PANEL_BOARD_LCD_SPI_MODE (0) // 0/1/2/3, typically set to 0
55-
#define ESP_PANEL_BOARD_LCD_SPI_CLK_HZ (40 * 1000 * 1000)
56-
// Should be an integer divisor of 80M, typically set to 40M
57-
#define ESP_PANEL_BOARD_LCD_SPI_TRANS_QUEUE_SZ (10) // Typically set to 10
58-
#define ESP_PANEL_BOARD_LCD_SPI_CMD_BITS (8) // Typically set to 8
59-
#define ESP_PANEL_BOARD_LCD_SPI_PARAM_BITS (8) // Typically set to 8
57+
/* For host */
58+
#define ESP_PANEL_BOARD_LCD_SPI_IO_SCK (1)
59+
#define ESP_PANEL_BOARD_LCD_SPI_IO_MOSI (0)
60+
#define ESP_PANEL_BOARD_LCD_SPI_IO_MISO (-1) // -1 if not used
61+
#endif // ESP_PANEL_BOARD_LCD_BUS_SKIP_INIT_HOST
62+
/* For panel */
63+
#define ESP_PANEL_BOARD_LCD_SPI_IO_CS (7) // -1 if not used
64+
#define ESP_PANEL_BOARD_LCD_SPI_IO_DC (2)
65+
#define ESP_PANEL_BOARD_LCD_SPI_MODE (0) // 0/1/2/3. Typically set to 0
66+
#define ESP_PANEL_BOARD_LCD_SPI_CLK_HZ (40 * 1000 * 1000)
67+
// Should be an integer divisor of 80M, typically set to 40M
68+
#define ESP_PANEL_BOARD_LCD_SPI_CMD_BITS (8) // Typically set to 8
69+
#define ESP_PANEL_BOARD_LCD_SPI_PARAM_BITS (8) // Typically set to 8
6070

6171
#endif /* ESP_PANEL_BOARD_LCD_BUS_TYPE */
6272

6373
/**
64-
* LCD Vendor Initialization Commands.
74+
* LCD vendor initialization commands.
6575
*
6676
* Vendor specific initialization can be different between manufacturers, should consult the LCD supplier for
6777
* initialization sequence code. Please uncomment and change the following macro definitions. Otherwise, the LCD driver
@@ -70,86 +80,104 @@
7080
* There are two formats for the sequence code:
7181
* 1. Raw data: {command, (uint8_t []){ data0, data1, ... }, data_size, delay_ms}
7282
* 2. Formatter: ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(delay_ms, command, { data0, data1, ... }) and
73-
* ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(delay_ms, command)
83+
* ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(delay_ms, command)
7484
*/
7585
/*
76-
#define ESP_PANEL_BOARD_LCD_VENDOR_INIT_CMD \
77-
{ \
78-
{0xFF, (uint8_t []){0x77, 0x01, 0x00, 0x00, 0x10}, 5, 0}, \
79-
{0xC0, (uint8_t []){0x3B, 0x00}, 2, 0}, \
80-
{0xC1, (uint8_t []){0x0D, 0x02}, 2, 0}, \
81-
{0x29, (uint8_t []){0x00}, 0, 120}, \
82-
or \
86+
#define ESP_PANEL_BOARD_LCD_VENDOR_INIT_CMD() \
87+
{ \
88+
{0xFF, (uint8_t []){0x77, 0x01, 0x00, 0x00, 0x10}, 5, 0}, \
89+
{0xC0, (uint8_t []){0x3B, 0x00}, 2, 0}, \
90+
{0xC1, (uint8_t []){0x0D, 0x02}, 2, 0}, \
91+
{0x29, (uint8_t []){0x00}, 0, 120}, \
92+
or
8393
ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFF, {0x77, 0x01, 0x00, 0x00, 0x10}), \
8494
ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC0, {0x3B, 0x00}), \
8595
ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC1, {0x0D, 0x02}), \
8696
ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(120, 0x29), \
8797
}
8898
*/
8999

90-
/* LCD Color Settings */
91-
/* LCD color depth in bits */
92-
#define ESP_PANEL_BOARD_LCD_COLOR_BITS (16) // 8/16/18/24
93-
/*
94-
* LCD RGB Element Order. Choose one of the following:
95-
* - 0: RGB
96-
* - 1: BGR
97-
*/
98-
#define ESP_PANEL_BOARD_LCD_COLOR_BGR_ORDER (1) // 0/1
99-
#define ESP_PANEL_BOARD_LCD_INEVRT_COLOR (1) // 0/1
100+
/* LCD device color */
101+
/* Color depth in bits */
102+
#define ESP_PANEL_BOARD_LCD_COLOR_BITS (ESP_PANEL_LCD_COLOR_BITS_RGB565)
103+
// ESP_PANEL_LCD_COLOR_BITS_RGB565/RGB666/RGB888
104+
/* Color RGB element order */
105+
#define ESP_PANEL_BOARD_LCD_COLOR_BGR_ORDER (1) // 0: RGB, 1: BGR
100106

101-
/* LCD Transformation Flags */
102-
#define ESP_PANEL_BOARD_LCD_SWAP_XY (0) // 0/1
103-
#define ESP_PANEL_BOARD_LCD_MIRROR_X (1) // 0/1
104-
#define ESP_PANEL_BOARD_LCD_MIRROR_Y (0) // 0/1
107+
/* LCD pre-process flags */
108+
#define ESP_PANEL_BOARD_LCD_INEVRT_COLOR (1) // 0/1
109+
#define ESP_PANEL_BOARD_LCD_SWAP_XY (0) // 0/1
110+
#define ESP_PANEL_BOARD_LCD_MIRROR_X (1) // 0/1
111+
#define ESP_PANEL_BOARD_LCD_MIRROR_Y (0) // 0/1
105112

106-
/* LCD Other Settings */
107-
/* IO num of RESET pin, set to -1 if not use */
108-
#define ESP_PANEL_BOARD_LCD_RST_IO (-1)
109-
#define ESP_PANEL_BOARD_LCD_RST_LEVEL (0) // 0: low level, 1: high level
113+
/* LCD other settings */
114+
/* Reset pin */
115+
#define ESP_PANEL_BOARD_LCD_RST_IO (-1) // Reset IO pin num. Set to -1 if not use
116+
#define ESP_PANEL_BOARD_LCD_RST_LEVEL (0) // Reset active level. 0: low level, 1: high level
110117

111-
#endif /* ESP_PANEL_BOARD_DEFAULT_USE_LCD */
118+
#endif // ESP_PANEL_BOARD_DEFAULT_USE_LCD
112119

113120
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
114121
//////////////////////////// Please update the following macros to configure the touch panel ///////////////////////////
115122
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
116-
/* Set to 1 when using an touch panel */
117-
#define ESP_PANEL_BOARD_DEFAULT_USE_TOUCH (0) // 0/1
123+
/* Set to 1 when using a touch panel */
124+
#define ESP_PANEL_BOARD_DEFAULT_USE_TOUCH (0) // 0/1
118125

119126
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
120127
///////////////////////////// Please update the following macros to configure the backlight ////////////////////////////
121128
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
122-
#define ESP_PANEL_BOARD_DEFAULT_USE_BACKLIGHT (1) // 0/1
129+
/* Set to 1 when using the backlight */
130+
#define ESP_PANEL_BOARD_DEFAULT_USE_BACKLIGHT (1) // 0/1
123131
#if ESP_PANEL_BOARD_DEFAULT_USE_BACKLIGHT
124-
/* IO num of backlight pin */
125-
#define ESP_PANEL_BOARD_BACKLIGHT_IO (5)
126-
#define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // 0: low level, 1: high level
132+
/**
133+
* Backlight control mode. Choose one of the following:
134+
* - ESP_PANEL_BACKLIGHT_TYPE_SWITCH_GPIO: Use GPIO switch to control the backlight, only support on/off
135+
* - ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC: Use LEDC PWM to control the backlight, support brightness adjustment
136+
* - ESP_PANEL_BACKLIGHT_TYPE_CUSTOM: Use custom function to control the backlight
137+
*
138+
*/
139+
#define ESP_PANEL_BOARD_BACKLIGHT_TYPE (ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC)
140+
141+
#if (ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_SWITCH_GPIO) || \
142+
(ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC)
143+
144+
/* Output pin */
145+
#define ESP_PANEL_BOARD_BACKLIGHT_IO (5) // Output IO pin num
146+
#define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Light up level. 0: low level, 1: high level
127147

128-
/* Set to 1 if you want to turn off the backlight after initializing the panel; otherwise, set it to turn on */
129-
#define ESP_PANEL_BOARD_BACKLIGHT_IDLE_OFF (0) // 0: on, 1: off
148+
#endif // ESP_PANEL_BOARD_BACKLIGHT_TYPE
130149

131-
/* Set to 1 if use PWM for brightness control */
132-
#define ESP_PANEL_LCD_BL_USE_PWM (1) // 0/1
133-
#endif /* ESP_PANEL_BOARD_DEFAULT_USE_BACKLIGHT */
150+
/* Set to 1 if want to turn off the backlight after initializing. Otherwise, the backlight will be on */
151+
#define ESP_PANEL_BOARD_BACKLIGHT_IDLE_OFF (0) // 0/1
152+
153+
#endif // ESP_PANEL_BOARD_DEFAULT_USE_BACKLIGHT
134154

135155
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
136156
///////////////////////////// Please update the following macros to configure the IO expander //////////////////////////
137157
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
138-
/* Set to 0 if not using IO Expander */
139-
#define ESP_PANEL_BOARD_DEFAULT_USE_EXPANDER (0) // 0/1
158+
/* Set to 0 if not using an IO Expander */
159+
#define ESP_PANEL_BOARD_DEFAULT_USE_EXPANDER (0) // 0/1
140160

141161
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
142-
///////////////////////////// Please utilize the following macros to execute any additional code if required. //////////
162+
/////////////////////// Please utilize the following macros to execute any additional code if required /////////////////
163+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
164+
143165
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
144-
// #define ESP_PANEL_BOARD_PRE_BEGIN_FUNCTION( p )
145-
// #define ESP_PANEL_BOARD_EXPANDER_PRE_BEGIN_FUNCTION( p )
146-
// #define ESP_PANEL_BOARD_EXPANDER_POST_BEGIN_FUNCTION( p )
147-
// #define ESP_PANEL_BOARD_LCD_PRE_BEGIN_FUNCTION( p )
148-
// #define ESP_PANEL_BOARD_LCD_POST_BEGIN_FUNCTION( p )
149-
// #define ESP_PANEL_BOARD_TOUCH_PRE_BEGIN_FUNCTION( p )
150-
// #define ESP_PANEL_BOARD_TOUCH_POST_BEGIN_FUNCTION( p )
151-
// #define ESP_PANEL_BOARD_BACKLIGHT_PRE_BEGIN_FUNCTION( p )
152-
// #define ESP_PANEL_BOARD_BACKLIGHT_POST_BEGIN_FUNCTION( p )
153-
// #define ESP_PANEL_BOARD_POST_BEGIN_FUNCTION( p )
166+
/////////////////////////////////////////////// File Version ///////////////////////////////////////////////////////////
167+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
168+
/**
169+
* Do not change the following versions, they are used to check if the configurations in this file are compatible with
170+
* the current version of `esp_panel_board_custom.h` in the library. The detailed rules are as follows:
171+
*
172+
* 1. If the major version is not consistent, then the configurations in this file are incompatible with the library
173+
* and must be replaced with the file from the library.
174+
* 2. If the minor version is not consistent, this file might be missing some new configurations, which will be set to
175+
* default values. It is recommended to replace it with the file from the library.
176+
* 3. Even if the patch version is not consistent, it will not affect normal functionality.
177+
*
178+
*/
179+
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1
180+
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0
181+
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0
154182

155183
// *INDENT-OFF*

src/drivers/bus/esp_panel_bus.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@
1111
namespace esp_panel::drivers {
1212

1313
#define CREATE_FUNCTION(type_name) \
14-
[](const void *config) { \
14+
[](const BusFactory::Config &config) { \
1515
std::shared_ptr<Bus> device = nullptr; \
16+
ESP_UTILS_CHECK_FALSE_RETURN(std::holds_alternative<Bus ##type_name::Config>(config), device, \
17+
"Config is not a " #type_name " config" \
18+
); \
1619
ESP_UTILS_CHECK_EXCEPTION_RETURN( \
1720
(device = esp_utils::make_shared<Bus ##type_name>( \
18-
*static_cast<const Bus ##type_name::Config *>(config)) \
21+
std::get<Bus ##type_name::Config>(config)) \
1922
), nullptr, "Create " #type_name " failed" \
2023
); \
2124
return device; \
@@ -39,7 +42,7 @@ BusFactory::_type_name_function_map = {
3942
#endif // SOC_MIPI_DSI_SUPPORTED
4043
};
4144

42-
std::shared_ptr<Bus> BusFactory::create(int type, const void *config)
45+
std::shared_ptr<Bus> BusFactory::create(int type, const Config &config)
4346
{
4447
ESP_UTILS_LOGD("Param: name(%d), config(@%p)", type, &config);
4548

0 commit comments

Comments
 (0)