ADS9324 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Classes | Enumerations | Functions | Variables
ads9324::reg Namespace Reference

The ADS9324 register map. More...

Classes

struct  ChannelLocation
 Where a channel's registers are: the bank and the bank-local index. More...
 

Typedefs

DIG_DELAY_CFG1 and DIG_DELAY_CFG2 (sections 8.1.10, 8.1.11), 3 bits

per output

using DelaySdout = Field< uint16_t, 12U, 3U >
 DIG_DELAY_SDOUT, in CFG1.
 
using DelayD3 = Field< uint16_t, 9U, 3U >
 DIG_DELAY_D3, in CFG1.
 
using DelayD2 = Field< uint16_t, 6U, 3U >
 DIG_DELAY_D2, in CFG1.
 
using DelayD1 = Field< uint16_t, 3U, 3U >
 DIG_DELAY_D1, in CFG1.
 
using DelayD0 = Field< uint16_t, 0U, 3U >
 DIG_DELAY_D0, in CFG1.
 
using DelayD7 = Field< uint16_t, 9U, 3U >
 DIG_DELAY_D7, in CFG2.
 
using DelayD6 = Field< uint16_t, 6U, 3U >
 DIG_DELAY_D6, in CFG2.
 
using DelayD5 = Field< uint16_t, 3U, 3U >
 DIG_DELAY_D5, in CFG2.
 
using DelayD4 = Field< uint16_t, 0U, 3U >
 DIG_DELAY_D4, in CFG2.
 

Enumerations

enum class  Bank : uint8_t { Bank::Common = 0 , Bank::Ain1To8 = 1 , Bank::Ain9To16 = 2 }
 A register bank. The value is the index of the bank in the driver's tables. More...
 

Functions

constexpr uint16_t BankSelCode (Bank bank) noexcept
 The BANK_SEL code of a bank (section 8.1.2).
 
constexpr ChannelLocation Locate (uint8_t channel) noexcept
 The bank and local index of a channel (the AIN9 to AIN16 bank is reversed).
 
constexpr uint8_t ChannelAt (Bank bank, uint8_t local) noexcept
 The channel at a bank-local index; the inverse of Locate().
 
constexpr uint8_t PgaConfigAddress (uint8_t local) noexcept
 The address of the register that holds the PGA_CONFIG of a local index.
 
constexpr uint8_t PhaseDelayAddress (uint8_t local) noexcept
 The address of the PHASE_DELAY register of a local index.
 
constexpr uint8_t OffsetAddress (uint8_t local) noexcept
 The address of the OFS register of a local index.
 
constexpr uint8_t GainAddress (uint8_t local) noexcept
 The address of the GAN register of a local index.
 
constexpr uint8_t DwcThAddress (uint8_t local) noexcept
 The address of the DWC_TH register of a local index.
 
constexpr uint8_t DwcHysAddress (uint8_t local) noexcept
 The address of the DWC_HYS register of a local index.
 
constexpr uint8_t TpAddress (uint8_t local) noexcept
 The address of the TP_AIN register of a local index.
 
constexpr uint32_t HalfShift (uint8_t local) noexcept
 The bit position of the odd (high) or even (low) half of a two-channel register.
 
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).
 
constexpr bool IsReadOnly (Bank bank, uint8_t address) noexcept
 Whether a register is read only (DEVICE_STATUS, DEVICE_ID and DWC_FLAG).
 
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 the two frame-control registers GEN_CFG1 and BANK_SEL.
 
constexpr uint16_t ResetValue (Bank bank, uint8_t address) noexcept
 The value of a register after reset (section 8).
 
constexpr uint32_t CountDocumented () noexcept
 The number of documented registers over the three banks.
 

Variables

constexpr uint8_t kBankCount = 3
 Number of register banks.
 
constexpr uint8_t kChannelCount = 16
 Number of channels.
 
constexpr uint8_t kChannelsPerBank = 8
 Channels per channel bank.
 
constexpr uint8_t kAddressSpace = 64
 Addresses per bank table: the highest documented address is 0x3E.
 
constexpr uint16_t kResetDetectFlag = 0x0100
 DIAG_CTRL.RESET_DETECT_FLAG (8.1.3).
 
constexpr uint16_t kDevicePdn = 0x0001
 PDN_CTL.DEVICE_PDN (8.1.4).
 
constexpr uint16_t kXorBitsRandomizer = 0x00F1
 
constexpr uint16_t kCalibBusyFlag = 0x0008
 DEVICE_STATUS.CALIB_BUSY_FLAG (8.1.17).
 
constexpr uint16_t kDeviceIdValue = 0x0004
 DEVICE_ID after reset, read only (8.1.18).
 
Common bank addresses (section 8.1)
constexpr uint8_t kGenCfg1 = 0x01
 GEN_CFG1: read command, software reset.
 
constexpr uint8_t kBankSel = 0x02
 BANK_SEL: always accessible.
 
constexpr uint8_t kDiagCtrl = 0x07
 DIAG_CTRL: RESET_DETECT_FLAG.
 
