Contains variables for bandgap reference calibration together with defines for them.
Copyright (c) 2008, Atmel Corporation All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. The name of ATMEL may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file calibration.h.
#include <stdint.h>


Go to the source code of this file.
Defines | |
| #define | CAL_CHANNEL 0x01 |
| Mux value for calibration channel PV1 (Cell1). | |
| #define | CAL_GAIN cell_gain[0] |
| Gain for calibration channel. | |
| #define | CAL_OFFSET cell_offset[0] |
| Offset for calibration channel. | |
| #define | TEMP_CAL0 0x00 |
| temp_cal[0]. Temperature dependency calibration (BGCRR) setting 0. | |
| #define | TEMP_CAL1 0x01 |
| temp_cal[1]. Temperature dependency calibration (BGCRR) setting 1. | |
| #define | TEMP_CAL2 0x03 |
| temp_cal[2]. Temperature dependency calibration (BGCRR) setting 2. | |
| #define | TEMP_CAL3 0x07 |
| temp_cal[3]. Temperature dependency calibration (BGCRR) setting 3. | |
| #define | TEMP_CAL4 0x0F |
| temp_cal[4]. Temperature dependency calibration (BGCRR) setting 4. | |
| #define | TEMP_CAL5 0x1F |
| temp_cal[5]. Temperature dependency calibration (BGCRR) setting 5. | |
| #define | TEMP_CAL6 0x3F |
| temp_cal[6]. Temperature dependency calibration (BGCRR) setting 6. | |
| #define | TEMP_CAL7 0x7F |
| temp_cal[7]. Temperature dependency calibration (BGCRR) setting 7. | |
| #define | TEMP_CAL8 0xFF |
| temp_cal[8]. Temperature dependency calibration (BGCRR) setting 8. | |
| #define | USE_CAL_GAIN 1 |
| Define for ignoring second point calibration and doing a new one on devices that already have that. | |
| #define | USE_CELL1_CAL 1 |
| Use Cell1 for calibration, otherwise use VADC0. | |
| #define | VCALIB_VALUE 4096 |
| 4096mV in | |
| #define | VLEVEL0 -37 |
| vcalibration_level[0]. Padding to enable TEMP_CAL0 if < VLEVEL1 | |
| #define | VLEVEL1 -37 |
| vcalibration_level[1]. | |
| #define | VLEVEL2 -30 |
| vcalibration_level[2]. | |
| #define | VLEVEL3 -20 |
| vcalibration_level[3]. | |
| #define | VLEVEL4 -9 |
| vcalibration_level[4]. | |
| #define | VLEVEL5 0 |
| vcalibration_level[5]. | |
| #define | VLEVEL6 4 |
| vcalibration_level[6]. | |
| #define | VLEVEL7 7 |
| vcalibration_level[7]. | |
| #define | VLEVEL8 11 |
| vcalibration_level[8]. | |
Variables | |
| __flash uint8_t | temp_cal [] = {TEMP_CAL0,TEMP_CAL1,TEMP_CAL2,TEMP_CAL3,TEMP_CAL4,TEMP_CAL5,TEMP_CAL6,TEMP_CAL7,TEMP_CAL8} |
| Flash constant for temperature dependency setting (BGCRR). | |
| __flash int8_t | vcalibration_level [] = {VLEVEL0,VLEVEL1,VLEVEL2,VLEVEL3,VLEVEL4,VLEVEL5,VLEVEL6,VLEVEL7,VLEVEL8} |
| Flash constant for calibration limits. See appnote for details. | |
| #define CAL_CHANNEL 0x01 |
Mux value for calibration channel PV1 (Cell1).
Definition at line 80 of file calibration.h.
Referenced by CalibrateVREF().
| #define CAL_GAIN cell_gain[0] |
Gain for calibration channel.
Definition at line 81 of file calibration.h.
Referenced by MeasureVADCerror().
| #define CAL_OFFSET cell_offset[0] |
Offset for calibration channel.
Definition at line 82 of file calibration.h.
Referenced by MeasureVADCerror().
| #define TEMP_CAL0 0x00 |
temp_cal[0]. Temperature dependency calibration (BGCRR) setting 0.
Definition at line 55 of file calibration.h.
| #define TEMP_CAL1 0x01 |
temp_cal[1]. Temperature dependency calibration (BGCRR) setting 1.
Definition at line 56 of file calibration.h.
| #define TEMP_CAL2 0x03 |
temp_cal[2]. Temperature dependency calibration (BGCRR) setting 2.
Definition at line 57 of file calibration.h.
| #define TEMP_CAL3 0x07 |
temp_cal[3]. Temperature dependency calibration (BGCRR) setting 3.
Definition at line 58 of file calibration.h.
| #define TEMP_CAL4 0x0F |
temp_cal[4]. Temperature dependency calibration (BGCRR) setting 4.
Definition at line 59 of file calibration.h.
| #define TEMP_CAL5 0x1F |
temp_cal[5]. Temperature dependency calibration (BGCRR) setting 5.
Definition at line 60 of file calibration.h.
| #define TEMP_CAL6 0x3F |
temp_cal[6]. Temperature dependency calibration (BGCRR) setting 6.
Definition at line 61 of file calibration.h.
| #define TEMP_CAL7 0x7F |
temp_cal[7]. Temperature dependency calibration (BGCRR) setting 7.
Definition at line 62 of file calibration.h.
| #define TEMP_CAL8 0xFF |
temp_cal[8]. Temperature dependency calibration (BGCRR) setting 8.
Definition at line 63 of file calibration.h.
| #define USE_CAL_GAIN 1 |
Define for ignoring second point calibration and doing a new one on devices that already have that.
Use gain and offset for calibration. This adjusts calibration values, and also method in CalibrateVREF().
Definition at line 70 of file calibration.h.
| #define USE_CELL1_CAL 1 |
| #define VCALIB_VALUE 4096 |
| #define VLEVEL0 -37 |
vcalibration_level[0]. Padding to enable TEMP_CAL0 if < VLEVEL1
Definition at line 89 of file calibration.h.
| #define VLEVEL1 -37 |
| #define VLEVEL2 -30 |
| #define VLEVEL3 -20 |
| #define VLEVEL4 -9 |
| #define VLEVEL5 0 |
| #define VLEVEL6 4 |
| #define VLEVEL7 7 |
| #define VLEVEL8 11 |
| __flash uint8_t temp_cal[] = {TEMP_CAL0,TEMP_CAL1,TEMP_CAL2,TEMP_CAL3,TEMP_CAL4,TEMP_CAL5,TEMP_CAL6,TEMP_CAL7,TEMP_CAL8} |
Flash constant for temperature dependency setting (BGCRR).
Definition at line 156 of file calibration.h.
Referenced by CalibrateVREF().
| __flash int8_t vcalibration_level[] = {VLEVEL0,VLEVEL1,VLEVEL2,VLEVEL3,VLEVEL4,VLEVEL5,VLEVEL6,VLEVEL7,VLEVEL8} |
Flash constant for calibration limits. See appnote for details.
Definition at line 159 of file calibration.h.
Referenced by CalibrateVREF().
1.5.5