|
PicoLowLevel
|
#include <ams_as5048b.h>

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) |
| AMS_AS5048B::AMS_AS5048B | ( | void | ) |
Constructor
| AMS_AS5048B::AMS_AS5048B | ( | uint8_t | chipAddress | ) |
| uint8_t AMS_AS5048B::addressRegR | ( | void | ) |
reads I2C address register value
@params[in] none

| void AMS_AS5048B::addressRegW | ( | uint8_t | regVal | ) |
write I2C address value (5 bits) into the address register
@params[in] unit8_t register value
| 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

| uint16_t AMS_AS5048B::angleRegR | ( | void | ) |
| void AMS_AS5048B::begin | ( | void | ) |
init values and overall behaviors for AS5948B use
@params none


| uint8_t AMS_AS5048B::diagR | ( | void | ) |
| void AMS_AS5048B::doProg | ( | void | ) |
Burn values to the slave address OTP register.
@params[in] none

| void AMS_AS5048B::doProgZero | ( | void | ) |
Burn values to the zero position OTP register.
@params[in] none

| uint8_t AMS_AS5048B::getAutoGain | ( | void | ) |
reads the 1 bytes auto gain register value
@params[in] none
| uint8_t AMS_AS5048B::getDiagReg | ( | void | ) |
reads the 1 bytes diagnostic register value
@params[in] none
| 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
| uint16_t AMS_AS5048B::magnitudeR | ( | void | ) |
reads the 2 bytes magnitude register value
@params[in] none
| void AMS_AS5048B::progRegister | ( | uint8_t | regVal | ) |
writes OTP control register
@params[in] unit8_t register value

| void AMS_AS5048B::resetMovingAvgExp | ( | void | ) |

| void AMS_AS5048B::setClockWise | ( | boolean | cw = true | ) |
Set / unset clock wise counting - sensor counts CCW natively.
@params[in] boolean cw - true: CW, false: CCW


| void AMS_AS5048B::setZeroReg | ( | void | ) |
sets current angle as the zero position
@params[in] none


| void AMS_AS5048B::toggleDebug | ( | void | ) |
Toggle debug output to serial.
@params none
| 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


| uint16_t AMS_AS5048B::zeroRegR | ( | void | ) |
reads the 2 bytes Zero position register value
@params[in] none

| void AMS_AS5048B::zeroRegW | ( | uint16_t | regVal | ) |
writes the 2 bytes Zero position register value
@params[in] unit16_t register value
