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.

921 lines
22 KiB

  1. // -----------------------------------------------------------------------------
  2. // DEFAULTS PER MODULE
  3. // -----------------------------------------------------------------------------
  4. #pragma once
  5. // -----------------------------------------------------------------------------
  6. // Buttons
  7. // -----------------------------------------------------------------------------
  8. #ifndef BUTTON1_PIN
  9. #define BUTTON1_PIN GPIO_NONE
  10. #endif
  11. #ifndef BUTTON2_PIN
  12. #define BUTTON2_PIN GPIO_NONE
  13. #endif
  14. #ifndef BUTTON3_PIN
  15. #define BUTTON3_PIN GPIO_NONE
  16. #endif
  17. #ifndef BUTTON4_PIN
  18. #define BUTTON4_PIN GPIO_NONE
  19. #endif
  20. #ifndef BUTTON5_PIN
  21. #define BUTTON5_PIN GPIO_NONE
  22. #endif
  23. #ifndef BUTTON6_PIN
  24. #define BUTTON6_PIN GPIO_NONE
  25. #endif
  26. #ifndef BUTTON7_PIN
  27. #define BUTTON7_PIN GPIO_NONE
  28. #endif
  29. #ifndef BUTTON8_PIN
  30. #define BUTTON8_PIN GPIO_NONE
  31. #endif
  32. #ifndef BUTTON1_CONFIG
  33. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  34. #endif
  35. #ifndef BUTTON2_CONFIG
  36. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  37. #endif
  38. #ifndef BUTTON3_CONFIG
  39. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  40. #endif
  41. #ifndef BUTTON4_CONFIG
  42. #define BUTTON4_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  43. #endif
  44. #ifndef BUTTON5_CONFIG
  45. #define BUTTON5_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  46. #endif
  47. #ifndef BUTTON6_CONFIG
  48. #define BUTTON6_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  49. #endif
  50. #ifndef BUTTON7_CONFIG
  51. #define BUTTON7_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  52. #endif
  53. #ifndef BUTTON8_CONFIG
  54. #define BUTTON8_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  55. #endif
  56. #ifndef BUTTON1_PRESS
  57. #define BUTTON1_PRESS BUTTON_ACTION_NONE
  58. #endif
  59. #ifndef BUTTON2_PRESS
  60. #define BUTTON2_PRESS BUTTON_ACTION_NONE
  61. #endif
  62. #ifndef BUTTON3_PRESS
  63. #define BUTTON3_PRESS BUTTON_ACTION_NONE
  64. #endif
  65. #ifndef BUTTON4_PRESS
  66. #define BUTTON4_PRESS BUTTON_ACTION_NONE
  67. #endif
  68. #ifndef BUTTON5_PRESS
  69. #define BUTTON5_PRESS BUTTON_ACTION_NONE
  70. #endif
  71. #ifndef BUTTON6_PRESS
  72. #define BUTTON6_PRESS BUTTON_ACTION_NONE
  73. #endif
  74. #ifndef BUTTON7_PRESS
  75. #define BUTTON7_PRESS BUTTON_ACTION_NONE
  76. #endif
  77. #ifndef BUTTON8_PRESS
  78. #define BUTTON8_PRESS BUTTON_ACTION_NONE
  79. #endif
  80. #ifndef BUTTON1_RELEASE
  81. #define BUTTON1_RELEASE BUTTON_ACTION_NONE
  82. #endif
  83. #ifndef BUTTON2_RELEASE
  84. #define BUTTON2_RELEASE BUTTON_ACTION_NONE
  85. #endif
  86. #ifndef BUTTON3_RELEASE
  87. #define BUTTON3_RELEASE BUTTON_ACTION_NONE
  88. #endif
  89. #ifndef BUTTON4_RELEASE
  90. #define BUTTON4_RELEASE BUTTON_ACTION_NONE
  91. #endif
  92. #ifndef BUTTON5_RELEASE
  93. #define BUTTON5_RELEASE BUTTON_ACTION_NONE
  94. #endif
  95. #ifndef BUTTON6_RELEASE
  96. #define BUTTON6_RELEASE BUTTON_ACTION_NONE
  97. #endif
  98. #ifndef BUTTON7_RELEASE
  99. #define BUTTON7_RELEASE BUTTON_ACTION_NONE
  100. #endif
  101. #ifndef BUTTON8_RELEASE
  102. #define BUTTON8_RELEASE BUTTON_ACTION_NONE
  103. #endif
  104. #ifndef BUTTON1_CLICK
  105. #define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  106. #endif
  107. #ifndef BUTTON2_CLICK
  108. #define BUTTON2_CLICK BUTTON_ACTION_TOGGLE
  109. #endif
  110. #ifndef BUTTON3_CLICK
  111. #define BUTTON3_CLICK BUTTON_ACTION_TOGGLE
  112. #endif
  113. #ifndef BUTTON4_CLICK
  114. #define BUTTON4_CLICK BUTTON_ACTION_TOGGLE
  115. #endif
  116. #ifndef BUTTON5_CLICK
  117. #define BUTTON5_CLICK BUTTON_ACTION_TOGGLE
  118. #endif
  119. #ifndef BUTTON6_CLICK
  120. #define BUTTON6_CLICK BUTTON_ACTION_TOGGLE
  121. #endif
  122. #ifndef BUTTON7_CLICK
  123. #define BUTTON7_CLICK BUTTON_ACTION_TOGGLE
  124. #endif
  125. #ifndef BUTTON8_CLICK
  126. #define BUTTON8_CLICK BUTTON_ACTION_TOGGLE
  127. #endif
  128. #ifndef BUTTON1_DBLCLICK
  129. #define BUTTON1_DBLCLICK BUTTON_ACTION_AP
  130. #endif
  131. #ifndef BUTTON2_DBLCLICK
  132. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  133. #endif
  134. #ifndef BUTTON3_DBLCLICK
  135. #define BUTTON3_DBLCLICK BUTTON_ACTION_NONE
  136. #endif
  137. #ifndef BUTTON4_DBLCLICK
  138. #define BUTTON4_DBLCLICK BUTTON_ACTION_NONE
  139. #endif
  140. #ifndef BUTTON5_DBLCLICK
  141. #define BUTTON5_DBLCLICK BUTTON_ACTION_NONE
  142. #endif
  143. #ifndef BUTTON6_DBLCLICK
  144. #define BUTTON6_DBLCLICK BUTTON_ACTION_NONE
  145. #endif
  146. #ifndef BUTTON7_DBLCLICK
  147. #define BUTTON7_DBLCLICK BUTTON_ACTION_NONE
  148. #endif
  149. #ifndef BUTTON8_DBLCLICK
  150. #define BUTTON8_DBLCLICK BUTTON_ACTION_NONE
  151. #endif
  152. #ifndef BUTTON1_TRIPLECLICK
  153. #define BUTTON1_TRIPLECLICK BUTTON_ACTION_SMART_CONFIG
  154. #endif
  155. #ifndef BUTTON2_TRIPLECLICK
  156. #define BUTTON2_TRIPLECLICK BUTTON_ACTION_NONE
  157. #endif
  158. #ifndef BUTTON3_TRIPLECLICK
  159. #define BUTTON3_TRIPLECLICK BUTTON_ACTION_NONE
  160. #endif
  161. #ifndef BUTTON4_TRIPLECLICK
  162. #define BUTTON4_TRIPLECLICK BUTTON_ACTION_NONE
  163. #endif
  164. #ifndef BUTTON5_TRIPLECLICK
  165. #define BUTTON5_TRIPLECLICK BUTTON_ACTION_NONE
  166. #endif
  167. #ifndef BUTTON6_TRIPLECLICK
  168. #define BUTTON6_TRIPLECLICK BUTTON_ACTION_NONE
  169. #endif
  170. #ifndef BUTTON7_TRIPLECLICK
  171. #define BUTTON7_TRIPLECLICK BUTTON_ACTION_NONE
  172. #endif
  173. #ifndef BUTTON8_TRIPLECLICK
  174. #define BUTTON8_TRIPLECLICK BUTTON_ACTION_NONE
  175. #endif
  176. #ifndef BUTTON1_LNGCLICK
  177. #define BUTTON1_LNGCLICK BUTTON_ACTION_RESET
  178. #endif
  179. #ifndef BUTTON2_LNGCLICK
  180. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  181. #endif
  182. #ifndef BUTTON3_LNGCLICK
  183. #define BUTTON3_LNGCLICK BUTTON_ACTION_NONE
  184. #endif
  185. #ifndef BUTTON4_LNGCLICK
  186. #define BUTTON4_LNGCLICK BUTTON_ACTION_NONE
  187. #endif
  188. #ifndef BUTTON5_LNGCLICK
  189. #define BUTTON5_LNGCLICK BUTTON_ACTION_NONE
  190. #endif
  191. #ifndef BUTTON6_LNGCLICK
  192. #define BUTTON6_LNGCLICK BUTTON_ACTION_NONE
  193. #endif
  194. #ifndef BUTTON7_LNGCLICK
  195. #define BUTTON7_LNGCLICK BUTTON_ACTION_NONE
  196. #endif
  197. #ifndef BUTTON8_LNGCLICK
  198. #define BUTTON8_LNGCLICK BUTTON_ACTION_NONE
  199. #endif
  200. #ifndef BUTTON1_LNGLNGCLICK
  201. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_FACTORY
  202. #endif
  203. #ifndef BUTTON2_LNGLNGCLICK
  204. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_NONE
  205. #endif
  206. #ifndef BUTTON3_LNGLNGCLICK
  207. #define BUTTON3_LNGLNGCLICK BUTTON_ACTION_NONE
  208. #endif
  209. #ifndef BUTTON4_LNGLNGCLICK
  210. #define BUTTON4_LNGLNGCLICK BUTTON_ACTION_NONE
  211. #endif
  212. #ifndef BUTTON5_LNGLNGCLICK
  213. #define BUTTON5_LNGLNGCLICK BUTTON_ACTION_NONE
  214. #endif
  215. #ifndef BUTTON6_LNGLNGCLICK
  216. #define BUTTON6_LNGLNGCLICK BUTTON_ACTION_NONE
  217. #endif
  218. #ifndef BUTTON7_LNGLNGCLICK
  219. #define BUTTON7_LNGLNGCLICK BUTTON_ACTION_NONE
  220. #endif
  221. #ifndef BUTTON8_LNGLNGCLICK
  222. #define BUTTON8_LNGLNGCLICK BUTTON_ACTION_NONE
  223. #endif
  224. #ifndef BUTTON1_RELAY
  225. #define BUTTON1_RELAY RELAY_NONE
  226. #endif
  227. #ifndef BUTTON2_RELAY
  228. #define BUTTON2_RELAY RELAY_NONE
  229. #endif
  230. #ifndef BUTTON3_RELAY
  231. #define BUTTON3_RELAY RELAY_NONE
  232. #endif
  233. #ifndef BUTTON4_RELAY
  234. #define BUTTON4_RELAY RELAY_NONE
  235. #endif
  236. #ifndef BUTTON5_RELAY
  237. #define BUTTON5_RELAY RELAY_NONE
  238. #endif
  239. #ifndef BUTTON6_RELAY
  240. #define BUTTON6_RELAY RELAY_NONE
  241. #endif
  242. #ifndef BUTTON7_RELAY
  243. #define BUTTON7_RELAY RELAY_NONE
  244. #endif
  245. #ifndef BUTTON8_RELAY
  246. #define BUTTON8_RELAY RELAY_NONE
  247. #endif
  248. #ifndef BUTTON1_DEBOUNCE_DELAY
  249. #define BUTTON1_DEBOUNCE_DELAY BUTTON_DEBOUNCE_DELAY
  250. #endif
  251. #ifndef BUTTON2_DEBOUNCE_DELAY
  252. #define BUTTON2_DEBOUNCE_DELAY BUTTON_DEBOUNCE_DELAY
  253. #endif
  254. #ifndef BUTTON3_DEBOUNCE_DELAY
  255. #define BUTTON3_DEBOUNCE_DELAY BUTTON_DEBOUNCE_DELAY
  256. #endif
  257. #ifndef BUTTON4_DEBOUNCE_DELAY
  258. #define BUTTON4_DEBOUNCE_DELAY BUTTON_DEBOUNCE_DELAY
  259. #endif
  260. #ifndef BUTTON5_DEBOUNCE_DELAY
  261. #define BUTTON5_DEBOUNCE_DELAY BUTTON_DEBOUNCE_DELAY
  262. #endif
  263. #ifndef BUTTON6_DEBOUNCE_DELAY
  264. #define BUTTON6_DEBOUNCE_DELAY BUTTON_DEBOUNCE_DELAY
  265. #endif
  266. #ifndef BUTTON7_DEBOUNCE_DELAY
  267. #define BUTTON7_DEBOUNCE_DELAY BUTTON_DEBOUNCE_DELAY
  268. #endif
  269. #ifndef BUTTON8_DEBOUNCE_DELAY
  270. #define BUTTON8_DEBOUNCE_DELAY BUTTON_DEBOUNCE_DELAY
  271. #endif
  272. #ifndef BUTTON1_REPEAT_DELAY
  273. #define BUTTON1_REPEAT_DELAY BUTTON_REPEAT_DELAY
  274. #endif
  275. #ifndef BUTTON2_REPEAT_DELAY
  276. #define BUTTON2_REPEAT_DELAY BUTTON_REPEAT_DELAY
  277. #endif
  278. #ifndef BUTTON3_REPEAT_DELAY
  279. #define BUTTON3_REPEAT_DELAY BUTTON_REPEAT_DELAY
  280. #endif
  281. #ifndef BUTTON4_REPEAT_DELAY
  282. #define BUTTON4_REPEAT_DELAY BUTTON_REPEAT_DELAY
  283. #endif
  284. #ifndef BUTTON5_REPEAT_DELAY
  285. #define BUTTON5_REPEAT_DELAY BUTTON_REPEAT_DELAY
  286. #endif
  287. #ifndef BUTTON6_REPEAT_DELAY
  288. #define BUTTON6_REPEAT_DELAY BUTTON_REPEAT_DELAY
  289. #endif
  290. #ifndef BUTTON7_REPEAT_DELAY
  291. #define BUTTON7_REPEAT_DELAY BUTTON_REPEAT_DELAY
  292. #endif
  293. #ifndef BUTTON8_REPEAT_DELAY
  294. #define BUTTON8_REPEAT_DELAY BUTTON_REPEAT_DELAY
  295. #endif
  296. #ifndef BUTTON1_LNGCLICK_DELAY
  297. #define BUTTON1_LNGCLICK_DELAY BUTTON_LNGCLICK_DELAY
  298. #endif
  299. #ifndef BUTTON2_LNGCLICK_DELAY
  300. #define BUTTON2_LNGCLICK_DELAY BUTTON_LNGCLICK_DELAY
  301. #endif
  302. #ifndef BUTTON3_LNGCLICK_DELAY
  303. #define BUTTON3_LNGCLICK_DELAY BUTTON_LNGCLICK_DELAY
  304. #endif
  305. #ifndef BUTTON4_LNGCLICK_DELAY
  306. #define BUTTON4_LNGCLICK_DELAY BUTTON_LNGCLICK_DELAY
  307. #endif
  308. #ifndef BUTTON5_LNGCLICK_DELAY
  309. #define BUTTON5_LNGCLICK_DELAY BUTTON_LNGCLICK_DELAY
  310. #endif
  311. #ifndef BUTTON6_LNGCLICK_DELAY
  312. #define BUTTON6_LNGCLICK_DELAY BUTTON_LNGCLICK_DELAY
  313. #endif
  314. #ifndef BUTTON7_LNGCLICK_DELAY
  315. #define BUTTON7_LNGCLICK_DELAY BUTTON_LNGCLICK_DELAY
  316. #endif
  317. #ifndef BUTTON8_LNGCLICK_DELAY
  318. #define BUTTON8_LNGCLICK_DELAY BUTTON_LNGCLICK_DELAY
  319. #endif
  320. #ifndef BUTTON1_LNGLNGCLICK_DELAY
  321. #define BUTTON1_LNGLNGCLICK_DELAY BUTTON_LNGLNGCLICK_DELAY
  322. #endif
  323. #ifndef BUTTON2_LNGLNGCLICK_DELAY
  324. #define BUTTON2_LNGLNGCLICK_DELAY BUTTON_LNGLNGCLICK_DELAY
  325. #endif
  326. #ifndef BUTTON3_LNGLNGCLICK_DELAY
  327. #define BUTTON3_LNGLNGCLICK_DELAY BUTTON_LNGLNGCLICK_DELAY
  328. #endif
  329. #ifndef BUTTON4_LNGLNGCLICK_DELAY
  330. #define BUTTON4_LNGLNGCLICK_DELAY BUTTON_LNGLNGCLICK_DELAY
  331. #endif
  332. #ifndef BUTTON5_LNGLNGCLICK_DELAY
  333. #define BUTTON5_LNGLNGCLICK_DELAY BUTTON_LNGLNGCLICK_DELAY
  334. #endif
  335. #ifndef BUTTON6_LNGLNGCLICK_DELAY
  336. #define BUTTON6_LNGLNGCLICK_DELAY BUTTON_LNGLNGCLICK_DELAY
  337. #endif
  338. #ifndef BUTTON7_LNGLNGCLICK_DELAY
  339. #define BUTTON7_LNGLNGCLICK_DELAY BUTTON_LNGLNGCLICK_DELAY
  340. #endif
  341. #ifndef BUTTON8_LNGLNGCLICK_DELAY
  342. #define BUTTON8_LNGLNGCLICK_DELAY BUTTON_LNGLNGCLICK_DELAY
  343. #endif
  344. #ifndef BUTTON1_MQTT_SEND_ALL_EVENTS
  345. #define BUTTON1_MQTT_SEND_ALL_EVENTS BUTTON_MQTT_SEND_ALL_EVENTS
  346. #endif
  347. #ifndef BUTTON2_MQTT_SEND_ALL_EVENTS
  348. #define BUTTON2_MQTT_SEND_ALL_EVENTS BUTTON_MQTT_SEND_ALL_EVENTS
  349. #endif
  350. #ifndef BUTTON3_MQTT_SEND_ALL_EVENTS
  351. #define BUTTON3_MQTT_SEND_ALL_EVENTS BUTTON_MQTT_SEND_ALL_EVENTS
  352. #endif
  353. #ifndef BUTTON4_MQTT_SEND_ALL_EVENTS
  354. #define BUTTON4_MQTT_SEND_ALL_EVENTS BUTTON_MQTT_SEND_ALL_EVENTS
  355. #endif
  356. #ifndef BUTTON5_MQTT_SEND_ALL_EVENTS
  357. #define BUTTON5_MQTT_SEND_ALL_EVENTS BUTTON_MQTT_SEND_ALL_EVENTS
  358. #endif
  359. #ifndef BUTTON6_MQTT_SEND_ALL_EVENTS
  360. #define BUTTON6_MQTT_SEND_ALL_EVENTS BUTTON_MQTT_SEND_ALL_EVENTS
  361. #endif
  362. #ifndef BUTTON7_MQTT_SEND_ALL_EVENTS
  363. #define BUTTON7_MQTT_SEND_ALL_EVENTS BUTTON_MQTT_SEND_ALL_EVENTS
  364. #endif
  365. #ifndef BUTTON8_MQTT_SEND_ALL_EVENTS
  366. #define BUTTON8_MQTT_SEND_ALL_EVENTS BUTTON_MQTT_SEND_ALL_EVENTS
  367. #endif
  368. #ifndef BUTTON1_MQTT_RETAIN
  369. #define BUTTON1_MQTT_RETAIN BUTTON_MQTT_RETAIN
  370. #endif
  371. #ifndef BUTTON2_MQTT_RETAIN
  372. #define BUTTON2_MQTT_RETAIN BUTTON_MQTT_RETAIN
  373. #endif
  374. #ifndef BUTTON3_MQTT_RETAIN
  375. #define BUTTON3_MQTT_RETAIN BUTTON_MQTT_RETAIN
  376. #endif
  377. #ifndef BUTTON4_MQTT_RETAIN
  378. #define BUTTON4_MQTT_RETAIN BUTTON_MQTT_RETAIN
  379. #endif
  380. #ifndef BUTTON5_MQTT_RETAIN
  381. #define BUTTON5_MQTT_RETAIN BUTTON_MQTT_RETAIN
  382. #endif
  383. #ifndef BUTTON6_MQTT_RETAIN
  384. #define BUTTON6_MQTT_RETAIN BUTTON_MQTT_RETAIN
  385. #endif
  386. #ifndef BUTTON7_MQTT_RETAIN
  387. #define BUTTON7_MQTT_RETAIN BUTTON_MQTT_RETAIN
  388. #endif
  389. #ifndef BUTTON8_MQTT_RETAIN
  390. #define BUTTON8_MQTT_RETAIN BUTTON_MQTT_RETAIN
  391. #endif
  392. #ifndef BUTTON1_PROVIDER
  393. #define BUTTON1_PROVIDER BUTTON_PROVIDER_GENERIC
  394. #endif
  395. #ifndef BUTTON2_PROVIDER
  396. #define BUTTON2_PROVIDER BUTTON_PROVIDER_GENERIC
  397. #endif
  398. #ifndef BUTTON3_PROVIDER
  399. #define BUTTON3_PROVIDER BUTTON_PROVIDER_GENERIC
  400. #endif
  401. #ifndef BUTTON4_PROVIDER
  402. #define BUTTON4_PROVIDER BUTTON_PROVIDER_GENERIC
  403. #endif
  404. #ifndef BUTTON5_PROVIDER
  405. #define BUTTON5_PROVIDER BUTTON_PROVIDER_GENERIC
  406. #endif
  407. #ifndef BUTTON6_PROVIDER
  408. #define BUTTON6_PROVIDER BUTTON_PROVIDER_GENERIC
  409. #endif
  410. #ifndef BUTTON7_PROVIDER
  411. #define BUTTON7_PROVIDER BUTTON_PROVIDER_GENERIC
  412. #endif
  413. #ifndef BUTTON8_PROVIDER
  414. #define BUTTON8_PROVIDER BUTTON_PROVIDER_GENERIC
  415. #endif
  416. #ifndef BUTTON1_ANALOG_LEVEL
  417. #define BUTTON1_ANALOG_LEVEL 0
  418. #endif
  419. #ifndef BUTTON2_ANALOG_LEVEL
  420. #define BUTTON2_ANALOG_LEVEL 0
  421. #endif
  422. #ifndef BUTTON3_ANALOG_LEVEL
  423. #define BUTTON3_ANALOG_LEVEL 0
  424. #endif
  425. #ifndef BUTTON4_ANALOG_LEVEL
  426. #define BUTTON4_ANALOG_LEVEL 0
  427. #endif
  428. #ifndef BUTTON5_ANALOG_LEVEL
  429. #define BUTTON5_ANALOG_LEVEL 0
  430. #endif
  431. #ifndef BUTTON6_ANALOG_LEVEL
  432. #define BUTTON6_ANALOG_LEVEL 0
  433. #endif
  434. #ifndef BUTTON7_ANALOG_LEVEL
  435. #define BUTTON7_ANALOG_LEVEL 0
  436. #endif
  437. #ifndef BUTTON8_ANALOG_LEVEL
  438. #define BUTTON8_ANALOG_LEVEL 0
  439. #endif
  440. // -----------------------------------------------------------------------------
  441. // Encoders
  442. // -----------------------------------------------------------------------------
  443. #ifndef ENCODER1_PIN1
  444. #define ENCODER1_PIN1 GPIO_NONE
  445. #endif
  446. #ifndef ENCODER2_PIN1
  447. #define ENCODER2_PIN1 GPIO_NONE
  448. #endif
  449. #ifndef ENCODER3_PIN1
  450. #define ENCODER3_PIN1 GPIO_NONE
  451. #endif
  452. #ifndef ENCODER4_PIN1
  453. #define ENCODER4_PIN1 GPIO_NONE
  454. #endif
  455. #ifndef ENCODER5_PIN1
  456. #define ENCODER5_PIN1 GPIO_NONE
  457. #endif
  458. #ifndef ENCODER1_PIN2
  459. #define ENCODER1_PIN2 GPIO_NONE
  460. #endif
  461. #ifndef ENCODER2_PIN2
  462. #define ENCODER2_PIN2 GPIO_NONE
  463. #endif
  464. #ifndef ENCODER3_PIN2
  465. #define ENCODER3_PIN2 GPIO_NONE
  466. #endif
  467. #ifndef ENCODER4_PIN2
  468. #define ENCODER4_PIN2 GPIO_NONE
  469. #endif
  470. #ifndef ENCODER5_PIN2
  471. #define ENCODER5_PIN2 GPIO_NONE
  472. #endif
  473. #ifndef ENCODER1_BUTTON_PIN
  474. #define ENCODER1_BUTTON_PIN GPIO_NONE
  475. #endif
  476. #ifndef ENCODER2_BUTTON_PIN
  477. #define ENCODER2_BUTTON_PIN GPIO_NONE
  478. #endif
  479. #ifndef ENCODER3_BUTTON_PIN
  480. #define ENCODER3_BUTTON_PIN GPIO_NONE
  481. #endif
  482. #ifndef ENCODER4_BUTTON_PIN
  483. #define ENCODER4_BUTTON_PIN GPIO_NONE
  484. #endif
  485. #ifndef ENCODER5_BUTTON_PIN
  486. #define ENCODER5_BUTTON_PIN GPIO_NONE
  487. #endif
  488. #ifndef ENCODER1_BUTTON_LOGIC
  489. #define ENCODER1_BUTTON_LOGIC HIGH
  490. #endif
  491. #ifndef ENCODER2_BUTTON_LOGIC
  492. #define ENCODER2_BUTTON_LOGIC HIGH
  493. #endif
  494. #ifndef ENCODER3_BUTTON_LOGIC
  495. #define ENCODER3_BUTTON_LOGIC HIGH
  496. #endif
  497. #ifndef ENCODER4_BUTTON_LOGIC
  498. #define ENCODER4_BUTTON_LOGIC HIGH
  499. #endif
  500. #ifndef ENCODER5_BUTTON_LOGIC
  501. #define ENCODER5_BUTTON_LOGIC HIGH
  502. #endif
  503. #ifndef ENCODER1_BUTTON_MODE
  504. #define ENCODER1_BUTTON_MODE INPUT_PULLUP
  505. #endif
  506. #ifndef ENCODER2_BUTTON_MODE
  507. #define ENCODER2_BUTTON_MODE INPUT_PULLUP
  508. #endif
  509. #ifndef ENCODER3_BUTTON_MODE
  510. #define ENCODER3_BUTTON_MODE INPUT_PULLUP
  511. #endif
  512. #ifndef ENCODER4_BUTTON_MODE
  513. #define ENCODER4_BUTTON_MODE INPUT_PULLUP
  514. #endif
  515. #ifndef ENCODER5_BUTTON_MODE
  516. #define ENCODER5_BUTTON_MODE INPUT_PULLUP
  517. #endif
  518. #ifndef ENCODER1_MODE
  519. #define ENCODER1_MODE 1
  520. #endif
  521. #ifndef ENCODER2_MODE
  522. #define ENCODER2_MODE 1
  523. #endif
  524. #ifndef ENCODER3_MODE
  525. #define ENCODER3_MODE 1
  526. #endif
  527. #ifndef ENCODER4_MODE
  528. #define ENCODER4_MODE 1
  529. #endif
  530. #ifndef ENCODER5_MODE
  531. #define ENCODER5_MODE 1
  532. #endif
  533. #ifndef ENCODER1_CHANNEL1
  534. #define ENCODER1_CHANNEL1 0
  535. #endif
  536. #ifndef ENCODER2_CHANNEL1
  537. #define ENCODER2_CHANNEL1 0
  538. #endif
  539. #ifndef ENCODER3_CHANNEL1
  540. #define ENCODER3_CHANNEL1 0
  541. #endif
  542. #ifndef ENCODER4_CHANNEL1
  543. #define ENCODER4_CHANNEL1 0
  544. #endif
  545. #ifndef ENCODER5_CHANNEL1
  546. #define ENCODER5_CHANNEL1 0
  547. #endif
  548. #ifndef ENCODER1_CHANNEL2
  549. #define ENCODER1_CHANNEL2 1
  550. #endif
  551. #ifndef ENCODER2_CHANNEL2
  552. #define ENCODER2_CHANNEL2 1
  553. #endif
  554. #ifndef ENCODER3_CHANNEL2
  555. #define ENCODER3_CHANNEL2 1
  556. #endif
  557. #ifndef ENCODER4_CHANNEL2
  558. #define ENCODER4_CHANNEL2 1
  559. #endif
  560. #ifndef ENCODER5_CHANNEL2
  561. #define ENCODER5_CHANNEL2 1
  562. #endif
  563. // -----------------------------------------------------------------------------
  564. // Relays
  565. // -----------------------------------------------------------------------------
  566. #ifndef DUMMY_RELAY_COUNT
  567. #define DUMMY_RELAY_COUNT 0
  568. #endif
  569. #ifndef RELAY1_PIN
  570. #define RELAY1_PIN GPIO_NONE
  571. #endif
  572. #ifndef RELAY2_PIN
  573. #define RELAY2_PIN GPIO_NONE
  574. #endif
  575. #ifndef RELAY3_PIN
  576. #define RELAY3_PIN GPIO_NONE
  577. #endif
  578. #ifndef RELAY4_PIN
  579. #define RELAY4_PIN GPIO_NONE
  580. #endif
  581. #ifndef RELAY5_PIN
  582. #define RELAY5_PIN GPIO_NONE
  583. #endif
  584. #ifndef RELAY6_PIN
  585. #define RELAY6_PIN GPIO_NONE
  586. #endif
  587. #ifndef RELAY7_PIN
  588. #define RELAY7_PIN GPIO_NONE
  589. #endif
  590. #ifndef RELAY8_PIN
  591. #define RELAY8_PIN GPIO_NONE
  592. #endif
  593. #ifndef RELAY1_TYPE
  594. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  595. #endif
  596. #ifndef RELAY2_TYPE
  597. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  598. #endif
  599. #ifndef RELAY3_TYPE
  600. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  601. #endif
  602. #ifndef RELAY4_TYPE
  603. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  604. #endif
  605. #ifndef RELAY5_TYPE
  606. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  607. #endif
  608. #ifndef RELAY6_TYPE
  609. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  610. #endif
  611. #ifndef RELAY7_TYPE
  612. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  613. #endif
  614. #ifndef RELAY8_TYPE
  615. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  616. #endif
  617. #ifndef RELAY1_RESET_PIN
  618. #define RELAY1_RESET_PIN GPIO_NONE
  619. #endif
  620. #ifndef RELAY2_RESET_PIN
  621. #define RELAY2_RESET_PIN GPIO_NONE
  622. #endif
  623. #ifndef RELAY3_RESET_PIN
  624. #define RELAY3_RESET_PIN GPIO_NONE
  625. #endif
  626. #ifndef RELAY4_RESET_PIN
  627. #define RELAY4_RESET_PIN GPIO_NONE
  628. #endif
  629. #ifndef RELAY5_RESET_PIN
  630. #define RELAY5_RESET_PIN GPIO_NONE
  631. #endif
  632. #ifndef RELAY6_RESET_PIN
  633. #define RELAY6_RESET_PIN GPIO_NONE
  634. #endif
  635. #ifndef RELAY7_RESET_PIN
  636. #define RELAY7_RESET_PIN GPIO_NONE
  637. #endif
  638. #ifndef RELAY8_RESET_PIN
  639. #define RELAY8_RESET_PIN GPIO_NONE
  640. #endif
  641. #ifndef RELAY1_DELAY_ON
  642. #define RELAY1_DELAY_ON 0
  643. #endif
  644. #ifndef RELAY2_DELAY_ON
  645. #define RELAY2_DELAY_ON 0
  646. #endif
  647. #ifndef RELAY3_DELAY_ON
  648. #define RELAY3_DELAY_ON 0
  649. #endif
  650. #ifndef RELAY4_DELAY_ON
  651. #define RELAY4_DELAY_ON 0
  652. #endif
  653. #ifndef RELAY5_DELAY_ON
  654. #define RELAY5_DELAY_ON 0
  655. #endif
  656. #ifndef RELAY6_DELAY_ON
  657. #define RELAY6_DELAY_ON 0
  658. #endif
  659. #ifndef RELAY7_DELAY_ON
  660. #define RELAY7_DELAY_ON 0
  661. #endif
  662. #ifndef RELAY8_DELAY_ON
  663. #define RELAY8_DELAY_ON 0
  664. #endif
  665. #ifndef RELAY1_DELAY_OFF
  666. #define RELAY1_DELAY_OFF 0
  667. #endif
  668. #ifndef RELAY2_DELAY_OFF
  669. #define RELAY2_DELAY_OFF 0
  670. #endif
  671. #ifndef RELAY3_DELAY_OFF
  672. #define RELAY3_DELAY_OFF 0
  673. #endif
  674. #ifndef RELAY4_DELAY_OFF
  675. #define RELAY4_DELAY_OFF 0
  676. #endif
  677. #ifndef RELAY5_DELAY_OFF
  678. #define RELAY5_DELAY_OFF 0
  679. #endif
  680. #ifndef RELAY6_DELAY_OFF
  681. #define RELAY6_DELAY_OFF 0
  682. #endif
  683. #ifndef RELAY7_DELAY_OFF
  684. #define RELAY7_DELAY_OFF 0
  685. #endif
  686. #ifndef RELAY8_DELAY_OFF
  687. #define RELAY8_DELAY_OFF 0
  688. #endif
  689. #ifndef RELAY_DELAY_INTERLOCK
  690. #define RELAY_DELAY_INTERLOCK 0
  691. #endif
  692. // -----------------------------------------------------------------------------
  693. // LEDs
  694. // -----------------------------------------------------------------------------
  695. #ifndef LED1_PIN
  696. #define LED1_PIN GPIO_NONE
  697. #endif
  698. #ifndef LED2_PIN
  699. #define LED2_PIN GPIO_NONE
  700. #endif
  701. #ifndef LED3_PIN
  702. #define LED3_PIN GPIO_NONE
  703. #endif
  704. #ifndef LED4_PIN
  705. #define LED4_PIN GPIO_NONE
  706. #endif
  707. #ifndef LED5_PIN
  708. #define LED5_PIN GPIO_NONE
  709. #endif
  710. #ifndef LED6_PIN
  711. #define LED6_PIN GPIO_NONE
  712. #endif
  713. #ifndef LED7_PIN
  714. #define LED7_PIN GPIO_NONE
  715. #endif
  716. #ifndef LED8_PIN
  717. #define LED8_PIN GPIO_NONE
  718. #endif
  719. #ifndef LED1_MODE
  720. #define LED1_MODE LED_MODE_WIFI
  721. #endif
  722. #ifndef LED2_MODE
  723. #define LED2_MODE LED_MODE_MANUAL
  724. #endif
  725. #ifndef LED3_MODE
  726. #define LED3_MODE LED_MODE_MANUAL
  727. #endif
  728. #ifndef LED4_MODE
  729. #define LED4_MODE LED_MODE_MANUAL
  730. #endif
  731. #ifndef LED5_MODE
  732. #define LED5_MODE LED_MODE_MANUAL
  733. #endif
  734. #ifndef LED6_MODE
  735. #define LED6_MODE LED_MODE_MANUAL
  736. #endif
  737. #ifndef LED7_MODE
  738. #define LED7_MODE LED_MODE_MANUAL
  739. #endif
  740. #ifndef LED8_MODE
  741. #define LED8_MODE LED_MODE_MANUAL
  742. #endif
  743. #ifndef LED1_RELAY
  744. #define LED1_RELAY 1
  745. #endif
  746. #ifndef LED2_RELAY
  747. #define LED2_RELAY 2
  748. #endif
  749. #ifndef LED3_RELAY
  750. #define LED3_RELAY 3
  751. #endif
  752. #ifndef LED4_RELAY
  753. #define LED4_RELAY 4
  754. #endif
  755. #ifndef LED5_RELAY
  756. #define LED5_RELAY 5
  757. #endif
  758. #ifndef LED6_RELAY
  759. #define LED6_RELAY 6
  760. #endif
  761. #ifndef LED7_RELAY
  762. #define LED7_RELAY 7
  763. #endif
  764. #ifndef LED8_RELAY
  765. #define LED8_RELAY 8
  766. #endif
  767. #ifndef LED1_PIN_INVERSE
  768. #define LED1_PIN_INVERSE 0
  769. #endif
  770. #ifndef LED2_PIN_INVERSE
  771. #define LED2_PIN_INVERSE 0
  772. #endif
  773. #ifndef LED3_PIN_INVERSE
  774. #define LED3_PIN_INVERSE 0
  775. #endif
  776. #ifndef LED4_PIN_INVERSE
  777. #define LED4_PIN_INVERSE 0
  778. #endif
  779. #ifndef LED5_PIN_INVERSE
  780. #define LED5_PIN_INVERSE 0
  781. #endif
  782. #ifndef LED6_PIN_INVERSE
  783. #define LED6_PIN_INVERSE 0
  784. #endif
  785. #ifndef LED7_PIN_INVERSE
  786. #define LED7_PIN_INVERSE 0
  787. #endif
  788. #ifndef LED8_PIN_INVERSE
  789. #define LED8_PIN_INVERSE 0
  790. #endif
  791. // -----------------------------------------------------------------------------
  792. // Lights
  793. // -----------------------------------------------------------------------------
  794. #ifndef LIGHT_CHANNELS
  795. #define LIGHT_CHANNELS 0
  796. #endif
  797. #ifndef LIGHT_ENABLE_PIN
  798. #define LIGHT_ENABLE_PIN GPIO_NONE
  799. #endif
  800. #ifndef LIGHT_CH1_PIN
  801. #define LIGHT_CH1_PIN GPIO_NONE
  802. #endif
  803. #ifndef LIGHT_CH2_PIN
  804. #define LIGHT_CH2_PIN GPIO_NONE
  805. #endif
  806. #ifndef LIGHT_CH3_PIN
  807. #define LIGHT_CH3_PIN GPIO_NONE
  808. #endif
  809. #ifndef LIGHT_CH4_PIN
  810. #define LIGHT_CH4_PIN GPIO_NONE
  811. #endif
  812. #ifndef LIGHT_CH5_PIN
  813. #define LIGHT_CH5_PIN GPIO_NONE
  814. #endif
  815. #ifndef LIGHT_CH1_INVERSE
  816. #define LIGHT_CH1_INVERSE 0
  817. #endif
  818. #ifndef LIGHT_CH2_INVERSE
  819. #define LIGHT_CH2_INVERSE 0
  820. #endif
  821. #ifndef LIGHT_CH3_INVERSE
  822. #define LIGHT_CH3_INVERSE 0
  823. #endif
  824. #ifndef LIGHT_CH4_INVERSE
  825. #define LIGHT_CH4_INVERSE 0
  826. #endif
  827. #ifndef LIGHT_CH5_INVERSE
  828. #define LIGHT_CH5_INVERSE 0
  829. #endif
  830. // -----------------------------------------------------------------------------
  831. // General
  832. // -----------------------------------------------------------------------------
  833. // Device name (DNS, SoftAP SSID, ALEXA etc.)
  834. // If empty, default will be ESPURNA-XXXXXX, where XXXXXX is last 3 octets of chipID
  835. // When set, must be 1..31 characters. See:
  836. // https://github.com/xoseperez/espurna/issues/921
  837. // https://github.com/xoseperez/espurna/issues/1151
  838. #ifndef HOSTNAME
  839. #define HOSTNAME ""
  840. #endif
  841. // Relay providers
  842. #ifndef RELAY_PROVIDER
  843. #define RELAY_PROVIDER RELAY_PROVIDER_RELAY
  844. #endif
  845. // Light provider
  846. #ifndef LIGHT_PROVIDER
  847. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  848. #endif