Changelog¶
What changed in each release of the driver.
All notable changes to this driver are listed here. The format follows Keep a Changelog and the project uses Semantic Versioning.
[Unreleased]¶
Added¶
- Host unit tests (
-DHF_AS5047U_BUILD_TESTS=ON) against a model of the AS5047U SPI slave, and a CI workflow.
Changed¶
- CI builds all five ESP32 example apps (
ci_enabledinexamples/esp32/app_config.yml); onlydriver_integration_testwas built before.configuration_exampleandfull_featuresnow check each setter's result and report the sticky flags of a failed one. - Breaking (port contract): the SPI port's
transfer()returnsbool(true= frame clocked,false= bus error) and every driver path propagates it: setters,WriteReg()andProgramOTP()returnfalse, a read-modify-write setter whose read fails writes nothing, and every failed frame sets the newAS5047U_Error::BusErrorsticky flag. Avoidtransfer()still compiles and is treated as never failing; any other return type is rejected bystatic_assert. NewReadReg(reg, retries)overload returns whether the read worked. Datasheet "SPI Transaction", Figures 29 and 30: a read or write is a fixed sequence of frames, so a frame that was not clocked leaves the access incomplete. - Breaking:
GetStickyErrorFlags()no longer clears the flags; the newClearStickyErrorFlags()clears them and returns what it cleared. The measurement getters no longer consume the flags to decide on a retry (they use the ERRFL of their own read), so the flags of every sample stay visible until the caller clears them. Datasheet Figure 33: ERRFL clears when read, so the driver's cache is the only copy. Code that relied on a get to clear must callClearStickyErrorFlags()instead. - Documentation moved to the HardFOC MkDocs platform: new page set (quickstart, hardware, architecture, SPI
protocol, OTP programming, 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 doxygen-awesome submodule are gone.
Fixed¶
cmake --installnow installsas5047u.ipp, whichas5047u.hppincludes, so an installed copy compiles; the header includes it through the include path (src/is a build include directory) instead of../src/. The installed target is exported ashf::as5047u, the name the package config and the docs give (it washf::hf_as5047u, which stays available as an alias). New ctesthf_as5047u_install_consumerbuilds afind_package()consumer against a fresh install.- The write path no longer prints: a failed write verification used to
printfa line from inside the driver. The cause is in the sticky flags, which the write path already fills from ERRFL.DumpStatus(), which exists to print, is unchanged. - The non-standard
M_PIis replaced by the constantas5047u::kPi, so the header builds whereM_PIis not defined (MSVC without_USE_MATH_DEFINES, strict-ISO newlib);<cmath>is no longer included. ProgramOTP()follows the datasheet's step-by-step OTP procedure exactly (DS000637 page 41-42, Figure 60): it now clears the volatile registers before the guard-band test (step 15, which was skipped, so the guard-band comparison could pass on values still in the volatile registers), writes the PROG values of Figure 60 (0x01,0x08,0x40,0x04; it wrote0x09,0x49,0x4D,0x49, which set PROGOTP again after the burn), compares DISABLE..ECC (0x0015..0x001B) instead of 0x0016..0x001A, checks the result of every step and stops at the first failure (it ignored every write result and could burn after a failed write). New optionalOtpResult*argument reports the failed step, whether the burn started and the burned image; newVerifyOTP()performs the power-on check of steps 21 and 22.- The CRC of each 24- and 32-bit reply the driver uses is checked: a corrupted reply fails the access (retried
when
retriesallows; a failed read returns 0) and sets the newReplyCrcErrorsticky flag, instead of being returned as data. The warning and error bits of the replies are recorded as the newReplyWarningandReplyErrorsticky flags. Datasheet "SPI Transaction" Figures 22, 25 and 28 (MISO data frames) and "CRC Checksum" with Figure 31. - Every ERRFL value the driver reads reaches the sticky flags:
GetErrorFlags()andReadReg<ERRFL>()used to read ERRFL a second time for the sticky update, which returned 0 and dropped the flags (datasheet Figure 33).GetErrorFlags()no longer re-reads ERRFL until it reads 0. - Every member of
AS5047U<>compiles on current GCC and Clang: thetemplatekeyword is no longer used without a template argument list, andGetFilterParameters()no longer binds bit-fields to references.
[1.0.0]¶
The version set in cmake/hf_as5047u_build_settings.cmake; not tagged yet.
Added¶
AS5047U<SpiType>driver over a CRTP SPI interface: angle, velocity, AGC, magnitude, diagnostics, 16-, 24- and 32-bit frames with CRC, zero position, direction, DAEC, adaptive filter presets, ABI / UVW / PWM outputs, hysteresis, OTP programming, typed register access.- ESP-IDF component wrapper and ESP32 example applications.