ADS9324 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
ads9324_types.hpp
Go to the documentation of this file.
1
14#ifndef ADS9324_TYPES_HPP
15#define ADS9324_TYPES_HPP
16
17#include <algorithm>
18#include <array>
19#include <cstddef>
20#include <cstdint>
21#include <span>
22
23#include "ads9324_detail.hpp"
24#include "ads9324_registers.hpp"
25#include "ads9324_version.h"
26
29namespace ads9324 {
30
45enum class [[nodiscard]] Error : uint8_t {
46 Ok = 0,
47 NotInitialized = 1,
48 InvalidArgument = 2,
49 Bus = 3,
50 Timeout = 4,
52 Crc = 6,
53 Busy = 7,
54 DeviceFault = 8,
55 Unsupported = 9,
56 UnexpectedReset = 16,
57 VerifyFailed = 17,
58 Refused = 18,
59 DataMismatch = 19,
61};
62
69constexpr const char* ToString(Error error) noexcept {
70 switch (error) {
71 case Error::Ok:
72 return "Ok";
74 return "NotInitialized";
76 return "InvalidArgument";
77 case Error::Bus:
78 return "Bus";
79 case Error::Timeout:
80 return "Timeout";
82 return "DeviceIdMismatch";
83 case Error::Crc:
84 return "Crc";
85 case Error::Busy:
86 return "Busy";
88 return "DeviceFault";
90 return "Unsupported";
92 return "UnexpectedReset";
94 return "VerifyFailed";
95 case Error::Refused:
96 return "Refused";
98 return "DataMismatch";
99 default:
100 break;
101 }
102 return "Unknown";
103}
104
113template <typename T>
114struct [[nodiscard]] Result {
115 T value{};
116 Error error{Error::Ok};
117
119 [[nodiscard]] constexpr bool ok() const noexcept {
120 return error == Error::Ok;
121 }
123 constexpr explicit operator bool() const noexcept {
124 return ok();
125 }
131 static constexpr Result Success(T v) noexcept {
132 return {v, Error::Ok};
133 }
139 static constexpr Result Failure(Error e) noexcept {
140 return {T{}, e};
141 }
142};
143
145template <>
146struct [[nodiscard]] Result<void> {
147 Error error{Error::Ok};
148
150 [[nodiscard]] constexpr bool ok() const noexcept {
151 return error == Error::Ok;
152 }
154 constexpr explicit operator bool() const noexcept {
155 return ok();
156 }
158 static constexpr Result Success() noexcept {
159 return {Error::Ok};
160 }
166 static constexpr Result Failure(Error e) noexcept {
167 return {e};
168 }
169};
170
172enum class LogLevel : uint8_t {
173 Error = 0,
174 Warning,
175 Info,
176 Debug,
177};
178
181enum class Verify : uint8_t {
182 None = 0,
183 ReadBack = 1,
184};
185
187enum class ResetKind : uint8_t {
188 Software = 0,
189 Hardware = 1,
190};
191
193enum class InputType : uint8_t {
194 Differential = 0,
195 SingleEnded = 5,
197};
198
200enum class InputRange : uint8_t {
201 V5 = 0,
202 V2_5 = 2,
203 V6_25 = 3,
204 V10 = 4,
205 V12_5 = 5,
206};
207
209enum class Bandwidth : uint8_t {
210 Low = 0,
211 Wide = 1,
212};
213
215enum class Lanes : uint8_t {
216 Eight = 0,
217 Four = 1,
218 Two = 2,
219 One = 3,
220};
221
223enum class WordLength : uint8_t {
224 Bits16 = 0,
225 Bits24 = 2,
226};
227
229enum class DataFormat : uint8_t {
230 TwosComplement = 0,
231 OffsetBinary = 1,
232};
233
236enum class DriveStrength : uint8_t {
237 Normal = 0,
238 Half = 1,
239 Double = 2,
240 OneAndHalf = 3,
241};
242
244enum class ReferenceSource : uint8_t {
245 Pin = 0,
246 Internal = 1,
247 External = 2,
249};
250
253enum class ChannelCount : uint8_t {
254 All16 = 0,
255 Eight = 1,
256 Four = 2,
257 Two = 3,
258};
259
261enum class AlarmFunction : uint8_t {
262 Drdy = 0,
263 WindowAlert = 1,
264 CalDone = 6,
265 OrMasked = 8,
267};
268
271inline constexpr uint8_t kAlarmSourceDrdy = 0x01;
272inline constexpr uint8_t kAlarmSourceWindow = 0x02;
273inline constexpr uint8_t kAlarmSourceCalDone = 0x40;
274
276enum class AverageLength : uint8_t {
277 None = 0,
278 X2,
279 X4,
280 X6,
281 X8,
282 X10,
283 X12,
284 X16,
285 X20,
286 X32,
287 X64,
288 X128,
289};
290
293enum class FirFilter : uint8_t {
294 Fir1 = 1,
295 Fir2 = 2,
296 Fir3 = 3,
297 Fir4 = 4,
298 Fir5 = 5,
299 Fir7 = 7,
300};
301
303enum class FilterKind : uint8_t {
304 None = 0,
305 BlockAverage = 1,
306 MovingAverage = 2,
307 Fir = 3,
308};
309
311enum class PatternKind : uint8_t {
312 Constant = 0,
313 Ramp = 2,
315};
316
318enum class ReadySource : uint8_t {
319 Time = 0,
320 Pin = 1,
321};
322
324enum class CalibrationMode : uint8_t {
325 Offset = 1,
326 Gain = 2,
327 OffsetAndGain = 3,
328};
329
332enum class CalibrationTrigger : uint8_t {
333 SingleShot = 0,
334 Continuous = 1,
335};
336
337namespace detail {
339template <>
340struct EnumLast<Verify> {
341 static constexpr Verify kValue = Verify::ReadBack;
342};
344template <>
345struct EnumLast<ResetKind> {
346 static constexpr ResetKind kValue = ResetKind::Hardware;
347};
349template <>
350struct EnumLast<Bandwidth> {
351 static constexpr Bandwidth kValue = Bandwidth::Wide;
352};
354template <>
355struct EnumLast<Lanes> {
356 static constexpr Lanes kValue = Lanes::One;
357};
359template <>
360struct EnumLast<DataFormat> {
361 static constexpr DataFormat kValue = DataFormat::OffsetBinary;
362};
364template <>
365struct EnumLast<DriveStrength> {
366 static constexpr DriveStrength kValue = DriveStrength::OneAndHalf;
367};
369template <>
370struct EnumLast<ReferenceSource> {
371 static constexpr ReferenceSource kValue = ReferenceSource::External;
372};
374template <>
375struct EnumLast<ChannelCount> {
376 static constexpr ChannelCount kValue = ChannelCount::Two;
377};
379template <>
380struct EnumLast<AverageLength> {
381 static constexpr AverageLength kValue = AverageLength::X128;
382};
384template <>
385struct EnumLast<FilterKind> {
386 static constexpr FilterKind kValue = FilterKind::Fir;
387};
389template <>
390struct EnumLast<ReadySource> {
391 static constexpr ReadySource kValue = ReadySource::Pin;
392};
394template <>
395struct EnumLast<CalibrationTrigger> {
396 static constexpr CalibrationTrigger kValue = CalibrationTrigger::Continuous;
397};
398} // namespace detail
399
405constexpr bool IsValid(InputType v) noexcept {
406 switch (v) {
410 return true;
411 default:
412 break;
413 }
414 return false;
415}
421constexpr bool IsValid(InputRange v) noexcept {
422 switch (v) {
423 case InputRange::V5:
424 case InputRange::V2_5:
426 case InputRange::V10:
428 return true;
429 default:
430 break;
431 }
432 return false;
433}
439constexpr bool IsValid(WordLength v) noexcept {
440 return (v == WordLength::Bits16) || (v == WordLength::Bits24);
441}
447constexpr bool IsValid(AlarmFunction v) noexcept {
448 switch (v) {
453 return true;
454 default:
455 break;
456 }
457 return false;
458}
464constexpr bool IsValid(FirFilter v) noexcept {
465 const auto code = static_cast<uint32_t>(detail::ToUnderlying(v));
466 return (code >= 1U) && (code <= 7U) && (code != 6U);
467}
474constexpr bool IsValid(PatternKind v) noexcept {
475 return (v == PatternKind::Constant) || (v == PatternKind::Ramp);
476}
482constexpr bool IsValid(CalibrationMode v) noexcept {
483 const auto code = static_cast<uint32_t>(detail::ToUnderlying(v));
484 return (code >= 1U) && (code <= 3U);
485}
486
488struct Window {
489 bool enabled{false};
490 int8_t high_code{127};
491 int8_t low_code{-128};
492 uint8_t hysteresis{0};
493};
494
506
519
525
533
535struct Alarm {
537 bool active_low{false};
538 bool pulse{false};
539 bool disabled{false};
540 uint8_t sources{0};
542};
543
545struct Sampling {
546 uint32_t convst_hz{100'000};
548 uint32_t ready_timeout_us{10'000};
550};
551
555 bool offset_enabled{true};
556 bool gain_enabled{true};
557};
558
565
568 bool enabled{false};
570 bool index_insertion{true};
571 bool step_every_convst{false};
572 std::array<uint16_t, 8> value{};
573};
574
578 bool enabled{false};
579 uint8_t location{0};
580 uint8_t devices{0};
581};
582
584struct Supply {
585 uint32_t avdd_5v_mv{0};
586 uint32_t avdd_1v8_mv{0};
587 uint32_t iovdd_mv{0};
589};
590
596constexpr std::array<Input, 16> DefaultInputs() noexcept {
597 std::array<Input, 16> inputs{};
598 for (Input& in : inputs) {
599 in = Input{};
600 }
601 return inputs;
602}
603
629
633 uint16_t high{0};
634 uint16_t low{0};
641 friend constexpr bool operator==(const WindowFlags& lhs,
642 const WindowFlags& rhs) noexcept = default;
643};
644
646inline constexpr uint16_t kDeviceId = 0x0004;
648inline constexpr uint32_t kPowerUpMs = 30;
650inline constexpr uint32_t kResetMs = 30;
653inline constexpr uint32_t kResetPulseUs = 1000;
655inline constexpr uint32_t kConvstMinHz = 100'000;
657inline constexpr uint32_t kConvstMaxHz = 1'000'000;
659inline constexpr uint32_t kConvstHighMinNs = 50;
661inline constexpr uint32_t kConvstLowMinNs = 50;
663inline constexpr uint32_t kDrdyLowDelayNs = 350;
665inline constexpr uint32_t kConversionNs = 1250;
667inline constexpr uint32_t kSclkMaxHz = 60'000'000;
669inline constexpr uint32_t kSingleShotCalMs = 125;
671inline constexpr uint32_t kCalMarginMs = 25;
674inline constexpr uint32_t kContinuousCalConvst = 100'000;
676inline constexpr uint32_t kReadyTimeoutMaxUs = 200'000;
678inline constexpr uint32_t kInternalVrefMv = 4096;
681inline constexpr uint32_t kInputResistanceOhm = 1'000'000;
684inline constexpr std::size_t kMaxFrameBytes = 50;
685
691constexpr Config ChipResetConfig() noexcept {
692 Config c{};
694 c.interface.data_on_sdout = false;
695 return c;
696}
697
699inline constexpr uint8_t kGlitchMax = 15;
701inline constexpr uint8_t kDelayMaxNs = 5;
703inline constexpr int32_t kOffsetMin = -512;
705inline constexpr int32_t kOffsetMax = 511;
707inline constexpr int32_t kGainMin = -8192;
709inline constexpr int32_t kGainMax = 8191;
710
711namespace detail {
712
714constexpr bool InRange(int32_t v, int32_t lo, int32_t hi) noexcept {
715 return (v >= lo) && (v <= hi);
716}
717
719constexpr Error Check(bool condition) noexcept {
720 return condition ? Error::Ok : Error::InvalidArgument;
721}
722
724constexpr uint8_t GroupCount(ChannelCount count) noexcept {
725 switch (count) {
727 return 1U;
729 return 2U;
731 return 4U;
733 return 8U;
734 default:
735 break;
736 }
737 return 0U;
738}
739
740constexpr Error ValidateInterface(const Interface& i) noexcept {
741 bool ok =
742 IsEnumerator(i.lanes) && IsEnumerator(i.format) && IsEnumerator(i.drive) && IsValid(i.length);
743 // One data lane on SDOUT is the only lane layout that uses SDOUT (Table
744 // 7-11).
745 ok = ok && (!i.data_on_sdout || (i.lanes == Lanes::One));
746 // The randomizer is not specified for 24-bit words (section 7.3.14.4).
747 ok = ok && (!i.randomize || (i.length == WordLength::Bits16));
748 for (const uint8_t d : i.delay_ns) {
749 ok = ok && (d <= kDelayMaxNs);
750 }
751 return Check(ok);
752}
753
754constexpr Error ValidateWindow(const Window& w) noexcept {
755 return Check(!w.enabled || (w.low_code <= w.high_code));
756}
757
758constexpr Error ValidateInput(const Input& in) noexcept {
759 bool ok = IsValid(in.type) && IsValid(in.range) && IsEnumerator(in.bandwidth);
760 ok = ok && InRange(in.offset_quarter_lsb, kOffsetMin, kOffsetMax);
761 ok = ok && InRange(in.gain, kGainMin, kGainMax);
762 return Check(ok);
763}
764
765constexpr bool IsDifferential(const Input& in) noexcept {
766 return in.type == InputType::Differential;
767}
768
771constexpr bool BankClassUniform(const std::array<Input, 16>& inputs, uint32_t first) noexcept {
772 const bool first_class = IsDifferential(inputs[first]);
773 for (uint32_t i = first; i < (first + 8U); ++i) {
774 if (IsDifferential(inputs[i]) != first_class) {
775 return false;
776 }
777 }
778 return true;
779}
780
781constexpr Error ValidateInputs(const std::array<Input, 16>& inputs) noexcept {
782 for (const Input& in : inputs) {
783 const Error e = ValidateInput(in);
784 if (e != Error::Ok) {
785 return e;
786 }
787 const Error w = ValidateWindow(in.window);
788 if (w != Error::Ok) {
789 return w;
790 }
791 }
792 return Check(BankClassUniform(inputs, 0U) && BankClassUniform(inputs, 8U));
793}
794
795constexpr Error ValidateFilter(const Filter& f) noexcept {
796 bool ok = IsEnumerator(f.kind) && IsEnumerator(f.length) && IsValid(f.fir);
797 const bool average =
799 ok = ok && (!average || (f.length != AverageLength::None));
800 ok = ok && (!f.internal_clock || (f.kind == FilterKind::BlockAverage));
801 return Check(ok);
802}
803
804constexpr Error ValidateAlarm(const Alarm& a) noexcept {
805 bool ok = IsValid(a.function);
806 const bool or_masked = a.function == AlarmFunction::OrMasked;
807 ok = ok && (or_masked || (a.sources == 0U));
808 ok = ok && (!or_masked || (a.or_mask_acknowledged && (a.sources != 0U)));
809 ok = ok && (!a.pulse || (a.function == AlarmFunction::WindowAlert));
810 return Check(ok);
811}
812
813constexpr Error ValidateSampling(const Sampling& s) noexcept {
814 bool ok = IsEnumerator(s.ready);
815 ok = ok && (s.convst_hz >= kConvstMinHz) && (s.convst_hz <= kConvstMaxHz);
816 ok = ok && (s.ready_timeout_us >= 1U) && (s.ready_timeout_us <= kReadyTimeoutMaxUs);
817 return Check(ok);
818}
819
820constexpr Error ValidateSupply(const Supply& s) noexcept {
821 const auto in = [](uint32_t v, uint32_t lo, uint32_t hi) {
822 return (v == 0U) || ((v >= lo) && (v <= hi));
823 };
824 return Check(in(s.avdd_5v_mv, 4750U, 5250U) && in(s.avdd_1v8_mv, 1700U, 1900U) &&
825 in(s.iovdd_mv, 1700U, 3600U));
826}
827
828constexpr Error ValidateExtras(const Config& c) noexcept {
829 bool ok = IsEnumerator(c.reference) && IsEnumerator(c.channels.count);
830 ok = ok && (c.channels.group < GroupCount(c.channels.count));
831 ok = ok && IsValid(c.calibration.mode) && IsEnumerator(c.calibration.trigger);
832 // ADC calibration needs the digital filters off (section 7.3.10).
833 ok = ok && (!c.calibration.run_at_start || (c.filter.kind == FilterKind::None));
834 for (const TestPattern& t : c.test_pattern) {
835 ok = ok && IsValid(t.kind);
836 }
837 for (const uint8_t g : c.window_glitch) {
838 ok = ok && (g <= kGlitchMax);
839 }
840 return Check(ok);
841}
842
845constexpr bool WindowWithOffsetBinary(const Config& c) noexcept {
847 return false;
848 }
849 return std::ranges::any_of(c.inputs, [](const Input& in) { return in.window.enabled; });
850}
851
852} // namespace detail
853
861constexpr Error Validate(const Config& c) noexcept {
862 if (c.daisy.enabled) {
863 return Error::Unsupported;
864 }
865 const std::array<Error, 8> steps{detail::ValidateInterface(c.interface),
866 detail::ValidateInputs(c.inputs),
867 detail::ValidateFilter(c.filter),
868 detail::ValidateAlarm(c.alarm),
869 detail::ValidateSampling(c.sampling),
870 detail::ValidateSupply(c.supply),
871 detail::ValidateExtras(c),
872 detail::Check(!detail::WindowWithOffsetBinary(c))};
873 for (const Error e : steps) {
874 if (e != Error::Ok) {
875 return e;
876 }
877 }
878 return Error::Ok;
879}
880
881static_assert(Validate(Config{}) == Error::Ok);
882static_assert(Validate(ChipResetConfig()) == Error::Ok);
883
884namespace detail {
890void ConfigIsInvalid() noexcept;
891} // namespace detail
892
901public:
904 consteval explicit CheckedConfig(const Config& config) : config_(config) {
905 if (Validate(config) != Error::Ok) {
906 detail::ConfigIsInvalid();
907 }
908 }
910 [[nodiscard]] constexpr const Config& Get() const& noexcept {
911 return config_;
912 }
914 void Get() const&& = delete;
915
916private:
917 Config config_;
918};
919
922constexpr int GetDriverVersionMajor() noexcept {
923 return ADS9324_VERSION_MAJOR;
924}
926constexpr int GetDriverVersionMinor() noexcept {
927 return ADS9324_VERSION_MINOR;
928}
930constexpr int GetDriverVersionPatch() noexcept {
931 return ADS9324_VERSION_PATCH;
932}
934constexpr const char* GetDriverVersion() noexcept {
935 return ADS9324_VERSION_STRING;
936}
937
944constexpr uint32_t AverageFactor(AverageLength length) noexcept {
945 constexpr std::array<uint8_t, 12> kFactor{1, 2, 4, 6, 8, 10, 12, 16, 20, 32, 64, 128};
946 const auto code = static_cast<uint32_t>(detail::ToUnderlying(length));
947 return (code < kFactor.size()) ? static_cast<uint32_t>(kFactor[code]) : 1U;
948}
949
955constexpr uint32_t FirDecimation(FirFilter fir) noexcept {
956 switch (fir) {
957 case FirFilter::Fir3:
958 case FirFilter::Fir5:
959 return 4U;
960 case FirFilter::Fir7:
961 return 8U;
962 case FirFilter::Fir1:
963 case FirFilter::Fir2:
964 case FirFilter::Fir4:
965 default:
966 break;
967 }
968 return 2U;
969}
970
976constexpr uint32_t ResultsPerOutput(const Filter& filter) noexcept {
977 switch (filter.kind) {
979 return AverageFactor(filter.length);
980 case FilterKind::Fir:
981 return FirDecimation(filter.fir);
982 case FilterKind::None:
984 default:
985 break;
986 }
987 return 1U;
988}
989
997constexpr uint32_t PulsesPerResult(const Filter& filter) noexcept {
998 if (filter.kind == FilterKind::Fir) {
999 return FirDecimation(filter.fir);
1000 }
1001 if ((filter.kind == FilterKind::BlockAverage) && !filter.internal_clock) {
1002 return AverageFactor(filter.length);
1003 }
1004 return 1U;
1005}
1006
1013constexpr uint32_t OutputRateHz(const Config& config) noexcept {
1014 return config.sampling.convst_hz / ResultsPerOutput(config.filter);
1015}
1016
1028constexpr uint32_t ConversionTimeUs(const Config& config) noexcept {
1029 const uint32_t n = ResultsPerOutput(config.filter);
1030 uint64_t ns = kConversionNs;
1031 if (n > 1U) {
1032 // Section 5.7: tCONV = (N - 1) x tCYC + 1.25 us, tCYC = 1 / fCONVST.
1033 ns += static_cast<uint64_t>(n - 1U) * (1'000'000'000ULL / config.sampling.convst_hz);
1034 }
1035 const uint64_t us = (ns + 999ULL) / 1000ULL;
1036 return static_cast<uint32_t>((us < 2ULL) ? 2ULL : us);
1037}
1038
1047constexpr int16_t OffsetCorrectionFor(int32_t expected_code, int32_t measured_code) noexcept {
1048 const int32_t v = 4 * (expected_code - measured_code);
1049 const int32_t clamped = std::clamp(v, kOffsetMin, kOffsetMax);
1050 return static_cast<int16_t>(clamped);
1051}
1052
1061constexpr int16_t GainCorrectionFor(int32_t expected_code, int32_t measured_code) noexcept {
1062 if (measured_code == 0) {
1063 return 0;
1064 }
1065 const int64_t num = static_cast<int64_t>(expected_code - measured_code) * 65536;
1066 const int64_t den = measured_code;
1067 const int64_t half = ((den < 0) ? -den : den) / 2;
1068 const bool same_sign = (num >= 0) == (den > 0);
1069 const int64_t v = same_sign ? ((((num < 0) ? -num : num) + half) / ((den < 0) ? -den : den))
1070 : -((((num < 0) ? -num : num) + half) / ((den < 0) ? -den : den));
1071 const int64_t clamped = std::clamp<int64_t>(v, kGainMin, kGainMax);
1072 return static_cast<int16_t>(clamped);
1073}
1074
1075static_assert((AverageFactor(AverageLength::X128) == 128U) &&
1076 (AverageFactor(AverageLength::None) == 1U));
1077static_assert(ConversionTimeUs(Config{}) == 2U);
1078static_assert((OffsetCorrectionFor(0, 3) == -12) && (OffsetCorrectionFor(0, 1000) == kOffsetMin));
1079static_assert((GainCorrectionFor(32000, 32000) == 0) && (GainCorrectionFor(32768, 32000) == 1573));
1080
1086constexpr int32_t RangeMillivolts(InputRange range) noexcept {
1087 switch (range) {
1088 case InputRange::V5:
1089 return 5000;
1090 case InputRange::V2_5:
1091 return 2500;
1092 case InputRange::V6_25:
1093 return 6250;
1094 case InputRange::V10:
1095 return 10000;
1096 case InputRange::V12_5:
1097 return 12500;
1098 default:
1099 break;
1100 }
1101 return 5000;
1102}
1103
1111constexpr int32_t CodeToMicrovolts(int32_t code, InputRange range) noexcept {
1112 const int64_t full_scale_uv = static_cast<int64_t>(RangeMillivolts(range)) * 1000;
1113 const int64_t scaled = static_cast<int64_t>(code) * full_scale_uv;
1114 const int64_t half = 16384;
1115 const int64_t rounded = (scaled >= 0) ? ((scaled + half) / 32768) : ((scaled - half) / 32768);
1116 return static_cast<int32_t>(rounded);
1117}
1118
1124constexpr int16_t ToSigned16(uint16_t raw) noexcept {
1125 return static_cast<int16_t>(raw);
1126}
1127
1134constexpr int16_t WireToCode(uint16_t raw, DataFormat format) noexcept {
1135 if (format == DataFormat::OffsetBinary) {
1136 return ToSigned16(static_cast<uint16_t>(static_cast<uint32_t>(raw) ^ 0x8000U));
1137 }
1138 return ToSigned16(raw);
1139}
1140
1146constexpr uint16_t DerandomizeMask(uint8_t prbs) noexcept {
1147 const auto value = static_cast<uint32_t>(prbs);
1148 const uint32_t low = ((value & 1U) != 0U) ? 255U : 0U;
1149 return static_cast<uint16_t>((value << 8U) + low);
1150}
1151
1157constexpr uint32_t FrameChannels(const ChannelSelect& select) noexcept {
1158 switch (select.count) {
1160 return 16U;
1162 return 8U;
1163 case ChannelCount::Four:
1164 return 4U;
1165 case ChannelCount::Two:
1166 return 2U;
1167 default:
1168 break;
1169 }
1170 return 16U;
1171}
1172
1179constexpr uint8_t FrameSlotChannel(const ChannelSelect& select, uint32_t slot) noexcept {
1180 const auto group = static_cast<uint32_t>(select.group);
1181 uint32_t channel = slot;
1182 switch (select.count) {
1184 if (group != 0U) {
1185 channel = slot + 4U;
1186 } else if (slot >= 4U) {
1187 channel = slot + 8U;
1188 } else {
1189 channel = slot; // group 0, slots 0 to 3: AIN1 to AIN4
1190 }
1191 break;
1192 case ChannelCount::Four:
1193 channel = (slot < 2U) ? (slot + (2U * group)) : (slot + 12U - (2U * group));
1194 break;
1195 case ChannelCount::Two:
1196 channel = (slot == 0U) ? group : (15U - group);
1197 break;
1199 default:
1200 break;
1201 }
1202 return static_cast<uint8_t>(channel);
1203}
1204
1212constexpr bool HasDiagByte(const Interface& interface) noexcept {
1213 return interface.append_diag || interface.randomize;
1214}
1215
1223constexpr std::size_t FrameBytes(const Interface& interface, const ChannelSelect& select) noexcept {
1224 const uint32_t per_channel = (interface.length == WordLength::Bits24) ? 3U : 2U;
1225 uint32_t bytes = FrameChannels(select) * per_channel;
1226 bytes += HasDiagByte(interface) ? 1U : 0U;
1227 bytes += interface.randomize ? 1U : 0U;
1228 return static_cast<std::size_t>(bytes);
1229}
1230
1232struct Frame {
1233 std::array<uint16_t, 16> raw{};
1234 std::array<int16_t, 16> codes{};
1235 std::array<uint8_t, 16> low_byte{};
1236 std::array<int32_t, 16> microvolts{};
1237 uint16_t present_mask{0};
1238 uint16_t clipped_mask{0};
1239 uint8_t diag{0};
1240 uint8_t prbs{0};
1241 bool window_alert{false};
1242 bool reset_detected{false};
1243};
1244
1246inline constexpr uint8_t kDiagWindowAlert = 0x40;
1248inline constexpr uint8_t kDiagResetDetect = 0x01;
1249
1256constexpr bool IsStuckFrame(std::span<const uint8_t> bytes) noexcept {
1257 if (bytes.size() < 4U) {
1258 return false;
1259 }
1260 const uint8_t first = bytes[0];
1261 if ((first != 0x00U) && (first != 0xFFU)) {
1262 return false;
1263 }
1264 return std::ranges::all_of(bytes, [first](uint8_t b) { return b == first; });
1265}
1266
1267} // namespace ads9324
1268
1269#endif // ADS9324_TYPES_HPP
Compile-time helpers of the ADS9324 driver: typed integer literals, exact hook matching,...
ADS9324 register map: banks, addresses, bit fields, reset values and the channel layout (datasheet se...
A configuration proven valid when the program is built. An invalid one does not compile.
Definition ads9324_types.hpp:900
constexpr uint32_t kSclkMaxHz
Highest SCLK frequency (section 5.6).
Definition ads9324_types.hpp:667
FirFilter fir
For FilterKind::Fir.
Definition ads9324_types.hpp:530
Supply supply
Supply voltages for the range check.
Definition ads9324_types.hpp:626
constexpr std::size_t FrameBytes(const Interface &interface, const ChannelSelect &select) noexcept
Bytes of one data frame (section 7.3.14).
Definition ads9324_types.hpp:1223
Correction correction
Offset and gain stages.
Definition ads9324_types.hpp:621
constexpr int16_t OffsetCorrectionFor(int32_t expected_code, int32_t measured_code) noexcept
The OFS value that removes a measured offset (equation 1, section 7.3.9).
Definition ads9324_types.hpp:1047
constexpr uint8_t kGlitchMax
Highest DWC glitch filter count (DWC_GLITCH_FILT, 4 bits).
Definition ads9324_types.hpp:699
CalibrationMode
Which errors ADC_CAL removes (ADC_CAL_MODE).
Definition ads9324_types.hpp:324
constexpr uint32_t kConversionNs
Conversion time without oversampling, tCONV.
Definition ads9324_types.hpp:665
DriveStrength drive
Output drive strength.
Definition ads9324_types.hpp:516
constexpr int16_t GainCorrectionFor(int32_t expected_code, int32_t measured_code) noexcept
The GAN value that removes a measured gain error (equations 2 to 4, section 7.3.9).
Definition ads9324_types.hpp:1061
bool cm_correction
Common mode error correction (CME_CORR_EN).
Definition ads9324_types.hpp:500
bool reject_stuck_frames
ReadFrame() refuses an all-0x00 or all-0xFF frame.
Definition ads9324_types.hpp:549
LogLevel
Severity passed to the optional Log() hook.
Definition ads9324_types.hpp:172
Verify
Whether a setter reads back what it wrote (costs one two-frame read per register).
Definition ads9324_types.hpp:181
constexpr uint32_t OutputRateHz(const Config &config) noexcept
Result rate of the data interface in hertz.
Definition ads9324_types.hpp:1013
Error
Why a call failed. Every call of the driver returns one of these in its Result.
Definition ads9324_types.hpp:45
constexpr bool HasDiagByte(const Interface &interface) noexcept
Whether the frame ends with a DIAG byte: asked for, or implied by the randomizer (the datasheet shows...
Definition ads9324_types.hpp:1212
InputRange
Input range of a channel (INPUT_RANGE_AINn, Table 7-1).
Definition ads9324_types.hpp:200
constexpr uint32_t kSingleShotCalMs
The single-shot ADC calibration time, TWAIT (Table 7-7).
Definition ads9324_types.hpp:669
constexpr const char * GetDriverVersion() noexcept
Definition ads9324_types.hpp:934
ReferenceSource reference
Reference selection.
Definition ads9324_types.hpp:614
CalibrationMode mode
Which errors.
Definition ads9324_types.hpp:562
constexpr uint32_t FirDecimation(FirFilter fir) noexcept
The decimation of a FIR filter (Table 7-9).
Definition ads9324_types.hpp:955
std::array< Input, 16 > inputs
AIN1 to AIN16.
Definition ads9324_types.hpp:615
constexpr int GetDriverVersionMinor() noexcept
Definition ads9324_types.hpp:926
constexpr std::size_t kMaxFrameBytes
Longest data frame in bytes: 16 channels of 24 bits, DIAG and PRBS.
Definition ads9324_types.hpp:684
constexpr int32_t kOffsetMax
OFS range in quarter LSBs.
Definition ads9324_types.hpp:705
constexpr int32_t kGainMin
GAN range (14 bits, two's complement).
Definition ads9324_types.hpp:707
bool enabled
DWC_EN: the digital window comparator watches this channel.
Definition ads9324_types.hpp:489
ChannelCount count
How many channels.
Definition ads9324_types.hpp:522
Filter filter
Digital filter.
Definition ads9324_types.hpp:616
uint32_t convst_hz
CONVST frequency, 100 kHz to 1 MHz.
Definition ads9324_types.hpp:546
constexpr const char * ToString(Error error) noexcept
The name of an error, for logs.
Definition ads9324_types.hpp:69
constexpr uint32_t kInputResistanceOhm
Input resistance of each AINnP and AINnM pin in ohms (section 7.3.3).
Definition ads9324_types.hpp:681
PatternKind
Kind of a test pattern (TP_MODE, Table 7-14).
Definition ads9324_types.hpp:311
DataFormat format
Coding.
Definition ads9324_types.hpp:513
friend constexpr bool operator==(const WindowFlags &lhs, const WindowFlags &rhs) noexcept=default
Equal when both masks are.
constexpr uint8_t FrameSlotChannel(const ChannelSelect &select, uint32_t slot) noexcept
Which channel a slot of the frame carries (Table 7-12).
Definition ads9324_types.hpp:1179
std::array< uint16_t, 8 > value
Pattern per channel; the first is the ramp step.
Definition ads9324_types.hpp:572
Alarm alarm
DRDY/ALARM pin.
Definition ads9324_types.hpp:619
WordLength length
16 or 24 bits per channel.
Definition ads9324_types.hpp:512
uint8_t group
Which group of that size (ADC_CH_SEL).
Definition ads9324_types.hpp:523
uint32_t ready_timeout_us
Longest pin wait, 1 to kReadyTimeoutMaxUs.
Definition ads9324_types.hpp:548
ReadySource
How WaitDataReady() learns that a result is ready.
Definition ads9324_types.hpp:318
constexpr uint32_t kConvstHighMinNs
Shortest CONVST high time.
Definition ads9324_types.hpp:659
uint16_t low
Channel n went below its low threshold.
Definition ads9324_types.hpp:634
bool append_diag
Append the DIAG byte (EN_DIAG_FLAG).
Definition ads9324_types.hpp:514
constexpr std::array< Input, 16 > DefaultInputs() noexcept
The default settings of the 16 inputs, spelled out because GCC skips nested member initialisers in in...
Definition ads9324_types.hpp:596
constexpr bool ok() const noexcept
Definition ads9324_types.hpp:150
constexpr bool IsValid(InputType v) noexcept
Whether an input type holds a documented code.
Definition ads9324_types.hpp:405
uint8_t sources
For OrMasked: the sources in the OR.
Definition ads9324_types.hpp:540
DriveStrength
Drive strength of the digital outputs (DRIVE_STRENGTH, Table 7-15).
Definition ads9324_types.hpp:236
bool enabled
TP_EN.
Definition ads9324_types.hpp:568
constexpr uint32_t kResetPulseUs
Shortest RESET low pulse the driver drives (a design choice, section 7.4.1).
Definition ads9324_types.hpp:653
constexpr Error Validate(const Config &c) noexcept
Check a configuration against the documented ranges and combinations, with no I/O.
Definition ads9324_types.hpp:861
AlarmFunction
What the DRDY/ALARM pin shows (DRDY_ALRM_SEL, Table 7-10).
Definition ads9324_types.hpp:261
uint8_t hysteresis
Hysteresis on both thresholds, in top-byte counts.
Definition ads9324_types.hpp:492
PatternKind kind
Constant or ramp.
Definition ads9324_types.hpp:569
constexpr int16_t WireToCode(uint16_t raw, DataFormat format) noexcept
The signed code of a wire value.
Definition ads9324_types.hpp:1134
DaisyChain daisy
Out of scope.
Definition ads9324_types.hpp:625
uint32_t avdd_5v_mv
AVDD_5V, 4750 to 5250.
Definition ads9324_types.hpp:585
constexpr uint32_t AverageFactor(AverageLength length) noexcept
The averaging factor of a length code: 1, 2, 4, 6, 8, 10, 12, 16, 20, 32, 64, 128.
Definition ads9324_types.hpp:944
Calibration calibration
ADC calibration.
Definition ads9324_types.hpp:622
constexpr uint32_t ConversionTimeUs(const Config &config) noexcept
Time from the start of a conversion to a ready result, rounded up to microseconds,...
Definition ads9324_types.hpp:1028
void Get() const &&=delete
Not on a temporary: the reference would dangle (KB-CPP20-044).
Bandwidth
Analog low-pass filter of a channel (PGA_BW_SEL_AINn, Table 7-2).
Definition ads9324_types.hpp:209
constexpr uint32_t kConvstMaxHz
Highest CONVST frequency, fCONVST.
Definition ads9324_types.hpp:657
int8_t low_code
Low threshold on the top byte of the code.
Definition ads9324_types.hpp:491
bool active_low
ALRM_POL, applies to every function.
Definition ads9324_types.hpp:537
CalibrationTrigger trigger
CONVST behaviour.
Definition ads9324_types.hpp:563
bool offset_enabled
OFS stage in the data path.
Definition ads9324_types.hpp:555
bool internal_clock
Block average: internal oversampling clock.
Definition ads9324_types.hpp:531
CalibrationTrigger
How the CONVST clock behaves during ADC calibration (section 7.3.10).
Definition ads9324_types.hpp:332
bool gain_enabled
GAN stage in the data path.
Definition ads9324_types.hpp:556
constexpr uint8_t kDiagResetDetect
DIAG bit 0, RESET_DETECT_FLAG.
Definition ads9324_types.hpp:1248
constexpr int32_t RangeMillivolts(InputRange range) noexcept
Full-scale voltage of a range in millivolts.
Definition ads9324_types.hpp:1086
std::array< uint8_t, 9 > delay_ns
Output delay 0 to 5 ns: SDOUT, then D0 to D7.
Definition ads9324_types.hpp:517
bool pulse
ALRM_TYPE: pulse instead of level (window).
Definition ads9324_types.hpp:538
constexpr uint32_t kConvstLowMinNs
Shortest CONVST low time.
Definition ads9324_types.hpp:661
std::array< TestPattern, 2 > test_pattern
Group 0 is AIN1 to AIN8, group 1 AIN9 to AIN16.
Definition ads9324_types.hpp:623
int16_t gain
GAN: -8192 to 8191, result x (1 + gain / 65536).
Definition ads9324_types.hpp:502
Window window
The window comparator of this channel.
Definition ads9324_types.hpp:504
bool run_at_start
Run ADC_CAL in EnsureInitialized().
Definition ads9324_types.hpp:561
ChannelCount
How many channels the data frame carries (ADC_NUM_SEL, Table 7-12).
Definition ads9324_types.hpp:253
constexpr uint32_t ResultsPerOutput(const Filter &filter) noexcept
Samples that make one result of the digital filter in the data path.
Definition ads9324_types.hpp:976
constexpr uint32_t kDrdyLowDelayNs
Delay from the CONVST falling edge to the DRDY falling edge.
Definition ads9324_types.hpp:663
constexpr int32_t kOffsetMin
OFS range in quarter LSBs (10 bits, two's complement).
Definition ads9324_types.hpp:703
DataFormat
Coding of the conversion result (EN_OFS_BINARY).
Definition ads9324_types.hpp:229
int16_t offset_quarter_lsb
OFS: -512 to 511 quarter LSBs, added first.
Definition ads9324_types.hpp:501
static constexpr Result Success() noexcept
Definition ads9324_types.hpp:158
uint32_t avdd_1v8_mv
AVDD_1V8, 1700 to 1900.
Definition ads9324_types.hpp:586
constexpr const Config & Get() const &noexcept
Definition ads9324_types.hpp:910
InputType type
Differential, single ended, open-wire safe.
Definition ads9324_types.hpp:497
constexpr uint32_t kCalMarginMs
Extra time the driver polls CALIB_BUSY after the single-shot wait.
Definition ads9324_types.hpp:671
constexpr uint8_t kAlarmSourceWindow
Source code 1, window alert.
Definition ads9324_types.hpp:272
constexpr bool IsStuckFrame(std::span< const uint8_t > bytes) noexcept
Whether a data frame could come from a stuck or floating line: every byte 0x00 or every byte 0xFF (ha...
Definition ads9324_types.hpp:1256
AlarmFunction function
What the pin shows.
Definition ads9324_types.hpp:536
ResetKind
How Reset() resets the chip.
Definition ads9324_types.hpp:187
ChannelSelect channels
Channels in the frame.
Definition ads9324_types.hpp:617
static constexpr Result Failure(Error e) noexcept
A failed result.
Definition ads9324_types.hpp:166
static constexpr Result Success(T v) noexcept
A successful result.
Definition ads9324_types.hpp:131
AverageLength length
For the two average kinds.
Definition ads9324_types.hpp:529
constexpr uint32_t kConvstMinHz
Lowest CONVST frequency, fCONVST (section 5.6).
Definition ads9324_types.hpp:655
WordLength
Bits per conversion result on the data interface (DOUT_LENGTH).
Definition ads9324_types.hpp:223
bool disabled
ALRM_DIS: the alarm function is off.
Definition ads9324_types.hpp:539
constexpr int32_t CodeToMicrovolts(int32_t code, InputRange range) noexcept
Microvolts of a signed code: code x full scale / 32768, rounded half away from zero.
Definition ads9324_types.hpp:1111
uint16_t high
Channel n went above its high threshold.
Definition ads9324_types.hpp:633
Sampling sampling
CONVST and ready wait.
Definition ads9324_types.hpp:620
constexpr uint8_t kDelayMaxNs
Largest output delay in nanoseconds (3 bits, section 8.1.10).
Definition ads9324_types.hpp:701
Bandwidth bandwidth
Analog low-pass filter.
Definition ads9324_types.hpp:499
std::array< uint8_t, 2 > window_glitch
DWC glitch filter per group, 0 to 15.
Definition ads9324_types.hpp:624
constexpr uint32_t kPowerUpMs
Power-up wait before the first access, tPU (section 5.7).
Definition ads9324_types.hpp:648
uint8_t devices
Devices in the chain (unused).
Definition ads9324_types.hpp:580
AverageLength
Length of a block or moving average (BLK_AVG_OSR, MVG_AVG_LEN).
Definition ads9324_types.hpp:276
constexpr Config ChipResetConfig() noexcept
The chip's reset state as a Config: eight lanes on D7 to D0, everything else as Config{}.
Definition ads9324_types.hpp:691
bool step_every_convst
Ramp: step at every CONVST (TP_UPD_MODE).
Definition ads9324_types.hpp:571
bool randomize
XOR the data with PRBS, append the PRBS byte.
Definition ads9324_types.hpp:515
bool or_mask_acknowledged
The caller accepts that the mask sense is unverified.
Definition ads9324_types.hpp:541
uint8_t phase_delay
Sample delay in CONVST periods, 0 to 255.
Definition ads9324_types.hpp:503
constexpr uint16_t DerandomizeMask(uint8_t prbs) noexcept
The XOR mask of the randomizer (equations 7 and 8, section 7.3.14.4).
Definition ads9324_types.hpp:1146
FilterKind
Which one digital filter is in the data path (section 7.3.11).
Definition ads9324_types.hpp:303
constexpr uint32_t kResetMs
Wait after a reset before the first access (tPU, A3).
Definition ads9324_types.hpp:650
bool data_on_sdout
One lane on SDOUT (true) or D7 (false).
Definition ads9324_types.hpp:511
ReferenceSource
Where the ADC reference comes from (Table 7-3).
Definition ads9324_types.hpp:244
constexpr uint8_t kDiagWindowAlert
DIAG bit 6, DWC_ALERT_FLAG (Table 7-13).
Definition ads9324_types.hpp:1246
Interface interface
Data interface.
Definition ads9324_types.hpp:613
uint32_t iovdd_mv
Definition ads9324_types.hpp:587
bool low_speed_crosstalk
CH_XTALK_LOW_SPEED, for under 100 kSPS per channel.
Definition ads9324_types.hpp:618
constexpr int GetDriverVersionMajor() noexcept
Definition ads9324_types.hpp:922
constexpr int GetDriverVersionPatch() noexcept
Definition ads9324_types.hpp:930
constexpr uint8_t kAlarmSourceCalDone
Source code 6, ADC calibration done.
Definition ads9324_types.hpp:273
Lanes lanes
Lane count; Config{} uses one lane.
Definition ads9324_types.hpp:510
constexpr uint32_t PulsesPerResult(const Filter &filter) noexcept
CONVST falling edges the chip needs for one result.
Definition ads9324_types.hpp:997
constexpr uint16_t kDeviceId
DEVICE_ID value of every ADS9324.
Definition ads9324_types.hpp:646
Lanes
Number of data lanes (DOUT_LANE_SEL, Table 7-11).
Definition ads9324_types.hpp:215
InputType
Input type of a channel (CM_RANGE_AINn, Table 7-1).
Definition ads9324_types.hpp:193
constexpr int16_t ToSigned16(uint16_t raw) noexcept
Reinterpret a 16-bit wire value as a signed code (two's complement).
Definition ads9324_types.hpp:1124
uint8_t location
Position in the chain (unused).
Definition ads9324_types.hpp:579
InputRange range
Full-scale range.
Definition ads9324_types.hpp:498
constexpr uint32_t FrameChannels(const ChannelSelect &select) noexcept
Number of channels in a frame.
Definition ads9324_types.hpp:1157
ReadySource ready
How a result is known to be ready.
Definition ads9324_types.hpp:547
constexpr uint32_t kReadyTimeoutMaxUs
Longest Sampling::ready_timeout_us.
Definition ads9324_types.hpp:676
constexpr bool ok() const noexcept
Definition ads9324_types.hpp:119
constexpr uint8_t kAlarmSourceDrdy
Sources of the OR output; bit n of Alarm::sources is the source with code n.
Definition ads9324_types.hpp:271
FirFilter
The FIR low-pass filters (FIR_FILT_SEL, Table 7-9). FIR6 is reserved and absent.
Definition ads9324_types.hpp:293
bool hardware_reset
Use the RESET pin at start-up (needs GpioSet()).
Definition ads9324_types.hpp:627
bool index_insertion
Add the channel index in the top nibble (TP_DIS_IDX = 0).
Definition ads9324_types.hpp:570
constexpr int32_t kGainMax
GAN range.
Definition ads9324_types.hpp:709
bool enabled
Refused with Unsupported.
Definition ads9324_types.hpp:578
FilterKind kind
Which filter.
Definition ads9324_types.hpp:528
static constexpr Result Failure(Error e) noexcept
A failed result.
Definition ads9324_types.hpp:139
int8_t high_code
High threshold on the top byte of the code (two's complement).
Definition ads9324_types.hpp:490
constexpr uint32_t kInternalVrefMv
Internal reference voltage in millivolts (section 5.5).
Definition ads9324_types.hpp:678
constexpr uint32_t kContinuousCalConvst
The free-running ADC calibration time in CONVST periods (Table 7-7).
Definition ads9324_types.hpp:674
consteval CheckedConfig(const Config &config)
Definition ads9324_types.hpp:904
@ Warning
Something unexpected that the driver recovered from.
@ Info
Lifecycle events.
@ Debug
Detail for bring-up.
@ None
No read-back.
@ ReadBack
Read every register the call touched and compare with the shadow.
@ UnexpectedReset
RESET_DETECT_FLAG is set: the chip reset since the start.
@ InvalidArgument
An argument or a Config field is out of range; nothing was sent.
@ DeviceIdMismatch
DEVICE_ID or BANK_SEL did not read as a ADS9324 after a reset.
@ Crc
Never returned: the chip has no CRC.
@ Bus
A port hook returned false.
@ VerifyFailed
A read-back differs from what was written.
@ DeviceFault
Reserved for a chip fault flag; the ADS9324 reports none.
@ NotInitialized
EnsureInitialized() has not succeeded, or the driver was reset.
@ Ok
The call succeeded.
@ Unsupported
The port hook or chip feature this call needs is absent.
@ Timeout
A flag did not change in the allowed time.
@ Busy
Never returned: the chip has no busy reply.
@ Refused
The call is not allowed in the current state; nothing was sent.
@ Constant
A fixed 16-bit value per channel.
@ Time
Wait the conversion time (no pin needed).
@ Pin
Poll the DRDY/ALARM pin through GpioGet().
@ Normal
1 x. Reset value.
@ WindowAlert
Digital window comparator alert.
@ Drdy
ADC data ready. Reset value.
@ CalDone
ADC calibration done.
@ Low
25.5 kHz for every range.
@ Wide
280 kHz to 350 kHz, by range.
@ Continuous
A free-running CONVST: 100,000 periods.
@ SingleShot
INT_TRIG_MODE = 1: one CONVST pulse, 125 ms.
@ All16
16 channels. Reset value.
@ Four
4 channels; group 0 to 3.
@ Two
2 channels; group 0 to 7.
@ Eight
8 channels; group 0 or 1.
@ OffsetBinary
Straight offset binary.
@ TwosComplement
Binary two's complement. Reset value.
@ Hardware
A pulse on the RESET pin through GpioSet().
@ Software
SW_RST in GEN_CFG1.
@ Bits16
16 bits. Reset value.
@ Bits24
24 bits: the result and an extra byte.
@ Fir
A FIR filter, Filter::fir.
@ MovingAverage
Moving average over Filter::length conversions.
@ BlockAverage
Block average over Filter::length conversions.
@ Internal
Internal 4.096 V reference, REFSEL ignored.
@ Pin
The REFSEL pin chooses. Reset value.
@ One
D7, or SDOUT with Interface::data_on_sdout.
@ Four
D7 to D4.
@ Two
D7 and D6.
@ Eight
D7 to D0. Reset value.
@ Differential
Differential, common mode up to +-12.5 V.
@ SingleEnded
AINnM tied to ground.
@ SingleEndedOpenWireSafe
Single ended with the least code change on an open wire.
@ Fir7
Decimation 8.
@ Fir1
Decimation 2.
@ Fir3
Decimation 4.
@ Fir2
Decimation 2.
@ Fir5
Decimation 4.
@ Fir4
Decimation 2.
The ADS9324 driver: everything it declares lives here; internals in detail.
Definition ads9324.hpp:32
The DRDY/ALARM pin (DRDY_ALARM_SEL, GEN_CFG4).
Definition ads9324_types.hpp:535
Calibration at start-up and the mode RunAdcCalibration() uses.
Definition ads9324_types.hpp:560
Which channels the data frame carries (ANA_CFG2).
Definition ads9324_types.hpp:521
Everything EnsureInitialized() and ApplyConfig() write to the chip.
Definition ads9324_types.hpp:612
System offset and gain correction stages (GEN_CFG5 of the channel banks).
Definition ads9324_types.hpp:554
Daisy chain settings: out of scope in this version, Validate() refuses enabled.
Definition ads9324_types.hpp:577
The digital filter in the data path (DIG_FILTER, GEN_CFG5).
Definition ads9324_types.hpp:527
One decoded data frame.
Definition ads9324_types.hpp:1232
The configuration of one input channel.
Definition ads9324_types.hpp:496
The data interface (GEN_CFG3, XOR_BITS_CTL, GEN_CFG4, DIG_DELAY_CFG1/2).
Definition ads9324_types.hpp:509
The value of a call, or why there is none.
Definition ads9324_types.hpp:114
CONVST timing and the ready wait (section 5.6).
Definition ads9324_types.hpp:545
Supplies in millivolts for the range checks; 0 means "not stated".
Definition ads9324_types.hpp:584
A test pattern of one channel group (TP_CFG, TP_AIN).
Definition ads9324_types.hpp:567
The latched digital window comparator flags, one bit per channel (bit 0 is AIN1).
Definition ads9324_types.hpp:632
The digital window comparator of one channel (section 7.3.12).
Definition ads9324_types.hpp:488