|
PebbleOS
|
Driver operations. More...
#include <accel.h>
Data Fields | |
| int(* | init )(const struct pbl_accel *accel) |
| Bring the hardware up. | |
| int(* | set_rotated )(const struct pbl_accel *accel, bool rotated) |
| Optional. | |
| int(* | set_sampling_interval )(const struct pbl_accel *accel, uint32_t interval_us, uint32_t *actual_us) |
Set the sampling interval, returning the one used in actual_us. | |
| uint32_t(* | get_sampling_interval )(const struct pbl_accel *accel) |
| Get the sampling interval. | |
| int(* | set_num_samples )(const struct pbl_accel *accel, uint32_t num_samples) |
| Set the maximum number of samples to batch. | |
| uint32_t(* | get_max_num_samples )(const struct pbl_accel *accel) |
| Get the depth of the hardware FIFO. | |
| int(* | peek )(const struct pbl_accel *accel, AccelDriverSample *sample) |
| Read the most recent sample. | |
| int(* | set_shake_detection )(const struct pbl_accel *accel, bool on) |
| Optional. | |
| int(* | set_double_tap_detection )(const struct pbl_accel *accel, bool on) |
| Optional. | |
| int(* | set_shake_sensitivity_high )(const struct pbl_accel *accel, bool high) |
| Optional. | |
| int(* | set_shake_sensitivity_percent )(const struct pbl_accel *accel, uint8_t percent) |
| Optional. | |
Driver operations.
Called with the device lock held. See the class functions for their semantics.
| uint32_t(* pbl_accel_ops::get_max_num_samples) (const struct pbl_accel *accel) |
Get the depth of the hardware FIFO.
| uint32_t(* pbl_accel_ops::get_sampling_interval) (const struct pbl_accel *accel) |
Get the sampling interval.
| int(* pbl_accel_ops::init) (const struct pbl_accel *accel) |
Bring the hardware up.
Returns 0, -ENODEV if the part does not answer, or a negative errno.
| int(* pbl_accel_ops::peek) (const struct pbl_accel *accel, AccelDriverSample *sample) |
Read the most recent sample.
| int(* pbl_accel_ops::set_double_tap_detection) (const struct pbl_accel *accel, bool on) |
Optional.
Enable or disable double tap detection.
| int(* pbl_accel_ops::set_num_samples) (const struct pbl_accel *accel, uint32_t num_samples) |
Set the maximum number of samples to batch.
| int(* pbl_accel_ops::set_rotated) (const struct pbl_accel *accel, bool rotated) |
Optional.
Set whether the sensor is mounted rotated by 180 degrees.
| int(* pbl_accel_ops::set_sampling_interval) (const struct pbl_accel *accel, uint32_t interval_us, uint32_t *actual_us) |
Set the sampling interval, returning the one used in actual_us.
| int(* pbl_accel_ops::set_shake_detection) (const struct pbl_accel *accel, bool on) |
Optional.
Enable or disable shake detection.
| int(* pbl_accel_ops::set_shake_sensitivity_high) (const struct pbl_accel *accel, bool high) |
Optional.
Select high or normal shake sensitivity.
| int(* pbl_accel_ops::set_shake_sensitivity_percent) (const struct pbl_accel *accel, uint8_t percent) |
Optional.
Set the normal shake sensitivity, 0 to 100.