|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Classes | |
| struct | AdcSelfTestResult |
| ADC self-test via internal TDAC. More... | |
| struct | BiasReadResult |
Enumerations | |
| enum class | BiasResult : uint8_t { CONNECTED = 0 , AMBIGUOUS = 1 , DISCONNECTED = 2 } |
Functions | |
| AdcSelfTestResult | run_adc_self_test (ADS126X &adc, uint8_t drdy_pin, uint8_t original_ref_neg, uint8_t original_ref_pos) |
| void | sensor_bias_enable (ADS126X &adc) |
| Call once before the connector loop. | |
| BiasReadResult | read_sensor_bias (ADS126X &adc, uint8_t drdy_pin, uint8_t adc_channel, uint8_t aincom, uint8_t settle_cycles=5) |
| Read one connector with sensor bias already active. | |
| void | sensor_bias_disable (ADS126X &adc) |
| Call once after the connector loop. | |
Variables | |
| constexpr int32_t | ADC_TDAC_EXPECTED_CODE = 214748364 |
| constexpr int32_t | ADC_TDAC_TOLERANCE = 2147484 |
| constexpr int32_t | SENSOR_BIAS_CLOSED_THRESHOLD = 858993459 |
| constexpr int32_t | SENSOR_BIAS_OPEN_THRESHOLD = 1288490188 |
| constexpr unsigned long | BIAS_SETTLE_MS = 50 |
| constexpr uint8_t | BIAS_AVG_SAMPLES = 4 |
|
strong |
| Enumerator | |
|---|---|
| CONNECTED | |
| AMBIGUOUS | |
| DISCONNECTED | |
Definition at line 35 of file SensorSelfTest.h.
|
inline |
Read one connector with sensor bias already active.
After switching the mux, flushes settle_cycles conversions so the digital filter (e.g. SINC5 needs 5) fully settles on the new channel before taking the real measurement.
Returns CONNECTED if |code| < SENSOR_BIAS_CLOSED_THRESHOLD, DISCONNECTED if |code| >= SENSOR_BIAS_OPEN_THRESHOLD, AMBIGUOUS otherwise (or on checksum failure).
Definition at line 128 of file SensorSelfTest.h.
References adc(), AMBIGUOUS, BIAS_AVG_SAMPLES, BIAS_SETTLE_MS, CONNECTED, delay(), delayMicroseconds(), digitalRead(), DISCONNECTED, LOW, r, SENSOR_BIAS_CLOSED_THRESHOLD, and SENSOR_BIAS_OPEN_THRESHOLD.
Referenced by run_self_test_cb(), test_sensor_bias_ambiguous(), test_sensor_bias_checksum_fails(), test_sensor_bias_connected(), and test_sensor_bias_disconnected().
|
inline |
Definition at line 54 of file SensorSelfTest.h.
References adc(), ADC_TDAC_EXPECTED_CODE, ADC_TDAC_TOLERANCE, ADS126X_REF_NEG_VSS, ADS126X_REF_POS_VDD, ADS126X_TDAC, ADS126X_TDAC_DIV_0_5, ADS126X_TDAC_DIV_0_6, delayMicroseconds(), diff(), digitalRead(), and LOW.
Referenced by run_self_test_cb(), test_adc_tdac_fail_checksum(), test_adc_tdac_fail_out_of_tolerance(), and test_adc_tdac_pass().
|
inline |
Call once after the connector loop.
Restores SBMAG = 0.
Definition at line 181 of file SensorSelfTest.h.
References adc(), and ADS126X_BIAS_MAG_0.
Referenced by run_self_test_cb().
|
inline |
Call once before the connector loop.
Configures sensor bias on ADC1 with 10MΩ pull-up, bypasses PGA (bias voltages can exceed PGA input range), and turns off IDACs.
Definition at line 102 of file SensorSelfTest.h.
References adc(), ADS126X_BIAS_ADC1, ADS126X_BIAS_MAG_10M, ADS126X_BIAS_PULLUP, ADS126X_IDAC_MAG_0, BIAS_SETTLE_MS, and delay().
Referenced by run_self_test_cb().
|
constexpr |
Definition at line 13 of file SensorSelfTest.h.
Referenced by run_adc_self_test(), run_self_test_cb(), test_adc_tdac_fail_checksum(), test_adc_tdac_fail_out_of_tolerance(), and test_adc_tdac_pass().
|
constexpr |
Definition at line 14 of file SensorSelfTest.h.
Referenced by run_adc_self_test(), run_self_test_cb(), and test_adc_tdac_fail_out_of_tolerance().
|
constexpr |
Definition at line 33 of file SensorSelfTest.h.
Referenced by read_sensor_bias().
|
constexpr |
Definition at line 30 of file SensorSelfTest.h.
Referenced by read_sensor_bias(), and sensor_bias_enable().
|
constexpr |
Definition at line 23 of file SensorSelfTest.h.
Referenced by read_sensor_bias().
|
constexpr |
Definition at line 24 of file SensorSelfTest.h.
Referenced by read_sensor_bias().