Changelog¶
What changed in each release of the driver. Entries marked BREAKING need source changes in code that used the affected API.
Unreleased¶
Added¶
HardwareReset(): pulses the active-low RESET pin through an optionalResetWrite(bool)hook in the host port (detected at compile time,HasHardwareReset()), waits tPU and reprograms the chip likeSoftwareReset()(SBASB22 section 7.4.1).RESET_PULSE_US(10 µs) sets the low time.SetReference(ReferenceSource)/GetReference(): REFSEL pin, internal or external reference through ANA_CFG1 (SBASB22 section 7.3.6, Table 7-3).SetOversampling(OversamplingRatio, OversamplingClock)/GetOversampling(): the block-average filter (DIG_FILTERBLK_AVG_OSR, 2 to 128 samples) with the internal or the external oversampling clock, including the GEN_CFG5AVG_MODE_OVR_EN/AVG_MODEinitialisation and theDIG_FILT_SYSREFaccumulator reset, held high for more than one tCONVST (SBASB22 section 7.3.11.2, Figure 7-14, Table 7-8, Table 8-17, Table 8-18).ReadSnapshot()pulses CONVST N times with the external clock and scales its DRDY timeout and fallback wait by N with the internal clock.RunAdcCalibration(AdcCalMode[, InputType, InputType])/GetAdcCalMode(): runs the on-chip ADC_CAL module in single-shot mode (offset, gain or both; SBASB22 section 7.3.10 steps 1 to 7, Table 7-7, Table 8-16), pollingCALIB_BUSY_FLAG(Table 8-19) and restoring the oversampling filter afterwards. NewADC_CAL_WAIT_MS(125) andADC_CAL_TIMEOUT_MS(125) settings.SetSystemCorrection(offset, gain):OFS_CORR_DIS/GAN_CORR_DISin the GEN_CFG5 register of both channel banks (SBASB22 sections 7.3.8 and 7.3.9, Table 8-70, Table 8-121).OffsetCorrectionFor()andGainCorrectionFor()computeOFS_AINnandGAN_AINnfrom a measurement (Equations 1 and 3).GetDriverVersion(): the version string.- Host-test workflow (
ci-host-tests.yml): GCC and Clang build and run the protocol tests and compile the documentation's code.
Fixed¶
- The
CONFIG_ADS9324_RANGE_*,CONFIG_ADS9324_SINGLE_ENDEDandCONFIG_ADS9324_PGA_WIDEdefaults only seeded the driver's channel cache; the chip kept its reset state (±5 V differential, low bandwidth), so voltages were scaled with the wrong range.EnsureInitialized()andSoftwareReset()now write them to all 16 channels (PGA_CONFIG and PGA_BW_SEL of both banks).SoftwareReset()also resets the cached channel-count mode and PGA configuration to match the chip. NewDefaultChannelConfig()andCONFIG_ADS9324_RANGE_6V25. - BREAKING
ReadSnapshot()in a reduced channel-count mode (SetChannelCountMode()withEight,FourorTwo) stored the nth word of the burst as channel n. The chip sends a fixed set from both ends of the device (SBASB22 Table 7-12, e.g. AIN1 to AIN4 and AIN13 to AIN16), socount[4]held AIN13 and was converted with channel 4's range. Each word is now stored under its real channel andvalid_maskmarks those channels. New helpersreg::FrameChannel(),reg::FrameChannelMask()andreg::FrameChannelCount(). Code that read the reduced burst fromcount[0]tocount[n - 1]must read the real channels (hasChannel()). - BREAKING
GetDriverVersionMajor(),GetDriverVersionMinor()andGetDriverVersionPatch()returned the literals 1, 0, 0 whatever the project version. They now return the macros of the generatedads9324_version.h, which comes from the version incmake/hf_ads9324_build_settings.cmake, now also the CMakeproject()version.ads9324.hppincludesads9324_version.h, so a build that adds onlyinc/andsrc/to the include path must also add the generated header (the CMake target and the ESP-IDF component provide it). Host tests check the getters,idf_component.ymland theDoxyfileagainst the project version. cmake --installdid not installads9324.ipp, whichads9324.hppincludes, and exported the target ashf::hf_ads9324while the documentation linkshf::ads9324: an installed package could not be used. The.ippis now installed next to the headers and the target is exported ashf::ads9324(hf::hf_ads9324stays as an alias). New host testhf_ads9324_install_consumerinstalls the package and builds afind_package()consumer.
Changed¶
- BREAKING
SetChannelGain(channel, gain)takes a signedint16_t(wasuint16_t):GAN_AINnis 14-bit two's complement (SBASB22 Table 7-6, Table 8-40). Values outsidekGainMin(−8192) tokGainMax(+8191) are rejected withfalseinstead of being truncated to 14 bits (8192 used to become −8192). Code that passed a negative value cast touint16_tkeeps working; code that passed the raw 14-bit pattern of a negative value (e.g.0x3333) must pass the signed value (−3277). - BREAKING
SetChannelOffset()rejects values outside the 10-bit field,kOffsetMin(−512) tokOffsetMax(+511), instead of truncating them (512 used to become −128 LSB): such calls now returnfalseand write nothing. - BREAKING The SPI port's
transfer()now returnsbool(true= bytes clocked,false= bus error) and the driver propagates it: configuration calls returnfalse,ReadDeviceId()returns 0,ReadSnapshot()/ReadChannel()returnError::SpiError. Cached settings (data format, lanes, channel-count mode, PGA) change only after the frames that set them were transferred, and a failedBANK_SELframe forces the next access to select the bank again. A port with avoidtransfer()still compiles and is treated as never failing; any other return type (for exampleesp_err_t) is a compile error: returnbool(trueon success). The ESP32 example port returnsfalseon an ESP-IDF error. - ESP32 examples: CI now builds
basic_snapshotandpga_offsetas well (ci_enabled: true). Both check theboolresults of the configuration calls;pga_offsetreads both channels from one snapshot and programs a signed gain.driver_integration_testadds oversampling, system-correction and ADC_CAL tests and logs the driver version. - Documentation moved to the HardFOC MkDocs platform: new page set (quickstart, hardware, architecture, API guide,
porting, testing), code snippets compiled by the host build from
tests/docs/, Doxygen under/api/, versioned with mike. The Jekyll site files and the vendored doxygen-awesome stylesheet are gone. - Host tests moved into
tests/CMakeLists.txt; the option is stillHF_ADS9324_BUILD_HOST_TESTS.
1.0.0¶
First version (not tagged).
ads9324::ADS9324<Spi, Host>: initialisation with the 1-lane SDOUT sequence of SBASB22 Table 7-18 and a DEVICE_ID check, per-channel PGA range, input type and bandwidth, offset and gain registers, data format, channel-count mode, power-down, DRDY/ALARM mux, digital window comparator, simultaneous snapshots.- CRTP
SpiInterfaceandHostInterfacecontracts. - ESP32-C6 examples (
driver_integration_test,basic_snapshot,pga_offset) and host protocol tests.