From 7f70d6f5e0268c5bfda66cb9440825fe3895867e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Sat, 6 Jan 2018 21:01:10 +0100 Subject: [PATCH] Support for Arilux AL-LC02 (Thanks you user Crispin) --- code/espurna/config/arduino.h | 1 + code/espurna/config/hardware.h | 20 ++++++++++++++++++++ code/espurna/migrate.ino | 15 +++++++++++++++ code/platformio.ini | 25 +++++++++++++++++++++++++ 4 files changed, 61 insertions(+) diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h index 2a2b9ac5..2ddfdadc 100644 --- a/code/espurna/config/arduino.h +++ b/code/espurna/config/arduino.h @@ -57,6 +57,7 @@ //#define GENERIC_8CH //#define ARILUX_AL_LC01 //#define ARILUX_AL_LC11 +//#define ARILUX_AL_LC02 //-------------------------------------------------------------------------------- // Features (values below are non-default values) diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 8535e185..7137a936 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -1182,6 +1182,26 @@ #define LIGHT_CH4_INVERSE 0 +#elif defined(ARILUX_AL_LC02) + + // Info + #define MANUFACTURER "ARILUX" + #define DEVICE "AL_LC02" + #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT + #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER + #define DUMMY_RELAY_COUNT 1 + + // Light + #define LIGHT_CHANNELS 4 + #define LIGHT_CH1_PIN 12 // RED + #define LIGHT_CH2_PIN 5 // GREEN + #define LIGHT_CH3_PIN 13 // BLUE + #define LIGHT_CH4_PIN 15 // WHITE1 + #define LIGHT_CH1_INVERSE 0 + #define LIGHT_CH2_INVERSE 0 + #define LIGHT_CH3_INVERSE 0 + #define LIGHT_CH4_INVERSE 0 + #elif defined(ARILUX_AL_LC06) // Info diff --git a/code/espurna/migrate.ino b/code/espurna/migrate.ino index fe6a0c7e..d06ad0d5 100644 --- a/code/espurna/migrate.ino +++ b/code/espurna/migrate.ino @@ -683,6 +683,21 @@ void migrate() { setSetting("chLogic", 4, 0); setSetting("relays", 1); + #elif defined(ARILUX_AL_LC02) + + setSetting("board", 52); + setSetting("relayProvider", RELAY_PROVIDER_LIGHT); + setSetting("lightProvider", LIGHT_PROVIDER_DIMMER); + setSetting("chGPIO", 0, 12); + setSetting("chGPIO", 1, 5); + setSetting("chGPIO", 2, 13); + setSetting("chGPIO", 3, 15); + setSetting("chLogic", 0, 0); + setSetting("chLogic", 1, 0); + setSetting("chLogic", 2, 0); + setSetting("chLogic", 3, 0); + setSetting("relays", 1); + #else // Allow users to define new settings without migration config diff --git a/code/platformio.ini b/code/platformio.ini index 430f2f25..04958577 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -933,6 +933,31 @@ upload_flags = --auth=fibonacci --port 8266 monitor_baud = 115200 extra_scripts = ${common.extra_scripts} +[env:arilux-al-lc02] +platform = ${common.platform} +framework = arduino +board = esp01_1m +board_flash_mode = dout +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = -g -Wl,-Tesp8266.flash.1m0.ld -DARILUX_AL_LC02 +monitor_baud = 115200 +extra_scripts = ${common.extra_scripts} + +[env:arilux-al-lc02-ota] +platform = ${common.platform} +framework = arduino +board = esp01_1m +board_flash_mode = dout +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = -g -Wl,-Tesp8266.flash.1m0.ld -DARILUX_AL_LC02 +upload_speed = 115200 +upload_port = "192.168.4.1" +upload_flags = --auth=fibonacci --port 8266 +monitor_baud = 115200 +extra_scripts = ${common.extra_scripts} + [env:arilux-al-lc06] platform = ${common.platform} framework = arduino