diff --git a/src/httpserver/new_http.c b/src/httpserver/new_http.c index f7eb9fa28..3f17ae95b 100644 --- a/src/httpserver/new_http.c +++ b/src/httpserver/new_http.c @@ -248,7 +248,8 @@ template_t g_templates [] = { { Setup_Device_TuyaWL_SW01_16A, "WL SW01 16A"}, { Setup_Device_TuyaSmartLife4CH10A, "Smart Life 4CH 10A"}, { Setup_Device_IntelligentLife_NF101A, "Intelligent Life NF101A"}, - { Setup_Device_TuyaLEDDimmerSingleChannel, "Tuya LED Dimmer Single Channel PWM WB3S"} + { Setup_Device_TuyaLEDDimmerSingleChannel, "Tuya LED Dimmer Single Channel PWM WB3S"}, + { Setup_Device_CalexLEDDimmerFiveChannel, "Calex RGBWW LED Dimmer Five Channel PWM BK7231S"} }; int g_total_templates = sizeof(g_templates)/sizeof(g_templates[0]); diff --git a/src/new_builtin_devices.c b/src/new_builtin_devices.c index 4fd0469da..72e3828f4 100644 --- a/src/new_builtin_devices.c +++ b/src/new_builtin_devices.c @@ -80,3 +80,35 @@ void Setup_Device_TuyaLEDDimmerSingleChannel() { PIN_SaveToFlash(); } + +void Setup_Device_CalexLEDDimmerFiveChannel() { + + // pins are: + // red - PWM2 = P7 + // green - PWM3 = P8 + // blue - PWM1 = P6 + // warm white - PWM5 = P26 + // cold white - PWM4 = P24 + + PIN_ClearPins(); + + // red + PIN_SetPinChannelForPinIndex(7, 1); + PIN_SetPinRoleForPinIndex(7, IOR_PWM); + // green + PIN_SetPinChannelForPinIndex(8, 2); + PIN_SetPinRoleForPinIndex(8, IOR_PWM); + // blue + PIN_SetPinChannelForPinIndex(6, 3); + PIN_SetPinRoleForPinIndex(6, IOR_PWM); + // cold white + PIN_SetPinChannelForPinIndex(24, 4); + PIN_SetPinRoleForPinIndex(24, IOR_PWM); + // warm white + PIN_SetPinChannelForPinIndex(26, 5); + PIN_SetPinRoleForPinIndex(26, IOR_PWM); + + PIN_SaveToFlash(); +} + + diff --git a/src/new_pins.h b/src/new_pins.h index 6d1509797..693ae5370 100644 --- a/src/new_pins.h +++ b/src/new_pins.h @@ -40,6 +40,7 @@ void Setup_Device_TuyaWL_SW01_16A(); void Setup_Device_TuyaSmartLife4CH10A(); void Setup_Device_IntelligentLife_NF101A(); void Setup_Device_TuyaLEDDimmerSingleChannel(); +void Setup_Device_CalexLEDDimmerFiveChannel(); #endif