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.

225 lines
6.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 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. // Note: definitions for this board are based on third party data
  133. // and have not been fully tested yet. If you have the chance to
  134. // test them, please report back. Thank you.
  135. #define MANUFACTURER "ITEAD"
  136. #define DEVICE "1CH_INCHING"
  137. #define BUTTON1_PIN 0
  138. #define BUTTON2_PIN 15
  139. #define RELAY1_PIN 12
  140. #define LED1_PIN 13
  141. #define LED1_PIN_INVERSE 0
  142. #define LED_PULSE 14
  143. // -----------------------------------------------------------------------------
  144. // Electrodragon boards
  145. // -----------------------------------------------------------------------------
  146. #elif defined(ESP_RELAY_BOARD)
  147. #define MANUFACTURER "ELECTRODRAGON"
  148. #define DEVICE "ESP_RELAY_BOARD"
  149. #define BUTTON1_PIN 0
  150. #define BUTTON2_PIN 2
  151. #define RELAY1_PIN 12
  152. #define RELAY1_PIN_INVERSE 0
  153. #define RELAY2_PIN 13
  154. #define RELAY2_PIN_INVERSE 0
  155. #define LED1_PIN 16
  156. #define LED1_PIN_INVERSE 0
  157. // -----------------------------------------------------------------------------
  158. // WorkChoice ecoPlug
  159. // -----------------------------------------------------------------------------
  160. #elif defined(ECOPLUG)
  161. #define MANUFACTURER "WORKCHOICE"
  162. #define DEVICE "ECOPLUG"
  163. #define BUTTON1_PIN 13
  164. #define RELAY1_PIN 15
  165. #define RELAY1_PIN_INVERSE 0
  166. #define LED1_PIN 2
  167. #define LED1_PIN_INVERSE 0
  168. // -----------------------------------------------------------------------------
  169. // ESPurna board (still beta)
  170. // -----------------------------------------------------------------------------
  171. #elif defined(ESPURNA)
  172. #define MANUFACTURER "TINKERMAN"
  173. #define DEVICE "ESPURNA"
  174. #define BUTTON1_PIN 0
  175. #define RELAY1_PIN 12
  176. #define RELAY1_PIN_INVERSE 0
  177. #define LED1_PIN 13
  178. #define LED1_PIN_INVERSE 0
  179. // -----------------------------------------------------------------------------
  180. // Unknown hardware
  181. // -----------------------------------------------------------------------------
  182. #else
  183. #error "UNSUPPORTED HARDWARE!"
  184. #endif