- A fork of Damien's program.
Dependencies: WebSocketClient WiflyInterface mbed messages
Fork of BatteryModelTester by
headers/ADC.h@1:4403f2ed1c1f, 2016-10-04 (annotated)
- Committer:
- defrost
- Date:
- Tue Oct 04 13:19:19 2016 +0000
- Revision:
- 1:4403f2ed1c1f
- Child:
- 2:7abdaa5a9209
- Temperature sensor with injected channel conversion
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
defrost | 1:4403f2ed1c1f | 1 | // ************ |
defrost | 1:4403f2ed1c1f | 2 | // * iQ_ADC.h * |
defrost | 1:4403f2ed1c1f | 3 | // ************ |
defrost | 1:4403f2ed1c1f | 4 | // |
defrost | 1:4403f2ed1c1f | 5 | // Created: 2015/03/19 |
defrost | 1:4403f2ed1c1f | 6 | // By: Damien Frost |
defrost | 1:4403f2ed1c1f | 7 | // |
defrost | 1:4403f2ed1c1f | 8 | // Description: |
defrost | 1:4403f2ed1c1f | 9 | // Setup and functions of the ADC Module. |
defrost | 1:4403f2ed1c1f | 10 | |
defrost | 1:4403f2ed1c1f | 11 | #ifndef IQ_ADC_H |
defrost | 1:4403f2ed1c1f | 12 | #define IQ_ADC_H |
defrost | 1:4403f2ed1c1f | 13 | |
defrost | 1:4403f2ed1c1f | 14 | // Properties of the internal temperature sensor: |
defrost | 1:4403f2ed1c1f | 15 | #define IT_VMIN 1.7f |
defrost | 1:4403f2ed1c1f | 16 | #define IT_VMAX 3.3f |
defrost | 1:4403f2ed1c1f | 17 | #define IT_AVG_SLOPE 0.0025f |
defrost | 1:4403f2ed1c1f | 18 | #define IT_V25 0.76f |
defrost | 1:4403f2ed1c1f | 19 | |
defrost | 1:4403f2ed1c1f | 20 | #define ADC_MAX 4095.0f |
defrost | 1:4403f2ed1c1f | 21 | |
defrost | 1:4403f2ed1c1f | 22 | #define STARTADCCONVERSION ADC1->CR2 |= ADC_CR2_JSWSTART // This command starts the ADC Conversion. |
defrost | 1:4403f2ed1c1f | 23 | #define ADCCONVERSIONCOMPLETE ((ADC1->SR & ADC_SR_JSTRT) == 0) // This command returns true when the ADC conversion is complete. |
defrost | 1:4403f2ed1c1f | 24 | |
defrost | 1:4403f2ed1c1f | 25 | void ConfigureADC(void); |
defrost | 1:4403f2ed1c1f | 26 | |
defrost | 1:4403f2ed1c1f | 27 | |
defrost | 1:4403f2ed1c1f | 28 | #endif /* IQ_ADC_H */ |