PicoLowLevel
Loading...
Searching...
No Matches
AMS_AS5048B Class Reference

#include <ams_as5048b.h>

Inheritance diagram for AMS_AS5048B:

Public Member Functions

 AMS_AS5048B (void)
 
 AMS_AS5048B (uint8_t chipAddress)
 
void begin (void)
 init values and overall behaviors for AS5948B use
 
void toggleDebug (void)
 Toggle debug output to serial.
 
void setClockWise (boolean cw=true)
 Set / unset clock wise counting - sensor counts CCW natively.
 
void progRegister (uint8_t regVal)
 writes OTP control register
 
void doProg (void)
 Burn values to the slave address OTP register.
 
void doProgZero (void)
 Burn values to the zero position OTP register.
 
void addressRegW (uint8_t regVal)
 write I2C address value (5 bits) into the address register
 
uint8_t addressRegR (void)
 reads I2C address register value
 
void setZeroReg (void)
 sets current angle as the zero position
 
void zeroRegW (uint16_t regVal)
 writes the 2 bytes Zero position register value
 
uint16_t zeroRegR (void)
 reads the 2 bytes Zero position register value
 
uint16_t angleRegR (void)
 
uint8_t diagR (void)
 
uint16_t magnitudeR (void)
 reads the 2 bytes magnitude register value
 
double angleR (int unit=U_RAW, boolean newVal=true)
 reads current angle value and converts it into the desired unit
 
uint8_t getAutoGain (void)
 reads the 1 bytes auto gain register value
 
uint8_t getDiagReg (void)
 reads the 1 bytes diagnostic register value
 
void updateMovingAvgExp (void)
 Performs an exponential moving average on the angle. Works on Sine and Cosine of the angle to avoid issues 0°/360° discontinuity.
 
double getMovingAvgExp (int unit=U_RAW)
 sent back the exponential moving averaged angle in the desired unit
 
void resetMovingAvgExp (void)
 

Constructor & Destructor Documentation

◆ AMS_AS5048B() [1/2]

AMS_AS5048B::AMS_AS5048B ( void  )

Constructor

◆ AMS_AS5048B() [2/2]

AMS_AS5048B::AMS_AS5048B ( uint8_t  chipAddress)

Member Function Documentation

◆ addressRegR()

uint8_t AMS_AS5048B::addressRegR ( void  )

reads I2C address register value

@params[in] none

Returns
uint8_t register value
Here is the caller graph for this function:

◆ addressRegW()

void AMS_AS5048B::addressRegW ( uint8_t  regVal)

write I2C address value (5 bits) into the address register

@params[in] unit8_t register value

Returns
none

◆ angleR()

double AMS_AS5048B::angleR ( int  unit = U_RAW,
boolean  newVal = true 
)

reads current angle value and converts it into the desired unit

@params[in] String unit : string expressing the unit of the angle. Sensor raw value as default @params[in] Boolean newVal : have a new measurement or use the last read one. True as default

Returns
Double angle value converted into the desired unit
Here is the caller graph for this function:

◆ angleRegR()

uint16_t AMS_AS5048B::angleRegR ( void  )

◆ begin()

void AMS_AS5048B::begin ( void  )

init values and overall behaviors for AS5948B use

@params none

Returns
none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ diagR()

uint8_t AMS_AS5048B::diagR ( void  )

◆ doProg()

void AMS_AS5048B::doProg ( void  )

Burn values to the slave address OTP register.

@params[in] none

Returns
none
Here is the call graph for this function:

◆ doProgZero()

void AMS_AS5048B::doProgZero ( void  )

Burn values to the zero position OTP register.

@params[in] none

Returns
none
Here is the call graph for this function:

◆ getAutoGain()

uint8_t AMS_AS5048B::getAutoGain ( void  )

reads the 1 bytes auto gain register value

@params[in] none

Returns
uint8_t register value

◆ getDiagReg()

uint8_t AMS_AS5048B::getDiagReg ( void  )

reads the 1 bytes diagnostic register value

@params[in] none

Returns
uint8_t register value

◆ getMovingAvgExp()

double AMS_AS5048B::getMovingAvgExp ( int  unit = U_RAW)

sent back the exponential moving averaged angle in the desired unit

@params[in] String unit : string expressing the unit of the angle. Sensor raw value as default

Returns
Double exponential moving averaged angle value

◆ magnitudeR()

uint16_t AMS_AS5048B::magnitudeR ( void  )

reads the 2 bytes magnitude register value

@params[in] none

Returns
uint16_t register value trimmed on 14 bits

◆ progRegister()

void AMS_AS5048B::progRegister ( uint8_t  regVal)

writes OTP control register

@params[in] unit8_t register value

Returns
none
Here is the caller graph for this function:

◆ resetMovingAvgExp()

void AMS_AS5048B::resetMovingAvgExp ( void  )
Here is the caller graph for this function:

◆ setClockWise()

void AMS_AS5048B::setClockWise ( boolean  cw = true)

Set / unset clock wise counting - sensor counts CCW natively.

@params[in] boolean cw - true: CW, false: CCW

Returns
none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setZeroReg()

void AMS_AS5048B::setZeroReg ( void  )

sets current angle as the zero position

@params[in] none

Returns
none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ toggleDebug()

void AMS_AS5048B::toggleDebug ( void  )

Toggle debug output to serial.

@params none

Returns
none

◆ updateMovingAvgExp()

void AMS_AS5048B::updateMovingAvgExp ( void  )

Performs an exponential moving average on the angle. Works on Sine and Cosine of the angle to avoid issues 0°/360° discontinuity.

@params[in] none

Returns
none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zeroRegR()

uint16_t AMS_AS5048B::zeroRegR ( void  )

reads the 2 bytes Zero position register value

@params[in] none

Returns
uint16_t register value trimmed on 14 bits
Here is the caller graph for this function:

◆ zeroRegW()

void AMS_AS5048B::zeroRegW ( uint16_t  regVal)

writes the 2 bytes Zero position register value

@params[in] unit16_t register value

Returns
none
Here is the caller graph for this function:

The documentation for this class was generated from the following files: