Skip to content

Commit 15c264b

Browse files
Merge branch 'fix/modify_variable_name' into 'master'
fix: modify variable name for sm16825e See merge request ae_group/esp-iot-solution!1366
2 parents efdbf4c + 94da688 commit 15c264b

File tree

8 files changed

+28
-22
lines changed

8 files changed

+28
-22
lines changed

components/led/lightbulb_driver/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# ChangeLog
22

3+
## v1.10.1 - 2025-09-03
4+
5+
### Bug Fix:
6+
7+
* Modify the variable names associated with sm16825e to ensure consistency.
8+
39
## v1.10.0 - 2025-08-19
410

511
### Improve:

components/led/lightbulb_driver/drivers/sm16825e/sm16825e.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ static esp_err_t set_config_data(uint8_t *buf, uint32_t start_bit_index)
222222
* @param red Red channel value (0-255)
223223
* @param green Green channel value (0-255)
224224
* @param blue Blue channel value (0-255)
225-
* @param white White channel value (0-255)
226-
* @param yellow Yellow channel value (0-255)
225+
* @param cold_white White channel value (0-255)
226+
* @param warm_yellow Yellow channel value (0-255)
227227
* @param out_buf Output buffer
228228
*
229229
* @note Data frame: 80 bits (5×16 bits gray) + 32 bits (config) = 112 bits total
@@ -232,15 +232,15 @@ static esp_err_t set_config_data(uint8_t *buf, uint32_t start_bit_index)
232232
* Frame duration: 112 × 1200ns = 134.4μs per chip
233233
*/
234234
static esp_err_t generate_data(uint32_t index, uint16_t red, uint16_t green, uint16_t blue,
235-
uint16_t white, uint16_t yellow, uint8_t *out_buf)
235+
uint16_t cold_white, uint16_t warm_yellow, uint8_t *out_buf)
236236
{
237237
uint8_t *chip_buf = out_buf + (index * SM16825E_LED_BUF);
238238
memset(chip_buf, 0, SM16825E_LED_BUF);
239239

240240
uint32_t bit_index = 0;
241241

242242
// Create array of channel values in logical order (R,G,B,W,Y)
243-
uint16_t channel_values[5] = {red, green, blue, white, yellow};
243+
uint16_t channel_values[5] = {red, green, blue, cold_white, warm_yellow};
244244

245245
// Set gray data for each channel (16 bits each, MSB first)
246246
// get mapping address from mapping_addr array, and set gray data to the corresponding physical pin

components/led/lightbulb_driver/drivers/sm16825e/sm16825e.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ typedef enum {
1919
SM16825E_CHANNEL_R = 0, /**< Red channel */
2020
SM16825E_CHANNEL_G, /**< Green channel */
2121
SM16825E_CHANNEL_B, /**< Blue channel */
22-
SM16825E_CHANNEL_W, /**< White channel */
23-
SM16825E_CHANNEL_Y, /**< Yellow channel */
22+
SM16825E_CHANNEL_W, /**< Cold white channel */
23+
SM16825E_CHANNEL_Y, /**< Warm yellow channel */
2424
SM16825E_CHANNEL_MAX,
2525
} sm16825e_channel_t;
2626

@@ -32,13 +32,13 @@ typedef enum {
3232
SM16825E_PIN_OUTR = 0, /**< OUTR pin (Standard pins for red output) */
3333
SM16825E_PIN_OUTG, /**< OUTG pin (Standard pins for green output) */
3434
SM16825E_PIN_OUTB, /**< OUTB pin (Standard pins for blue output) */
35-
SM16825E_PIN_OUTW, /**< OUTW pin (Standard pins for white output) */
36-
SM16825E_PIN_OUTY, /**< OUTY pin (Standard pins for yellow output) */
35+
SM16825E_PIN_OUTW, /**< OUTW pin (Standard pins for cold white output) */
36+
SM16825E_PIN_OUTY, /**< OUTY pin (Standard pins for warm yellow output) */
3737
SM16825E_PIN_OUT1 = 0, /**< OUTR pin (Standard pins for red output) */
3838
SM16825E_PIN_OUT2, /**< OUTG pin (Standard pins for green output) */
3939
SM16825E_PIN_OUT3, /**< OUTB pin (Standard pins for blue output) */
40-
SM16825E_PIN_OUT4, /**< OUTW pin (Standard pins for white output) */
41-
SM16825E_PIN_OUT5, /**< OUTY pin (Standard pins for yellow output) */
40+
SM16825E_PIN_OUT4, /**< OUTW pin (Standard pins for cold white output) */
41+
SM16825E_PIN_OUT5, /**< OUTY pin (Standard pins for warm yellow output) */
4242
SM16825E_PIN_OUT_MAX,
4343
} sm16825e_out_pin_t;
4444

@@ -83,8 +83,8 @@ esp_err_t sm16825e_regist_channel(sm16825e_channel_t channel, sm16825e_out_pin_t
8383
* @param value_r Output red value (0-255)
8484
* @param value_g Output green value (0-255)
8585
* @param value_b Output blue value (0-255)
86-
* @param value_w Output white value (0-255)
87-
* @param value_y Output yellow value (0-255)
86+
* @param value_w Output cold white value (0-255)
87+
* @param value_y Output warm yellow value (0-255)
8888
* @return esp_err_t
8989
*/
9090
esp_err_t sm16825e_set_rgbwy_channel(uint16_t value_r, uint16_t value_g, uint16_t value_b,

components/led/lightbulb_driver/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.10.0"
1+
version: "1.10.1"
22
description: Provide multiple dimming driver solutions to easily build lightbulb applications
33
url: https://github.com/espressif/esp-iot-solution/tree/master/components/led/lightbulb_driver
44
dependencies:

components/led/lightbulb_driver/include/lightbulb.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ typedef struct {
395395
lightbulb_chip_out_pin_t red; /**< GPIO Pin for the red LED for SM16825E driver */
396396
lightbulb_chip_out_pin_t green; /**< GPIO Pin for the green LED for SM16825E driver */
397397
lightbulb_chip_out_pin_t blue; /**< GPIO Pin for the blue LED for SM16825E driver */
398-
lightbulb_chip_out_pin_t white; /**< GPIO Pin for the white LED for SM16825E driver */
399-
lightbulb_chip_out_pin_t yellow; /**< GPIO Pin for the yellow LED for SM16825E driver */
398+
lightbulb_chip_out_pin_t cold_white; /**< GPIO Pin for the white LED for SM16825E driver */
399+
lightbulb_chip_out_pin_t warm_yellow; /**< GPIO Pin for the yellow LED for SM16825E driver */
400400
} sm16825e_io; /**< Configuration for SM16825E driver I/O pins. */
401401
} io_conf; /**< Union for I/O configuration based on the selected driver type. */
402402

components/led/lightbulb_driver/src/lightbulb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ esp_err_t lightbulb_init(lightbulb_config_t *config)
800800
} else if (config->type == DRIVER_WS2812) {
801801
// Nothing
802802
} else if (config->type == DRIVER_SM16825E) {
803-
sprintf(driver_io, "IO List:[%d %d %d %d %d]", config->io_conf.sm16825e_io.red, config->io_conf.sm16825e_io.green, config->io_conf.sm16825e_io.blue, config->io_conf.sm16825e_io.white, config->io_conf.sm16825e_io.yellow);
803+
sprintf(driver_io, "IO List:[%d %d %d %d %d]", config->io_conf.sm16825e_io.red, config->io_conf.sm16825e_io.green, config->io_conf.sm16825e_io.blue, config->io_conf.sm16825e_io.cold_white, config->io_conf.sm16825e_io.warm_yellow);
804804
} else {
805805
ESP_LOGW(TAG, "The driver has not been updated to the component");
806806
abort();
@@ -847,7 +847,7 @@ esp_err_t lightbulb_init(lightbulb_config_t *config)
847847
if (config->type == DRIVER_ESP_PWM) {
848848
hal_regist_channel(CHANNEL_ID_COLD_CCT_WHITE, config->io_conf.pwm_io.cold_cct);
849849
} else if (config->type == DRIVER_SM16825E) {
850-
hal_regist_channel(CHANNEL_ID_COLD_CCT_WHITE, config->io_conf.sm16825e_io.white);
850+
hal_regist_channel(CHANNEL_ID_COLD_CCT_WHITE, config->io_conf.sm16825e_io.cold_white);
851851
} else {
852852
hal_regist_channel(CHANNEL_ID_COLD_CCT_WHITE, config->io_conf.iic_io.cold_white);
853853
}
@@ -857,7 +857,7 @@ esp_err_t lightbulb_init(lightbulb_config_t *config)
857857
if (config->type == DRIVER_ESP_PWM) {
858858
hal_regist_channel(CHANNEL_ID_WARM_BRIGHTNESS_YELLOW, config->io_conf.pwm_io.warm_brightness);
859859
} else if (config->type == DRIVER_SM16825E) {
860-
hal_regist_channel(CHANNEL_ID_WARM_BRIGHTNESS_YELLOW, config->io_conf.sm16825e_io.yellow);
860+
hal_regist_channel(CHANNEL_ID_WARM_BRIGHTNESS_YELLOW, config->io_conf.sm16825e_io.warm_yellow);
861861
} else {
862862
hal_regist_channel(CHANNEL_ID_WARM_BRIGHTNESS_YELLOW, config->io_conf.iic_io.warm_yellow);
863863
}

components/led/lightbulb_driver/test_apps/main/lightbulb_driver_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,8 +1554,8 @@ TEST_CASE("SM16825E", "[Application Layer]")
15541554
.io_conf.sm16825e_io.red = OUT4,
15551555
.io_conf.sm16825e_io.green = OUT1,
15561556
.io_conf.sm16825e_io.blue = OUT5,
1557-
.io_conf.sm16825e_io.white = OUT3,
1558-
.io_conf.sm16825e_io.yellow = OUT2,
1557+
.io_conf.sm16825e_io.cold_white = OUT3,
1558+
.io_conf.sm16825e_io.warm_yellow = OUT2,
15591559
.external_limit = NULL,
15601560
.gamma_conf = NULL,
15611561
.init_status.mode = WORK_COLOR,

examples/lighting/lightbulb/main/lightbulb_example_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ void app_main(void)
100100
.io_conf.sm16825e_io.red = OUT4,
101101
.io_conf.sm16825e_io.green = OUT1,
102102
.io_conf.sm16825e_io.blue = OUT5,
103-
.io_conf.sm16825e_io.white = OUT3,
104-
.io_conf.sm16825e_io.yellow = OUT2,
103+
.io_conf.sm16825e_io.cold_white = OUT3,
104+
.io_conf.sm16825e_io.warm_yellow = OUT2,
105105
.driver_conf.sm16825e.current = {150, 150, 150, 150, 150},
106106
#endif
107107
#ifdef CONFIG_LIGHTBULB_DEMO_DRIVER_SELECT_PWM

0 commit comments

Comments
 (0)