constexpr uint8_t kPdnCtl = 0x08
 PDN_CTL: standby.
 
constexpr uint8_t kGenCfg2 = 0x09
 GEN_CFG2: daisy chain (never written).
 
constexpr uint8_t kGenCfg3 = 0x0A
 GEN_CFG3: data format and lanes.
 
constexpr uint8_t kXorBitsCtl = 0x0B
 XOR_BITS_CTL: output randomizer.
 
constexpr uint8_t kDrdyAlarmSel = 0x0C
 DRDY_ALARM_SEL: pin function.
 
constexpr uint8_t kGenCfg4 = 0x0D
 GEN_CFG4: drive strength, delay enable.
 
constexpr uint8_t kDigDelayCfg1 = 0x0E
 DIG_DELAY_CFG1: SDOUT and D3 to D0 delay.
 
constexpr uint8_t kDigDelayCfg2 = 0x0F
 DIG_DELAY_CFG2: D7 to D4 delay.
 
constexpr uint8_t kAnaCfg1 = 0x10
 ANA_CFG1: reference source.
 
constexpr uint8_t kAnaCfg2 = 0x11
 ANA_CFG2: channel mode, low-speed crosstalk.
 
constexpr uint8_t kAdcCal = 0x12
 ADC_CAL: ADC calibration module.
 
constexpr uint8_t kDigFilter = 0x14
 DIG_FILTER: digital filters and SYSREF.
 
constexpr uint8_t kGenCfg5 = 0x15
 GEN_CFG5: AVG_MODE gate.
 
constexpr uint8_t kDeviceStatus = 0x1D
 DEVICE_STATUS (R): CALIB_BUSY_FLAG.
 
constexpr uint8_t kDeviceId = 0x21
 DEVICE_ID (R): 0x0004.
 
Channel bank addresses (sections 8.2 and 8.3)
constexpr uint8_t kPgaConfig = 0x08
 PGA_CONFIG, 4 registers, two channels each.
 
constexpr uint8_t kPgaBwSel = 0x0C
 PGA_BW_SEL, 2 bits per channel.
 
constexpr uint8_t kPhaseDelay = 0x0D
 PHASE_DELAY, 4 registers, 8 bits per channel.
 
constexpr uint8_t kOffset = 0x11
 OFS, 8 registers, 10 bits.
 
constexpr uint8_t kGain = 0x19
 GAN, 8 registers, 14 bits.
 
constexpr uint8_t kDwcCfg = 0x21
 DWC_CFG: enables, glitch filter, flag reset.
 
constexpr uint8_t kDwcTh = 0x22
 DWC_TH, 8 registers: high byte, low byte.
 
constexpr uint8_t kDwcHys = 0x2A
 DWC_HYS, 4 registers, 8 bits per channel.
 
constexpr uint8_t kTpCfg = 0x2E
 TP_CFG: test pattern control.
 
constexpr uint8_t kTp = 0x2F
 TP_AIN, 8 registers, 16 bits.
 
constexpr uint8_t kCorrection = 0x37
 GEN_CFG5 of a channel bank: correction bypass.
 
constexpr uint8_t kDwcFlag = 0x3E
 DWC_FLAG (R): latched high and low flags.
 

GEN_CFG1 (section 8.1.1)

using GenCfg1ReadAddress = Field< uint16_t, 8U, 8U >
 REG_RD_ADD[7:0].
 
constexpr uint16_t kSwRst = 0x0002
 SW_RST.
 
constexpr uint16_t kRegRdEn = 0x0001
 REG_RD_EN.
 

GEN_CFG2 daisy chain fields (section 8.1.5), defined for the seam,

never written

using DaisyLocation = Field< uint16_t, 8U, 4U >
 DAISY_CHN_LOC[3:0].
 
using DaisyDevices = Field< uint16_t, 4U, 4U >
 DAISY_CHN_NUM_DEV[3:0].
 
constexpr uint16_t kDaisyEnable = 0x0001
 DAISY_CHN_EN.
 

GEN_CFG3 (section 8.1.6)

using DoutLaneSel = Field< uint16_t, 4U, 2U >
 DOUT_LANE_SEL[1:0].
 
using DoutLength = Field< uint16_t, 2U, 2U >
 DOUT_LENGTH[1:0].
 
constexpr uint16_t kEnOfsBinary = 0x1000
 EN_OFS_BINARY: 1 = offset binary.
 
constexpr uint16_t kEnXorPatt = 0x0200
 EN_XOR_PATT: randomizer.
 
constexpr uint16_t kEnDiagFlag = 0x0100
 EN_DIAG_FLAG: DIAG byte after the data.
 
constexpr uint16_t kAdcDataSdoutEn = 0x0002
 ADC_DATA_SDOUT_EN.
 

DRDY_ALARM_SEL (section 8.1.8)

using AlarmMask = Field< uint16_t, 8U, 8U >
 ALRM_MASK[7:0].
 
using DrdyAlrmSel = Field< uint16_t, 0U, 4U >
 DRDY_ALRM_SEL[3:0].
 
