|  | 
| 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. 
 | 
|  | 
| bool | configure (MeasurementRate rate=MeasurementRate::Hz15, Gain gain=Gain::Ga1_3, MeasurementAverage average=MeasurementAverage::Average1) | 
|  | 
| bool | setMeasurementAverage (MeasurementAverage average) | 
|  | 
| bool | setMeasurementRate (MeasurementRate rate) | 
|  | 
| 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 () | 
|  | 
| bool | ping () | 
|  | 
| bool | read (uint8_t *buffer, std::size_t size) | 
|  | Starts a write transaction and waits until finished. 
 | 
|  | 
| bool | readMagneticField () | 
|  | 
| bool | readStatus () | 
|  | 
| void | setAddress (uint8_t address) | 
|  | 
| bool | setOperationMode (OperationMode mode) | 
|  | 
| 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<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