PebbleOS
Loading...
Searching...
No Matches

Awinic AW8623X Vibration motor driver, driving an LRA in continuous mode. More...

Data Structures

struct  pbl_aw8623x_state
 AW8623X driver state, owned by the driver. More...
 
struct  pbl_aw8623x
 AW8623X haptic driver. More...
 

Macros

#define PBL_AW8623X_DEFINE(sym, _bus, _addr, _reset)
 Define an AW8623X.
 

Detailed Description

Awinic AW8623X Vibration motor driver, driving an LRA in continuous mode.

PBL_AW8623X_DEFINE(s_aw8623x, &s_i2c.bus, 0x5a, PBL_GPIO(SF32LB_GPIO1, 20, PBL_GPIO_ACTIVE_LOW));
const struct pbl_vibe *const VIBE = &s_aw8623x.vibe;
#define SF32LB_GPIO1
Port GPIO1 (PA).
Definition sf32lb.h:46
#define PBL_GPIO_ACTIVE_LOW
The pin is active when low.
Definition gpio.h:50
#define PBL_GPIO(_port, _pin, _flags)
Initializer for a struct pbl_gpio.
Definition gpio.h:148
#define PBL_AW8623X_DEFINE(sym, _bus, _addr, _reset)
Define an AW8623X.
Definition aw8623x.h:55
Vibration motor.
Definition vibe.h:60
const struct pbl_vibe *const VIBE
The board's vibration motor.

Data Structure Documentation

◆ pbl_aw8623x_state

struct pbl_aw8623x_state

AW8623X driver state, owned by the driver.

Data Fields
uint8_t strength Drive strength, 0 to VIBE_STRENGTH_MAX.

◆ pbl_aw8623x

struct pbl_aw8623x

AW8623X haptic driver.

Data Fields
struct pbl_i2c_dev i2c I2C device.
struct pbl_gpio reset Reset line, active while the chip is held in reset.
struct pbl_aw8623x_state * state Driver state.
struct pbl_vibe vibe Vibration motor, child of the I2C bus.

Macro Definition Documentation

◆ PBL_AW8623X_DEFINE

#define PBL_AW8623X_DEFINE (   sym,
  _bus,
  _addr,
  _reset 
)
Value:
static struct pbl_aw8623x_state sym##_aw8623x_state = {.strength = VIBE_STRENGTH_MAX}; \
const struct pbl_aw8623x sym = { \
.vibe = PBL_VIBE_INIT(sym, "aw8623x", &(_bus)->dev, &pbl_aw8623x_ops, VIBE_STRENGTH_OFF), \
.state = &sym##_aw8623x_state, \
.i2c = PBL_I2C_DEV(_bus, _addr), \
.reset = _reset, \
}; \
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 aw8623x.h:34
uint8_t strength
Drive strength, 0 to VIBE_STRENGTH_MAX.
Definition aw8623x.h:28
AW8623X driver state, owned by the driver.
Definition aw8623x.h:26
AW8623X haptic driver.
Definition aw8623x.h:32
struct pbl_vibe_state * state
Runtime state.
Definition vibe.h:66
struct pbl_device dev
Device.
Definition vibe.h:62
#define VIBE_STRENGTH_MAX
Full power.
Definition vibe.h:28
#define PBL_VIBE_INIT(sym, _name, _parent, _ops, _braking_strength)
Initialize a struct pbl_vibe.
Definition vibe.h:97
#define VIBE_STRENGTH_OFF
Stopped.
Definition vibe.h:32
#define PBL_VIBE_STATE_DEFINE(sym)
Define the class state of a vibration motor.
Definition vibe.h:84

Define an AW8623X.

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