tsl4531 - Driver for digital ambient light sensor TSL4531¶
-
group
tsl4531
ESP-IDF driver for digital ambient light sensor TSL4531.
Ported from esp-open-rtos
Copyright (C) 2017 Brian Schwind https://github.com/bschwind
Copyright (C) 2019 Ruslan V. Uss
unclerus@gmail.comBSD Licensed as described in the file LICENSE
Defines
-
TSL4531_I2C_ADDR
¶
Enums
Functions
-
esp_err_t
tsl4531_init_desc
(tsl4531_t *dev, i2c_port_t port, gpio_num_t sda_gpio, gpio_num_t scl_gpio)¶ Initialize device descriptor.
- Parameters
dev – Device descriptor
port – I2C port
sda_gpio – SDA GPIO pin
scl_gpio – SCL GPIO pin
- Returns
ESP_OK
on success
-
esp_err_t
tsl4531_free_desc
(tsl4531_t *dev)¶ Free device descriptor.
- Parameters
dev – Device descriptor
- Returns
ESP_OK
on success
-
esp_err_t
tsl4531_init
(tsl4531_t *dev)¶ Initialize device.
- Parameters
dev – Device descriptor
- Returns
ESP_OK
on success
-
esp_err_t
tsl4531_config
(tsl4531_t *dev, tsl4531_integration_time_t integration_time, bool skip_power_save)¶ Configure device.
- Parameters
dev – Device descriptor
integration_time – Integration time
skip_power_save – PowerSave Mode. When true, the power save states are skipped following a light integration cycle for shorter sampling rates
- Returns
ESP_OK
on success
-
struct
tsl4531_t
¶ - #include <tsl4531.h>
Device descriptor.
-