1
#ifndef TK_CALIBRATION_H
2
#define TK_CALIBRATION_H
4
* Attiny calibration header.
5
* This allows using a single set of hardcoded values across multiple projects.
7
* Copyright (C) 2015 Selene Scriven
9
* This program is free software: you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation, either version 3 of the License, or
12
* (at your option) any later version.
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.
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/>.
24
/********************** Voltage ADC calibration **************************/
25
// These values were measured using RMM's FET+7135.
26
// See battcheck/readings.txt for reference values.
27
// the ADC values we expect for specific voltages
54
#define ADC_100p ADC_42 // the ADC value for 100% full (resting)
55
#define ADC_75p ADC_40 // the ADC value for 75% full (resting)
56
#define ADC_50p ADC_38 // the ADC value for 50% full (resting)
57
#define ADC_25p ADC_35 // the ADC value for 25% full (resting)
58
#define ADC_0p ADC_30 // the ADC value for 0% full (resting)
59
#define ADC_LOW ADC_28 // When do we start ramping down
60
#define ADC_CRIT ADC_27 // When do we shut the light off
63
/********************** Offtime capacitor calibration ********************/
64
// Values are between 1 and 255, and can be measured with offtime-cap.c
65
// See battcheck/otc-readings.txt for reference values.
66
// These #defines are the edge boundaries, not the center of the target.
68
// The OTC value 0.5s after being disconnected from power
69
// (anything higher than this is a "short press")
71
// The OTC value 1.5s after being disconnected from power
72
// Between CAP_MED and CAP_SHORT is a "medium press"
74
// Below CAP_MED is a long press
76
// The OTC value 1.0s after being disconnected from power
77
// Anything higher than this is a short press, lower is a long press
82
#endif // TK_CALIBRATION_H