PebbleOS
Loading...
Searching...
No Matches
pbl_accel_ops Struct Reference

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.
 

Detailed Description

Driver operations.

Called with the device lock held. See the class functions for their semantics.

Field Documentation

◆ get_max_num_samples

uint32_t(* pbl_accel_ops::get_max_num_samples) (const struct pbl_accel *accel)

Get the depth of the hardware FIFO.

◆ get_sampling_interval

uint32_t(* pbl_accel_ops::get_sampling_interval) (const struct pbl_accel *accel)

Get the sampling interval.

◆ init

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.

◆ peek

int(* pbl_accel_ops::peek) (const struct pbl_accel *accel, AccelDriverSample *sample)

Read the most recent sample.

◆ set_double_tap_detection

int(* pbl_accel_ops::set_double_tap_detection) (const struct pbl_accel *accel, bool on)

Optional.

Enable or disable double tap detection.

◆ set_num_samples

int(* pbl_accel_ops::set_num_samples) (const struct pbl_accel *accel, uint32_t num_samples)

Set the maximum number of samples to batch.

◆ set_rotated

int(* pbl_accel_ops::set_rotated) (const struct pbl_accel *accel, bool rotated)

Optional.

Set whether the sensor is mounted rotated by 180 degrees.

◆ set_sampling_interval

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.

◆ set_shake_detection

int(* pbl_accel_ops::set_shake_detection) (const struct pbl_accel *accel, bool on)

Optional.

Enable or disable shake detection.

◆ set_shake_sensitivity_high

int(* pbl_accel_ops::set_shake_sensitivity_high) (const struct pbl_accel *accel, bool high)

Optional.

Select high or normal shake sensitivity.

◆ set_shake_sensitivity_percent

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.


The documentation for this struct was generated from the following file: