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

Vibration motor driver operations, called with the device lock held. More...

#include <vibe.h>

Data Fields

int(* init )(const struct pbl_vibe *vibe)
 Bring the hardware up.
 
int(* start )(const struct pbl_vibe *vibe, int8_t strength)
 Drive the motor at strength, starting it if stopped.
 
int(* stop )(const struct pbl_vibe *vibe)
 Stop the motor.
 
int(* calibrate )(const struct pbl_vibe *vibe, uint8_t *cali)
 Optional.
 
int(* set_calibration )(const struct pbl_vibe *vibe, uint8_t cali)
 Optional.
 

Detailed Description

Vibration motor driver operations, called with the device lock held.

Field Documentation

◆ calibrate

int(* pbl_vibe_ops::calibrate) (const struct pbl_vibe *vibe, uint8_t *cali)

Optional.

Calibrate, setting cali to the value to persist.

◆ init

int(* pbl_vibe_ops::init) (const struct pbl_vibe *vibe)

Bring the hardware up.

Returns 0, -ENODEV if the part does not answer, or a negative errno.

◆ set_calibration

int(* pbl_vibe_ops::set_calibration) (const struct pbl_vibe *vibe, uint8_t cali)

Optional.

Apply a value set by calibrate.

◆ start

int(* pbl_vibe_ops::start) (const struct pbl_vibe *vibe, int8_t strength)

Drive the motor at strength, starting it if stopped.

◆ stop

int(* pbl_vibe_ops::stop) (const struct pbl_vibe *vibe)

Stop the motor.


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