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

TI OPT3001 Ambient light sensor driver. More...

Data Structures

struct  pbl_als_opt3001
 OPT3001 ambient light sensor. More...
 

Macros

#define PBL_ALS_OPT3001_DEFINE(sym, _bus, _addr, _supply)
 Define an OPT3001.
 

Detailed Description

TI OPT3001 Ambient light sensor driver.

PBL_ALS_OPT3001_DEFINE(s_opt3001, &s_i2c, 0x44, nullptr);
const struct pbl_als *const ALS = &s_opt3001;
Ambient light sensor.
Definition driver.h:48
#define PBL_ALS_OPT3001_DEFINE(sym, _bus, _addr, _supply)
Define an OPT3001.
Definition opt3001.h:47
const struct pbl_als *const ALS
The board's ambient light sensor.

Data Structure Documentation

◆ pbl_als_opt3001

struct pbl_als_opt3001

OPT3001 ambient light sensor.

Data Fields
struct pbl_als als Ambient light sensor, child of the I2C bus.
struct pbl_i2c_dev i2c I2C device.
const struct pbl_regulator * supply Supply, vdd-supply, or NULL.

Macro Definition Documentation

◆ PBL_ALS_OPT3001_DEFINE

#define PBL_ALS_OPT3001_DEFINE (   sym,
  _bus,
  _addr,
  _supply 
)
Value:
PBL_DEVICE_INSTANCE(sym, struct pbl_als_opt3001, struct pbl_als, als) { \
.als = PBL_ALS_INIT(sym, "opt3001", &(_bus)->dev, &pbl_als_opt3001_ops, nullptr), \
.i2c = PBL_I2C_DEV(_bus, _addr), .supply = (_supply), \
}
#define PBL_ALS_INIT(sym, _name, _parent, _ops, _scale)
Initialize a struct pbl_als.
Definition driver.h:81
#define PBL_ALS_STATE_DEFINE(sym)
Define the class state of an ambient light sensor.
Definition driver.h:64
OPT3001 ambient light sensor.
Definition opt3001.h:26
#define PBL_I2C_DEV(_bus, _addr)
Initializer for a struct pbl_i2c_dev.
Definition i2c.h:159

Define an OPT3001.

Parameters
symSymbol of the instance, a struct pbl_als.
_busI2C bus.
_addr7-bit I2C address.
_supplySupply, or NULL.