|
ADS7952 Driver 0.1.0
API reference
|
What the driver is told about the chip and the board. Config{} is an ADS7952 in TSSOP left in its reset state (Tables 1 to 13): Range 1, every GPIO an input, every channel in Auto-1, channel 11 the last of Auto-2, no alarm; with a 2.5 V reference and a 5 V analog supply.
More...
#include <ads7952_types.hpp>
Public Attributes | |
| Variant | variant {Variant::Ads7952} |
| The fitted part; every channel is checked against it. | |
| Package | package {Package::Tssop} |
| Range | range {Range::Vref} |
| uint16_t | vref_mv {2500} |
| uint16_t | va_min_mv {5000} |
| uint16_t | auto1_channels {0x0FFF} |
| uint8_t | auto2_last_channel {11} |
| GpioConfig | gpio {} |
| GPIO program register and output levels. | |
| std::array< AlarmThreshold, kMaxChannels > | alarms {} |
| ScaleMonitor | monitor {} |
| uint8_t | park_channel {kNoPark} |
What the driver is told about the chip and the board. Config{} is an ADS7952 in TSSOP left in its reset state (Tables 1 to 13): Range 1, every GPIO an input, every channel in Auto-1, channel 11 the last of Auto-2, no alarm; with a 2.5 V reference and a 5 V analog supply.
Every setting is written by EnsureInitialized(), which first resets the chip, and by ApplyConfig() on a running driver. Verification is not configured here: each call that can read back takes a Verify argument.
| std::array<AlarmThreshold, kMaxChannels> ads7952::Config::alarms {} |
Thresholds per channel; index = channel.
| uint16_t ads7952::Config::auto1_channels {0x0FFF} |
The Auto-1 sequence, bit n for channel n; at least one channel of the variant. The reset value of an ADS7952 is 0x0FFF (every channel).
| uint8_t ads7952::Config::auto2_last_channel {11} |
The last channel of the Auto-2 sequence (channel 0 to this one). Reset value: the variant's last channel (11 on the ADS7952).
| ScaleMonitor ads7952::Config::monitor {} |
A channel with a known voltage: checked by EnsureInitialized(), CheckScale() and CheckScaleCode(). None by default.
| Package ads7952::Config::package {Package::Tssop} |
The package; VQFN has GPIO0 only.
| uint8_t ads7952::Config::park_channel {kNoPark} |
Reset witness for reads of channel 0 (opt-in): 1 to the variant's last channel, or kNoPark. Channel 0 is the channel a reset leaves the chip on (section 8.4.3), so a reset while the chip rests there shows in no reply. With a park channel, ReadChannel(0) reads with the Manual word of the park channel and one frame more, so the chip rests there; the next read checks that the chip is still on it and returns DeviceReset if a reset moved it to channel 0. Cost: ReadChannel(0) takes 4 frames instead of 1 when repeated, 2 instead of 1 the first time.
| Range ads7952::Config::range {Range::Vref} |
Input range, sent with every mode word (DI06). With gpio.gpio2_range_input the chip ignores DI06 and the GPIO2 pin selects the range: then this is the level the board drives on GPIO2, which the driver cannot see; declare a monitor to check it.
| uint16_t ads7952::Config::va_min_mv {5000} |
The lowest +VA the board guarantees, in millivolts: the rail's minimum after its tolerance, ripple and load, not its nominal value. 2700 to 5250 (section 7.3). Range 2 is specified only while 2 x VREF <= +VA (section 7.6), so it needs 2 x vref_mv <= va_min_mv.
| uint16_t ads7952::Config::vref_mv {2500} |
REFP voltage, in millivolts: 2000 to 3000 (section 7.3). Sets the scale of every code (one LSB is vref_mv / 4096 in Range 1, 2 x vref_mv / 4096 in Range 2) and is checked against va_min_mv; never sent to the chip.