|
PebbleOS
|
#include <stdbool.h>#include <stdint.h>#include <system/status_codes.h>Macros | |
| #define | VIBE_STRENGTH_MAX 100 |
| Full power. | |
| #define | VIBE_STRENGTH_MIN -100 |
| Full reverse, for drivers that can brake. | |
| #define | VIBE_STRENGTH_OFF 0 |
| Stopped. | |
Functions | |
| void | vibe_init (void) |
| Initialize the vibration motor driver. | |
| void | vibe_ctl (bool on) |
| Start or stop the motor at the strength set with vibe_set_strength(). | |
| void | vibe_force_off (void) |
| Stop the motor immediately. | |
| void | vibe_set_strength (int8_t strength) |
| Set the drive strength. | |
| int8_t | vibe_get_braking_strength (void) |
| Get the strength to use to brake the motor to a stop. | |
| status_t | vibe_calibrate (void) |
| Calibrate the motor driver. | |
| uint8_t | vibe_get_calibration (void) |
| Get the calibration computed by the last successful vibe_calibrate(). | |
| void | vibe_apply_calibration (uint8_t cali) |
| Apply a calibration value previously returned by vibe_get_calibration(). | |