constexpr uint16_t kAlrmType = 0x0020
 ALRM_TYPE: 1 = pulse (window alert only).
 
constexpr uint16_t kAlrmPol = 0x0010
 ALRM_POL: 1 = active low.
 

GEN_CFG4 (section 8.1.9)

using DriveStrengthField = Field< uint16_t, 0U, 2U >
 DRIVE_STRENGTH[1:0].
 
constexpr uint16_t kAlrmDis = 0x0020
 ALRM_DIS: 1 = alarm function disabled.
 
constexpr uint16_t kDigDelayEn = 0x0008
 DIG_DELAY_EN.
 

ANA_CFG1 and ANA_CFG2 (sections 8.1.12, 8.1.13)

using AdcChSel = Field< uint16_t, 4U, 3U >
 ADC_CH_SEL[2:0].
 
using AdcNumSel = Field< uint16_t, 2U, 2U >
 ADC_NUM_SEL[1:0].
 
constexpr uint16_t kRefselCtrlDis = 0x0002
 REFSEL_CTRL_DIS: ignore the REFSEL pin.
 
constexpr uint16_t kExtRefEn = 0x0001
 EXT_REF_EN: external reference.
 
constexpr uint16_t kXtalkLowSpeed = 0x8000
 CH_XTALK_LOW_SPEED.
 

ADC_CAL (section 8.1.14)

using AdcCalMode = Field< uint16_t, 0U, 2U >
 ADC_CAL_MODE[1:0].
 
constexpr uint16_t kSeDiffAin1To8 = 0x2000
 SE_DIFF_MODE_AIN1_8: 1 = differential.
 
constexpr uint16_t kSeDiffAin9To16 = 0x1000
 SE_DIFF_MODE_AIN9_16: 1 = differential.
 
constexpr uint16_t kAdcCalTrig = 0x0100
 ADC_CAL_TRIG: written 1, then 0.
 

DIG_FILTER and GEN_CFG5 (sections 8.1.15, 8.1.16)

using FirFiltSel = Field< uint16_t, 12U, 3U >
 FIR_FILT_SEL[2:0].
 
using MvgAvgLen = Field< uint16_t, 8U, 4U >
 MVG_AVG_LEN[3:0].
 
using BlkAvgOsr = Field< uint16_t, 4U, 4U >
 BLK_AVG_OSR[3:0].
 
constexpr uint16_t kPhaseDelayEn = 0x8000
 PHASE_DELAY_EN.
 
constexpr uint16_t kIntTrigMode = 0x0002
 INT_TRIG_MODE: internal oversampling clock.
 
constexpr uint16_t kDigFiltSysref = 0x0001
 DIG_FILT_SYSREF: written 1, then 0.
 
constexpr uint16_t kAvgModeOvrEn = 0x0002
 AVG_MODE_OVR_EN.
 
constexpr uint16_t kAvgMode = 0x0001
 AVG_MODE.
 

Channel register fields, bank-local layout (sections 8.2, 8.3)

using CmeCorrEn = Field< uint8_t, 7U, 1U >
 CME_CORR_EN_AINn, in one byte of PGA_CONFIG.
 
using CmRange = Field< uint8_t, 4U, 3U >
 CM_RANGE_AINn, in one byte of PGA_CONFIG.
 
using InputRangeField = Field< uint8_t, 0U, 3U >
 INPUT_RANGE_AINn, in one byte of PGA_CONFIG.
 
using PgaBw = Field< uint16_t, 0U, 2U >
 PGA_BW_SEL_AINn, 2 bits at 2 * local.
 
using OffsetField = Field< uint16_t, 0U, 10U >
 OFS_AINn[9:0], two's complement.
 
using GainField = Field< uint16_t, 0U, 14U >
 GAN_AINn[13:0], two's complement.
 
using DwcGlitchFilt = Field< uint16_t, 8U, 4U >
 DWC_GLITCH_FILT[3:0].
 
using DwcHighTh = Field< uint16_t, 8U, 8U >
 HIGH_TH_AINn[7:0].
 
using DwcLowTh = Field< uint16_t, 0U, 8U >
 LOW_TH_AINn[7:0].
 
using TpMode = Field< uint16_t, 4U, 3U >
 TP_MODE[2:0].
 
constexpr uint16_t kDwcStatRst = 0x8000
 DWC_STAT_RST: written 1, then 0.
 
constexpr uint16_t kTpDisIdx = 0x0004
 TP_DIS_IDX: 1 = no channel index insertion.
 
constexpr uint16_t kTpUpdMode = 0x0002
 TP_UPD_MODE: 1 = ramp steps at every CONVST.
 
constexpr uint16_t kTpEn = 0x0001
 TP_EN.
 
constexpr uint16_t kOfsCorrDis = 0x0002
 OFS_CORR_DIS.
 
constexpr uint16_t kGanCorrDis = 0x0001
 GAN_CORR_DIS.
 

Detailed Description

The ADS9324 register map.