HF-Core Platform 0.1.0-dev
Hardware-Agnostic Handler Layer & RTOS Utilities for HardFOC
Loading...
Searching...
No Matches
As5047uHandler.h File Reference

Unified handler for AS5047U magnetic rotary position sensor with SPI integration. More...

#include <cstdint>
#include <memory>
#include <type_traits>
#include <utility>
#include "core/hf-core-drivers/external/hf-as5047u-driver/inc/as5047u.hpp"
#include "base/BaseSpi.h"
#include "RtosMutex.h"
Include dependency graph for As5047uHandler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  As5047uSpiAdapter
 CRTP adapter connecting BaseSpi interface to AS5047U SpiInterface. More...
 
struct  As5047uMeasurement
 Complete sensor measurement data structure. More...
 
struct  As5047uDiagnostics
 Sensor diagnostic information. More...
 
struct  As5047uConfig
 AS5047U configuration structure. More...
 
class  As5047uHandler
 Unified handler for AS5047U magnetic rotary position sensor. More...
 

Functions

std::unique_ptr< As5047uHandlerCreateAs5047uHandler (BaseSpi &spi_interface, const As5047uConfig &config=As5047uHandler::GetDefaultConfig()) noexcept
 Create AS5047U handler instance.
 

Detailed Description

Unified handler for AS5047U magnetic rotary position sensor with SPI integration.

This class provides a modern, unified interface for a single AS5047U device following the same architectural excellence as TMC9660Handler and PCAL95555Handler:

  • Bridge pattern for BaseSpi integration
  • Lazy initialization with lightweight construction
  • Shared pointer management for safe memory handling
  • Complete exception-free design with noexcept methods
  • Thread-safe operations with RtosMutex protection
  • Comprehensive error handling and validation
  • High-level sensor abstraction with position/velocity/diagnostics
  • Advanced AS5047U features (DAEC, OTP programming, interface configuration)
  • Factory method for creating multiple sensor instances

Features:

  • 14-bit absolute angle measurement (0-16383 counts per revolution)
  • Velocity measurement with multiple unit conversions
  • Dynamic Angle Error Compensation (DAEC)
  • ABI/UVW/PWM interface configuration
  • OTP programming for permanent settings
  • Comprehensive diagnostics and error handling
  • Multiple SPI frame formats (16/24/32-bit)
  • Thread-safe concurrent access
Author
HardFOC Team
Version
1.0
Date
2025

Function Documentation

◆ CreateAs5047uHandler()

std::unique_ptr< As5047uHandler > CreateAs5047uHandler ( BaseSpi & spi_interface,
const As5047uConfig & config = As5047uHandler::GetDefaultConfig() )
noexcept

Create AS5047U handler instance.

Parameters
spi_interfaceReference to SPI interface
configSensor configuration
Returns
Unique pointer to AS5047U handler