|
ADS7952 Driver 0.1.0
API reference
|
Public types of the ADS7952 driver: errors, Result<T>, variants, ranges, GPIO and alarm settings, the configuration and the result of a scan.
More...
#include <array>#include <cstddef>#include <cstdint>#include "ads7952_detail.hpp"#include "ads7952_registers.hpp"#include "ads7952_version.h"Go to the source code of this file.
Classes | |
| struct | ads7952::Result< T > |
| The value of a call, or why there is none. More... | |
| struct | ads7952::Result< void > |
| The result of a call that returns no value. More... | |
| struct | ads7952::GpioConfig |
The GPIO program register and the GPIO output levels. GpioConfig{} is the reset state: every pin an input with no function. More... | |
| struct | ads7952::AlarmThreshold |
The two alarm thresholds of one channel, in 12-bit result codes. The chip keeps the upper 10 bits and compares them with the upper 10 bits of each result (Table 13), so the two lowest bits of a threshold are dropped. AlarmThreshold{} is the reset state: no alarm. More... | |
| struct | ads7952::Bank |
| The result of one Auto-1 or Auto-2 scan: one code per channel of the sequence. More... | |
| struct | ads7952::ScaleMonitor |
| A channel the board drives with a known voltage, so the driver can prove the scale every code is converted with: the range the chip is really in, and a reference that is present. More... | |
| struct | ads7952::Config |
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... | |
Namespaces | |
| namespace | ads7952 |
The ADS7952 driver: everything it declares lives here; internals in detail. | |
Functions | |
| constexpr const char * | ads7952::ToString (Error error) noexcept |
| The name of an error, for logs. | |
| constexpr uint8_t | ads7952::ChannelCount (Variant variant) noexcept |
| Number of analog inputs of a variant. | |
| constexpr uint16_t | ads7952::AllChannels (Variant variant) noexcept |
| The mask of every channel of a variant: also the reset value of its Auto-1 program register (section 8.4.1). | |
| constexpr Error | ads7952::ValidateMonitor (const Config &config) noexcept |
| Check the scale monitor of a configuration. | |
| constexpr Error | ads7952::CheckScaleCode (const Config &config, uint16_t code) noexcept |
| Judge one code of the scale monitor's channel. No I/O. | |
| constexpr Error | ads7952::ValidateGpio (const Config &config) noexcept |
| Check the GPIO settings of a configuration against its package. | |
| constexpr Error | ads7952::ValidateAlarms (const Config &config) noexcept |
| Check the alarm thresholds of a configuration against its variant. | |
| constexpr bool | ads7952::ValidSupplies (const Config &config) noexcept |
| Check the reference and the analog supply (section 7.3), and Range 2 against them (2 x VREF <= +VA, section 7.6). | |
| constexpr bool | ads7952::ValidPark (const Config &config) noexcept |
Check Config::park_channel against the variant. | |
| constexpr Error | ads7952::Validate (const Config &config) noexcept |
| Check a configuration without touching the chip. | |
| constexpr Config | ads7952::ResetConfig (Variant variant) noexcept |
The Config of a variant left in its reset state: Config{} with that variant's Auto-1 mask and Auto-2 last channel. | |
| constexpr uint32_t | ads7952::CodeToMicrovolts (uint16_t code, Range range, uint16_t vref_mv) noexcept |
| Convert a result code to the input voltage it stands for (Table 8: one LSB is full scale / 4096, code 4095 is full scale less one LSB). | |
| constexpr const char * | ads7952::GetDriverVersion () noexcept |
| constexpr uint32_t | ads7952::GetDriverVersionMajor () noexcept |
| constexpr uint32_t | ads7952::GetDriverVersionMinor () noexcept |
| constexpr uint32_t | ads7952::GetDriverVersionPatch () noexcept |
Variables | |
| constexpr std::size_t | ads7952::kMaxChannels = 16 |
| Channels of the largest part (ADS7953); arrays indexed by channel have this size. | |
| constexpr uint16_t | ads7952::kMaxCode = 4095 |
| Largest result code: 12 bits, straight binary (Table 8). | |
| constexpr uint32_t | ads7952::kCodesPerFullScale = 4096 |
| Codes per full scale: one LSB is full scale / 4096 (Table 8). | |
| constexpr uint32_t | ads7952::kPowerUpUs = 1 |
| constexpr std::size_t | ads7952::kMaxTraceFrames = 32 |
Longest TraceFrames() request, in frames. | |
| constexpr std::size_t | ads7952::kFrameBytes = 2 |
| Bytes per transfer: every frame is 16 bits with CS low throughout (section 8.1). | |
| constexpr uint8_t | ads7952::kNoMonitor = 0xFF |
ScaleMonitor::channel when no channel carries a known voltage: no scale check. | |
| constexpr uint8_t | ads7952::kNoPark = 0xFF |
Config::park_channel when the chip stays on channel 0 after a read of it: no parking. | |
Public types of the ADS7952 driver: errors, Result<T>, variants, ranges, GPIO and alarm settings, the configuration and the result of a scan.
Everything here is plain data with no platform dependency, so handlers, tests and tools can include it without the driver template. Section, table and figure numbers refer to the ADS79xx datasheet, TI SLAS605C (revised July 2018).