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/boards.h
- Revision:
- 15:aed8f326c949
- Parent:
- 9:816b9a4e4f21
- Child:
- 25:8bcc8bea0e31
--- a/inc/boards.h Sat Dec 08 16:57:27 2018 +0000 +++ b/inc/boards.h Tue Dec 11 16:59:21 2018 +0000 @@ -29,11 +29,19 @@ #ifndef BOARDS_H #define BOARDS_H -#define ADC_CH2 7 -#define ADC_CH1 20 -#define ADC_CH1_OFFSET 11 -#define ADC_CH2_OFFSET 16 -#define ADC_OFFSET 10922 +#include "adc_defs.h" + +#define VOLTAGE_TOLERANCE 0.1 +const unsigned int V48_HI = (unsigned int)ADC_SCALE_FACTOR*(VOLTAGE_48_ACTUAL_VALUE/VOLTAGE_TARG_VALUE)*(1.0+VOLTAGE_TOLERANCE); +const unsigned int V48_LO = (unsigned int)ADC_SCALE_FACTOR*(VOLTAGE_48_ACTUAL_VALUE/VOLTAGE_TARG_VALUE)*(1.0-VOLTAGE_TOLERANCE); +const unsigned int V24_HI = (unsigned int)ADC_SCALE_FACTOR*(VOLTAGE_24_ACTUAL_VALUE/VOLTAGE_TARG_VALUE)*(1.0+VOLTAGE_TOLERANCE); +const unsigned int V24_LO = (unsigned int)ADC_SCALE_FACTOR*(VOLTAGE_24_ACTUAL_VALUE/VOLTAGE_TARG_VALUE)*(1.0-VOLTAGE_TOLERANCE); +const unsigned int V12_HI = (unsigned int)ADC_SCALE_FACTOR*(VOLTAGE_12_ACTUAL_VALUE/VOLTAGE_TARG_VALUE)*(1.0+VOLTAGE_TOLERANCE); +const unsigned int V12_LO = (unsigned int)ADC_SCALE_FACTOR*(VOLTAGE_12_ACTUAL_VALUE/VOLTAGE_TARG_VALUE)*(1.0-VOLTAGE_TOLERANCE); + +void initBoards(struct adcValues); + +extern bool buck; extern unsigned int boardEnableBits; extern unsigned int boardsActive; @@ -41,17 +49,18 @@ extern unsigned int en_out_code; extern unsigned int wr_out_code; -unsigned int setBoardEnables(unsigned int enableBits); -unsigned int setBoardWeights(unsigned int enableWeights); +unsigned int setBoardEnables(unsigned int); +unsigned int setBoardWeights(unsigned int); -int checkRange(int setvalue, int limlo, int limhi); +int checkRange(int, int, int); void toggleLatchSignal(void); -void startConverter(unsigned int reg); +void startConverter(unsigned int); void stopConverter(void); +struct statusValues checkLevels(struct adcValues); void updateControls(unsigned short); -void XupdateControls(unsigned short ref); +void XupdateControls(unsigned short); #endif \ No newline at end of file