Loading...
Searching...
No Matches
isl29125.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015 Ludwig Knüpfer
3 * SPDX-FileCopyrightText: 2017 HAW Hamburg
4 * SPDX-License-Identifier: LGPL-2.1-only
5 */
6
7#pragma once
8
46
47#include <stdint.h>
48
49#include "periph/i2c.h"
50#include "periph/gpio.h"
51#include "color.h"
52
53#ifdef __cplusplus
54extern "C" {
55#endif
56
60typedef struct {
61 float red;
62 float green;
63 float blue;
65
80
88
97
108
115
125
135
143
154
171 isl29125_interrupt_persist_t interrupt_persist,
172 isl29125_interrupt_conven_t interrupt_conven,
173 uint16_t lower_threshold, uint16_t higher_threshold,
174 gpio_cb_t cb, void *arg);
175
183
191
199
208
209#ifdef __cplusplus
210}
211#endif
212
Headers for the color handling module.
Low-level GPIO peripheral driver interface definitions.
isl29125_interrupt_status_t
Configuration-3 Register 0x03 B1:0.
Definition isl29125.h:119
int isl29125_init(isl29125_t *dev, const isl29125_params_t *params)
Initialize a new ISL29125 device.
isl29125_resolution_t
Supported color resolutions of the ISL29125 sensor's AD conversion.
Definition isl29125.h:93
isl29125_interrupt_conven_t
Configuration-3 Register 0x03 B4.
Definition isl29125.h:139
void isl29125_read_rgb_color(const isl29125_t *dev, color_rgb_t *dest)
Read color values from device.
isl29125_mode_t
Supported operation modes of the ISL29125 sensor's AD conversion.
Definition isl29125.h:70
int isl29125_read_irq_status(const isl29125_t *dev)
Read isl29125 interrupt status.
void isl29125_set_mode(const isl29125_t *dev, isl29125_mode_t mode)
Set the device's operation mode.
isl29125_range_t
Supported RGB sensing range values of the ISL29125 sensor.
Definition isl29125.h:84
int isl29125_init_int(isl29125_t *dev, isl29125_interrupt_status_t interrupt_status, isl29125_interrupt_persist_t interrupt_persist, isl29125_interrupt_conven_t interrupt_conven, uint16_t lower_threshold, uint16_t higher_threshold, gpio_cb_t cb, void *arg)
Initialize interrupts.
isl29125_interrupt_persist_t
Configuration-3 Register 0x03 B3:2.
Definition isl29125.h:129
void isl29125_read_rgb_lux(const isl29125_t *dev, isl29125_rgb_t *dest)
Read RGB values from device.
@ ISL29125_INTERRUPT_STATUS_GREEN
GREEN interrupt.
Definition isl29125.h:121
@ ISL29125_INTERRUPT_STATUS_BLUE
BLUE interrupt.
Definition isl29125.h:123
@ ISL29125_INTERRUPT_STATUS_NONE
No interrupt.
Definition isl29125.h:120
@ ISL29125_INTERRUPT_STATUS_RED
RED interrupt.
Definition isl29125.h:122
@ ISL29125_RESOLUTION_16
resolution: 16 bit
Definition isl29125.h:95
@ ISL29125_RESOLUTION_12
resolution: 12 bit
Definition isl29125.h:94
@ ISL29125_INTERRUPT_CONV_DIS
RGB Conversion done to ~INT Control disable.
Definition isl29125.h:140
@ ISL29125_INTERRUPT_CONV_EN
RGB Conversion done to ~INT Control enable.
Definition isl29125.h:141
@ ISL29125_MODE_DOWN
ADC powered down.
Definition isl29125.h:71
@ ISL29125_MODE_B
blue conversion only
Definition isl29125.h:76
@ ISL29125_MODE_STANDBY
AD conversion not performed.
Definition isl29125.h:72
@ ISL29125_MODE_G
green conversion only
Definition isl29125.h:75
@ ISL29125_MODE_RGB
RGB conversion.
Definition isl29125.h:73
@ ISL29125_MODE_R
red conversion only
Definition isl29125.h:74
@ ISL29125_MODE_GB
green and blue conversion only
Definition isl29125.h:78
@ ISL29125_MODE_RG
red and green conversion only
Definition isl29125.h:77
@ ISL29125_RANGE_375
range: 5.7m - 375 lux
Definition isl29125.h:85
@ ISL29125_RANGE_10K
range: 0.152 - 10,000 lux
Definition isl29125.h:86
@ ISL29125_INTERRUPT_PERSIST_1
Int.
Definition isl29125.h:130
@ ISL29125_INTERRUPT_PERSIST_4
Int.
Definition isl29125.h:132
@ ISL29125_INTERRUPT_PERSIST_2
Int.
Definition isl29125.h:131
@ ISL29125_INTERRUPT_PERSIST_8
Int.
Definition isl29125.h:133
void(* gpio_cb_t)(void *arg)
Signature of event callback functions triggered from interrupts.
Definition gpio.h:143
uint_fast8_t i2c_t
Default i2c_t type definition.
Definition i2c.h:155
Low-level I2C peripheral driver interface definition.
Data-structure describing an RGB color.
Definition color.h:34
Device parameters for ISL29125 sensors.
Definition isl29125.h:101
gpio_t gpio
GPIO pin for interrupt/sync mode.
Definition isl29125.h:103
isl29125_resolution_t res
AD conversion resolution.
Definition isl29125.h:106
isl29125_range_t range
measurement range
Definition isl29125.h:104
isl29125_mode_t mode
AD conversion mode.
Definition isl29125.h:105
i2c_t i2c
I2C device the sensor is connected to.
Definition isl29125.h:102
Data type for storing lux RGB sensor readings.
Definition isl29125.h:60
float red
red lux value
Definition isl29125.h:61
float blue
blue lux value
Definition isl29125.h:63
float green
green lux value
Definition isl29125.h:62
Device descriptor for ISL29125 sensors.
Definition isl29125.h:112
isl29125_params_t params
device parameters
Definition isl29125.h:113