|
PebbleOS
|
W1160 Ambient light sensor driver. More...
Data Structures | |
| struct | pbl_w1160_state |
| W1160 driver state, owned by the driver. More... | |
| struct | pbl_w1160 |
| W1160 ambient light sensor. More... | |
Macros | |
| #define | PBL_W1160_DEFINE(sym, _bus, _addr, _scale) |
| Define a W1160. | |
W1160 Ambient light sensor driver.
While primed the sensor samples continuously and reads are plain register reads; otherwise each read is a one-shot conversion.
| struct pbl_w1160_state |
W1160 driver state, owned by the driver.
| Data Fields | ||
|---|---|---|
| bool | active | Primed. |
| bool | cache_valid | cached_level holds a reading from the current window. |
| uint16_t | cached_level | Last level read. |
| bool | sampling | Continuous sampling enabled. |
| RtcTicks | sampling_started_ticks | Time continuous sampling was enabled. |
| struct pbl_w1160 |
W1160 ambient light sensor.
| Data Fields | ||
|---|---|---|
| struct pbl_als | als | Ambient light sensor, child of the I2C bus. |
| struct pbl_i2c_dev | i2c | I2C device. |
| struct pbl_w1160_state * | state | Driver state. |
| #define PBL_W1160_DEFINE | ( | sym, | |
| _bus, | |||
| _addr, | |||
| _scale | |||
| ) |
Define a W1160.
| sym | Symbol of the instance; the sensor is sym.als. |
| _bus | I2C bus. |
| _addr | 7-bit I2C address. |
| _scale | Lux calibration (const struct pbl_als_scale *), or nullptr. |