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.9 KiB

  1. // -----------------------------------------------------------------------------
  2. // Development boards
  3. // -----------------------------------------------------------------------------
  4. #if defined(NODEMCUV2)
  5. #define MANUFACTURER "NODEMCU"
  6. #define DEVICE "LOLIN"
  7. #define BUTTON1_PIN 0
  8. #define BUTTON1_RELAY 1
  9. #define RELAY1_PIN 12
  10. #define RELAY1_PIN_INVERSE 0
  11. #define LED1_PIN 2
  12. #define LED1_PIN_INVERSE 1
  13. #elif defined(D1_RELAYSHIELD)
  14. #define MANUFACTURER "WEMOS"
  15. #define DEVICE "D1_MINI"
  16. #define RELAY1_PIN 5
  17. #define RELAY1_PIN_INVERSE 0
  18. #define LED1_PIN 2
  19. #define LED1_PIN_INVERSE 1
  20. // -----------------------------------------------------------------------------
  21. // Itead Studio boards
  22. // -----------------------------------------------------------------------------
  23. #elif defined(SONOFF)
  24. #define MANUFACTURER "ITEAD"
  25. #define DEVICE "SONOFF"
  26. #define BUTTON1_PIN 0
  27. #define BUTTON1_RELAY 1
  28. #define RELAY1_PIN 12
  29. #define RELAY1_PIN_INVERSE 0
  30. #define LED1_PIN 13
  31. #define LED1_PIN_INVERSE 1
  32. #elif defined(SONOFF_TH)
  33. #define MANUFACTURER "ITEAD"
  34. #define DEVICE "SONOFF_TH"
  35. #define BUTTON1_PIN 0
  36. #define BUTTON1_RELAY 1
  37. #define RELAY1_PIN 12
  38. #define RELAY1_PIN_INVERSE 0
  39. #define LED1_PIN 13
  40. #define LED1_PIN_INVERSE 1
  41. #elif defined(SONOFF_SV)
  42. #define MANUFACTURER "ITEAD"
  43. #define DEVICE "SONOFF_SV"
  44. #define BUTTON1_PIN 0
  45. #define BUTTON1_RELAY 1
  46. #define RELAY1_PIN 12
  47. #define RELAY1_PIN_INVERSE 0
  48. #define LED1_PIN 13
  49. #define LED1_PIN_INVERSE 1
  50. #elif defined(SLAMPHER)
  51. #define MANUFACTURER "ITEAD"
  52. #define DEVICE "SLAMPHER"
  53. #define BUTTON1_PIN 0
  54. #define BUTTON1_RELAY 1
  55. #define RELAY1_PIN 12
  56. #define RELAY1_PIN_INVERSE 0
  57. #define LED1_PIN 13
  58. #define LED1_PIN_INVERSE 1
  59. #elif defined(S20)
  60. #define MANUFACTURER "ITEAD"
  61. #define DEVICE "S20"
  62. #define BUTTON1_PIN 0
  63. #define BUTTON1_RELAY 1
  64. #define RELAY1_PIN 12
  65. #define RELAY1_PIN_INVERSE 0
  66. #define LED1_PIN 13
  67. #define LED1_PIN_INVERSE 1
  68. #elif defined(SONOFF_TOUCH)
  69. #define MANUFACTURER "ITEAD"
  70. #define DEVICE "SONOFF_TOUCH"
  71. #define BUTTON1_PIN 0
  72. #define BUTTON1_RELAY 1
  73. #define RELAY1_PIN 12
  74. #define RELAY1_PIN_INVERSE 0
  75. #define LED1_PIN 13
  76. #define LED1_PIN_INVERSE 1
  77. #elif defined(SONOFF_POW)
  78. #define MANUFACTURER "ITEAD"
  79. #define DEVICE "SONOFF_POW"
  80. #define BUTTON1_PIN 0
  81. #define BUTTON1_RELAY 1
  82. #define RELAY1_PIN 12
  83. #define RELAY1_PIN_INVERSE 0
  84. #define LED1_PIN 15
  85. #define LED1_PIN_INVERSE 0
  86. #define ENABLE_POW 1
  87. #elif defined(SONOFF_DUAL)
  88. #define MANUFACTURER "ITEAD"
  89. #define DEVICE "SONOFF_DUAL"
  90. #define BUTTON1_PIN 0
  91. #define LED1_PIN 13
  92. #define LED1_PIN_INVERSE 1
  93. #undef SERIAL_BAUDRATE
  94. #define SERIAL_BAUDRATE 19230
  95. #elif defined(SONOFF_4CH)
  96. #define MANUFACTURER "ITEAD"
  97. #define DEVICE "SONOFF_4CH"
  98. #define BUTTON1_PIN 0
  99. #define BUTTON1_RELAY 1
  100. #define BUTTON2_PIN 9
  101. #define BUTTON2_RELAY 2
  102. #define BUTTON3_PIN 10
  103. #define BUTTON3_RELAY 3
  104. #define BUTTON4_PIN 14
  105. #define BUTTON4_RELAY 4
  106. #define RELAY1_PIN 12
  107. #define RELAY1_PIN_INVERSE 0
  108. #define RELAY2_PIN 5
  109. #define RELAY2_PIN_INVERSE 0
  110. #define RELAY3_PIN 4
  111. #define RELAY3_PIN_INVERSE 0
  112. #define RELAY4_PIN 15
  113. #define RELAY4_PIN_INVERSE 0
  114. #define LED1_PIN 13
  115. #define LED1_PIN_INVERSE 1
  116. // -----------------------------------------------------------------------------
  117. // Electrodragon boards
  118. // -----------------------------------------------------------------------------
  119. #elif defined(ESP_RELAY_BOARD)
  120. #define MANUFACTURER "ELECTRODRAGON"
  121. #define DEVICE "ESP_RELAY_BOARD"
  122. #define BUTTON1_PIN 0
  123. #define BUTTON1_RELAY 1
  124. #define BUTTON2_PIN 2
  125. #define BUTTON2_RELAY 2
  126. #define RELAY1_PIN 12
  127. #define RELAY1_PIN_INVERSE 0
  128. #define RELAY2_PIN 13
  129. #define RELAY2_PIN_INVERSE 0
  130. #define LED1_PIN 16
  131. #define LED1_PIN_INVERSE 0
  132. // -----------------------------------------------------------------------------
  133. // WorkChoice ecoPlug
  134. // -----------------------------------------------------------------------------
  135. #elif defined(ECOPLUG)
  136. #define MANUFACTURER "WORKCHOICE"
  137. #define DEVICE "ECOPLUG"
  138. #define BUTTON1_PIN 13
  139. #define BUTTON1_RELAY 1
  140. #define RELAY1_PIN 15
  141. #define RELAY1_PIN_INVERSE 0
  142. #define LED1_PIN 2
  143. #define LED1_PIN_INVERSE 0
  144. // -----------------------------------------------------------------------------
  145. // JanGoe Wifi Relay (https://github.com/JanGoe/esp8266-wifi-relay)
  146. // -----------------------------------------------------------------------------
  147. #elif defined(WIFI_RELAY_NC)
  148. #define MANUFACTURER "JANGOE"
  149. #define DEVICE "WIFI_RELAY_NC"
  150. #define BUTTON1_PIN 12
  151. #define BUTTON1_RELAY 1
  152. #define BUTTON2_PIN 13
  153. #define BUTTON2_RELAY 2
  154. #define RELAY1_PIN 2
  155. #define RELAY1_PIN_INVERSE 1
  156. #define RELAY2_PIN 14
  157. #define RELAY2_PIN_INVERSE 1
  158. #elif defined(WIFI_RELAY_NO)
  159. #define MANUFACTURER "JANGOE"
  160. #define DEVICE "WIFI_RELAY_NO"
  161. #define BUTTON1_PIN 12
  162. #define BUTTON1_RELAY 1
  163. #define BUTTON2_PIN 13
  164. #define BUTTON2_RELAY 2
  165. #define RELAY1_PIN 2
  166. #define RELAY1_PIN_INVERSE 0
  167. #define RELAY2_PIN 14
  168. #define RELAY2_PIN_INVERSE 0
  169. // -----------------------------------------------------------------------------
  170. // ESPurna board (still beta)
  171. // -----------------------------------------------------------------------------
  172. #elif defined(ESPURNA)
  173. #define MANUFACTURER "TINKERMAN"
  174. #define DEVICE "ESPURNA"
  175. #define BUTTON1_PIN 0
  176. #define BUTTON1_RELAY 1
  177. #define RELAY1_PIN 12
  178. #define RELAY1_PIN_INVERSE 0
  179. #define LED1_PIN 13
  180. #define LED1_PIN_INVERSE 0
  181. // -----------------------------------------------------------------------------
  182. // Unknown hardware
  183. // -----------------------------------------------------------------------------
  184. #else
  185. #error "UNSUPPORTED HARDWARE!"
  186. #endif