|
satnogs-rotator-firmware
|
Class that functions for interacting with AS5601 magnetic rotary position sensor. More...
#include <as5601.h>
Public Member Functions | |
| void | Begin () |
| Initialize the I2C bus. | |
| uint8_t | get_pos (double *new_pos) |
| Calculate an unwrap the position. | |
| uint8_t | get_agc () |
| Calculate the automatic gain control (AGC) | |
| uint16_t | get_magnitude () |
| Get the magnitude value of the internal CORDIC output. | |
| uint16_t | get_conf () |
| Get the configuration register. | |
| uint8_t | set_zero () |
| Set zero by setting offset angle. | |
| void | init_zero () |
| Reset zero position set the offset to zero. | |
| void | set_gear_ratio (uint8_t enc_ratio) |
| Set the gear ratio between encoder and measure axis. | |
Private Member Functions | |
| uint8_t | i2c_byte_transaction (uint8_t i2c_address, uint8_t i2c_register) |
| uint16_t | i2c_word_transaction (uint8_t i2c_address, uint8_t i2c_register) |
Private Attributes | |
| double | _angle_offset = 0 |
| int32_t | _n = 0 |
| float | _raw_prev_pos = 0 |
| uint8_t | _enc_ratio = 0 |
Class that functions for interacting with AS5601 magnetic rotary position sensor.
|
inline |
|
inline |
Calculate the automatic gain control (AGC)
Definition at line 97 of file as5601.h.
References AGC, AS5601_ID, and i2c_byte_transaction().

|
inline |
Get the configuration register.
Definition at line 117 of file as5601.h.
References AS5601_ID, CONF_HIGH, and i2c_word_transaction().

|
inline |
Get the magnitude value of the internal CORDIC output.
Definition at line 107 of file as5601.h.
References AS5601_ID, i2c_word_transaction(), and MAGNITUDE_HIGH.

|
inline |
Calculate an unwrap the position.
| new_pos | Calculate the current position of the sensor |
Definition at line 60 of file as5601.h.
References _angle_offset, _enc_ratio, _n, _raw_prev_pos, AS5601_ID, i2c_byte_transaction(), i2c_word_transaction(), RAW_ANG_HIGH, and STATUS_REG.
Referenced by homing(), loop(), and set_zero().

|
inlineprivate |
Definition at line 163 of file as5601.h.
Referenced by get_agc(), get_pos(), and i2c_word_transaction().
|
inlineprivate |
Definition at line 173 of file as5601.h.
References i2c_byte_transaction().
Referenced by get_conf(), get_magnitude(), and get_pos().

|
inline |
Reset zero position set the offset to zero.
Definition at line 142 of file as5601.h.
References _angle_offset.
Referenced by homing().
|
inline |
Set the gear ratio between encoder and measure axis.
| enc_ratio | An uitn8_t, that represents the gear ratio |
Definition at line 153 of file as5601.h.
References _enc_ratio.
Referenced by setup().
|
inline |
|
private |
Definition at line 158 of file as5601.h.
Referenced by get_pos(), init_zero(), and set_zero().
|
private |
Definition at line 161 of file as5601.h.
Referenced by get_pos(), and set_gear_ratio().
|
private |