|
AS5047U Driver 0.1.0
API reference
|
Public types of the AS5047U driver: errors, Result<T>, configuration, decoded registers.
More...
#include <array>#include <cstdint>#include "as5047u_detail.hpp"#include "as5047u_registers.hpp"#include "as5047u_version.h"Go to the source code of this file.
Classes | |
| struct | as5047u::Result< T > |
| The value of a call, or why there is none. More... | |
| struct | as5047u::Result< void > |
| The result of a call that returns no value. More... | |
| struct | as5047u::Config |
Everything EnsureInitialized() and ApplyConfig() write to the chip. More... | |
| struct | as5047u::OtpBurnConfirm |
The typed confirmation ProgramOtp() requires: burning the OTP cannot be undone, so the call names its intent and a stray integer cannot stand in for it (KB-CPP-045, KB-CPP20-030). More... | |
| struct | as5047u::ErrorFlags |
| ERRFL, decoded. Reading ERRFL clears it on the chip. More... | |
| struct | as5047u::Diagnostics |
| DIA, decoded: the state of the chip's internal loops. More... | |
| struct | as5047u::OtpReport |
Outcome of AS5047U::ProgramOtp(). More... | |
Namespaces | |
| namespace | as5047u |
The AS5047U driver: everything it declares lives here; internals in detail. | |
Typedefs | |
| using | as5047u::NonVolatileRegisters = std::array< uint16_t, reg::kNonVolatileCount > |
The non-volatile registers DISABLE to ECC, in address order; index with reg::At(reg::NvIndex). | |
Functions | |
| constexpr const char * | as5047u::ToString (Error error) noexcept |
| The name of an error, for logs. | |
| constexpr Error | as5047u::Validate (const Config &config) noexcept |
| Check a configuration without touching the chip. | |
| constexpr float | as5047u::CountsToDegrees (uint16_t counts) noexcept |
| Convert angle counts to degrees. | |
| constexpr float | as5047u::CountsToRadians (uint16_t counts) noexcept |
| Convert angle counts to radians. | |
| constexpr const char * | as5047u::GetDriverVersion () noexcept |
| constexpr uint32_t | as5047u::GetDriverVersionMajor () noexcept |
| constexpr uint32_t | as5047u::GetDriverVersionMinor () noexcept |
| constexpr uint32_t | as5047u::GetDriverVersionPatch () noexcept |
Variables | |
| constexpr uint32_t | as5047u::kPowerOnTimeMs = 10 |
| constexpr uint32_t | as5047u::kStartupTimeoutMaxMs = 1000 |
Largest Config::startup_timeout_ms that Validate() accepts. | |
| constexpr uint16_t | as5047u::kCountsPerRevolution = 16384 |
| Angle counts per revolution (14 bits). | |
| constexpr uint16_t | as5047u::kMaxAngleCount = kCountsPerRevolution - 1U |
| Highest angle count. | |
| constexpr float | as5047u::kVelocityDegPerSecPerLsb = 24.141F |
| Velocity resolution in degrees per second per LSB (datasheet, VEL register). | |
| constexpr float | as5047u::kPi = 3.14159265358979323846F |
Pi, as a float (C++20's std::numbers is not on every embedded toolchain). | |
| constexpr uint32_t | as5047u::kOtpBurnTimeoutMs = 100 |
| constexpr OtpBurnConfirm | as5047u::kOtpConfirm {0x0B7B'0B7BU} |
The confirmation to pass to ProgramOtp(). | |
| constexpr uint8_t | as5047u::kMax3BitCode = 7 |
The highest field code for 3-bit fields (filter_k_*_code, abi_resolution_code). | |
| constexpr uint8_t | as5047u::kMaxHysteresisCode = 3 |
| The highest hysteresis code (2-bit field). | |
| constexpr uint8_t | as5047u::kMaxUvwPolePairs = 7 |
| Highest UVW pole-pair count. | |
Public types of the AS5047U driver: errors, Result<T>, configuration, decoded registers.
Everything here is plain data with no platform dependency, so handlers, tests and tools can include it without the driver template. The configuration defaults are the register reset values of a part whose OTP was never burned (datasheet DS000637, "Register Description"), so Config{} describes a freshly powered chip; only the SPI frame format is a driver-side choice.