Browse Source

Add Huacanxing H802 support

fastled
Martijn Bakker 7 years ago
parent
commit
3e84c83238
4 changed files with 63 additions and 0 deletions
  1. +1
    -0
      code/espurna/config/arduino.h
  2. +24
    -0
      code/espurna/config/hardware.h
  3. +15
    -0
      code/espurna/hardware.ino
  4. +23
    -0
      code/platformio.ini

+ 1
- 0
code/espurna/config/arduino.h View File

@ -39,6 +39,7 @@
//#define JANGOE_WIFI_RELAY_NO
//#define JORGEGARCIA_WIFI_RELAYS
//#define OPENENERGYMONITOR_MQTT_RELAY
//#define HUACANXING_H802
//--------------------------------------------------------------------------------
// Features (values below are non-default values)


+ 24
- 0
code/espurna/config/hardware.h View File

@ -809,6 +809,30 @@
#define RELAY1_TYPE RELAY_TYPE_LATCHED
#define RELAY1_RESET_PIN 12
// -----------------------------------------------------------------------------
// HUACANXING H802
// -----------------------------------------------------------------------------
#elif defined(HUACANXING_H802)
// Info
#define MANUFACTURER "HUACANXING"
#define DEVICE "H802"
#define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
#define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
#define DUMMY_RELAY_COUNT 1
// Channels
#define LIGHT_CH1_PIN 12 // RED
#define LIGHT_CH2_PIN 14 // GREEN
#define LIGHT_CH3_PIN 13 // BLUE
#define LIGHT_CH4_PIN 15 // WHITE
#define LIGHT_CH1_INVERSE 0
#define LIGHT_CH2_INVERSE 0
#define LIGHT_CH3_INVERSE 0
#define LIGHT_CH4_INVERSE 0
// -----------------------------------------------------------------------------
// Unknown hardware
// -----------------------------------------------------------------------------


+ 15
- 0
code/espurna/hardware.ino View File

@ -419,6 +419,21 @@ void hwUpwardsCompatibility() {
setSetting("relayResetGPIO", 1, 12);
setSetting("relayType", 1, RELAY_TYPE_NORMAL);
#elif defined(HUACANXING_H802)
setSetting("board", 36);
setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
setSetting("chGPIO", 1, 12);
setSetting("chGPIO", 2, 14);
setSetting("chGPIO", 3, 13);
setSetting("chGPIO", 4, 15);
setSetting("chLogic", 1, 0);
setSetting("chLogic", 2, 0);
setSetting("chLogic", 3, 0);
setSetting("chLogic", 4, 0);
setSetting("relays", 1);
#else
#error "UNSUPPORTED HARDWARE!"


+ 23
- 0
code/platformio.ini View File

@ -831,3 +831,26 @@ build_flags = ${common.build_flags} -D${env.BOARD}
upload_speed = 115200
upload_port = "${env.IP}"
upload_flags = --auth=${env.AUTH} --port 8266
[env:huacanxing-h802]
platform = espressif8266
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 -DHUACANXING_H802 -DDEBUG_PORT=Serial1
monitor_baud = 115200
[env:huacanxing-h802-ota]
platform = espressif8266
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 -DHUACANXING_H802 -DDEBUG_PORT=Serial1
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
monitor_baud = 115200

Loading…
Cancel
Save