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.

337 lines
7.8 KiB

  1. // -----------------------------------------------------------------------------
  2. // Hardware default values
  3. // -----------------------------------------------------------------------------
  4. // -----------------------------------------------------------------------------
  5. // Buttons
  6. // -----------------------------------------------------------------------------
  7. #ifndef BUTTON1_PRESS
  8. #define BUTTON1_PRESS BUTTON_MODE_NONE
  9. #endif
  10. #ifndef BUTTON2_PRESS
  11. #define BUTTON2_PRESS BUTTON_MODE_NONE
  12. #endif
  13. #ifndef BUTTON3_PRESS
  14. #define BUTTON3_PRESS BUTTON_MODE_NONE
  15. #endif
  16. #ifndef BUTTON4_PRESS
  17. #define BUTTON4_PRESS BUTTON_MODE_NONE
  18. #endif
  19. #ifndef BUTTON5_PRESS
  20. #define BUTTON5_PRESS BUTTON_MODE_NONE
  21. #endif
  22. #ifndef BUTTON6_PRESS
  23. #define BUTTON6_PRESS BUTTON_MODE_NONE
  24. #endif
  25. #ifndef BUTTON7_PRESS
  26. #define BUTTON7_PRESS BUTTON_MODE_NONE
  27. #endif
  28. #ifndef BUTTON8_PRESS
  29. #define BUTTON8_PRESS BUTTON_MODE_NONE
  30. #endif
  31. #ifndef BUTTON1_CLICK
  32. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  33. #endif
  34. #ifndef BUTTON2_CLICK
  35. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  36. #endif
  37. #ifndef BUTTON3_CLICK
  38. #define BUTTON3_CLICK BUTTON_MODE_TOGGLE
  39. #endif
  40. #ifndef BUTTON4_CLICK
  41. #define BUTTON4_CLICK BUTTON_MODE_TOGGLE
  42. #endif
  43. #ifndef BUTTON5_CLICK
  44. #define BUTTON5_CLICK BUTTON_MODE_TOGGLE
  45. #endif
  46. #ifndef BUTTON6_CLICK
  47. #define BUTTON6_CLICK BUTTON_MODE_TOGGLE
  48. #endif
  49. #ifndef BUTTON7_CLICK
  50. #define BUTTON7_CLICK BUTTON_MODE_TOGGLE
  51. #endif
  52. #ifndef BUTTON8_CLICK
  53. #define BUTTON8_CLICK BUTTON_MODE_TOGGLE
  54. #endif
  55. #ifndef BUTTON1_DBLCLICK
  56. #define BUTTON1_DBLCLICK BUTTON_MODE_AP
  57. #endif
  58. #ifndef BUTTON2_DBLCLICK
  59. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  60. #endif
  61. #ifndef BUTTON3_DBLCLICK
  62. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  63. #endif
  64. #ifndef BUTTON4_DBLCLICK
  65. #define BUTTON4_DBLCLICK BUTTON_MODE_NONE
  66. #endif
  67. #ifndef BUTTON5_DBLCLICK
  68. #define BUTTON5_DBLCLICK BUTTON_MODE_NONE
  69. #endif
  70. #ifndef BUTTON6_DBLCLICK
  71. #define BUTTON6_DBLCLICK BUTTON_MODE_NONE
  72. #endif
  73. #ifndef BUTTON7_DBLCLICK
  74. #define BUTTON7_DBLCLICK BUTTON_MODE_NONE
  75. #endif
  76. #ifndef BUTTON8_DBLCLICK
  77. #define BUTTON8_DBLCLICK BUTTON_MODE_NONE
  78. #endif
  79. #ifndef BUTTON1_LNGCLICK
  80. #define BUTTON1_LNGCLICK BUTTON_MODE_RESET
  81. #endif
  82. #ifndef BUTTON2_LNGCLICK
  83. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  84. #endif
  85. #ifndef BUTTON3_LNGCLICK
  86. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  87. #endif
  88. #ifndef BUTTON4_LNGCLICK
  89. #define BUTTON4_LNGCLICK BUTTON_MODE_NONE
  90. #endif
  91. #ifndef BUTTON5_LNGCLICK
  92. #define BUTTON5_LNGCLICK BUTTON_MODE_NONE
  93. #endif
  94. #ifndef BUTTON6_LNGCLICK
  95. #define BUTTON6_LNGCLICK BUTTON_MODE_NONE
  96. #endif
  97. #ifndef BUTTON7_LNGCLICK
  98. #define BUTTON7_LNGCLICK BUTTON_MODE_NONE
  99. #endif
  100. #ifndef BUTTON8_LNGCLICK
  101. #define BUTTON8_LNGCLICK BUTTON_MODE_NONE
  102. #endif
  103. #ifndef BUTTON1_LNGLNGCLICK
  104. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_FACTORY
  105. #endif
  106. #ifndef BUTTON2_LNGLNGCLICK
  107. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  108. #endif
  109. #ifndef BUTTON3_LNGLNGCLICK
  110. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_NONE
  111. #endif
  112. #ifndef BUTTON4_LNGLNGCLICK
  113. #define BUTTON4_LNGLNGCLICK BUTTON_MODE_NONE
  114. #endif
  115. #ifndef BUTTON5_LNGLNGCLICK
  116. #define BUTTON5_LNGLNGCLICK BUTTON_MODE_NONE
  117. #endif
  118. #ifndef BUTTON6_LNGLNGCLICK
  119. #define BUTTON6_LNGLNGCLICK BUTTON_MODE_NONE
  120. #endif
  121. #ifndef BUTTON7_LNGLNGCLICK
  122. #define BUTTON7_LNGLNGCLICK BUTTON_MODE_NONE
  123. #endif
  124. #ifndef BUTTON8_LNGLNGCLICK
  125. #define BUTTON8_LNGLNGCLICK BUTTON_MODE_NONE
  126. #endif
  127. #ifndef BUTTON1_RELAY
  128. #define BUTTON1_RELAY 0
  129. #endif
  130. #ifndef BUTTON2_RELAY
  131. #define BUTTON2_RELAY 0
  132. #endif
  133. #ifndef BUTTON3_RELAY
  134. #define BUTTON3_RELAY 0
  135. #endif
  136. #ifndef BUTTON4_RELAY
  137. #define BUTTON4_RELAY 0
  138. #endif
  139. #ifndef BUTTON5_RELAY
  140. #define BUTTON5_RELAY 0
  141. #endif
  142. #ifndef BUTTON6_RELAY
  143. #define BUTTON6_RELAY 0
  144. #endif
  145. #ifndef BUTTON7_RELAY
  146. #define BUTTON7_RELAY 0
  147. #endif
  148. #ifndef BUTTON8_RELAY
  149. #define BUTTON8_RELAY 0
  150. #endif
  151. // -----------------------------------------------------------------------------
  152. // Relays
  153. // -----------------------------------------------------------------------------
  154. #ifndef RELAY1_TYPE
  155. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  156. #endif
  157. #ifndef RELAY2_TYPE
  158. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  159. #endif
  160. #ifndef RELAY3_TYPE
  161. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  162. #endif
  163. #ifndef RELAY4_TYPE
  164. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  165. #endif
  166. #ifndef RELAY5_TYPE
  167. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  168. #endif
  169. #ifndef RELAY6_TYPE
  170. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  171. #endif
  172. #ifndef RELAY7_TYPE
  173. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  174. #endif
  175. #ifndef RELAY8_TYPE
  176. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  177. #endif
  178. #ifndef RELAY1_RESET_PIN
  179. #define RELAY1_RESET_PIN 0
  180. #endif
  181. #ifndef RELAY2_RESET_PIN
  182. #define RELAY2_RESET_PIN 0
  183. #endif
  184. #ifndef RELAY3_RESET_PIN
  185. #define RELAY3_RESET_PIN 0
  186. #endif
  187. #ifndef RELAY4_RESET_PIN
  188. #define RELAY4_RESET_PIN 0
  189. #endif
  190. #ifndef RELAY5_RESET_PIN
  191. #define RELAY5_RESET_PIN 0
  192. #endif
  193. #ifndef RELAY6_RESET_PIN
  194. #define RELAY6_RESET_PIN 0
  195. #endif
  196. #ifndef RELAY7_RESET_PIN
  197. #define RELAY7_RESET_PIN 0
  198. #endif
  199. #ifndef RELAY8_RESET_PIN
  200. #define RELAY8_RESET_PIN 0
  201. #endif
  202. #ifndef RELAY1_DELAY_ON
  203. #define RELAY1_DELAY_ON 0
  204. #endif
  205. #ifndef RELAY2_DELAY_ON
  206. #define RELAY2_DELAY_ON 0
  207. #endif
  208. #ifndef RELAY3_DELAY_ON
  209. #define RELAY3_DELAY_ON 0
  210. #endif
  211. #ifndef RELAY4_DELAY_ON
  212. #define RELAY4_DELAY_ON 0
  213. #endif
  214. #ifndef RELAY5_DELAY_ON
  215. #define RELAY5_DELAY_ON 0
  216. #endif
  217. #ifndef RELAY6_DELAY_ON
  218. #define RELAY6_DELAY_ON 0
  219. #endif
  220. #ifndef RELAY7_DELAY_ON
  221. #define RELAY7_DELAY_ON 0
  222. #endif
  223. #ifndef RELAY8_DELAY_ON
  224. #define RELAY8_DELAY_ON 0
  225. #endif
  226. #ifndef RELAY1_DELAY_OFF
  227. #define RELAY1_DELAY_OFF 0
  228. #endif
  229. #ifndef RELAY2_DELAY_OFF
  230. #define RELAY2_DELAY_OFF 0
  231. #endif
  232. #ifndef RELAY3_DELAY_OFF
  233. #define RELAY3_DELAY_OFF 0
  234. #endif
  235. #ifndef RELAY4_DELAY_OFF
  236. #define RELAY4_DELAY_OFF 0
  237. #endif
  238. #ifndef RELAY5_DELAY_OFF
  239. #define RELAY5_DELAY_OFF 0
  240. #endif
  241. #ifndef RELAY6_DELAY_OFF
  242. #define RELAY6_DELAY_OFF 0
  243. #endif
  244. #ifndef RELAY7_DELAY_OFF
  245. #define RELAY7_DELAY_OFF 0
  246. #endif
  247. #ifndef RELAY8_DELAY_OFF
  248. #define RELAY8_DELAY_OFF 0
  249. #endif
  250. // -----------------------------------------------------------------------------
  251. // LEDs
  252. // -----------------------------------------------------------------------------
  253. #ifndef LED1_MODE
  254. #define LED1_MODE LED_MODE_WIFI
  255. #endif
  256. #ifndef LED2_MODE
  257. #define LED2_MODE LED_MODE_MQTT
  258. #endif
  259. #ifndef LED3_MODE
  260. #define LED3_MODE LED_MODE_MQTT
  261. #endif
  262. #ifndef LED4_MODE
  263. #define LED4_MODE LED_MODE_MQTT
  264. #endif
  265. #ifndef LED5_MODE
  266. #define LED5_MODE LED_MODE_MQTT
  267. #endif
  268. #ifndef LED6_MODE
  269. #define LED6_MODE LED_MODE_MQTT
  270. #endif
  271. #ifndef LED7_MODE
  272. #define LED7_MODE LED_MODE_MQTT
  273. #endif
  274. #ifndef LED8_MODE
  275. #define LED8_MODE LED_MODE_MQTT
  276. #endif
  277. #ifndef LED1_RELAY
  278. #define LED1_RELAY 1
  279. #endif
  280. #ifndef LED2_RELAY
  281. #define LED2_RELAY 2
  282. #endif
  283. #ifndef LED3_RELAY
  284. #define LED3_RELAY 3
  285. #endif
  286. #ifndef LED4_RELAY
  287. #define LED4_RELAY 4
  288. #endif
  289. #ifndef LED5_RELAY
  290. #define LED5_RELAY 5
  291. #endif
  292. #ifndef LED6_RELAY
  293. #define LED6_RELAY 6
  294. #endif
  295. #ifndef LED7_RELAY
  296. #define LED7_RELAY 7
  297. #endif
  298. #ifndef LED8_RELAY
  299. #define LED8_RELAY 8
  300. #endif
  301. // -----------------------------------------------------------------------------
  302. // General
  303. // -----------------------------------------------------------------------------
  304. // Needed for ESP8285 boards under Windows using PlatformIO (?)
  305. #ifndef BUTTON_PUSHBUTTON
  306. #define BUTTON_PUSHBUTTON 0
  307. #define BUTTON_SWITCH 1
  308. #define BUTTON_DEFAULT_HIGH 2
  309. #define BUTTON_SET_PULLUP 4
  310. #endif
  311. // Relay providers
  312. #ifndef RELAY_PROVIDER
  313. #define RELAY_PROVIDER RELAY_PROVIDER_RELAY
  314. #endif
  315. // Light provider
  316. #ifndef LIGHT_PROVIDER
  317. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  318. #endif