Browse Source

Support for Teckin SP21

master
Xose Pérez 5 years ago
parent
commit
06ebab31b5
4 changed files with 45 additions and 0 deletions
  1. +1
    -0
      code/espurna/config/arduino.h
  2. +24
    -0
      code/espurna/config/hardware.h
  3. +10
    -0
      code/espurna/migrate.ino
  4. +10
    -0
      code/platformio.ini

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

@ -116,6 +116,7 @@
//#define SMARTLIFE_MINI_SMART_SOCKET
//#define STM_RELAY
//#define TECKIN_SP20
//#define TECKIN_SP21
//#define TECKIN_SP22_V14
//#define TINKERMAN_ESPURNA_H06
//#define TINKERMAN_ESPURNA_H08


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

@ -2916,6 +2916,30 @@
// BUTTON1 and LED1 are using Serial pins
#define DEBUG_SERIAL_SUPPORT 0
// -----------------------------------------------------------------------------
// Teckin SP21
// -----------------------------------------------------------------------------
#elif defined(TECKIN_SP21)
// Info
#define MANUFACTURER "TECKIN"
#define DEVICE "SP21"
// Buttons
#define BUTTON1_PIN 13
#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON1_RELAY 1
// Relays
#define RELAY1_PIN 15
#define RELAY1_TYPE RELAY_TYPE_NORMAL
// LEDs
#define LED1_PIN 2
#define LED1_PIN_INVERSE 1
// -----------------------------------------------------------------------------
// Teckin SP22 v1.4 - v1.6
// -----------------------------------------------------------------------------


+ 10
- 0
code/espurna/migrate.ino View File

@ -1339,6 +1339,16 @@ void migrate() {
setSetting("relayGPIO", 0, 12);
setSetting("relayType", 0, RELAY_TYPE_NORMAL);
#elif defined(TECKIN_SP21)
setSetting("board", 100);
setSetting("ledGPIO", 0, 2);
setSetting("ledLogic", 0, 1);
setSetting("btnGPIO", 0, 13);
setSetting("btnRelay", 0, 0);
setSetting("relayGPIO", 0, 15);
setSetting("relayType", 0, RELAY_TYPE_NORMAL);
#else
// Allow users to define new settings without migration config


+ 10
- 0
code/platformio.ini View File

@ -1335,6 +1335,16 @@ build_flags = ${common.build_flags_1m0m} -DBLITZWOLF_BWSHPX_V23
upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags}
[env:teckin-sp21]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DTECKIN_SP21
[env:teckin-sp21-ota]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DTECKIN_SP21
upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags}
[env:teckin-sp22-v14]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DTECKIN_SP22_V14


Loading…
Cancel
Save