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.

240 lines
7.4 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 BUTTON2_PIN 15
  124. #define RELAY1_PIN 12
  125. #define LED1_PIN 13
  126. #define LED1_PIN_INVERSE 0
  127. #define LED_PULSE 14
  128. // -----------------------------------------------------------------------------
  129. // Electrodragon boards
  130. // -----------------------------------------------------------------------------
  131. #elif defined(ESP_RELAY_BOARD)
  132. #define MANUFACTURER "ELECTRODRAGON"
  133. #define DEVICE "ESP_RELAY_BOARD"
  134. #define BUTTON1_PIN 0
  135. #define BUTTON1_RELAY 1
  136. #define BUTTON2_PIN 2
  137. #define BUTTON2_RELAY 2
  138. #define RELAY1_PIN 12
  139. #define RELAY1_PIN_INVERSE 0
  140. #define RELAY2_PIN 13
  141. #define RELAY2_PIN_INVERSE 0
  142. #define LED1_PIN 16
  143. #define LED1_PIN_INVERSE 0
  144. // -----------------------------------------------------------------------------
  145. // WorkChoice ecoPlug
  146. // -----------------------------------------------------------------------------
  147. #elif defined(ECOPLUG)
  148. #define MANUFACTURER "WORKCHOICE"
  149. #define DEVICE "ECOPLUG"
  150. #define BUTTON1_PIN 13
  151. #define BUTTON1_RELAY 1
  152. #define RELAY1_PIN 15
  153. #define RELAY1_PIN_INVERSE 0
  154. #define LED1_PIN 2
  155. #define LED1_PIN_INVERSE 0
  156. // -----------------------------------------------------------------------------
  157. // JanGoe Wifi Relay (https://github.com/JanGoe/esp8266-wifi-relay)
  158. // -----------------------------------------------------------------------------
  159. #elif defined(WIFI_RELAY_NC)
  160. #define MANUFACTURER "JANGOE"
  161. #define DEVICE "WIFI_RELAY_NC"
  162. #define BUTTON1_PIN 12
  163. #define BUTTON1_RELAY 1
  164. #define BUTTON2_PIN 13
  165. #define BUTTON2_RELAY 2
  166. #define RELAY1_PIN 2
  167. #define RELAY1_PIN_INVERSE 1
  168. #define RELAY2_PIN 14
  169. #define RELAY2_PIN_INVERSE 1
  170. #elif defined(WIFI_RELAY_NO)
  171. #define MANUFACTURER "JANGOE"
  172. #define DEVICE "WIFI_RELAY_NO"
  173. #define BUTTON1_PIN 12
  174. #define BUTTON1_RELAY 1
  175. #define BUTTON2_PIN 13
  176. #define BUTTON2_RELAY 2
  177. #define RELAY1_PIN 2
  178. #define RELAY1_PIN_INVERSE 0
  179. #define RELAY2_PIN 14
  180. #define RELAY2_PIN_INVERSE 0
  181. // -----------------------------------------------------------------------------
  182. // ESPurna board (still beta)
  183. // -----------------------------------------------------------------------------
  184. #elif defined(ESPURNA)
  185. #define MANUFACTURER "TINKERMAN"
  186. #define DEVICE "ESPURNA"
  187. #define BUTTON1_PIN 0
  188. #define BUTTON1_RELAY 1
  189. #define RELAY1_PIN 12
  190. #define RELAY1_PIN_INVERSE 0
  191. #define LED1_PIN 13
  192. #define LED1_PIN_INVERSE 0
  193. // -----------------------------------------------------------------------------
  194. // Unknown hardware
  195. // -----------------------------------------------------------------------------
  196. #else
  197. #error "UNSUPPORTED HARDWARE!"
  198. #endif