Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

193 lines
5.7 KiB

  1. //--------------------------------------------------------------------------------
  2. // HARDWARE
  3. // This setting is normally provided by PlatformIO
  4. // Uncomment the appropiate line to build from the Arduino IDE
  5. //--------------------------------------------------------------------------------
  6. //#define NODEMCUV2
  7. //#define SONOFF
  8. //#define SONOFF_TH
  9. //#define SLAMPHER
  10. //#define S20
  11. //#define SONOFF_SV
  12. //#define SONOFF_POW
  13. //#define SONOFF_DUAL
  14. //#define SONOFF_4CH
  15. //#define ESP_RELAY_BOARD
  16. //#define ECOPLUG
  17. //#define ESPURNA
  18. //#define ENABLE_DHT 1
  19. //#define ENABLE_DS18B20 1
  20. //#define ENABLE_EMON 1
  21. //#define ENABLE_HLW8018 1
  22. //#define ENABLE_RF 1
  23. //#define ENABLE_FAUXMO 0
  24. //#define ENABLE_NOFUSS 1
  25. #ifndef ENABLE_FAUXMO
  26. #define ENABLE_FAUXMO 1
  27. #endif
  28. // -----------------------------------------------------------------------------
  29. // Development boards
  30. // -----------------------------------------------------------------------------
  31. #if defined(NODEMCUV2)
  32. #define MANUFACTURER "NODEMCU"
  33. #define DEVICE "LOLIN"
  34. #define BUTTON1_PIN 0
  35. #define RELAY1_PIN 12
  36. #define LED1_PIN 2
  37. #define LED1_PIN_INVERSE 1
  38. #elif defined(D1_RELAYSHIELD)
  39. #define MANUFACTURER "WEMOS"
  40. #define DEVICE "D1_MINI"
  41. #define RELAY1_PIN 5
  42. #define LED1_PIN 2
  43. #define LED1_PIN_INVERSE 1
  44. // -----------------------------------------------------------------------------
  45. // Itead Studio boards
  46. // -----------------------------------------------------------------------------
  47. #elif defined(SONOFF)
  48. #define MANUFACTURER "ITEAD"
  49. #define DEVICE "SONOFF"
  50. #define BUTTON1_PIN 0
  51. #define RELAY1_PIN 12
  52. #define LED1_PIN 13
  53. #define LED1_PIN_INVERSE 1
  54. #elif defined(SONOFF_TH)
  55. #define MANUFACTURER "ITEAD"
  56. #define DEVICE "SONOFF_TH"
  57. #define BUTTON1_PIN 0
  58. #define RELAY1_PIN 12
  59. #define LED1_PIN 13
  60. #define LED1_PIN_INVERSE 1
  61. #elif defined(SONOFF_SV)
  62. #define MANUFACTURER "ITEAD"
  63. #define DEVICE "SONOFF_SV"
  64. #define BUTTON1_PIN 0
  65. #define RELAY1_PIN 12
  66. #define LED1_PIN 13
  67. #define LED1_PIN_INVERSE 1
  68. #elif defined(SLAMPHER)
  69. #define MANUFACTURER "ITEAD"
  70. #define DEVICE "SLAMPHER"
  71. #define BUTTON1_PIN 0
  72. #define RELAY1_PIN 12
  73. #define LED1_PIN 13
  74. #define LED1_PIN_INVERSE 1
  75. #elif defined(S20)
  76. #define MANUFACTURER "ITEAD"
  77. #define DEVICE "S20"
  78. #define BUTTON1_PIN 0
  79. #define RELAY1_PIN 12
  80. #define LED1_PIN 13
  81. #define LED1_PIN_INVERSE 1
  82. #elif defined(SONOFF_TOUCH)
  83. #define MANUFACTURER "ITEAD"
  84. #define DEVICE "SONOFF_TOUCH"
  85. #define BUTTON1_PIN 0
  86. #define RELAY1_PIN 12
  87. #define LED1_PIN 13
  88. #define LED1_PIN_INVERSE 1
  89. #elif defined(SONOFF_POW)
  90. #define MANUFACTURER "ITEAD"
  91. #define DEVICE "SONOFF_POW"
  92. #define BUTTON1_PIN 0
  93. #define RELAY1_PIN 12
  94. #define LED1_PIN 15
  95. #define LED1_PIN_INVERSE 0
  96. #define ENABLE_POW 1
  97. #elif defined(SONOFF_DUAL)
  98. #define MANUFACTURER "ITEAD"
  99. #define DEVICE "SONOFF_DUAL"
  100. #define BUTTON1_PIN 0
  101. #define LED1_PIN 13
  102. #define LED1_PIN_INVERSE 1
  103. #undef SERIAL_BAUDRATE
  104. #define SERIAL_BAUDRATE 19230
  105. #elif defined(SONOFF_4CH)
  106. #define MANUFACTURER "ITEAD"
  107. #define DEVICE "SONOFF_4CH"
  108. #define BUTTON1_PIN 0
  109. #define BUTTON2_PIN 9
  110. #define BUTTON3_PIN 10
  111. #define BUTTON4_PIN 14
  112. #define RELAY1_PIN 12
  113. #define RELAY2_PIN 5
  114. #define RELAY3_PIN 4
  115. #define RELAY4_PIN 15
  116. #define LED1_PIN 13
  117. #define LED1_PIN_INVERSE 1
  118. // -----------------------------------------------------------------------------
  119. // Electrodragon boards
  120. // -----------------------------------------------------------------------------
  121. #elif defined(ESP_RELAY_BOARD)
  122. #define MANUFACTURER "ELECTRODRAGON"
  123. #define DEVICE "ESP_RELAY_BOARD"
  124. #define BUTTON1_PIN 0
  125. #define BUTTON2_PIN 2
  126. #define RELAY1_PIN 12
  127. #define RELAY2_PIN 13
  128. #define LED1_PIN 16
  129. #define LED1_PIN_INVERSE 0
  130. // -----------------------------------------------------------------------------
  131. // WorkChoice ecoPlug
  132. // -----------------------------------------------------------------------------
  133. #elif defined(ECOPLUG)
  134. #define MANUFACTURER "WORKCHOICE"
  135. #define DEVICE "ECOPLUG"
  136. #define BUTTON1_PIN 13
  137. #define RELAY1_PIN 15
  138. #define LED1_PIN 2
  139. #define LED1_PIN_INVERSE 0
  140. // -----------------------------------------------------------------------------
  141. // ESPurna board (still beta)
  142. // -----------------------------------------------------------------------------
  143. #elif defined(ESPURNA)
  144. #define MANUFACTURER "TINKERMAN"
  145. #define DEVICE "ESPURNA"
  146. #define BUTTON1_PIN 0
  147. #define RELAY1_PIN 12
  148. #define LED1_PIN 13
  149. #define LED1_PIN_INVERSE 0
  150. // -----------------------------------------------------------------------------
  151. // Unknown hardware
  152. // -----------------------------------------------------------------------------
  153. #else
  154. #error "UNSUPPORTED HARDWARE!"
  155. #endif