ADS7952 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Public Attributes | List of all members
ads7952::Config Struct 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}
 

Detailed Description

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.

Member Data Documentation

◆ alarms

std::array<AlarmThreshold, kMaxChannels> ads7952::Config::alarms {}

Thresholds per channel; index = channel.

◆ auto1_channels

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).

◆ auto2_last_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).

◆ monitor

ScaleMonitor ads7952::Config::monitor {}

A channel with a known voltage: checked by EnsureInitialized(), CheckScale() and CheckScaleCode(). None by default.

◆ package

Package ads7952::Config::package {Package::Tssop}

The package; VQFN has GPIO0 only.

◆ park_channel

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

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.

◆ va_min_mv

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.

◆ vref_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.


The documentation for this struct was generated from the following file: