![]() |
LibDriver TSL2561
|
driver tsl2561 header file More...
#include <stdio.h>#include <stdint.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | tsl2561_handle_s |
| tsl2561 handle structure definition More... | |
| struct | tsl2561_info_s |
| tsl2561 information structure definition More... | |
Macros | |
| #define | DRIVER_TSL2561_LINK_INIT(HANDLE, STRUCTURE) |
| initialize tsl2561_handle_t structure | |
| #define | DRIVER_TSL2561_LINK_IIC_INIT(HANDLE, FUC) |
| link iic_init function | |
| #define | DRIVER_TSL2561_LINK_IIC_DEINIT(HANDLE, FUC) |
| link iic_deinit function | |
| #define | DRIVER_TSL2561_LINK_IIC_READ(HANDLE, FUC) |
| link iic_read function | |
| #define | DRIVER_TSL2561_LINK_IIC_WRITE(HANDLE, FUC) |
| link iic_write function | |
| #define | DRIVER_TSL2561_LINK_DELAY_MS(HANDLE, FUC) |
| link delay_ms function | |
| #define | DRIVER_TSL2561_LINK_DEBUG_PRINT(HANDLE, FUC) |
| link debug_print function | |
Typedefs | |
| typedef struct tsl2561_handle_s | tsl2561_handle_t |
| tsl2561 handle structure definition | |
| typedef struct tsl2561_info_s | tsl2561_info_t |
| tsl2561 information structure definition | |
Functions | |
| uint8_t | tsl2561_info (tsl2561_info_t *info) |
| get chip's information | |
| uint8_t | tsl2561_set_addr_pin (tsl2561_handle_t *handle, tsl2561_address_t addr_pin) |
| set the iic address pin | |
| uint8_t | tsl2561_get_addr_pin (tsl2561_handle_t *handle, tsl2561_address_t *addr_pin) |
| get the iic address pin | |
| uint8_t | tsl2561_init (tsl2561_handle_t *handle) |
| initialize the chip | |
| uint8_t | tsl2561_deinit (tsl2561_handle_t *handle) |
| close the chip | |
| uint8_t | tsl2561_read (tsl2561_handle_t *handle, uint16_t *channel_0_raw, uint16_t *channel_1_raw, uint32_t *lux) |
| read data from the chip | |
| uint8_t | tsl2561_power_down (tsl2561_handle_t *handle) |
| power down the chip | |
| uint8_t | tsl2561_wake_up (tsl2561_handle_t *handle) |
| wake up the chip | |
| uint8_t | tsl2561_set_gain (tsl2561_handle_t *handle, tsl2561_gain_t gain) |
| set the adc gain | |
| uint8_t | tsl2561_get_gain (tsl2561_handle_t *handle, tsl2561_gain_t *gain) |
| get the adc gain | |
| uint8_t | tsl2561_set_integration_time (tsl2561_handle_t *handle, tsl2561_integration_time_t t) |
| set the integration time | |
| uint8_t | tsl2561_get_integration_time (tsl2561_handle_t *handle, tsl2561_integration_time_t *t) |
| get the integration time | |
| uint8_t | tsl2561_set_interrupt_mode (tsl2561_handle_t *handle, tsl2561_interrupt_mode_t mode) |
| set the interrupt mode | |
| uint8_t | tsl2561_get_interrupt_mode (tsl2561_handle_t *handle, tsl2561_interrupt_mode_t *mode) |
| get the interrupt mode | |
| uint8_t | tsl2561_set_interrupt (tsl2561_handle_t *handle, tsl2561_bool_t enable) |
| enable or disable the chip interrupt | |
| uint8_t | tsl2561_get_interrupt (tsl2561_handle_t *handle, tsl2561_bool_t *enable) |
| get the chip interrupt | |
| uint8_t | tsl2561_set_interrupt_high_threshold (tsl2561_handle_t *handle, uint16_t ch0_raw) |
| set the interrupt high threshold | |
| uint8_t | tsl2561_get_interrupt_high_threshold (tsl2561_handle_t *handle, uint16_t *ch0_raw) |
| get the interrupt high threshold | |
| uint8_t | tsl2561_set_interrupt_low_threshold (tsl2561_handle_t *handle, uint16_t ch0_raw) |
| set the interrupt low threshold | |
| uint8_t | tsl2561_get_interrupt_low_threshold (tsl2561_handle_t *handle, uint16_t *ch0_raw) |
| get the interrupt low threshold | |
| uint8_t | tsl2561_set_reg (tsl2561_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len) |
| set the chip register | |
| uint8_t | tsl2561_get_reg (tsl2561_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len) |
| get the chip register | |
driver tsl2561 header file
Copyright (c) 2015 - present LibDriver All rights reserved
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Date | Version | Author | Description |
|---|---|---|---|
| 2021/02/26 | 2.0 | Shifeng Li | format the code |
| 2020/10/28 | 1.0 | Shifeng Li | first upload |
Definition in file driver_tsl2561.h.