LibDriver TCS34725
Loading...
Searching...
No Matches
driver_tcs34725.h File Reference

driver tcs34725 header file More...

#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_tcs34725.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tcs34725_handle_s
 tcs34725 handle structure definition More...
struct  tcs34725_info_s
 tcs34725 information structure definition More...

Macros

#define DRIVER_TCS34725_LINK_INIT(HANDLE, STRUCTURE)
 initialize tcs34725_handle_t structure
#define DRIVER_TCS34725_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_TCS34725_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_TCS34725_LINK_IIC_READ(HANDLE, FUC)
 link iic_read function
#define DRIVER_TCS34725_LINK_IIC_WRITE(HANDLE, FUC)
 link iic_write function
#define DRIVER_TCS34725_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_TCS34725_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

Typedefs

typedef struct tcs34725_handle_s tcs34725_handle_t
 tcs34725 handle structure definition
typedef struct tcs34725_info_s tcs34725_info_t
 tcs34725 information structure definition

Enumerations

enum  tcs34725_bool_t { TCS34725_BOOL_FALSE = 0x00 , TCS34725_BOOL_TRUE = 0x01 }
 tcs34725 bool enumeration definition More...
enum  tcs34725_integration_time_t {
  TCS34725_INTEGRATION_TIME_2P4MS = 0xFF , TCS34725_INTEGRATION_TIME_24MS = 0xF6 , TCS34725_INTEGRATION_TIME_50MS = 0xEB , TCS34725_INTEGRATION_TIME_101MS = 0xD5 ,
  TCS34725_INTEGRATION_TIME_154MS = 0xC0 , TCS34725_INTEGRATION_TIME_700MS = 0x00
}
 tcs34725 integration time enumeration definition More...
enum  tcs34725_gain_t { TCS34725_GAIN_1X = 0x00 , TCS34725_GAIN_4X = 0x01 , TCS34725_GAIN_16X = 0x02 , TCS34725_GAIN_60X = 0x03 }
 tcs34725 gain enumeration definition More...
enum  tcs34725_wait_time_t {
  TCS34725_WAIT_TIME_2P4MS = 0x0FF , TCS34725_WAIT_TIME_204MS = 0x0AB , TCS34725_WAIT_TIME_614MS = 0x000 , TCS34725_WAIT_TIME_29MS = 0x1FF ,
  TCS34725_WAIT_TIME_2450MS = 0x1AB , TCS34725_WAIT_TIME_7400MS = 0x100
}
 tcs34725 wait time enumeration definition More...
enum  tcs34725_interrupt_mode_t {
  TCS34725_INTERRUPT_MODE_EVERY_RGBC_CYCLE = 0x00 , TCS34725_INTERRUPT_MODE_1_CLEAR_CHANNEL_OUT_OF_THRESHOLD = 0x01 , TCS34725_INTERRUPT_MODE_2_CLEAR_CHANNEL_OUT_OF_THRESHOLD = 0x02 , TCS34725_INTERRUPT_MODE_3_CLEAR_CHANNEL_OUT_OF_THRESHOLD = 0x03 ,
  TCS34725_INTERRUPT_MODE_5_CLEAR_CHANNEL_OUT_OF_THRESHOLD = 0x04 , TCS34725_INTERRUPT_MODE_10_CLEAR_CHANNEL_OUT_OF_THRESHOLD = 0x05 , TCS34725_INTERRUPT_MODE_15_CLEAR_CHANNEL_OUT_OF_THRESHOLD = 0x06 , TCS34725_INTERRUPT_MODE_20_CLEAR_CHANNEL_OUT_OF_THRESHOLD = 0x07 ,
  TCS34725_INTERRUPT_MODE_25_CLEAR_CHANNEL_OUT_OF_THRESHOLD = 0x08 , TCS34725_INTERRUPT_MODE_30_CLEAR_CHANNEL_OUT_OF_THRESHOLD = 0x09 , TCS34725_INTERRUPT_MODE_35_CLEAR_CHANNEL_OUT_OF_THRESHOLD = 0x0A , TCS34725_INTERRUPT_MODE_40_CLEAR_CHANNEL_OUT_OF_THRESHOLD = 0x0B ,
  TCS34725_INTERRUPT_MODE_45_CLEAR_CHANNEL_OUT_OF_THRESHOLD = 0x0C , TCS34725_INTERRUPT_MODE_50_CLEAR_CHANNEL_OUT_OF_THRESHOLD = 0x0D , TCS34725_INTERRUPT_MODE_55_CLEAR_CHANNEL_OUT_OF_THRESHOLD = 0x0E , TCS34725_INTERRUPT_MODE_60_CLEAR_CHANNEL_OUT_OF_THRESHOLD = 0x0F
}
 tcs34725 interrupt mode enumeration definition More...

Functions

uint8_t tcs34725_info (tcs34725_info_t *info)
 get chip information
uint8_t tcs34725_init (tcs34725_handle_t *handle)
 initialize the chip
uint8_t tcs34725_deinit (tcs34725_handle_t *handle)
 close the chip
uint8_t tcs34725_read_rgbc (tcs34725_handle_t *handle, uint16_t *red, uint16_t *green, uint16_t *blue, uint16_t *clear)
 read the rgbc data
uint8_t tcs34725_read_rgb (tcs34725_handle_t *handle, uint16_t *red, uint16_t *green, uint16_t *blue)
 read the rgb data
uint8_t tcs34725_read_c (tcs34725_handle_t *handle, uint16_t *clear)
 read the clear data
uint8_t tcs34725_set_wait (tcs34725_handle_t *handle, tcs34725_bool_t enable)
 enable or disable the wait time
uint8_t tcs34725_get_wait (tcs34725_handle_t *handle, tcs34725_bool_t *enable)
 get the wait time
uint8_t tcs34725_set_rgbc (tcs34725_handle_t *handle, tcs34725_bool_t enable)
 enable or disable the rgbc adc
uint8_t tcs34725_get_rgbc (tcs34725_handle_t *handle, tcs34725_bool_t *enable)
 get the rgbc status
uint8_t tcs34725_set_power_on (tcs34725_handle_t *handle, tcs34725_bool_t enable)
 enable or disable the power
uint8_t tcs34725_get_power_on (tcs34725_handle_t *handle, tcs34725_bool_t *enable)
 get the power status
uint8_t tcs34725_set_rgbc_integration_time (tcs34725_handle_t *handle, tcs34725_integration_time_t t)
 set the rgbc adc integration time
uint8_t tcs34725_get_rgbc_integration_time (tcs34725_handle_t *handle, tcs34725_integration_time_t *t)
 get the rgbc adc integration time
uint8_t tcs34725_set_wait_time (tcs34725_handle_t *handle, tcs34725_wait_time_t t)
 set the wait time
uint8_t tcs34725_get_wait_time (tcs34725_handle_t *handle, tcs34725_wait_time_t *t)
 get the wait time
uint8_t tcs34725_set_gain (tcs34725_handle_t *handle, tcs34725_gain_t gain)
 set the adc gain
uint8_t tcs34725_get_gain (tcs34725_handle_t *handle, tcs34725_gain_t *gain)
 get the adc gain
uint8_t tcs34725_set_rgbc_interrupt (tcs34725_handle_t *handle, tcs34725_bool_t enable)
 enable or disable the rgbc interrupt
uint8_t tcs34725_get_rgbc_interrupt (tcs34725_handle_t *handle, tcs34725_bool_t *enable)
 get the rgbc interrupt
uint8_t tcs34725_set_interrupt_mode (tcs34725_handle_t *handle, tcs34725_interrupt_mode_t mode)
 set the interrupt mode
uint8_t tcs34725_get_interrupt_mode (tcs34725_handle_t *handle, tcs34725_interrupt_mode_t *mode)
 get the interrupt mode
uint8_t tcs34725_set_rgbc_clear_low_interrupt_threshold (tcs34725_handle_t *handle, uint16_t threshold)
 set the rgbc clear low interrupt threshold
uint8_t tcs34725_get_rgbc_clear_low_interrupt_threshold (tcs34725_handle_t *handle, uint16_t *threshold)
 get the rgbc clear low interrupt threshold
uint8_t tcs34725_set_rgbc_clear_high_interrupt_threshold (tcs34725_handle_t *handle, uint16_t threshold)
 set the rgbc clear high interrupt threshold
uint8_t tcs34725_get_rgbc_clear_high_interrupt_threshold (tcs34725_handle_t *handle, uint16_t *threshold)
 get the rgbc clear high interrupt threshold
uint8_t tcs34725_set_reg (tcs34725_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 set the chip register
uint8_t tcs34725_get_reg (tcs34725_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 get the chip register

Detailed Description

driver tcs34725 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.

Version
2.0.0
Author
Shifeng Li
Date
2021-02-28

history

Date Version Author Description
2021/02/28 2.0 Shifeng Li format the code
2020/10/30 1.0 Shifeng Li first upload

Definition in file driver_tcs34725.h.