PebbleOS v4.48.0-75-g7416f78a1
Loading...
Searching...
No Matches

TI DRV2604 Vibration motor driver, driving an LRA in real-time playback mode. More...

Data Structures

struct  pbl_vibe_drv2604
 DRV2604 haptic driver. More...
 

Macros

#define PBL_VIBE_DRV2604_DEFINE(sym, _bus, _addr, _enable, _mode, _rated_mv, _overdrive_mv)
 Define a DRV2604.
 

Detailed Description

TI DRV2604 Vibration motor driver, driving an LRA in real-time playback mode.

PBL_VIBE_DRV2604_DEFINE(s_drv2604, &s_i2c, 0x5A, PBL_GPIO(&dt_gpio0, 2, 0), DRV260X_LRA_MODE,
1384, 3009);
const struct pbl_vibe *const VIBE = &s_drv2604;
#define PBL_GPIO(_port, _pin, _flags)
Initializer for a struct pbl_gpio.
Definition gpio.h:126
Vibration motor.
Definition driver.h:44
#define PBL_VIBE_DRV2604_DEFINE(sym, _bus, _addr, _enable, _mode, _rated_mv, _overdrive_mv)
Define a DRV2604.
Definition drv2604.h:62
const struct pbl_vibe *const VIBE
The board's vibration motor.
#define DRV260X_LRA_MODE
Definition ti-drv260x.h:8

Data Structure Documentation

◆ pbl_vibe_drv2604

struct pbl_vibe_drv2604

DRV2604 haptic driver.

Data Fields
struct pbl_gpio enable Enable line.
struct pbl_i2c_dev i2c I2C device.
uint8_t mode Actuator mode, DRV260X_LRA_MODE or DRV260X_LRA_NO_CAL_MODE.
uint8_t od_clamp Overdrive clamp register value.
uint8_t rated_voltage Rated voltage register value.
struct pbl_vibe vibe Vibration motor, child of the I2C bus.

Macro Definition Documentation

◆ PBL_VIBE_DRV2604_DEFINE

#define PBL_VIBE_DRV2604_DEFINE (   sym,
  _bus,
  _addr,
  _enable,
  _mode,
  _rated_mv,
  _overdrive_mv 
)
Value:
PBL_DEVICE_INSTANCE(sym, struct pbl_vibe_drv2604, struct pbl_vibe, vibe) { \
.vibe = PBL_VIBE_INIT(sym, "drv2604", &(_bus)->dev, &pbl_vibe_drv2604_ops, VIBE_STRENGTH_MIN), \
.i2c = PBL_I2C_DEV(_bus, _addr), .enable = _enable, .mode = (_mode), \
.rated_voltage = DRV2604_VOLTAGE_REG(_rated_mv), \
.od_clamp = DRV2604_VOLTAGE_REG(_overdrive_mv), \
}
#define PBL_I2C_DEV(_bus, _addr)
Initializer for a struct pbl_i2c_dev.
Definition i2c.h:159
#define PBL_VIBE_INIT(sym, _name, _parent, _ops, _braking_strength)
Initialize a struct pbl_vibe.
Definition driver.h:78
#define PBL_VIBE_STATE_DEFINE(sym)
Define the class state of a vibration motor.
Definition driver.h:65
DRV2604 haptic driver.
Definition drv2604.h:27
#define VIBE_STRENGTH_MIN
Full reverse, for drivers that can brake.
Definition vibe.h:29

Define a DRV2604.

Parameters
symSymbol of the instance, a struct pbl_vibe; the motor is sym.vibe.
_busI2C bus.
_addr7-bit I2C address.
_enableEnable line (struct pbl_gpio).
_modeActuator mode, from dt-bindings/input/ti-drv260x.h.
_rated_mvRated voltage of the actuator, in millivolts.
_overdrive_mvOverdrive voltage of the actuator, in millivolts.