ADS9324 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Classes | Enumerations | Functions | Variables
Register map

Banks, addresses, fields and reset values. More...

Classes

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

Enumerations

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

Functions

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

Variables

constexpr uint8_t ads9324::reg::kBankCount = 3
 Number of register banks.
 
constexpr uint8_t ads9324::reg::kChannelCount = 16
 Number of channels.
 
constexpr uint8_t ads9324::reg::kChannelsPerBank = 8
 Channels per channel bank.
 
constexpr uint8_t ads9324::reg::kAddressSpace = 64
 Addresses per bank table: the highest documented address is 0x3E.
 
constexpr uint16_t ads9324::reg::kResetDetectFlag = 0x0100
 DIAG_CTRL.RESET_DETECT_FLAG (8.1.3).
 
constexpr uint16_t ads9324::reg::kDevicePdn = 0x0001
 PDN_CTL.DEVICE_PDN (8.1.4).
 
constexpr uint16_t ads9324::reg::kXorBitsRandomizer = 0x00F1
 
constexpr uint16_t ads9324::reg::kCalibBusyFlag = 0x0008
 DEVICE_STATUS.CALIB_BUSY_FLAG (8.1.17).
 
constexpr uint16_t ads9324::reg::kDeviceIdValue = 0x0004
 DEVICE_ID after reset, read only (8.1.18).
 

GEN_CFG1 (section 8.1.1)

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

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

never written

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

GEN_CFG3 (section 8.1.6)

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

DRDY_ALARM_SEL (section 8.1.8)

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

GEN_CFG4 (section 8.1.9)

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

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

per output

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

ANA_CFG1 and ANA_CFG2 (sections 8.1.12, 8.1.13)

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

ADC_CAL (section 8.1.14)

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

DIG_FILTER and GEN_CFG5 (sections 8.1.15, 8.1.16)

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

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

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

Common bank addresses (section 8.1)

constexpr uint8_t ads9324::reg::kGenCfg1 = 0x01
 GEN_CFG1: read command, software reset.
 
constexpr uint8_t ads9324::reg::kBankSel = 0x02
 BANK_SEL: always accessible.
 
constexpr uint8_t ads9324::reg::kDiagCtrl = 0x07
 DIAG_CTRL: RESET_DETECT_FLAG.
 
constexpr uint8_t ads9324::reg::kPdnCtl = 0x08
 PDN_CTL: standby.
 
constexpr uint8_t ads9324::reg::kGenCfg2 = 0x09
 GEN_CFG2: daisy chain (never written).
 
constexpr uint8_t ads9324::reg::kGenCfg3 = 0x0A
 GEN_CFG3: data format and lanes.
 
constexpr uint8_t ads9324::reg::kXorBitsCtl = 0x0B
 XOR_BITS_CTL: output randomizer.
 
constexpr uint8_t ads9324::reg::kDrdyAlarmSel = 0x0C
 DRDY_ALARM_SEL: pin function.
 
constexpr uint8_t ads9324::reg::kGenCfg4 = 0x0D
 GEN_CFG4: drive strength, delay enable.
 
constexpr uint8_t ads9324::reg::kDigDelayCfg1 = 0x0E
 DIG_DELAY_CFG1: SDOUT and D3 to D0 delay.
 
constexpr uint8_t ads9324::reg::kDigDelayCfg2 = 0x0F
 DIG_DELAY_CFG2: D7 to D4 delay.
 
constexpr uint8_t ads9324::reg::kAnaCfg1 = 0x10
 ANA_CFG1: reference source.
 
constexpr uint8_t ads9324::reg::kAnaCfg2 = 0x11
 ANA_CFG2: channel mode, low-speed crosstalk.
 
constexpr uint8_t ads9324::reg::kAdcCal = 0x12
 ADC_CAL: ADC calibration module.
 
constexpr uint8_t ads9324::reg::kDigFilter = 0x14
 DIG_FILTER: digital filters and SYSREF.
 
