modm API documentation
|
#include <modm/driver/inertial/mmc5603.hpp>
Classes | |
struct | Data |
Public Types | |
enum | Register : uint8_t |
enum | Status1 : uint8_t |
enum | Control0 : uint8_t |
enum | Control1 : uint8_t |
enum | Bandwidth : uint8_t |
enum | Control2 : uint8_t |
enum | PeriodicalSet : uint8_t |
Public Member Functions | |
MODM_FLAGS8 (Status1) | |
MODM_FLAGS8 (Control0) | |
MODM_FLAGS8 (Control1) | |
MODM_FLAGS_CONFIG (Control1, Bandwidth) | |
MODM_FLAGS8 (Control2) | |
MODM_FLAGS_CONFIG (Control2, PeriodicalSet) | |
Mmc5603 (Data &data, uint8_t address=addr ()) | |
Constructor, requires a mmc5603::Data object. | |
modm::ResumableResult< bool > | ping () |
modm::ResumableResult< bool > | startTemperatureMeasurement () |
modm::ResumableResult< bool > | configureContinuousMode (uint8_t frequency, Bandwidth bandwidth=Bandwidth::Ms2_0) |
Continuous Mode up to 250Hz with Automatic Set/Reset, 2ms Measurement Time. | |
Data & | getData () |
Status1_t | getStatus1 () |
uint8_t | getOutputDataRate () |
Control0_t | getControl0 () |
Control1_t | getControl1 () |
Control2_t | getControl2 () |
modm::ResumableResult< bool > | readProductId (uint8_t &value) |
modm::ResumableResult< bool > | readMagneticField () |
modm::ResumableResult< bool > | update (Register reg, Register_t setMask, Register_t clearMask=Register_t (0)) |
modm::ResumableResult< bool > | write (Register reg, uint8_t value) |
modm::ResumableResult< bool > | read (Register reg, uint8_t &value) |
modm::ResumableResult< bool > | read (Register reg, uint8_t *data, uint8_t size) |
void | attachConfigurationHandler (I2c::ConfigurationHandler handler) |
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. | |
Static Public Member Functions | |
static constexpr uint8_t | addr (uint8_t factory=0) |
Static Public Attributes | |
static constexpr uint8_t | ProductID {0x10} |
Protected Member Functions | |
uint8_t & | rb (Register reg) |
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 | |
Data & | data |
uint8_t | regBuffer [9] = {} |
uint8_t | buffer [2] |
I2cWriteReadTransaction | transaction |
|
strong |
The bandwidth adjusts the length of the decimation filter. It controls the duration of each measurement.
|
strong |
These bits determine how many measurements are done before a set is executed, when the part is in continuous mode and the automatic set/reset is enabled. From 000 to 111, the sensor will do one set for every 1, 25, 75, 100, 250, 500, 1000, and 2000 samples. In order to enable this feature, both En_prd_set and Auto_SR must be set to 1, and the part should work in continuous mode. Please note that during this operation, the sensor will not be reset.
|
inlinestaticconstexpr |
The MEMSIC device 7-bit device address is 0110000 where the three LSB’s are pre-programmed into the MMC5603NJ by the factory.
|
inheritedinline |
Attaches a configuration handler, which is called before a transaction, whenever the configuration has to be changed.
|
inherited |
Run the resumable function.
You need to implement this method in you subclass yourself.
NestingError
if still running, <=NestingError
if it has finished.
|
inheritedinline |
|
inheritedinline |
true
if a resumable function is running at the current nesting level, else false
|
inheritedinlineprotected |
true
when transaction is busy.
|
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.