Vibration motor driver interface.
More...
Vibration motor driver interface.
#define VIBE_STRENGTH_MAX
Full power.
Definition vibe.h:26
void vibe_ctl(bool on)
Start or stop the motor at the strength set with vibe_set_strength().
void vibe_set_strength(int8_t strength)
Set the drive strength.
◆ VIBE_STRENGTH_MAX
| #define VIBE_STRENGTH_MAX 100 |
◆ VIBE_STRENGTH_MIN
| #define VIBE_STRENGTH_MIN -100 |
Full reverse, for drivers that can brake.
◆ VIBE_STRENGTH_OFF
| #define VIBE_STRENGTH_OFF 0 |
◆ vibe_apply_calibration()
| void vibe_apply_calibration |
( |
uint8_t |
cali | ) |
|
◆ vibe_calibrate()
| status_t vibe_calibrate |
( |
void |
| ) |
|
Calibrate the motor driver.
If the driver has non-volatile memory, a successful calibration is stored there.
- Return values
-
| S_SUCCESS | Calibration succeeded. |
- Returns
- Otherwise an error code.
◆ vibe_ctl()
◆ vibe_force_off()
| void vibe_force_off |
( |
void |
| ) |
|
Stop the motor immediately.
◆ vibe_get_braking_strength()
| int8_t vibe_get_braking_strength |
( |
void |
| ) |
|
Get the strength to use to brake the motor to a stop.
- Returns
- Braking strength, VIBE_STRENGTH_OFF if the driver does not brake this way.
◆ vibe_get_calibration()
| uint8_t vibe_get_calibration |
( |
void |
| ) |
|
Get the calibration computed by the last successful vibe_calibrate().
- Returns
- Driver-specific calibration value, to persist to non-volatile storage.
◆ vibe_init()
Initialize the vibration motor driver.
◆ vibe_set_strength()
| void vibe_set_strength |
( |
int8_t |
strength | ) |
|
Set the drive strength.
Drivers without reverse drive use the absolute value.
- Parameters
-