constexpr uint8_t ads9324::reg::kGenCfg5 = 0x15
 GEN_CFG5: AVG_MODE gate.
 
constexpr uint8_t ads9324::reg::kDeviceStatus = 0x1D
 DEVICE_STATUS (R): CALIB_BUSY_FLAG.
 
constexpr uint8_t ads9324::reg::kDeviceId = 0x21
 DEVICE_ID (R): 0x0004.
 

Channel bank addresses (sections 8.2 and 8.3)

constexpr uint8_t ads9324::reg::kPgaConfig = 0x08
 PGA_CONFIG, 4 registers, two channels each.
 
constexpr uint8_t ads9324::reg::kPgaBwSel = 0x0C
 PGA_BW_SEL, 2 bits per channel.
 
constexpr uint8_t ads9324::reg::kPhaseDelay = 0x0D
 PHASE_DELAY, 4 registers, 8 bits per channel.
 
constexpr uint8_t ads9324::reg::kOffset = 0x11
 OFS, 8 registers, 10 bits.
 
constexpr uint8_t ads9324::reg::kGain = 0x19
 GAN, 8 registers, 14 bits.
 
constexpr uint8_t ads9324::reg::kDwcCfg = 0x21
 DWC_CFG: enables, glitch filter, flag reset.
 
constexpr uint8_t ads9324::reg::kDwcTh = 0x22
 DWC_TH, 8 registers: high byte, low byte.
 
constexpr uint8_t ads9324::reg::kDwcHys = 0x2A
 DWC_HYS, 4 registers, 8 bits per channel.
 
constexpr uint8_t ads9324::reg::kTpCfg = 0x2E
 TP_CFG: test pattern control.
 
constexpr uint8_t ads9324::reg::kTp = 0x2F
 TP_AIN, 8 registers, 16 bits.
 
constexpr uint8_t ads9324::reg::kCorrection = 0x37
 GEN_CFG5 of a channel bank: correction bypass.
 
constexpr uint8_t ads9324::reg::kDwcFlag = 0x3E
 DWC_FLAG (R): latched high and low flags.
 

Detailed Description

Banks, addresses, fields and reset values.

Enumeration Type Documentation

◆ Bank

enum class ads9324::reg::Bank : uint8_t
strong

A register bank. The value is the index of the bank in the driver's tables.

Enumerator
Common 

The common registers, BANK_SEL code 001b.

Ain1To8 

Channel registers AIN1 to AIN8, BANK_SEL code 010b.

Ain9To16 

Channel registers AIN9 to AIN16 (reversed order), BANK_SEL code 100b.

Function Documentation

◆ BankSelCode()

constexpr uint16_t ads9324::reg::BankSelCode ( Bank  bank)
constexprnoexcept

The BANK_SEL code of a bank (section 8.1.2).

Parameters
bankThe bank.
Returns
1, 2 or 4.

◆ ChannelAt()

constexpr uint8_t ads9324::reg::ChannelAt ( Bank  bank,
uint8_t  local 
)
constexprnoexcept

The channel at a bank-local index; the inverse of Locate().

Parameters
bankA channel bank.
localThe bank-local index, 0 to 7.
Returns
The channel counted from 0.

◆ CountDocumented()

constexpr uint32_t ads9324::reg::CountDocumented ( )
constexprnoexcept

The number of documented registers over the three banks.

Returns
The count (116).

◆ DwcHysAddress()

constexpr uint8_t ads9324::reg::DwcHysAddress ( uint8_t  local)
constexprnoexcept

The address of the DWC_HYS register of a local index.

Parameters
localThe bank-local channel index, 0 to 7.
Returns
The register address in the bank.

◆ DwcThAddress()

constexpr uint8_t ads9324::reg::DwcThAddress ( uint8_t  local)
constexprnoexcept

The address of the DWC_TH register of a local index.

Parameters
localThe bank-local channel index, 0 to 7.
Returns
The register address in the bank.

