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.

221 lines
6.5 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 RELAY1_PIN_INVERSE 0
  37. #define LED1_PIN 2
  38. #define LED1_PIN_INVERSE 1
  39. #elif defined(D1_RELAYSHIELD)
  40. #define MANUFACTURER "WEMOS"
  41. #define DEVICE "D1_MINI"
  42. #define RELAY1_PIN 5
  43. #define RELAY1_PIN_INVERSE 0
  44. #define LED1_PIN 2
  45. #define LED1_PIN_INVERSE 1
  46. // -----------------------------------------------------------------------------
  47. // Itead Studio boards
  48. // -----------------------------------------------------------------------------
  49. #elif defined(SONOFF)
  50. #define MANUFACTURER "ITEAD"
  51. #define DEVICE "SONOFF"
  52. #define BUTTON1_PIN 0
  53. #define RELAY1_PIN 12
  54. #define RELAY1_PIN_INVERSE 0
  55. #define LED1_PIN 13
  56. #define LED1_PIN_INVERSE 1
  57. #elif defined(SONOFF_TH)
  58. #define MANUFACTURER "ITEAD"
  59. #define DEVICE "SONOFF_TH"
  60. #define BUTTON1_PIN 0
  61. #define RELAY1_PIN 12
  62. #define RELAY1_PIN_INVERSE 0
  63. #define LED1_PIN 13
  64. #define LED1_PIN_INVERSE 1
  65. #elif defined(SONOFF_SV)
  66. #define MANUFACTURER "ITEAD"
  67. #define DEVICE "SONOFF_SV"
  68. #define BUTTON1_PIN 0
  69. #define RELAY1_PIN 12
  70. #define RELAY1_PIN_INVERSE 0
  71. #define LED1_PIN 13
  72. #define LED1_PIN_INVERSE 1
  73. #elif defined(SLAMPHER)
  74. #define MANUFACTURER "ITEAD"
  75. #define DEVICE "SLAMPHER"
  76. #define BUTTON1_PIN 0
  77. #define RELAY1_PIN 12
  78. #define RELAY1_PIN_INVERSE 0
  79. #define LED1_PIN 13
  80. #define LED1_PIN_INVERSE 1
  81. #elif defined(S20)
  82. #define MANUFACTURER "ITEAD"
  83. #define DEVICE "S20"
  84. #define BUTTON1_PIN 0
  85. #define RELAY1_PIN 12
  86. #define RELAY1_PIN_INVERSE 0
  87. #define LED1_PIN 13
  88. #define LED1_PIN_INVERSE 1
  89. #elif defined(SONOFF_TOUCH)
  90. #define MANUFACTURER "ITEAD"
  91. #define DEVICE "SONOFF_TOUCH"
  92. #define BUTTON1_PIN 0
  93. #define RELAY1_PIN 12
  94. #define RELAY1_PIN_INVERSE 0
  95. #define LED1_PIN 13
  96. #define LED1_PIN_INVERSE 1
  97. #elif defined(SONOFF_POW)
  98. #define MANUFACTURER "ITEAD"
  99. #define DEVICE "SONOFF_POW"
  100. #define BUTTON1_PIN 0
  101. #define RELAY1_PIN 12
  102. #define RELAY1_PIN_INVERSE 0
  103. #define LED1_PIN 15
  104. #define LED1_PIN_INVERSE 0
  105. #define ENABLE_POW 1
  106. #elif defined(SONOFF_DUAL)
  107. #define MANUFACTURER "ITEAD"
  108. #define DEVICE "SONOFF_DUAL"
  109. #define BUTTON1_PIN 0
  110. #define LED1_PIN 13
  111. #define LED1_PIN_INVERSE 1
  112. #undef SERIAL_BAUDRATE
  113. #define SERIAL_BAUDRATE 19230
  114. #elif defined(SONOFF_4CH)
  115. #define MANUFACTURER "ITEAD"
  116. #define DEVICE "SONOFF_4CH"
  117. #define BUTTON1_PIN 0
  118. #define BUTTON2_PIN 9
  119. #define BUTTON3_PIN 10
  120. #define BUTTON4_PIN 14
  121. #define RELAY1_PIN 12
  122. #define RELAY1_PIN_INVERSE 0
  123. #define RELAY2_PIN 5
  124. #define RELAY2_PIN_INVERSE 0
  125. #define RELAY3_PIN 4
  126. #define RELAY3_PIN_INVERSE 0
  127. #define RELAY4_PIN 15
  128. #define RELAY4_PIN_INVERSE 0
  129. #define LED1_PIN 13
  130. #define LED1_PIN_INVERSE 1
  131. #elif defined(ITEAD_1CH_INCHING)
  132. #define MANUFACTURER "ITEAD"
  133. #define DEVICE "1CH_INCHING"
  134. #define BUTTON1_PIN 0
  135. #define BUTTON2_PIN 15
  136. #define RELAY1_PIN 12
  137. #define LED1_PIN 13
  138. #define LED1_PIN_INVERSE 0
  139. #define LED_INCHING 14
  140. // -----------------------------------------------------------------------------
  141. // Electrodragon boards
  142. // -----------------------------------------------------------------------------
  143. #elif defined(ESP_RELAY_BOARD)
  144. #define MANUFACTURER "ELECTRODRAGON"
  145. #define DEVICE "ESP_RELAY_BOARD"
  146. #define BUTTON1_PIN 0
  147. #define BUTTON2_PIN 2
  148. #define RELAY1_PIN 12
  149. #define RELAY1_PIN_INVERSE 0
  150. #define RELAY2_PIN 13
  151. #define RELAY2_PIN_INVERSE 0
  152. #define LED1_PIN 16
  153. #define LED1_PIN_INVERSE 0
  154. // -----------------------------------------------------------------------------
  155. // WorkChoice ecoPlug
  156. // -----------------------------------------------------------------------------
  157. #elif defined(ECOPLUG)
  158. #define MANUFACTURER "WORKCHOICE"
  159. #define DEVICE "ECOPLUG"
  160. #define BUTTON1_PIN 13
  161. #define RELAY1_PIN 15
  162. #define RELAY1_PIN_INVERSE 0
  163. #define LED1_PIN 2
  164. #define LED1_PIN_INVERSE 0
  165. // -----------------------------------------------------------------------------
  166. // ESPurna board (still beta)
  167. // -----------------------------------------------------------------------------
  168. #elif defined(ESPURNA)
  169. #define MANUFACTURER "TINKERMAN"
  170. #define DEVICE "ESPURNA"
  171. #define BUTTON1_PIN 0
  172. #define RELAY1_PIN 12
  173. #define RELAY1_PIN_INVERSE 0
  174. #define LED1_PIN 13
  175. #define LED1_PIN_INVERSE 0
  176. // -----------------------------------------------------------------------------
  177. // Unknown hardware
  178. // -----------------------------------------------------------------------------
  179. #else
  180. #error "UNSUPPORTED HARDWARE!"
  181. #endif