modm API documentation
|
Public Typedefs | |
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 > |
Public Member Functions | |
MODM_FLAGS16 (Config) | |
MODM_FLAGS8 (Status) | |
As5600 (Data &data, uint8_t address=0x36) | |
modm::ResumableResult< bool > | reset () |
modm::ResumableResult< bool > | configure (Config_t config) |
modm::ResumableResult< bool > | setI2cAddress (uint8_t address) |
modm::ResumableResult< bool > | setLowerLimit (Data data) |
Wait 1ms after setting the lower limit. | |
modm::ResumableResult< bool > | setUpperLimit (Data data) |
Wait 1ms after setting the upper limit. | |
modm::ResumableResult< bool > | setMaxAngle (Data data) |
modm::ResumableResult< bool > | burn (Burn flags) |
modm::ResumableResult< Data > | getRawValue () |
modm::ResumableResult< Status > | getStatus () |
modm::ResumableResult< uint16_t > | getMagnitude () |
modm::ResumableResult< uint8_t > | getAgcValue () |
modm::ResumableResult< bool > | read () |
Data & | getData () |
void | attachConfigurationHandler (I2c::ConfigurationHandler handler) |
modm::ResumableResult< bool > | ping () |
modm::ResumableResult< bool > | read (uint8_t *buffer, std::size_t size) |
Starts a write transaction and waits until finished. | |
void | setAddress (uint8_t address) |
modm::ResumableResult< bool > | write (const uint8_t *buffer, std::size_t size) |
Starts a write transaction and waits until finished. | |
modm::ResumableResult< 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. | |
Protected Member Functions | |
modm::ResumableResult< ReturnType > resumable | function (...) |
int8_t | getResumableDepth () const |
bool | isResumableRunning () const |
bool | isTransactionRunning () |
modm::ResumableResult< bool > | runTransaction () |
Starts our own transaction and waits until finished. | |
bool | startRead (uint8_t *buffer, std::size_t size) |
Configures the transaction with a read operation and starts it. | |
bool | startTransaction () |
Starts the transaction with our own transaction object. | |
bool | startTransaction (modm::I2cTransaction *transaction) |
Starts the transaction with a separate transaction object. | |
bool | startWrite (const uint8_t *buffer, std::size_t size) |
Configures the transaction with a write operation and starts it. | |
bool | startWriteRead (const uint8_t *writeBuffer, std::size_t writeSize, uint8_t *readBuffer, std::size_t readSize) |
Configures the transaction with a write/read operation and starts it. | |
void | stopResumable () |
Force all resumable functions to stop running at the current nesting level. | |
bool | wasTransactionSuccessful () |
Protected Attributes | |
I2cWriteReadTransaction | transaction |
|
inline |
AS5600 has hardwired address 0x36 AS4500L has default address 0x40 but supports programming a different one
|
inheritedinline |
Attaches a configuration handler, which is called before a transaction, whenever the configuration has to be changed.
|
inline |
Permanently burn configurations
|
inherited |
Run the resumable function.
You need to implement this method in you subclass yourself.
NestingError
if still running, <=NestingError
if it has finished.
|
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
|
inheritedinline |
|
inheritedinline |
true
if a resumable function is running at the current nesting level, else false
|
inheritedinlineprotected |
true
when transaction is busy.
|
inheritedinline |
true | device responds to address |
false | no device with address found |
|
inline |
Reset to Power up state. Useful for developement, not required in production.
The config registers span from 0x00 to 0x08
|
inheritedinline |
Sets a new address of the slave device.
address | the slave address not yet shifted left (address < 128). |
|
inheritedinlineprotected |
true
when transaction did not return an error.