◆ GainAddress()

constexpr uint8_t ads9324::reg::GainAddress ( uint8_t  local)
constexprnoexcept

The address of the GAN register of a local index.

Parameters
localThe bank-local channel index, 0 to 7.
Returns
The register address in the bank.

◆ HalfShift()

constexpr uint32_t ads9324::reg::HalfShift ( uint8_t  local)
constexprnoexcept

The bit position of the odd (high) or even (low) half of a two-channel register.

Parameters
localThe bank-local channel index.
Returns
8 for an odd index, 0 for an even one.

◆ IsDocumented()

constexpr bool ads9324::reg::IsDocumented ( Bank  bank,
uint8_t  address 
)
constexprnoexcept

Whether a register is documented in a bank (section 8, Tables 8-1, 8-21, 8-72).

Parameters
bankThe bank.
addressThe address.
Returns
true for the 116 documented registers; every other address is reserved and never accessed.

◆ IsReadOnly()

constexpr bool ads9324::reg::IsReadOnly ( Bank  bank,
uint8_t  address 
)
constexprnoexcept

Whether a register is read only (DEVICE_STATUS, DEVICE_ID and DWC_FLAG).

Parameters
bankThe bank.
addressThe address.
Returns
true for a register the driver never writes.

◆ IsShadowed()

constexpr bool ads9324::reg::IsShadowed ( Bank  bank,
uint8_t  address 
)
constexprnoexcept

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.

Parameters
bankThe bank.
addressThe address.
Returns
true when the register is shadowed.

◆ Locate()

constexpr ChannelLocation ads9324::reg::Locate ( uint8_t  channel)
constexprnoexcept

The bank and local index of a channel (the AIN9 to AIN16 bank is reversed).

Parameters
channelThe channel counted from 0 (AIN1 is 0, AIN16 is 15); 0 to 15.
Returns
{Ain1To8, channel} for 0 to 7, {Ain9To16, 15 - channel} for 8 to 15.

◆ OffsetAddress()

constexpr uint8_t ads9324::reg::OffsetAddress ( uint8_t  local)
constexprnoexcept

The address of the OFS register of a local index.

Parameters
localThe bank-local channel index, 0 to 7.
Returns
The register address in the bank.

◆ PgaConfigAddress()

constexpr uint8_t ads9324::reg::PgaConfigAddress ( uint8_t  local)
constexprnoexcept

The address of the register that holds the PGA_CONFIG of a local index.

Parameters
localThe bank-local channel index, 0 to 7.
Returns
The register address in the bank.

◆ PhaseDelayAddress()

constexpr uint8_t ads9324::reg::PhaseDelayAddress ( uint8_t  local)
constexprnoexcept

The address of the PHASE_DELAY register of a local index.

Parameters
localThe bank-local channel index, 0 to 7.
Returns
The register address in the bank.

◆ ResetValue()

constexpr uint16_t ads9324::reg::ResetValue ( Bank  bank,
uint8_t  address 
)
constexprnoexcept

The value of a register after reset (section 8).

Parameters
bankThe bank.
addressThe address.
Returns
0x0004 for DEVICE_ID, 1 for BANK_SEL, 0xFF00 for DWC_TH and the HYS pairs 0x2B to 0x2D, 0 otherwise.

◆ TpAddress()

constexpr uint8_t ads9324::reg::TpAddress ( uint8_t  local)
constexprnoexcept

The address of the TP_AIN register of a local index.

Parameters
localThe bank-local channel index, 0 to 7.
Returns
The register address in the bank.

Variable Documentation

◆ kXorBitsRandomizer

constexpr uint16_t ads9324::reg::kXorBitsRandomizer = 0x00F1
inlineconstexpr

XOR_BITS_CTL for the randomizer: XOR_MODE 11b, NUM_XOR_BITS 11b, XOR_BIT_SEL 1 (section 7.3.14.4).