STIMA  3
i2c-rain-config.h
Go to the documentation of this file.
1 
3 /*********************************************************************
4 Copyright (C) 2017 Marco Baldinetti <m.baldinetti@digiteco.it>
5 authors:
6 Paolo patruno <p.patruno@iperbole.bologna.it>
7 Marco Baldinetti <m.baldinetti@digiteco.it>
8 
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of
12 the License, or (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 **********************************************************************/
22 
23 #ifndef _I2C_RAIN_CONFIG_H
24 #define _I2C_RAIN_CONFIG_H
25 
26 #include <sensors_config.h>
27 
28 /*********************************************************************
29 * MODULE
30 *********************************************************************/
35 #define MODULE_MAIN_VERSION (3)
36 
41 #define MODULE_MINOR_VERSION (18)
42 
47 #define MODULE_CONFIGURATION_VERSION (2)
48 
53 #define MODULE_TYPE (STIMA_MODULE_TYPE_RAIN)
54 
55 /*********************************************************************
56 * TIPPING BUCKET RAIN GAUGE
57 *********************************************************************/
62 #define TIPPING_BUCKET_PIN (2)
63 
64 
65 /*********************************************************************
66 * CONFIGURATION
67 *********************************************************************/
68 
73 #define CONFIGURATION_DEFAULT_TIPPING_BUCKET_TIME_MS (50)
74 
79 #define CONFIGURATION_DEFAULT_RAIN_FOR_TIP (1)
80 
85 #define CONFIGURATION_DEFAULT_IS_ONESHOT (true)
86 
91 #define CONFIGURATION_DEFAULT_IS_CONTINUOUS (false)
92 
97 #define CONFIGURATION_DEFAULT_I2C_ADDRESS (I2C_RAIN_DEFAULT_ADDRESS)
98 
103 #define CONFIGURATION_RESET_PIN (8)
104 #define SDCARD_CHIP_SELECT_PIN 7
109 
114 #define SPI_SPEED SD_SCK_MHZ(4)
115 
120 #define I2C_MAX_TIME (12)
121 
122 /*********************************************************************
123 * POWER DOWN
124 *********************************************************************/
129 #define USE_POWER_DOWN (true)
130 
135 #define DEBOUNCING_POWER_DOWN_TIME_MS (10)
136 
141 #define USE_TIMER_1 (true)
142 
143 /*********************************************************************
144 * WATCHDOG
145 *********************************************************************/
154 #define WDT_TIMER (WDTO_4S)
155 
156 /*********************************************************************
157 * TIMER1
158 *********************************************************************/
163 #define TIMER1_INTERRUPT_TIME_MS (4000)
164 
169 #define TIMER1_TCNT1_VALUE (0xFFFFUL - (TIMER1_INTERRUPT_TIME_MS*1000UL/(1024 / (F_CPU/1000000)))+1)
170 
171 #endif
172 
173 /*********************************************************************
174 * TASKS
175 *********************************************************************/
176 
181 #define TRANSACTION_TIMEOUT_MS (5000)
#define SDCARD_CHIP_SELECT_PIN
Chip select for SDcard SPI.
Definition: i2c-rain-config.h:108