PebbleOS v4.47.0
Loading...
Searching...
No Matches

Simulated vibration motor, reporting its strength to an observer. More...

Macros

#define SIM_VIBE   (&pbl_vibe_sim)
 The simulated vibration motor.
 

Typedefs

typedef void(* pbl_vibe_sim_observer_t) (const struct pbl_vibe *vibe, int8_t strength, void *arg)
 Strength change observer.
 

Functions

void pbl_vibe_sim_set_observer (const struct pbl_vibe *vibe, pbl_vibe_sim_observer_t observer, void *arg)
 Set the observer called whenever the motor strength changes.
 
int8_t pbl_vibe_sim_get_strength (const struct pbl_vibe *vibe)
 Get the motor strength.
 

Detailed Description

Simulated vibration motor, reporting its strength to an observer.

Macro Definition Documentation

◆ SIM_VIBE

#define SIM_VIBE   (&pbl_vibe_sim)

The simulated vibration motor.

Typedef Documentation

◆ pbl_vibe_sim_observer_t

typedef void(* pbl_vibe_sim_observer_t) (const struct pbl_vibe *vibe, int8_t strength, void *arg)

Strength change observer.

Called with the device lock held.

Parameters
vibeDevice.
strengthNew strength, 0 when stopped.
argArgument passed to pbl_vibe_sim_set_observer().

Function Documentation

◆ pbl_vibe_sim_get_strength()

int8_t pbl_vibe_sim_get_strength ( const struct pbl_vibe *  vibe)

Get the motor strength.

Parameters
vibeDevice.
Returns
Strength, 0 when stopped.

◆ pbl_vibe_sim_set_observer()

void pbl_vibe_sim_set_observer ( const struct pbl_vibe *  vibe,
pbl_vibe_sim_observer_t  observer,
void *  arg 
)

Set the observer called whenever the motor strength changes.

Parameters
vibeDevice.
observerObserver, or NULL for none.
argArgument passed to observer.