|
using | PowerMode_t = Configuration< Config_t, PowerMode, 0b11, 0 > |
|
using | Hysteresis_t = Configuration< Config_t, Hysteresis, 0b11, 2 > |
|
using | OutputStage_t = Configuration< Config_t, OutputStage, 0b11, 4 > |
|
using | PWMFrequency_t = Configuration< Config_t, PWMFrequency, 0b11, 6 > |
|
using | SlowFilter_t = Configuration< Config_t, SlowFilter, 0b11, 8 > |
|
using | FastFilterThreshold_t = Configuration< Config_t, FastFilterThreshold, 0b11, 10 > |
|
using | Data = modm::IntegerAngle< 12 > |
|
|
enum | Register : uint8_t {
ZMCO = 0x00,
ZPOS = 0x01,
MPOS = 0x03,
MANG = 0x05,
CONF = 0x07,
ANGLE_RAW = 0x0C,
ANGLE = 0x0E,
STATUS = 0x0B,
AGC = 0x1A,
MAGNITUDE = 0x1B,
BURN = 0xFF,
I2C_ADDR = 0x20,
I2C_UPDT = 0x21
} |
|
enum | Config : uint16_t {
PM0 = Bit0,
PM1 = Bit1,
HYST0 = Bit2,
HYST1 = Bit3,
OUTS0 = Bit4,
OUTS1 = Bit5,
PWM0 = Bit6,
PWM1 = Bit7,
SF0 = Bit8,
SF1 = Bit9,
FTH0 = Bit10,
FTH1 = Bit11,
FTH2 = Bit12,
WD = Bit13
} |
|
enum | PowerMode : uint16_t { NOM = 0,
LPM1 = 1,
LPM2 = 2,
LPM3 = 3
} |
|
enum | Hysteresis : uint16_t { OFF = 0,
LSB = 1,
LSB2 = 2,
LSB3 = 3
} |
|
enum | OutputStage : uint16_t { ANALOG = 0,
ANALOG_REDUCED = 1,
PWM = 2
} |
|
enum | PWMFrequency : uint16_t { Hz115 = 0,
Hz230 = 1,
Hz460 = 2,
Hz920 = 3
} |
|
enum | SlowFilter : uint16_t { x16 = 0,
x8 = 1,
x4 = 2,
x2 = 3
} |
|
enum | FastFilterThreshold : uint16_t {
LSB6 = 0,
LSB7 = 1,
LSB9 = 2,
LSB18 = 3,
LSB21 = 4,
LSB24 = 5,
LSB10 = 6
} |
|
enum | Burn : uint8_t { ANGLE = Bit3,
CONFIG = Bit2
} |
|
enum | Status : uint8_t { MagnetTooStrong = Bit3,
MagnetTooWeak = Bit4,
MagnetDetected = Bit5
} |
|
|
| MODM_FLAGS16 (Config) |
|
| MODM_FLAGS8 (Status) |
|
| As5600 (Data &data, uint8_t address=0x36) |
|
bool | reset () |
|
bool | configure (Config_t config) |
|
bool | setI2cAddress (uint8_t address) |
|
bool | setLowerLimit (Data data) |
| Wait 1ms after setting the lower limit.
|
|
bool | setUpperLimit (Data data) |
| Wait 1ms after setting the upper limit.
|
|
bool | setMaxAngle (Data data) |
|
bool | burn (Burn flags) |
|
Data | getRawValue () |
|
Status | getStatus () |
|
uint16_t | getMagnitude () |
|
uint8_t | getAgcValue () |
|
bool | read () |
|
Data & | getData () |
|
void | attachConfigurationHandler (I2c::ConfigurationHandler handler) |
|
bool | ping () |
|
bool | read (uint8_t *buffer, std::size_t size) |
| Starts a write transaction and waits until finished.
|
|
void | setAddress (uint8_t address) |
|
bool | write (const uint8_t *buffer, std::size_t size) |
| Starts a write transaction and waits until finished.
|
|
bool | writeRead (const uint8_t *writeBuffer, std::size_t writeSize, uint8_t *readBuffer, std::size_t readSize) |
| Starts a write-read transaction and waits until finished.
|
|
template<class I2cMaster >
uint8_t modm::as5600< I2cMaster >::getAgcValue |
( |
| ) |
|
|
inline |
Automated Gain Control
The AS5600 uses Automatic Gain Control in a closed loop to compensate for variations of the magnetic field strength due to changes of temperature, airgap between IC and magnet, and magnet degradation.
For the most robust performance, the gain value should be in the center of its range. The airgap of the physical system can be adjusted to achieve this value.
In 5V operation, range is 0-255 In 3.3V operation, range is reduced to 0-128