Browse Source

Support for ESPurna board v0.7

fastled
Xose Pérez 7 years ago
parent
commit
e9687b5ca2
4 changed files with 104 additions and 22 deletions
  1. +58
    -11
      code/espurna/config/hardware.h
  2. +14
    -1
      code/espurna/hardware.ino
  3. +6
    -6
      code/html/index.html
  4. +26
    -4
      code/platformio.ini

+ 58
- 11
code/espurna/config/hardware.h View File

@ -63,26 +63,32 @@
// ESPurna
// -----------------------------------------------------------------------------
#elif defined(TINKERMAN_ESPURNA_H)
#elif defined(TINKERMAN_ESPURNA_H06)
// Info
#define MANUFACTURER "TINKERMAN"
#define DEVICE "ESPURNA_H"
#define DEVICE "ESPURNA_H06"
// Buttons
#define BUTTON1_PIN 4
#define BUTTON1_RELAY 1
// Normal pushbutton
//#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#ifdef USE_TOUCH_BUTTON
// Touch button
#define BUTTON1_MODE BUTTON_PUSHBUTTON
#define BUTTON1_PRESS BUTTON_MODE_TOGGLE
#define BUTTON1_CLICK BUTTON_MODE_NONE
#define BUTTON1_DBLCLICK BUTTON_MODE_NONE
#define BUTTON1_LNGCLICK BUTTON_MODE_NONE
#define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
// Touch button
#define BUTTON1_MODE BUTTON_PUSHBUTTON
#define BUTTON1_PRESS BUTTON_MODE_TOGGLE
#define BUTTON1_CLICK BUTTON_MODE_NONE
#define BUTTON1_DBLCLICK BUTTON_MODE_NONE
#define BUTTON1_LNGCLICK BUTTON_MODE_NONE
#define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
#else
// Normal pushbutton
#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#endif
// Relays
@ -99,6 +105,47 @@
#define HLW8012_CF1_PIN 13
#define HLW8012_CF_PIN 14
#elif defined(TINKERMAN_ESPURNA_H07)
// Info
#define MANUFACTURER "TINKERMAN"
#define DEVICE "ESPURNA_H07"
// Buttons
#define BUTTON1_PIN 4
#define BUTTON1_RELAY 1
#ifdef USE_TOUCH_BUTTON
// Touch button
#define BUTTON1_MODE BUTTON_PUSHBUTTON
#define BUTTON1_PRESS BUTTON_MODE_TOGGLE
#define BUTTON1_CLICK BUTTON_MODE_NONE
#define BUTTON1_DBLCLICK BUTTON_MODE_NONE
#define BUTTON1_LNGCLICK BUTTON_MODE_NONE
#define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
#else
// Normal pushbutton
#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#endif
// Relays
#define RELAY1_PIN 12
#define RELAY1_TYPE RELAY_TYPE_NORMAL
// LEDs
#define LED1_PIN 2
#define LED1_PIN_INVERSE 0
// HLW8012
#define POWER_PROVIDER POWER_PROVIDER_HLW8012
#define HLW8012_SEL_PIN 5
#define HLW8012_CF1_PIN 13
#define HLW8012_CF_PIN 14
// -----------------------------------------------------------------------------
// Itead Studio boards
// -----------------------------------------------------------------------------


+ 14
- 1
code/espurna/hardware.ino View File

@ -252,7 +252,7 @@ void hwUpwardsCompatibility() {
setSetting("relayGPIO", 1, 12);
setSetting("relayType", 1, RELAY_TYPE_NORMAL);
#elif defined(TINKERMAN_ESPURNA_H)
#elif defined(TINKERMAN_ESPURNA_H06)
setSetting("board", 23);
setSetting("ledGPIO", 1, 5);
@ -442,6 +442,19 @@ void hwUpwardsCompatibility() {
setSetting("board", 38);
#elif defined(TINKERMAN_ESPURNA_H07)
setSetting("board", 39);
setSetting("ledGPIO", 1, 2);
setSetting("ledLogic", 1, 0);
setSetting("btnGPIO", 1, 4);
setSetting("btnRelay", 1, 1);
setSetting("relayGPIO", 1, 12);
setSetting("relayType", 1, RELAY_TYPE_NORMAL);
setSetting("selGPIO", 5);
setSetting("cf1GPIO", 13);
setSetting("cfGPIO", 14);
#else
#error "UNSUPPORTED HARDWARE!"


+ 6
- 6
code/html/index.html View File

@ -401,12 +401,6 @@
<div class="pure-u-1 pure-u-sm-1-4"><input type="radio" name="tmpUnits" tabindex="13" value="1"> Fahrenheit (&deg;F)</input></div>
</div>
<div class="pure-g">
<label class="pure-u-1 pure-u-sm-1-4">Settings</label>
<div class="pure-u-1 pure-u-sm-1-8"><button class="pure-button button-settings-backup pure-u-23-24">Backup</button></div>
<div class="pure-u-1 pure-u-sm-1-8"><button class="pure-button button-settings-restore pure-u-23-24">Restore</button></div>
</div>
</fieldset>
</div>
</div>
@ -475,6 +469,12 @@
<div class="pure-u-1 pure-u-md-3-4 hint">This name address of the NoFUSS server for automatic remote updates (see https://bitbucket.org/xoseperez/nofuss).</div>
</div>
<div class="pure-g">
<label class="pure-u-1 pure-u-sm-1-4">Settings</label>
<div class="pure-u-1 pure-u-sm-1-8"><button class="pure-button button-settings-backup pure-u-23-24">Backup</button></div>
<div class="pure-u-1 pure-u-sm-1-8"><button class="pure-button button-settings-restore pure-u-23-24">Restore</button></div>
</div>
<div class="pure-g">
<label class="pure-u-1 pure-u-md-1-4">Upgrade</label>
<input class="pure-u-1-2 pure-u-md-1-2" name="filename" type="text" readonly />


+ 26
- 4
code/platformio.ini View File

@ -100,23 +100,45 @@ monitor_baud = 115200
# ------------------------------------------------------------------------------
[env:tinkerman-espurna-h]
[env:tinkerman-espurna-h06]
platform = espressif8266
framework = arduino
board = esp12e
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags} -DTINKERMAN_ESPURNA_H
build_flags = ${common.build_flags} -DTINKERMAN_ESPURNA_H06
upload_speed = 460800
monitor_baud = 115200
[env:tinkerman-espurna-h-ota]
[env:tinkerman-espurna-h06-ota]
platform = espressif8266
framework = arduino
board = esp12e
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags} -DTINKERMAN_ESPURNA_H
build_flags = ${common.build_flags} -DTINKERMAN_ESPURNA_H06
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
monitor_baud = 115200
[env:tinkerman-espurna-h07]
platform = espressif8266
framework = arduino
board = esp12e
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags} -DTINKERMAN_ESPURNA_H07
upload_speed = 460800
monitor_baud = 115200
[env:tinkerman-espurna-h07-ota]
platform = espressif8266
framework = arduino
board = esp12e
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags} -DTINKERMAN_ESPURNA_H07
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266


Loading…
Cancel
Save