DIY fertilizer mixer and plant watering machine https://www.xythobuz.de/giessomat.html
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

config_pins.h 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /*
  2. * Copyright (c) 2021 Thomas Buck <thomas@xythobuz.de>
  3. *
  4. * This file is part of Giess-o-mat.
  5. *
  6. * Giess-o-mat is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Giess-o-mat is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Giess-o-mat. If not, see <https://www.gnu.org/licenses/>.
  18. */
  19. #ifndef _CONFIG_PINS_H_
  20. #define _CONFIG_PINS_H_
  21. // ----------------------------------------------------------------------------
  22. // ----------------------------------------------------------------------------
  23. #ifdef PLATFORM_AVR
  24. #define BUILTIN_LED_PIN 13
  25. // ----------------------------------------------------------------------------
  26. #ifdef FUNCTION_UI
  27. /*
  28. * AVR UI
  29. */
  30. #define SERIAL_LCD_TX_PIN 10
  31. #define KEYMATRIX_ROWS 4
  32. #define KEYMATRIX_COLS 3
  33. #define KEYMATRIX_ROW_PINS 5, 6, 7, 8
  34. #define KEYMATRIX_COL_PINS 2, 3, 4
  35. #endif // FUNCTION_UI
  36. // ----------------------------------------------------------------------------
  37. #ifdef FUNCTION_CONTROL
  38. /*
  39. * AVR Controller
  40. */
  41. #define I2C_GPIO_EXPANDER_COUNT 0
  42. //#define I2C_GPIO_EXPANDER_ADDR 0x20, 0x21
  43. // out 1, out 2, out 3, out 4, in
  44. #define VALVE_COUNT 5
  45. #define VALVE_PINS 10, 11, 12, 14, 15
  46. #define KICKSTART_PINS -1, -1, -1, -1
  47. // a, b, c
  48. #define PUMP_COUNT 3
  49. #define PUMP_PINS 16, 17, 18
  50. // bottom, top
  51. #define SWITCH_COUNT 2
  52. #define SWITCH_PINS 19, 20
  53. // stirrer
  54. #define STIRRER_COUNT 1
  55. #define LOCK_COUNT 0
  56. #define AUX_COUNT (STIRRER_COUNT + LOCK_COUNT)
  57. #define AUX_PINS 21
  58. #endif // FUNCTION_CONTROL
  59. #endif // PLATFORM_AVR
  60. // ----------------------------------------------------------------------------
  61. // ----------------------------------------------------------------------------
  62. #ifdef PLATFORM_ESP
  63. #define BUILTIN_LED_PIN 1
  64. // ----------------------------------------------------------------------------
  65. #ifdef FUNCTION_UI
  66. /*
  67. * ESP UI
  68. */
  69. #error configuration not supported
  70. #endif // FUNCTION_UI
  71. // ----------------------------------------------------------------------------
  72. #ifdef FUNCTION_CONTROL
  73. /*
  74. * ESP Controller
  75. */
  76. /*
  77. * I2C Port Expander PCF8574(A)
  78. *
  79. * Address ranges:
  80. * PCF8574: 0x20 - 0x27
  81. * PCF8574A: 0x38 - 0x3F
  82. */
  83. #define I2C_GPIO_EXPANDER_COUNT 2
  84. #define I2C_GPIO_EXPANDER_ADDR 0x20, 0x21
  85. /*
  86. * GPIO Numbering Scheme
  87. * 000 - 099: normal ESP32 GPIOs
  88. * 100 - 228: consecutive I2C Expander GPIOs
  89. */
  90. #define PLANT_COUNT 8
  91. #define PLANT_PINS 27, 14, 5, 18, 100, 101, 102, 103
  92. #define INLET_PIN 15
  93. // out 1, out 2, out 3, out 4, in
  94. #define VALVE_COUNT (PLANT_COUNT + 1)
  95. #define VALVE_PINS PLANT_PINS, INLET_PIN
  96. // kickstarting pumps, same count as plants!
  97. // set pin to -1 to disable kickstart for this plant.
  98. #define KICKSTART_PINS -1, -1, -1, -1, 108, 109, 110, 111
  99. // a, b, c
  100. #define PUMP_COUNT 3
  101. #define PUMP_PINS 2, 0, 4
  102. // stirrer, locks
  103. #define STIRRER_COUNT 1
  104. #define LOCK_COUNT 2
  105. #define AUX_COUNT (STIRRER_COUNT + LOCK_COUNT)
  106. #define AUX_PINS 19, 104, 105
  107. // bottom, top
  108. #define SWITCH_COUNT 2
  109. #define SWITCH_PINS 26, 25
  110. #define I2C_SDA_PIN 21
  111. #define I2C_SCL_PIN 22
  112. #endif // FUNCTION_CONTROL
  113. #endif // PLATFORM_ESP
  114. // ----------------------------------------------------------------------------
  115. // ----------------------------------------------------------------------------
  116. #endif // _CONFIG_PINS_H_