Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: inc/adc_defs.h
- Revision:
- 33:6c7364ea360f
- Parent:
- 30:d8721a46ee03
- Child:
- 54:660af33fa930
--- a/inc/adc_defs.h Wed Mar 06 23:37:45 2019 +0000 +++ b/inc/adc_defs.h Thu Aug 22 15:38:50 2019 +0000 @@ -33,18 +33,24 @@ const unsigned int ADC_SCALE_FACTOR = ADC_MAX_VALUE/2; -#define VOLTAGE_TARG_VALUE 1.65 +#define VOLTAGE_TARG_VALUE 1.65/* #define VOLTAGE_48_ACTUAL_VALUE 1.51 #define VOLTAGE_24_ACTUAL_VALUE 1.55 -#define VOLTAGE_12_ACTUAL_VALUE 1.53 -const double VOLTAGE_48_CORRECTION = VOLTAGE_TARG_VALUE/VOLTAGE_48_ACTUAL_VALUE/ADC_SCALE_FACTOR; -const double VOLTAGE_24_CORRECTION = VOLTAGE_TARG_VALUE/VOLTAGE_24_ACTUAL_VALUE/ADC_SCALE_FACTOR; -const double VOLTAGE_12_CORRECTION = VOLTAGE_TARG_VALUE/VOLTAGE_12_ACTUAL_VALUE/ADC_SCALE_FACTOR; -const double VOLTAGE_48_FACTOR = 48.0*VOLTAGE_48_CORRECTION; -const double VOLTAGE_24_FACTOR = 24.0*VOLTAGE_24_CORRECTION; -const double VOLTAGE_12_FACTOR = 12.0*VOLTAGE_12_CORRECTION; +#define VOLTAGE_12_ACTUAL_VALUE 1.53*/ +extern double VOLTAGE_48_ACTUAL_VALUE; +extern double VOLTAGE_24_ACTUAL_VALUE; +extern double VOLTAGE_12_ACTUAL_VALUE; +extern double VOLTAGE_48_OFFSET; +extern double VOLTAGE_24_OFFSET; +extern double VOLTAGE_12_OFFSET; +extern double VOLTAGE_48_CORRECTION; +extern double VOLTAGE_24_CORRECTION; +extern double VOLTAGE_12_CORRECTION; +extern double VOLTAGE_48_FACTOR; +extern double VOLTAGE_24_FACTOR; +extern double VOLTAGE_12_FACTOR; - +/* #define CURRENT_48_DIV_FACTOR5 -370 #define CURRENT_48_DIV_FACTOR4 -570 #define CURRENT_48_DIV_FACTOR3 -740 @@ -60,8 +66,6 @@ #define CURRENT_24_DIV_FACTOR -376 - - #define CURRENT_12_DIV_FACTOR5 -188 #define CURRENT_12_DIV_FACTOR4 -186 #define CURRENT_12_DIV_FACTOR3 -182 @@ -74,7 +78,42 @@ #define CURRENT_12_DIV_THRESH3 600 #define CURRENT_12_DIV_THRESH2 400 #define CURRENT_12_DIV_THRESH1 200 +*/ +extern signed int CURRENT_48_DIV_FACTOR5; +extern signed int CURRENT_48_DIV_FACTOR4; +extern signed int CURRENT_48_DIV_FACTOR3; +extern signed int CURRENT_48_DIV_FACTOR2; +extern signed int CURRENT_48_DIV_FACTOR1; +extern signed int CURRENT_48_DIV_FACTOR0; +extern unsigned int CURRENT_48_DIV_THRESH5; +extern unsigned int CURRENT_48_DIV_THRESH4; +extern unsigned int CURRENT_48_DIV_THRESH3; +extern unsigned int CURRENT_48_DIV_THRESH2; +extern unsigned int CURRENT_48_DIV_THRESH1; + +extern signed int CURRENT_24_DIV_FACTOR; + +extern signed int CURRENT_12_DIV_FACTOR5; +extern signed int CURRENT_12_DIV_FACTOR4; +extern signed int CURRENT_12_DIV_FACTOR3; +extern signed int CURRENT_12_DIV_FACTOR2; +extern signed int CURRENT_12_DIV_FACTOR1; +extern signed int CURRENT_12_DIV_FACTOR0; + +extern unsigned int CURRENT_12_DIV_THRESH5; +extern unsigned int CURRENT_12_DIV_THRESH4; +extern unsigned int CURRENT_12_DIV_THRESH3; +extern unsigned int CURRENT_12_DIV_THRESH2; +extern unsigned int CURRENT_12_DIV_THRESH1; + + +extern double CURRENT_12_CORRECTION0; +extern double CURRENT_12_CORRECTION1; +extern double CURRENT_12_CORRECTION2; +extern double CURRENT_12_CORRECTION3; +extern double CURRENT_12_CORRECTION4; +extern double CURRENT_12_CORRECTION5; //const double ROW_CORRECTION_FACTOR = 1.017; // 2.6W/chip avg. const double ROW_CORRECTION_FACTOR = 0.85; // 3W/chip avg.