|
PebbleOS
|
Magnetometer driver operations, called with the device lock held. More...
#include <mag.h>
Data Fields | |
| int(* | init )(const struct pbl_mag *mag) |
| Bring the hardware up. | |
| int(* | set_rotated )(const struct pbl_mag *mag, bool rotated) |
| Optional. | |
| int(* | set_sampling_interval )(const struct pbl_mag *mag, uint32_t interval_us, uint32_t *actual_us) |
Set the sampling interval, 0 to stop sampling, returning the one used in actual_us. | |
| int(* | peek )(const struct pbl_mag *mag, MagData *sample) |
| Read the most recent sample. | |
Magnetometer driver operations, called with the device lock held.
| int(* pbl_mag_ops::init) (const struct pbl_mag *mag) |
Bring the hardware up.
Returns 0, -ENODEV if the part does not answer, or a negative errno.
Read the most recent sample.
Returns -ENODATA when not sampling.
| int(* pbl_mag_ops::set_rotated) (const struct pbl_mag *mag, bool rotated) |
Optional.
Set whether the sensor is mounted rotated by 180 degrees.
| int(* pbl_mag_ops::set_sampling_interval) (const struct pbl_mag *mag, uint32_t interval_us, uint32_t *actual_us) |
Set the sampling interval, 0 to stop sampling, returning the one used in actual_us.