DIY fertilizer mixer and plant watering machine https://www.xythobuz.de/giessomat.html
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.

config_pins.h 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. // out 1, out 2, out 3, out 4, in
  42. #define VALVE_COUNT 5
  43. #define VALVE_PINS 10, 11, 12, 14, 15
  44. // a, b, c
  45. #define PUMP_COUNT 3
  46. #define PUMP_PINS 16, 17, 18
  47. // bottom, top
  48. #define SWITCH_COUNT 2
  49. #define SWITCH_PINS 19, 20
  50. // stirrer
  51. #define AUX_COUNT 1
  52. #define AUX_PINS 21
  53. #endif // FUNCTION_CONTROL
  54. #endif // PLATFORM_AVR
  55. // ----------------------------------------------------------------------------
  56. // ----------------------------------------------------------------------------
  57. #ifdef PLATFORM_ESP
  58. #define BUILTIN_LED_PIN 1
  59. // ----------------------------------------------------------------------------
  60. #ifdef FUNCTION_UI
  61. /*
  62. * ESP UI
  63. */
  64. #error configuration not supported
  65. #endif // FUNCTION_UI
  66. // ----------------------------------------------------------------------------
  67. #ifdef FUNCTION_CONTROL
  68. /*
  69. * ESP Controller
  70. */
  71. /*
  72. * I2C Port Expander PCF8574(A)
  73. *
  74. * Address ranges:
  75. * PCF8574: 0x20 - 0x27
  76. * PCF8574A: 0x38 - 0x3F
  77. */
  78. #define I2C_GPIO_EXPANDER_COUNT 1
  79. #define I2C_GPIO_EXPANDER_ADDR 0x20
  80. /*
  81. * GPIO Numbering Scheme
  82. * 000 - 099: normal ESP32 GPIOs
  83. * 100 - 228: consecutive I2C Expander GPIOs
  84. */
  85. #define PLANT_COUNT 8
  86. #define PLANT_PINS 27, 14, 5, 18, 100, 101, 102, 103
  87. #define INLET_PIN 15
  88. // out 1, out 2, out 3, out 4, in
  89. #define VALVE_COUNT (PLANT_COUNT + 1)
  90. #define VALVE_PINS PLANT_PINS, INLET_PIN
  91. // a, b, c
  92. #define PUMP_COUNT 3
  93. #define PUMP_PINS 2, 0, 4
  94. // stirrer
  95. #define AUX_COUNT 1
  96. #define AUX_PINS 19
  97. // bottom, top
  98. #define SWITCH_COUNT 2
  99. #define SWITCH_PINS 26, 25
  100. #define I2C_SDA_PIN 21
  101. #define I2C_SCL_PIN 22
  102. #endif // FUNCTION_CONTROL
  103. #endif // PLATFORM_ESP
  104. // ----------------------------------------------------------------------------
  105. // ----------------------------------------------------------------------------
  106. #endif // _CONFIG_PINS_H_