PebbleOS
Loading...
Searching...
No Matches

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

Data Structures

struct  pbl_drv2604
 DRV2604 haptic driver. More...
 

Macros

#define PBL_DRV2604_DEFINE(sym, _bus, _addr, _enable)
 Define a DRV2604.
 

Detailed Description

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

PBL_DRV2604_DEFINE(s_drv2604, &s_i2c.bus, 0x5A, PBL_GPIO(NRF5_GPIO_P0, 2, 0));
const struct pbl_vibe *const VIBE = &s_drv2604.vibe;
#define NRF5_GPIO_P0
Port P0.
Definition nrf5.h:40
#define PBL_GPIO(_port, _pin, _flags)
Initializer for a struct pbl_gpio.
Definition gpio.h:148
#define PBL_DRV2604_DEFINE(sym, _bus, _addr, _enable)
Define a DRV2604.
Definition drv2604.h:45
Vibration motor.
Definition vibe.h:60
const struct pbl_vibe *const VIBE
The board's vibration motor.

Data Structure Documentation

◆ pbl_drv2604

struct pbl_drv2604

DRV2604 haptic driver.

Data Fields
struct pbl_gpio enable Enable line.
struct pbl_i2c_dev i2c I2C device.
struct pbl_vibe vibe Vibration motor, child of the I2C bus.

Macro Definition Documentation

◆ PBL_DRV2604_DEFINE

#define PBL_DRV2604_DEFINE (   sym,
  _bus,
  _addr,
  _enable 
)
Value:
const struct pbl_drv2604 sym = { \
.vibe = PBL_VIBE_INIT(sym, "drv2604", &(_bus)->dev, &pbl_drv2604_ops, VIBE_STRENGTH_MIN), \
.i2c = PBL_I2C_DEV(_bus, _addr), \
.enable = _enable, \
}; \
PBL_DEVICE_REGISTER(sym, &sym.vibe.dev)
#define PBL_I2C_DEV(_bus, _addr)
Initializer for a struct pbl_i2c_dev.
Definition i2c.h:135
struct pbl_vibe vibe
Vibration motor, child of the I2C bus.
Definition drv2604.h:26
DRV2604 haptic driver.
Definition drv2604.h:24
struct pbl_device dev
Device.
Definition vibe.h:62
#define VIBE_STRENGTH_MIN
Full reverse, for drivers that can brake.
Definition vibe.h:30
#define PBL_VIBE_INIT(sym, _name, _parent, _ops, _braking_strength)
Initialize a struct pbl_vibe.
Definition vibe.h:97
#define PBL_VIBE_STATE_DEFINE(sym)
Define the class state of a vibration motor.
Definition vibe.h:84

Define a DRV2604.

Parameters
symSymbol of the instance; the motor is sym.vibe.
_busI2C bus.
_addr7-bit I2C address.
_enableEnable line (struct pbl_gpio).