AS5047U Driver
API reference
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Enumerations | Functions | Variables
as5047u.hpp File Reference

Driver for AMS AS5047U Magnetic Rotary Position Sensor (C++21) More...

#include "as5047u_registers.hpp"
#include "as5047u_spi_interface.hpp"
#include "as5047u_version.h"
#include <algorithm>
#include <array>
#include <atomic>
#include <bitset>
#include <cstdint>
#include <cstdio>
#include <functional>
#include <utility>
#include "as5047u_types.hpp"
#include "as5047u_config.hpp"
#include "as5047u.ipp"

Go to the source code of this file.

Classes

struct  as5047u::OtpResult
 Outcome of AS5047U::ProgramOTP(). More...
 
class  as5047u::AS5047U< SpiType >
 AS5047U magnetic rotary sensor driver class. More...
 
struct  as5047u::AS5047U< SpiType >::Angle
 Angle conversion helpers. More...
 
struct  as5047u::AS5047U< SpiType >::Velocity
 Helper constants and methods for velocity unit conversions. More...
 

Namespaces

namespace  as5047u
 

Macros

#define AS5047U_HEADER_INCLUDED
 

Enumerations

enum class  AS5047U_Error : uint16_t {
  None = 0 , AgcWarning = 1 << 0 , MagHalf = 1 << 1 , P2ramWarning = 1 << 2 ,
  P2ramError = 1 << 3 , FramingError = 1 << 4 , CommandError = 1 << 5 , CrcError = 1 << 6 ,
  WatchdogError = 1 << 7 , OffCompError = 1 << 9 , CordicOverflow = 1 << 10 , BusError = 1 << 11 ,
  ReplyCrcError = 1 << 12 , ReplyWarning = 1 << 13 , ReplyError = 1 << 14
}
 
enum class  as5047u::AngleUnit : uint8_t { as5047u::Lsb , as5047u::Degrees , as5047u::Radians }
 Units for angle-returning APIs. More...
 
enum class  as5047u::VelocityUnit : uint8_t { as5047u::Lsb , as5047u::DegPerSec , as5047u::RadPerSec , as5047u::Rpm }
 Units for velocity-returning APIs. More...
 

Functions

const char * as5047u::GetDriverVersion () noexcept
 

Variables

constexpr std::size_t as5047u::kOtpRegisterCount = 7
 Number of non-volatile registers burned into OTP: DISABLE (0x0015) to ECC (0x001B).
 
constexpr uint16_t as5047u::kOtpFirstAddress = 0x0015
 First non-volatile register address (DISABLE).
 
constexpr float as5047u::kPi = 3.14159265358979323846F
 

Detailed Description

Driver for AMS AS5047U Magnetic Rotary Position Sensor (C++21)

Macro Definition Documentation

◆ AS5047U_HEADER_INCLUDED

#define AS5047U_HEADER_INCLUDED

Enumeration Type Documentation

◆ AS5047U_Error

enum class AS5047U_Error : uint16_t
strong
Enumerator
None 
AgcWarning 

AGC reached minimum (0) or maximum (255) value.

MagHalf 

Magnetic field is half of regulated value (AGC=255)

P2ramWarning 

ECC corrected 1 bit in P2RAM customer area.

P2ramError 

ECC detected 2+ uncorrectable errors in P2RAM.

FramingError 

SPI framing error.

CommandError 

Invalid SPI command received.

CrcError 

CRC error during SPI communication.

WatchdogError 

Internal oscillator or watchdog not working proper.

OffCompError 

Internal offset compensation not finished.

CordicOverflow 

CORDIC algorithm overflow.

BusError 

Driver: the port's transfer() reported a bus error.

ReplyCrcError 

Driver: the CRC of a 24/32-bit MISO frame was wrong.

ReplyWarning 

Chip: warning bit set in a MISO frame (DS Figures 22, 25, 28)

ReplyError 

Chip: error bit set in a MISO frame (DS Figures 22, 25, 28)