|
enum | MeasurementAverage : uint8_t { Average8 = int(ConfigA::MA1) | int(ConfigA::MA0),
Average4 = int(ConfigA::MA1),
Average2 = int(ConfigA::MA0),
Average1 = 0
} |
|
enum | Gain : uint8_t {
Ga0_88 = 0,
Ga1_3 = int(ConfigB::GN0),
Ga1_9 = int(ConfigB::GN1),
Ga2_5 = int(ConfigB::GN1) | int(ConfigB::GN2),
Ga4_0 = int(ConfigB::GN2),
Ga4_7 = int(ConfigB::GN2) | int(ConfigB::GN0),
Ga5_6 = int(ConfigB::GN2) | int(ConfigB::GN1),
Ga8_1 = int(ConfigB::GN2) | int(ConfigB::GN1) | int(ConfigB::GN0)
} |
|
enum | MeasurementRate : uint8_t {
Hz0_75 = 0,
Hz1_5 = int(ConfigA::DO0),
Hz3 = int(ConfigA::DO1),
Hz7_5 = int(ConfigA::DO1) | int(ConfigA::DO0),
Hz15 = int(ConfigA::DO2),
Hz30 = int(ConfigA::DO2) | int(ConfigA::DO0),
Hz75 = int(ConfigA::DO2) | int(ConfigA::DO1)
} |
|
enum | ConfigA : uint8_t |
| Configuration Register A.
|
|
enum | ConfigB : uint8_t |
| Configuration Register B.
|
|
enum | Mode : uint8_t |
| Mode Register.
|
|
enum | OperationMode : uint8_t |
| Operation modes.
|
|
enum | Status : uint8_t |
| Status Register.
|
|
|
| Hmc5883 (Data &data, uint8_t address=0x1e) |
| Constructor, requires a hmc58x3::Data object, sets address to default of 0x1e.
|
|
modm::ResumableResult< bool > | configure (MeasurementRate rate=MeasurementRate::Hz15, Gain gain=Gain::Ga1_3, MeasurementAverage average=MeasurementAverage::Average1) |
|
modm::ResumableResult< bool > | setMeasurementAverage (MeasurementAverage average) |
|
modm::ResumableResult< bool > | setMeasurementRate (MeasurementRate rate) |
|
modm::ResumableResult< bool > | setGain (Gain gain) |
|
| MODM_FLAGS8 (ConfigA) |
|
| MODM_FLAGS8 (ConfigB) |
|
| MODM_FLAGS8 (Mode) |
|
| MODM_FLAGS8 (Status) |
|
void | attachConfigurationHandler (I2c::ConfigurationHandler handler) |
|
Data & | getData () |
| Get the data object for this sensor.
|
|
Status_t | getStatus () |
|
modm::ResumableResult< bool > | ping () |
|
modm::ResumableResult< bool > | read (uint8_t *buffer, std::size_t size) |
| Starts a write transaction and waits until finished.
|
|
modm::ResumableResult< bool > | readMagneticField () |
|
modm::ResumableResult< bool > | readStatus () |
|
void | setAddress (uint8_t address) |
|
modm::ResumableResult< bool > | setOperationMode (OperationMode mode) |
|
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.
|
|
|
ConfigA_t | getConfigA () |
|
ConfigB_t | getConfigB () |
|
Mode_t | getMode () |
|
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 () |
|
modm::ResumableResult< bool > | updateConfigA (ConfigA_t setMask, ConfigA_t clearMask=ConfigA_t (0x7f)) |
|
modm::ResumableResult< bool > | updateConfigB (ConfigB_t setMask, ConfigB_t clearMask=ConfigB_t (0xe0)) |
|
modm::ResumableResult< bool > | updateMode (Mode_t setMask, Mode_t clearMask=Mode::MD_Mask) |
|
bool | wasTransactionSuccessful () |
|
template<typename I2cMaster>
class modm::hmc5883< I2cMaster >
HMC5843 digital compass driver.
This class extends the Hmc58x3 family driver only by the addition of device specific Register bit masks.
For further information on this device consult the datasheet.
- See also
- Hmc58x3
- Author
- Niklas Hauser