From d7046cce02cacbbda20fdc2f18dcebc120e312a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Sun, 9 Dec 2018 21:11:40 +0100 Subject: [PATCH] Add support for MagicHome ZJ WFMN A/B v1.1 (#1339) --- code/espurna/config/arduino.h | 2 ++ code/espurna/config/hardware.h | 61 ++++++++++++++++++++++++++++++++++ code/platformio.ini | 48 ++++++++++++++++++++++++++ 3 files changed, 111 insertions(+) diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h index 9d5a57bb..fd97e4fc 100644 --- a/code/espurna/config/arduino.h +++ b/code/espurna/config/arduino.h @@ -105,6 +105,8 @@ //#define TECKIN_SP22_V14 //#define LOMBEX_LUX_NOVA2_TUNABLE_WHITE //#define LOMBEX_LUX_NOVA2_WHITE_COLOR +//#define MAGICHOME_ZJ_WFMN_A_11 +//#define MAGICHOME_ZJ_WFMN_B_11 //-------------------------------------------------------------------------------- // Features (values below are non-default values) diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 7e19d7a5..107b32c0 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -1213,6 +1213,67 @@ #define IR_RX_PIN 4 #define IR_BUTTON_SET 1 +#elif defined(MAGICHOME_ZJ_WFMN_A_11) + + // Info + #define MANUFACTURER "MAGICHOME" + #define DEVICE "ZJ_WFMN_A_11" + #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT + #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER + #define DUMMY_RELAY_COUNT 1 + + // LEDs + #define LED1_PIN 2 + #define LED1_PIN_INVERSE 1 + #define LED2_PIN 15 + #define LED2_PIN_INVERSE 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 14 // WHITE + #define LIGHT_CH1_INVERSE 0 + #define LIGHT_CH2_INVERSE 0 + #define LIGHT_CH3_INVERSE 0 + #define LIGHT_CH4_INVERSE 0 + + // IR + #define IR_SUPPORT 1 + #define IR_RX_PIN 4 + #define IR_BUTTON_SET 1 + +#elif defined(MAGICHOME_ZJ_WFMN_B_11) + + // Info + #define MANUFACTURER "MAGICHOME" + #define DEVICE "ZJ_WFMN_B_11" + #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT + #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER + #define DUMMY_RELAY_COUNT 1 + + // LEDs + #define LED1_PIN 2 + #define LED1_PIN_INVERSE 1 + #define LED2_PIN 15 + #define LED2_PIN_INVERSE 1 + + // Light + #define LIGHT_CHANNELS 4 + #define LIGHT_CH1_PIN 14 // RED + #define LIGHT_CH2_PIN 5 // GREEN + #define LIGHT_CH3_PIN 12 // BLUE + #define LIGHT_CH4_PIN 13 // WHITE + #define LIGHT_CH1_INVERSE 0 + #define LIGHT_CH2_INVERSE 0 + #define LIGHT_CH3_INVERSE 0 + #define LIGHT_CH4_INVERSE 0 + + // RF + #define RF_SUPPORT 1 + #define RF_PIN 4 + // ----------------------------------------------------------------------------- // HUACANXING H801 & H802 // ----------------------------------------------------------------------------- diff --git a/code/platformio.ini b/code/platformio.ini index 3c4501c6..4ae16a08 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -1254,6 +1254,54 @@ upload_flags = ${common.upload_flags} monitor_speed = ${common.monitor_speed} extra_scripts = ${common.extra_scripts} +[env:magichome-zj-wfmn-a-11] +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board_1m} +board_build.flash_mode = ${common.flash_mode} +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = ${common.build_flags_1m0m} -DMAGICHOME_ZJ_WFMN_A_11 +monitor_speed = ${common.monitor_speed} +extra_scripts = ${common.extra_scripts} + +[env:magichome-zj-wfmn-a-11-ota] +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board_1m} +board_build.flash_mode = ${common.flash_mode} +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = ${common.build_flags_1m0m} -DMAGICHOME_ZJ_WFMN_A_11 +monitor_speed = ${common.monitor_speed} +upload_port = ${common.upload_port} +upload_flags = ${common.upload_flags} +extra_scripts = ${common.extra_scripts} + +[env:magichome-zj-wfmn-b-11] +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board_1m} +board_build.flash_mode = ${common.flash_mode} +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = ${common.build_flags_1m0m} -DMAGICHOME_ZJ_WFMN_B_11 +monitor_speed = ${common.monitor_speed} +extra_scripts = ${common.extra_scripts} + +[env:magichome-zj-wfmn-b-11-ota] +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board_1m} +board_build.flash_mode = ${common.flash_mode} +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = ${common.build_flags_1m0m} -DMAGICHOME_ZJ_WFMN_B_11 +monitor_speed = ${common.monitor_speed} +upload_port = ${common.upload_port} +upload_flags = ${common.upload_flags} +extra_scripts = ${common.extra_scripts} + [env:huacanxing-h801] platform = ${common.platform} framework = ${common.framework}