Browse Source

Added support Authometion LYT8266 (testing)

fastled
Xose Pérez 6 years ago
parent
commit
8bad4218a0
5 changed files with 75 additions and 0 deletions
  1. +1
    -0
      code/espurna/config/arduino.h
  2. +27
    -0
      code/espurna/config/hardware.h
  3. +16
    -0
      code/espurna/hardware.ino
  4. +8
    -0
      code/espurna/light.ino
  5. +23
    -0
      code/platformio.ini

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

@ -50,6 +50,7 @@
//#define INTERMITTECH_QUINLED
//#define ARILUX_AL_LC06
//#define XENON_SM_PW702U
//#define AUTHOMETION_LYT8266
//--------------------------------------------------------------------------------
// Features (values below are non-default values)


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

@ -1136,6 +1136,33 @@
#define LED1_PIN 4
#define LED1_PIN_INVERSE 1
// -----------------------------------------------------------------------------
// AUTHOMETION LYT8266
// https://authometion.com/shop/en/home/13-lyt8266.html
// -----------------------------------------------------------------------------
#elif defined(AUTHOMETION_LYT8266)
// Info
#define MANUFACTURER "AUTHOMETION"
#define DEVICE "LYT8266"
#define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
#define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
#define DUMMY_RELAY_COUNT 1
// Channels
#define LIGHT_CH1_PIN 13 // RED
#define LIGHT_CH2_PIN 12 // GREEN
#define LIGHT_CH3_PIN 14 // BLUE
#define LIGHT_CH4_PIN 2 // WHITE
#define LIGHT_CH1_INVERSE 0
#define LIGHT_CH2_INVERSE 0
#define LIGHT_CH3_INVERSE 0
#define LIGHT_CH4_INVERSE 0
#define LIGHT_ENABLE_PIN 15
// -----------------------------------------------------------------------------
// Unknown hardware
// -----------------------------------------------------------------------------


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

@ -541,6 +541,22 @@ void hwUpwardsCompatibility() {
setSetting("relayGPIO", 1, 12);
setSetting("relayType", 1, RELAY_TYPE_NORMAL);
#elif defined(AUTHOMETION_LYT8266)
setSetting("board", 45);
setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
setSetting("chGPIO", 1, 13);
setSetting("chGPIO", 2, 12);
setSetting("chGPIO", 3, 14);
setSetting("chGPIO", 4, 2);
setSetting("chLogic", 1, 0);
setSetting("chLogic", 2, 0);
setSetting("chLogic", 3, 0);
setSetting("chLogic", 4, 0);
setSetting("relays", 1);
setSetting("enGPIO", 15);
#else
#error "UNSUPPORTED HARDWARE!"


+ 8
- 0
code/espurna/light.ino View File

@ -226,6 +226,10 @@ void _lightProviderUpdate() {
_shadow();
#ifdef LIGHT_ENABLE_PIN
digitalWrite(LIGHT_ENABLE_PIN, _lightState);
#endif
#if LIGHT_PROVIDER == LIGHT_PROVIDER_MY9192
if (_lightState) {
@ -542,6 +546,10 @@ void _lightAPISetup() {
void lightSetup() {
#ifdef LIGHT_ENABLE_PIN
pinMode(LIGHT_ENABLE_PIN, OUTPUT);
#endif
#if LIGHT_PROVIDER == LIGHT_PROVIDER_MY9192
_my9291 = new my9291(MY9291_DI_PIN, MY9291_DCKI_PIN, MY9291_COMMAND, MY9291_CHANNELS);


+ 23
- 0
code/platformio.ini View File

@ -1026,6 +1026,29 @@ upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
monitor_baud = 115200
[env:authometion-lyt8266]
platform = ${common.platform}
framework = arduino
board = esp01_1m
board_flash_mode = dout
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags_1m} -DAUTHOMETION_LYT8266
monitor_baud = 115200
[env:authometion-lyt8266-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 = ${common.build_flags_1m} -DAUTHOMETION_LYT8266
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
monitor_baud = 115200
# ------------------------------------------------------------------------------
# GENERIC OTA ENVIRONMENTS
# ------------------------------------------------------------------------------


Loading…
Cancel
Save