ADS9324 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
ads9324_registers.hpp
Go to the documentation of this file.
1
23#ifndef ADS9324_REGISTERS_HPP
24#define ADS9324_REGISTERS_HPP
25
26#include <array>
27#include <cstddef>
28#include <cstdint>
29
30#include "ads9324_detail.hpp"
31
33namespace ads9324::reg {
34
35using detail::Field;
36using detail::operator""_u16;
37using detail::operator""_u8;
38
47enum class Bank : uint8_t {
48 Common = 0,
49 Ain1To8 = 1,
50 Ain9To16 = 2,
52};
53
55inline constexpr uint8_t kBankCount = 3;
57inline constexpr uint8_t kChannelCount = 16;
59inline constexpr uint8_t kChannelsPerBank = 8;
61inline constexpr uint8_t kAddressSpace = 64;
62
68constexpr uint16_t BankSelCode(Bank bank) noexcept {
69 switch (bank) {
70 case Bank::Common:
71 return 1_u16;
72 case Bank::Ain1To8:
73 return 2_u16;
74 case Bank::Ain9To16:
75 return 4_u16;
76 default:
77 break;
78 }
79 return 1_u16;
80}
81
84inline constexpr uint8_t kGenCfg1 = 0x01;
85inline constexpr uint8_t kBankSel = 0x02;
86inline constexpr uint8_t kDiagCtrl = 0x07;
87inline constexpr uint8_t kPdnCtl = 0x08;
88inline constexpr uint8_t kGenCfg2 = 0x09;
89inline constexpr uint8_t kGenCfg3 = 0x0A;
90inline constexpr uint8_t kXorBitsCtl = 0x0B;
91inline constexpr uint8_t kDrdyAlarmSel = 0x0C;
92inline constexpr uint8_t kGenCfg4 = 0x0D;
93inline constexpr uint8_t kDigDelayCfg1 = 0x0E;
94inline constexpr uint8_t kDigDelayCfg2 = 0x0F;
95inline constexpr uint8_t kAnaCfg1 = 0x10;
96inline constexpr uint8_t kAnaCfg2 = 0x11;
97inline constexpr uint8_t kAdcCal = 0x12;
98inline constexpr uint8_t kDigFilter = 0x14;
99inline constexpr uint8_t kGenCfg5 = 0x15;
100inline constexpr uint8_t kDeviceStatus = 0x1D;
101inline constexpr uint8_t kDeviceId = 0x21;
106inline constexpr uint8_t kPgaConfig = 0x08;
107inline constexpr uint8_t kPgaBwSel = 0x0C;
108inline constexpr uint8_t kPhaseDelay = 0x0D;
109inline constexpr uint8_t kOffset = 0x11;
110inline constexpr uint8_t kGain = 0x19;
111inline constexpr uint8_t kDwcCfg = 0x21;
112inline constexpr uint8_t kDwcTh = 0x22;
113inline constexpr uint8_t kDwcHys = 0x2A;
114inline constexpr uint8_t kTpCfg = 0x2E;
115inline constexpr uint8_t kTp = 0x2F;
116inline constexpr uint8_t kCorrection = 0x37;
117inline constexpr uint8_t kDwcFlag = 0x3E;
122using GenCfg1ReadAddress = Field<uint16_t, 8U, 8U>;
123inline constexpr uint16_t kSwRst = 0x0002;
124inline constexpr uint16_t kRegRdEn = 0x0001;
127inline constexpr uint16_t kResetDetectFlag = 0x0100;
128inline constexpr uint16_t kDevicePdn = 0x0001;
129
133using DaisyLocation = Field<uint16_t, 8U, 4U>;
134using DaisyDevices = Field<uint16_t, 4U, 4U>;
135inline constexpr uint16_t kDaisyEnable = 0x0001;
140inline constexpr uint16_t kEnOfsBinary = 0x1000;
141inline constexpr uint16_t kEnXorPatt = 0x0200;
142inline constexpr uint16_t kEnDiagFlag = 0x0100;
143using DoutLaneSel = Field<uint16_t, 4U, 2U>;
144using DoutLength = Field<uint16_t, 2U, 2U>;
145inline constexpr uint16_t kAdcDataSdoutEn = 0x0002;
150inline constexpr uint16_t kXorBitsRandomizer = 0x00F1;
151
154using AlarmMask = Field<uint16_t, 8U, 8U>;
155inline constexpr uint16_t kAlrmType = 0x0020;
156inline constexpr uint16_t kAlrmPol = 0x0010;
157using DrdyAlrmSel = Field<uint16_t, 0U, 4U>;
162inline constexpr uint16_t kAlrmDis = 0x0020;
163inline constexpr uint16_t kDigDelayEn = 0x0008;
164using DriveStrengthField = Field<uint16_t, 0U, 2U>;
170using DelaySdout = Field<uint16_t, 12U, 3U>;
171using DelayD3 = Field<uint16_t, 9U, 3U>;
172using DelayD2 = Field<uint16_t, 6U, 3U>;
173using DelayD1 = Field<uint16_t, 3U, 3U>;
174using DelayD0 = Field<uint16_t, 0U, 3U>;
175using DelayD7 = Field<uint16_t, 9U, 3U>;
176using DelayD6 = Field<uint16_t, 6U, 3U>;
177using DelayD5 = Field<uint16_t, 3U, 3U>;
178using DelayD4 = Field<uint16_t, 0U, 3U>;
183inline constexpr uint16_t kRefselCtrlDis = 0x0002;
184inline constexpr uint16_t kExtRefEn = 0x0001;
185inline constexpr uint16_t kXtalkLowSpeed = 0x8000;
186using AdcChSel = Field<uint16_t, 4U, 3U>;
187using AdcNumSel = Field<uint16_t, 2U, 2U>;
192inline constexpr uint16_t kSeDiffAin1To8 = 0x2000;
193inline constexpr uint16_t kSeDiffAin9To16 = 0x1000;
194inline constexpr uint16_t kAdcCalTrig = 0x0100;
195using AdcCalMode = Field<uint16_t, 0U, 2U>;
200inline constexpr uint16_t kPhaseDelayEn = 0x8000;
201using FirFiltSel = Field<uint16_t, 12U, 3U>;
202using MvgAvgLen = Field<uint16_t, 8U, 4U>;
203using BlkAvgOsr = Field<uint16_t, 4U, 4U>;
204inline constexpr uint16_t kIntTrigMode = 0x0002;
205inline constexpr uint16_t kDigFiltSysref = 0x0001;
206inline constexpr uint16_t kAvgModeOvrEn = 0x0002;
207inline constexpr uint16_t kAvgMode = 0x0001;
210inline constexpr uint16_t kCalibBusyFlag = 0x0008;
211inline constexpr uint16_t kDeviceIdValue = 0x0004;
212
215using CmeCorrEn = Field<uint8_t, 7U, 1U>;
216using CmRange = Field<uint8_t, 4U, 3U>;
217using InputRangeField = Field<uint8_t, 0U, 3U>;
218using PgaBw = Field<uint16_t, 0U, 2U>;
219using OffsetField = Field<uint16_t, 0U, 10U>;
220using GainField = Field<uint16_t, 0U, 14U>;
221inline constexpr uint16_t kDwcStatRst = 0x8000;
222using DwcGlitchFilt = Field<uint16_t, 8U, 4U>;
223using DwcHighTh = Field<uint16_t, 8U, 8U>;
224using DwcLowTh = Field<uint16_t, 0U, 8U>;
225using TpMode = Field<uint16_t, 4U, 3U>;
226inline constexpr uint16_t kTpDisIdx = 0x0004;
227inline constexpr uint16_t kTpUpdMode = 0x0002;
228inline constexpr uint16_t kTpEn = 0x0001;
229inline constexpr uint16_t kOfsCorrDis = 0x0002;
230inline constexpr uint16_t kGanCorrDis = 0x0001;
239
247constexpr ChannelLocation Locate(uint8_t channel) noexcept {
248 if (channel < kChannelsPerBank) {
249 return {.bank = Bank::Ain1To8, .local = channel};
250 }
251 return {.bank = Bank::Ain9To16, .local = static_cast<uint8_t>(kChannelCount - 1U - channel)};
252}
253
260constexpr uint8_t ChannelAt(Bank bank, uint8_t local) noexcept {
261 if (bank == Bank::Ain9To16) {
262 return static_cast<uint8_t>(kChannelCount - 1U - local);
263 }
264 return local;
265}
266
273constexpr uint8_t PgaConfigAddress(uint8_t local) noexcept {
274 return static_cast<uint8_t>(kPgaConfig + (local >> 1U));
275}
281constexpr uint8_t PhaseDelayAddress(uint8_t local) noexcept {
282 return static_cast<uint8_t>(kPhaseDelay + (local >> 1U));
283}
289constexpr uint8_t OffsetAddress(uint8_t local) noexcept {
290 return static_cast<uint8_t>(kOffset + local);
291}
297constexpr uint8_t GainAddress(uint8_t local) noexcept {
298 return static_cast<uint8_t>(kGain + local);
299}
305constexpr uint8_t DwcThAddress(uint8_t local) noexcept {
306 return static_cast<uint8_t>(kDwcTh + local);
307}
313constexpr uint8_t DwcHysAddress(uint8_t local) noexcept {
314 return static_cast<uint8_t>(kDwcHys + (local >> 1U));
315}
321constexpr uint8_t TpAddress(uint8_t local) noexcept {
322 return static_cast<uint8_t>(kTp + local);
323}
330constexpr uint32_t HalfShift(uint8_t local) noexcept {
331 return ((static_cast<uint32_t>(local) & 1U) != 0U) ? 8U : 0U;
332}
333
334namespace detail {
335
337constexpr bool IsCommon(uint8_t address) noexcept {
338 switch (address) {
339 case kGenCfg1:
340 case kBankSel:
341 case kDiagCtrl:
342 case kPdnCtl:
343 case kGenCfg2:
344 case kGenCfg3:
345 case kXorBitsCtl:
346 case kDrdyAlarmSel:
347 case kGenCfg4:
348 case kDigDelayCfg1:
349 case kDigDelayCfg2:
350 case kAnaCfg1:
351 case kAnaCfg2:
352 case kAdcCal:
353 case kDigFilter:
354 case kGenCfg5:
355 case kDeviceStatus:
356 case kDeviceId:
357 return true;
358 default:
359 break;
360 }
361 return false;
362}
363
365constexpr bool IsChannel(uint8_t address) noexcept {
366 // PGA_CONFIG (0x08) to TP_AIN8 (0x36) is one run of registers, then GEN_CFG5
367 // and DWC_FLAG.
368 return ((address >= kPgaConfig) && (address < (kTp + 8U))) || (address == kCorrection) ||
369 (address == kDwcFlag);
370}
371
372} // namespace detail
373
382constexpr bool IsDocumented(Bank bank, uint8_t address) noexcept {
383 return (bank == Bank::Common) ? detail::IsCommon(address) : detail::IsChannel(address);
384}
385
393constexpr bool IsReadOnly(Bank bank, uint8_t address) noexcept {
394 if (bank == Bank::Common) {
395 return (address == kDeviceStatus) || (address == kDeviceId);
396 }
397 return address == kDwcFlag;
398}
399
408constexpr bool IsShadowed(Bank bank, uint8_t address) noexcept {
409 if (!IsDocumented(bank, address) || IsReadOnly(bank, address)) {
410 return false;
411 }
412 const bool command_register =
413 (bank == Bank::Common) && ((address == kGenCfg1) || (address == kBankSel));
414 return !command_register;
415}
416
424constexpr uint16_t ResetValue(Bank bank, uint8_t address) noexcept {
425 if (bank == Bank::Common) {
426 if (address == kDeviceId) {
427 return kDeviceIdValue;
428 }
429 return (address == kBankSel) ? 1_u16 : 0_u16;
430 }
431 const bool threshold = (address >= kDwcTh) && (address < kDwcTh + 8U);
432 const bool hysteresis = (address > kDwcHys) && (address < kDwcHys + 4U);
433 return (threshold || hysteresis) ? 0xFF00_u16 : 0_u16;
434}
435
440constexpr uint32_t CountDocumented() noexcept {
441 uint32_t count = 0U;
442 for (uint32_t b = 0U; b < kBankCount; ++b) {
443 for (uint32_t a = 0U; a < kAddressSpace; ++a) {
444 if (IsDocumented(static_cast<Bank>(b), static_cast<uint8_t>(a))) {
445 ++count;
446 }
447 }
448 }
449 return count;
450}
451
452// The register map is the datasheet's: 18 common registers and 49 in each
453// channel bank.
454static_assert(CountDocumented() == 116U);
457static_assert(!IsDocumented(Bank::Ain9To16, 0x13 + 0x40));
458// Reset values (Tables 8-1 to 8-71).
459static_assert(ResetValue(Bank::Common, kBankSel) == 1U);
460static_assert(ResetValue(Bank::Common, kDeviceId) == 4U);
461static_assert(ResetValue(Bank::Ain1To8, kDwcTh) == 0xFF00U);
462static_assert(ResetValue(Bank::Ain9To16, kDwcHys) == 0U);
463static_assert(ResetValue(Bank::Ain9To16, kDwcHys + 1U) == 0xFF00U);
464// The reversed bank (section 8.3): AIN16 is local 0, AIN9 is local 7; both
465// banks round trip.
466static_assert((Locate(0).bank == Bank::Ain1To8) && (Locate(0).local == 0U));
467static_assert((Locate(7).bank == Bank::Ain1To8) && (Locate(7).local == 7U));
468static_assert((Locate(15).bank == Bank::Ain9To16) && (Locate(15).local == 0U));
469static_assert((Locate(8).bank == Bank::Ain9To16) && (Locate(8).local == 7U));
470static_assert(ChannelAt(Locate(11).bank, Locate(11).local) == 11U);
471// AIN15 (channel 14) is local 1: the high half of PGA_CONFIG at 0x08 (Table
472// 8-74).
473static_assert((PgaConfigAddress(Locate(14).local) == 0x08U) && (HalfShift(Locate(14).local) == 8U));
474// AIN9 (channel 8) is local 7: OFS at 0x18, TP at 0x36 (Tables 8-72).
475static_assert((OffsetAddress(Locate(8).local) == 0x18U) && (TpAddress(Locate(8).local) == 0x36U));
476static_assert(DwcHysAddress(Locate(8).local) == 0x2DU);
477
480} // namespace ads9324::reg
481
482namespace ads9324::detail {
483
485template <>
486struct EnumLast<reg::Bank> {
487 static constexpr reg::Bank kValue = reg::Bank::Ain9To16;
488};
489
490} // namespace ads9324::detail
491
492#endif // ADS9324_REGISTERS_HPP
Compile-time helpers of the ADS9324 driver: typed integer literals, exact hook matching,...
constexpr uint16_t kDigFiltSysref
DIG_FILT_SYSREF: written 1, then 0.
Definition ads9324_registers.hpp:205
constexpr ChannelLocation Locate(uint8_t channel) noexcept
The bank and local index of a channel (the AIN9 to AIN16 bank is reversed).
Definition ads9324_registers.hpp:247
constexpr uint8_t kXorBitsCtl
XOR_BITS_CTL: output randomizer.
Definition ads9324_registers.hpp:90
constexpr uint8_t GainAddress(uint8_t local) noexcept
The address of the GAN register of a local index.
Definition ads9324_registers.hpp:297
Field< uint16_t, 0U, 4U > DrdyAlrmSel
DRDY_ALRM_SEL[3:0].
Definition ads9324_registers.hpp:157
constexpr uint16_t kXorBitsRandomizer
Definition ads9324_registers.hpp:150
constexpr uint8_t kDwcHys
DWC_HYS, 4 registers, 8 bits per channel.
Definition ads9324_registers.hpp:113
constexpr bool IsDocumented(Bank bank, uint8_t address) noexcept
Whether a register is documented in a bank (section 8, Tables 8-1, 8-21, 8-72).
Definition ads9324_registers.hpp:382
constexpr uint16_t kRefselCtrlDis
REFSEL_CTRL_DIS: ignore the REFSEL pin.
Definition ads9324_registers.hpp:183
constexpr uint16_t kSeDiffAin1To8
SE_DIFF_MODE_AIN1_8: 1 = differential.
Definition ads9324_registers.hpp:192
Field< uint16_t, 8U, 8U > GenCfg1ReadAddress
REG_RD_ADD[7:0].
Definition ads9324_registers.hpp:122
constexpr uint16_t kExtRefEn
EXT_REF_EN: external reference.
Definition ads9324_registers.hpp:184
constexpr uint16_t kAlrmPol
ALRM_POL: 1 = active low.
Definition ads9324_registers.hpp:156
Field< uint16_t, 8U, 8U > DwcHighTh
HIGH_TH_AINn[7:0].
Definition ads9324_registers.hpp:223
constexpr uint8_t kDwcFlag
DWC_FLAG (R): latched high and low flags.
Definition ads9324_registers.hpp:117
constexpr uint8_t kDigDelayCfg2
DIG_DELAY_CFG2: D7 to D4 delay.
Definition ads9324_registers.hpp:94
constexpr uint16_t ResetValue(Bank bank, uint8_t address) noexcept
The value of a register after reset (section 8).
Definition ads9324_registers.hpp:424
constexpr bool IsReadOnly(Bank bank, uint8_t address) noexcept
Whether a register is read only (DEVICE_STATUS, DEVICE_ID and DWC_FLAG).
Definition ads9324_registers.hpp:393
constexpr uint8_t kOffset
OFS, 8 registers, 10 bits.
Definition ads9324_registers.hpp:109
Field< uint16_t, 8U, 4U > DwcGlitchFilt
DWC_GLITCH_FILT[3:0].
Definition ads9324_registers.hpp:222
constexpr uint8_t kTpCfg
TP_CFG: test pattern control.
Definition ads9324_registers.hpp:114
Field< uint16_t, 8U, 4U > MvgAvgLen
MVG_AVG_LEN[3:0].
Definition ads9324_registers.hpp:202
Field< uint16_t, 8U, 8U > AlarmMask
ALRM_MASK[7:0].
Definition ads9324_registers.hpp:154
Field< uint16_t, 0U, 2U > PgaBw
PGA_BW_SEL_AINn, 2 bits at 2 * local.
Definition ads9324_registers.hpp:218
Field< uint16_t, 0U, 14U > GainField
GAN_AINn[13:0], two's complement.
Definition ads9324_registers.hpp:220
constexpr uint16_t kTpUpdMode
TP_UPD_MODE: 1 = ramp steps at every CONVST.
Definition ads9324_registers.hpp:227
constexpr uint8_t kPgaConfig
PGA_CONFIG, 4 registers, two channels each.
Definition ads9324_registers.hpp:106
Field< uint16_t, 4U, 4U > BlkAvgOsr
BLK_AVG_OSR[3:0].
Definition ads9324_registers.hpp:203
Field< uint16_t, 0U, 2U > DriveStrengthField
DRIVE_STRENGTH[1:0].
Definition ads9324_registers.hpp:164
Field< uint16_t, 12U, 3U > FirFiltSel
FIR_FILT_SEL[2:0].
Definition ads9324_registers.hpp:201
Field< uint16_t, 3U, 3U > DelayD5
DIG_DELAY_D5, in CFG2.
Definition ads9324_registers.hpp:177
constexpr uint16_t kEnDiagFlag
EN_DIAG_FLAG: DIAG byte after the data.
Definition ads9324_registers.hpp:142
constexpr uint8_t kDrdyAlarmSel
DRDY_ALARM_SEL: pin function.
Definition ads9324_registers.hpp:91
Field< uint16_t, 6U, 3U > DelayD6
DIG_DELAY_D6, in CFG2.
Definition ads9324_registers.hpp:176
constexpr uint16_t kDwcStatRst
DWC_STAT_RST: written 1, then 0.
Definition ads9324_registers.hpp:221
constexpr uint16_t kAvgModeOvrEn
AVG_MODE_OVR_EN.
Definition ads9324_registers.hpp:206
constexpr uint16_t kSwRst
SW_RST.
Definition ads9324_registers.hpp:123
constexpr uint8_t kGenCfg2
GEN_CFG2: daisy chain (never written).
Definition ads9324_registers.hpp:88
Field< uint16_t, 0U, 3U > DelayD4
DIG_DELAY_D4, in CFG2.
Definition ads9324_registers.hpp:178
Field< uint16_t, 3U, 3U > DelayD1
DIG_DELAY_D1, in CFG1.
Definition ads9324_registers.hpp:173
Field< uint8_t, 0U, 3U > InputRangeField
INPUT_RANGE_AINn, in one byte of PGA_CONFIG.
Definition ads9324_registers.hpp:217
constexpr uint8_t kGenCfg5
GEN_CFG5: AVG_MODE gate.
Definition ads9324_registers.hpp:99
constexpr uint8_t kAnaCfg1
ANA_CFG1: reference source.
Definition ads9324_registers.hpp:95
constexpr uint16_t kAlrmDis
ALRM_DIS: 1 = alarm function disabled.
Definition ads9324_registers.hpp:162
constexpr uint16_t kGanCorrDis
GAN_CORR_DIS.
Definition ads9324_registers.hpp:230
constexpr uint16_t kDigDelayEn
DIG_DELAY_EN.
Definition ads9324_registers.hpp:163
constexpr uint8_t kPdnCtl
PDN_CTL: standby.
Definition ads9324_registers.hpp:87
Field< uint8_t, 4U, 3U > CmRange
CM_RANGE_AINn, in one byte of PGA_CONFIG.
Definition ads9324_registers.hpp:216
constexpr uint8_t kGain
GAN, 8 registers, 14 bits.
Definition ads9324_registers.hpp:110
constexpr uint16_t kIntTrigMode
INT_TRIG_MODE: internal oversampling clock.
Definition ads9324_registers.hpp:204
constexpr uint8_t kCorrection
GEN_CFG5 of a channel bank: correction bypass.
Definition ads9324_registers.hpp:116
Field< uint16_t, 6U, 3U > DelayD2
DIG_DELAY_D2, in CFG1.
Definition ads9324_registers.hpp:172
constexpr uint16_t kEnXorPatt
EN_XOR_PATT: randomizer.
Definition ads9324_registers.hpp:141
Field< uint16_t, 0U, 8U > DwcLowTh
LOW_TH_AINn[7:0].
Definition ads9324_registers.hpp:224
constexpr uint16_t kAdcDataSdoutEn
ADC_DATA_SDOUT_EN.
Definition ads9324_registers.hpp:145
constexpr uint32_t HalfShift(uint8_t local) noexcept
The bit position of the odd (high) or even (low) half of a two-channel register.
Definition ads9324_registers.hpp:330
constexpr uint16_t kRegRdEn
REG_RD_EN.
Definition ads9324_registers.hpp:124
constexpr uint16_t kTpEn
TP_EN.
Definition ads9324_registers.hpp:228
constexpr uint8_t kBankCount
Number of register banks.
Definition ads9324_registers.hpp:55
Field< uint16_t, 0U, 3U > DelayD0
DIG_DELAY_D0, in CFG1.
Definition ads9324_registers.hpp:174
Field< uint16_t, 0U, 2U > AdcCalMode
ADC_CAL_MODE[1:0].
Definition ads9324_registers.hpp:195
constexpr uint8_t kGenCfg4
GEN_CFG4: drive strength, delay enable.
Definition ads9324_registers.hpp:92
Field< uint16_t, 2U, 2U > AdcNumSel
ADC_NUM_SEL[1:0].
Definition ads9324_registers.hpp:187
constexpr uint16_t kAvgMode
AVG_MODE.
Definition ads9324_registers.hpp:207
Field< uint16_t, 9U, 3U > DelayD7
DIG_DELAY_D7, in CFG2.
Definition ads9324_registers.hpp:175
constexpr uint8_t kPhaseDelay
PHASE_DELAY, 4 registers, 8 bits per channel.
Definition ads9324_registers.hpp:108
Field< uint16_t, 0U, 10U > OffsetField
OFS_AINn[9:0], two's complement.
Definition ads9324_registers.hpp:219
Bank
A register bank. The value is the index of the bank in the driver's tables.
Definition ads9324_registers.hpp:47
constexpr uint16_t BankSelCode(Bank bank) noexcept
The BANK_SEL code of a bank (section 8.1.2).
Definition ads9324_registers.hpp:68
constexpr uint8_t DwcThAddress(uint8_t local) noexcept
The address of the DWC_TH register of a local index.
Definition ads9324_registers.hpp:305
constexpr uint8_t kDigFilter
DIG_FILTER: digital filters and SYSREF.
Definition ads9324_registers.hpp:98
constexpr uint16_t kEnOfsBinary
EN_OFS_BINARY: 1 = offset binary.
Definition ads9324_registers.hpp:140
constexpr uint16_t kAlrmType
ALRM_TYPE: 1 = pulse (window alert only).
Definition ads9324_registers.hpp:155
constexpr uint16_t kTpDisIdx
TP_DIS_IDX: 1 = no channel index insertion.
Definition ads9324_registers.hpp:226
constexpr uint16_t kDeviceIdValue
DEVICE_ID after reset, read only (8.1.18).
Definition ads9324_registers.hpp:211
Field< uint16_t, 4U, 4U > DaisyDevices
DAISY_CHN_NUM_DEV[3:0].
Definition ads9324_registers.hpp:134
Field< uint16_t, 8U, 4U > DaisyLocation
DAISY_CHN_LOC[3:0].
Definition ads9324_registers.hpp:133
constexpr uint8_t kDeviceId
DEVICE_ID (R): 0x0004.
Definition ads9324_registers.hpp:101
constexpr uint8_t PhaseDelayAddress(uint8_t local) noexcept
The address of the PHASE_DELAY register of a local index.
Definition ads9324_registers.hpp:281
constexpr uint32_t CountDocumented() noexcept
The number of documented registers over the three banks.
Definition ads9324_registers.hpp:440
constexpr uint16_t kResetDetectFlag
DIAG_CTRL.RESET_DETECT_FLAG (8.1.3).
Definition ads9324_registers.hpp:127
constexpr uint8_t PgaConfigAddress(uint8_t local) noexcept
The address of the register that holds the PGA_CONFIG of a local index.
Definition ads9324_registers.hpp:273
constexpr uint8_t ChannelAt(Bank bank, uint8_t local) noexcept
The channel at a bank-local index; the inverse of Locate().
Definition ads9324_registers.hpp:260
constexpr uint8_t DwcHysAddress(uint8_t local) noexcept
The address of the DWC_HYS register of a local index.
Definition ads9324_registers.hpp:313
constexpr uint16_t kAdcCalTrig
ADC_CAL_TRIG: written 1, then 0.
Definition ads9324_registers.hpp:194
constexpr uint8_t OffsetAddress(uint8_t local) noexcept
The address of the OFS register of a local index.
Definition ads9324_registers.hpp:289
Field< uint16_t, 9U, 3U > DelayD3
DIG_DELAY_D3, in CFG1.
Definition ads9324_registers.hpp:171
constexpr uint8_t kDeviceStatus
DEVICE_STATUS (R): CALIB_BUSY_FLAG.
Definition ads9324_registers.hpp:100
constexpr uint16_t kXtalkLowSpeed
CH_XTALK_LOW_SPEED.
Definition ads9324_registers.hpp:185
Field< uint16_t, 4U, 2U > DoutLaneSel
DOUT_LANE_SEL[1:0].
Definition ads9324_registers.hpp:143
Field< uint16_t, 4U, 3U > AdcChSel
ADC_CH_SEL[2:0].
Definition ads9324_registers.hpp:186
constexpr uint8_t kAnaCfg2
ANA_CFG2: channel mode, low-speed crosstalk.
Definition ads9324_registers.hpp:96
constexpr uint8_t kDiagCtrl
DIAG_CTRL: RESET_DETECT_FLAG.
Definition ads9324_registers.hpp:86
constexpr uint16_t kDevicePdn
PDN_CTL.DEVICE_PDN (8.1.4).
Definition ads9324_registers.hpp:128
constexpr uint8_t kDwcTh
DWC_TH, 8 registers: high byte, low byte.
Definition ads9324_registers.hpp:112
constexpr uint8_t kChannelCount
Number of channels.
Definition ads9324_registers.hpp:57
constexpr uint8_t kTp
TP_AIN, 8 registers, 16 bits.
Definition ads9324_registers.hpp:115
constexpr uint8_t kAdcCal
ADC_CAL: ADC calibration module.
Definition ads9324_registers.hpp:97
constexpr uint8_t TpAddress(uint8_t local) noexcept
The address of the TP_AIN register of a local index.
Definition ads9324_registers.hpp:321
constexpr uint8_t kBankSel
BANK_SEL: always accessible.
Definition ads9324_registers.hpp:85
constexpr uint8_t kDigDelayCfg1
DIG_DELAY_CFG1: SDOUT and D3 to D0 delay.
Definition ads9324_registers.hpp:93
Field< uint16_t, 2U, 2U > DoutLength
DOUT_LENGTH[1:0].
Definition ads9324_registers.hpp:144
constexpr uint16_t kSeDiffAin9To16
SE_DIFF_MODE_AIN9_16: 1 = differential.
Definition ads9324_registers.hpp:193
constexpr uint8_t kChannelsPerBank
Channels per channel bank.
Definition ads9324_registers.hpp:59
Field< uint8_t, 7U, 1U > CmeCorrEn
CME_CORR_EN_AINn, in one byte of PGA_CONFIG.
Definition ads9324_registers.hpp:215
Field< uint16_t, 4U, 3U > TpMode
TP_MODE[2:0].
Definition ads9324_registers.hpp:225
constexpr uint8_t kDwcCfg
DWC_CFG: enables, glitch filter, flag reset.
Definition ads9324_registers.hpp:111
constexpr uint16_t kCalibBusyFlag
DEVICE_STATUS.CALIB_BUSY_FLAG (8.1.17).
Definition ads9324_registers.hpp:210
Field< uint16_t, 12U, 3U > DelaySdout
DIG_DELAY_SDOUT, in CFG1.
Definition ads9324_registers.hpp:170
constexpr uint8_t kGenCfg3
GEN_CFG3: data format and lanes.
Definition ads9324_registers.hpp:89
constexpr uint8_t kGenCfg1
GEN_CFG1: read command, software reset.
Definition ads9324_registers.hpp:84
constexpr uint8_t kPgaBwSel
PGA_BW_SEL, 2 bits per channel.
Definition ads9324_registers.hpp:107
constexpr uint16_t kDaisyEnable
DAISY_CHN_EN.
Definition ads9324_registers.hpp:135
constexpr uint16_t kOfsCorrDis
OFS_CORR_DIS.
Definition ads9324_registers.hpp:229
constexpr bool IsShadowed(Bank bank, uint8_t address) noexcept
Whether the driver keeps a write-through shadow of a register: documented, writable and not one of th...
Definition ads9324_registers.hpp:408
constexpr uint8_t kAddressSpace
Addresses per bank table: the highest documented address is 0x3E.
Definition ads9324_registers.hpp:61
constexpr uint16_t kPhaseDelayEn
PHASE_DELAY_EN.
Definition ads9324_registers.hpp:200
@ Ain1To8
Channel registers AIN1 to AIN8, BANK_SEL code 010b.
@ Common
The common registers, BANK_SEL code 001b.
The ADS9324 register map.
Definition ads9324_registers.hpp:33
Where a channel's registers are: the bank and the bank-local index.
Definition ads9324_registers.hpp:235
uint8_t local
The bank-local index, 0 to 7.
Definition ads9324_registers.hpp:237
Bank bank
The channel bank.
Definition ads9324_registers.hpp:236