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.

243 lines
7.5 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. #elif defined(ITEAD_1CH_INCHING)
  117. // Note: definitions for this board are based on third party data
  118. // and have not been fully tested yet. If you have the chance to
  119. // test them, please report back. Thank you.
  120. #define MANUFACTURER "ITEAD"
  121. #define DEVICE "1CH_INCHING"
  122. #define BUTTON1_PIN 0
  123. #define BUTTON1_RELAY 1
  124. #define BUTTON2_PIN 15
  125. #define BUTTON2_RELAY 0
  126. #define RELAY1_PIN 12
  127. #define RELAY1_PIN_INVERSE 0
  128. #define LED1_PIN 13
  129. #define LED1_PIN_INVERSE 0
  130. #define LED_PULSE 14
  131. // -----------------------------------------------------------------------------
  132. // Electrodragon boards
  133. // -----------------------------------------------------------------------------
  134. #elif defined(ESP_RELAY_BOARD)
  135. #define MANUFACTURER "ELECTRODRAGON"
  136. #define DEVICE "ESP_RELAY_BOARD"
  137. #define BUTTON1_PIN 0
  138. #define BUTTON1_RELAY 1
  139. #define BUTTON2_PIN 2
  140. #define BUTTON2_RELAY 2
  141. #define RELAY1_PIN 12
  142. #define RELAY1_PIN_INVERSE 0
  143. #define RELAY2_PIN 13
  144. #define RELAY2_PIN_INVERSE 0
  145. #define LED1_PIN 16
  146. #define LED1_PIN_INVERSE 0
  147. // -----------------------------------------------------------------------------
  148. // WorkChoice ecoPlug
  149. // -----------------------------------------------------------------------------
  150. #elif defined(ECOPLUG)
  151. #define MANUFACTURER "WORKCHOICE"
  152. #define DEVICE "ECOPLUG"
  153. #define BUTTON1_PIN 13
  154. #define BUTTON1_RELAY 1
  155. #define RELAY1_PIN 15
  156. #define RELAY1_PIN_INVERSE 0
  157. #define LED1_PIN 2
  158. #define LED1_PIN_INVERSE 0
  159. // -----------------------------------------------------------------------------
  160. // JanGoe Wifi Relay (https://github.com/JanGoe/esp8266-wifi-relay)
  161. // -----------------------------------------------------------------------------
  162. #elif defined(WIFI_RELAY_NC)
  163. #define MANUFACTURER "JANGOE"
  164. #define DEVICE "WIFI_RELAY_NC"
  165. #define BUTTON1_PIN 12
  166. #define BUTTON1_RELAY 1
  167. #define BUTTON2_PIN 13
  168. #define BUTTON2_RELAY 2
  169. #define RELAY1_PIN 2
  170. #define RELAY1_PIN_INVERSE 1
  171. #define RELAY2_PIN 14
  172. #define RELAY2_PIN_INVERSE 1
  173. #elif defined(WIFI_RELAY_NO)
  174. #define MANUFACTURER "JANGOE"
  175. #define DEVICE "WIFI_RELAY_NO"
  176. #define BUTTON1_PIN 12
  177. #define BUTTON1_RELAY 1
  178. #define BUTTON2_PIN 13
  179. #define BUTTON2_RELAY 2
  180. #define RELAY1_PIN 2
  181. #define RELAY1_PIN_INVERSE 0
  182. #define RELAY2_PIN 14
  183. #define RELAY2_PIN_INVERSE 0
  184. // -----------------------------------------------------------------------------
  185. // ESPurna board (still beta)
  186. // -----------------------------------------------------------------------------
  187. #elif defined(ESPURNA)
  188. #define MANUFACTURER "TINKERMAN"
  189. #define DEVICE "ESPURNA"
  190. #define BUTTON1_PIN 0
  191. #define BUTTON1_RELAY 1
  192. #define RELAY1_PIN 12
  193. #define RELAY1_PIN_INVERSE 0
  194. #define LED1_PIN 13
  195. #define LED1_PIN_INVERSE 0
  196. // -----------------------------------------------------------------------------
  197. // Unknown hardware
  198. // -----------------------------------------------------------------------------
  199. #else
  200. #error "UNSUPPORTED HARDWARE!"
  201. #endif