|
RocketLogger
2.0.0
|
#include <stdint.h>
Include dependency graph for tsl4531.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | TSL4531_I2C_ADDRESS_LEFT 0x29 |
| #define | TSL4531_I2C_ADDRESS_RIGHT 0x28 |
| #define | TSL4531_I2C_ADDRESSES { (TSL4531_I2C_ADDRESS_LEFT), (TSL4531_I2C_ADDRESS_RIGHT) } |
| #define | TSL4531_CHANNEL_DEFAULT 0 |
| #define | TSL4531_ID 162 |
| #define | TSL4531_COMMAND 0x80 |
| #define | TSL4531_REG_CONTROL 0x00 |
| #define | TSL4531_REG_CONFIG 0x01 |
| #define | TSL4531_REG_DATALOW 0x04 |
| #define | TSL4531_REG_DATAHIGH 0x05 |
| #define | TSL4531_REG_ID 0x0A |
| #define | TSL4531_SAMPLE_OFF 0x00 |
| #define | TSL4531_SAMPLE_SINGLE 0x2 |
| #define | TSL4531_SAMPLE_CONTINUOUS 0x03 |
| #define | TSL4531_HIGH_POWER 0x08 |
| #define | TSL4531_LOW_POWER 0x00 |
| #define | TSL4531_INT_TIME_100 0x02 |
| #define | TSL4531_INT_TIME_200 0x01 |
| #define | TSL4531_INT_TIME_400 0x00 |
| #define | TSL4531_MULT_100 4 |
| #define | TSL4531_MULT_200 2 |
| #define | TSL4531_MULT_400 1 |
| #define | TSL4531_RANGE_LOW_MAX 65000 |
| #define | TSL4531_RANGE_MEDIUM_MAX 130000 |
| #define | TSL4531_RANGE_HYSTERESIS 5000 |
Typedefs | |
| typedef enum tsl4531_range | tsl4531_range_t |
Enumerations | |
| enum | tsl4531_range { TSL4531_RANGE_LOW , TSL4531_RANGE_MEDIUM , TSL4531_RANGE_HIGH , TSL4531_RANGE_AUTO } |
Functions | |
| int | tsl4531_init (int sensor_identifier) |
| void | tsl4531_deinit (int sensor_identifier) |
| int | tsl4531_read (int sensor_identifier) |
| int32_t | tsl4531_get_value (int sensor_identifier, int channel) |
| #define TSL4531_I2C_ADDRESS_LEFT 0x29 |
Copyright (c) 2016-2020, ETH Zurich, Computer Engineering Group All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| #define TSL4531_I2C_ADDRESSES { (TSL4531_I2C_ADDRESS_LEFT), (TSL4531_I2C_ADDRESS_RIGHT) } |
| typedef enum tsl4531_range tsl4531_range_t |
| enum tsl4531_range |
| void tsl4531_deinit | ( | int | sensor_identifier | ) |
| int32_t tsl4531_get_value | ( | int | sensor_identifier, |
| int | channel | ||
| ) |
Get the values read from the sensor.
| sensor_identifier | The I2C address of the sensor |
| channel | The channel of the sensor to get |
Definition at line 227 of file tsl4531.c.
References tsl4531_get_index(), and tsl4531_values.
Here is the call graph for this function:| int tsl4531_init | ( | int | sensor_identifier | ) |
Initialize the light sensor.
| sensor_identifier | The I2C address of the sensor |
Definition at line 120 of file tsl4531.c.
References rl_log(), RL_LOG_ERROR, sensor_bus, sensors_get_bus(), sensors_init_comm(), tsl4531_get_id(), TSL4531_ID, and tsl4531_set_parameters().
Here is the call graph for this function:| int tsl4531_read | ( | int | sensor_identifier | ) |
Read the sensor values.
| sensor_identifier | The I2C address of the sensor |
Definition at line 161 of file tsl4531.c.
References data, ERROR, rl_log(), RL_LOG_ERROR, sensor_bus, sensors_get_bus(), sensors_init_comm(), tsl4531_auto_range, TSL4531_COMMAND, tsl4531_get_index(), tsl4531_multiplier, TSL4531_RANGE_AUTO, TSL4531_RANGE_HIGH, TSL4531_RANGE_HYSTERESIS, TSL4531_RANGE_LOW, TSL4531_RANGE_LOW_MAX, TSL4531_RANGE_MEDIUM, TSL4531_RANGE_MEDIUM_MAX, TSL4531_REG_DATALOW, tsl4531_send_range(), and tsl4531_values.
Here is the call graph for this function: