static_assert((_gain_percent) >= 50 && (_gain_percent) <= 100, "output gain of 50 to 100%"); \
static_assert( \
(_rated_uv) / 1000U * 1414U / 1000U <= PBL_VIBE_AW86225_FULL_SCALE_MV(_gain_percent), \
"rated voltage exceeds the full-scale output"); \
PBL_VIBE_STATE_DEFINE(sym); \
.state = &sym##_aw86225_state, .i2c =
PBL_I2C_DEV(_bus, _addr), .reset = _reset, \
.f0_hz = (_f0_hz), .f0_tolerance_hz = (_f0_tolerance_hz), .rated_mv = (_rated_uv) / 1000U, \
.gain_percent = (_gain_percent), .supply = (_supply), \
}
#define PBL_I2C_DEV(_bus, _addr)
Initializer for a struct pbl_i2c_dev.
Definition i2c.h:159
uint8_t strength
Drive strength, 0 to VIBE_STRENGTH_MAX.
Definition aw86225.h:27
AW86225 haptic driver.
Definition aw86225.h:39
AW86225 driver state, owned by the driver.
Definition aw86225.h:25
Vibration motor.
Definition driver.h:44
#define PBL_VIBE_INIT(sym, _name, _parent, _ops, _braking_strength)
Initialize a struct pbl_vibe.
Definition driver.h:78
#define VIBE_STRENGTH_MAX
Full power.
Definition vibe.h:27
#define VIBE_STRENGTH_OFF
Stopped.
Definition vibe.h:31
Define an AW86225.