LibDriver TCS34725
Loading...
Searching...
No Matches
tcs34725 base driver function

tcs34725 base driver modules More...

Collaboration diagram for tcs34725 base driver function:

Data Structures

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

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

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

Detailed Description

tcs34725 base driver modules

Typedef Documentation

◆ tcs34725_handle_t

tcs34725 handle structure definition

◆ tcs34725_info_t

tcs34725 information structure definition

Enumeration Type Documentation

◆ tcs34725_bool_t

tcs34725 bool enumeration definition

Enumerator
TCS34725_BOOL_FALSE 

disable function

TCS34725_BOOL_TRUE 

enable function

Definition at line 63 of file driver_tcs34725.h.

◆ tcs34725_gain_t

tcs34725 gain enumeration definition

Enumerator
TCS34725_GAIN_1X 

1x gain

TCS34725_GAIN_4X 

4x gain

TCS34725_GAIN_16X 

16x gain

TCS34725_GAIN_60X 

60x gain

Definition at line 85 of file driver_tcs34725.h.

◆ tcs34725_integration_time_t

tcs34725 integration time enumeration definition

Enumerator
TCS34725_INTEGRATION_TIME_2P4MS 

integration time 2.4 ms

TCS34725_INTEGRATION_TIME_24MS 

integration time 24 ms

TCS34725_INTEGRATION_TIME_50MS 

integration time 50 ms

TCS34725_INTEGRATION_TIME_101MS 

integration time 101 ms

TCS34725_INTEGRATION_TIME_154MS 

integration time 154 ms

TCS34725_INTEGRATION_TIME_700MS 

integration time 700 ms

Definition at line 72 of file driver_tcs34725.h.

◆ tcs34725_wait_time_t

tcs34725 wait time enumeration definition

Enumerator
TCS34725_WAIT_TIME_2P4MS 

2.4 ms wait time

TCS34725_WAIT_TIME_204MS 

204 ms wait time

TCS34725_WAIT_TIME_614MS 

614 ms wait time

TCS34725_WAIT_TIME_29MS 

29 ms wait time

TCS34725_WAIT_TIME_2450MS 

2450 ms wait time

TCS34725_WAIT_TIME_7400MS 

7400 ms wait time

Definition at line 96 of file driver_tcs34725.h.

Function Documentation

◆ tcs34725_deinit()

uint8_t tcs34725_deinit ( tcs34725_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to a tcs34725 handle structure
Returns
status code
  • 0 success
  • 1 iic deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1174 of file driver_tcs34725.c.

◆ tcs34725_get_gain()

uint8_t tcs34725_get_gain ( tcs34725_handle_t * handle,
tcs34725_gain_t * gain )

get the adc gain

Parameters
[in]*handlepointer to a tcs34725 handle structure
[out]*gainpointer to an adc gain buffer
Returns
status code
  • 0 success
  • 1 get gain failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 860 of file driver_tcs34725.c.

◆ tcs34725_get_power_on()

uint8_t tcs34725_get_power_on ( tcs34725_handle_t * handle,
tcs34725_bool_t * enable )

get the power status

Parameters
[in]*handlepointer to a tcs34725 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get power on failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 380 of file driver_tcs34725.c.

◆ tcs34725_get_rgbc()

uint8_t tcs34725_get_rgbc ( tcs34725_handle_t * handle,
tcs34725_bool_t * enable )

get the rgbc status

Parameters
[in]*handlepointer to a tcs34725 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get rgbc failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 299 of file driver_tcs34725.c.

◆ tcs34725_get_rgbc_integration_time()

uint8_t tcs34725_get_rgbc_integration_time ( tcs34725_handle_t * handle,
tcs34725_integration_time_t * t )

get the rgbc adc integration time

Parameters
[in]*handlepointer to a tcs34725 handle structure
[out]*tpointer to an integration time buffer
Returns
status code
  • 0 success
  • 1 get rgbc integration time failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 452 of file driver_tcs34725.c.

◆ tcs34725_get_wait()

uint8_t tcs34725_get_wait ( tcs34725_handle_t * handle,
tcs34725_bool_t * enable )

get the wait time

Parameters
[in]*handlepointer to a tcs34725 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get wait failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 218 of file driver_tcs34725.c.

◆ tcs34725_get_wait_time()

uint8_t tcs34725_get_wait_time ( tcs34725_handle_t * handle,
tcs34725_wait_time_t * t )

get the wait time

Parameters
[in]*handlepointer to a tcs34725 handle structure
[out]*tpointer to a wait time buffer
Returns
status code
  • 0 success
  • 1 get wait time failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 540 of file driver_tcs34725.c.

◆ tcs34725_info()

uint8_t tcs34725_info ( tcs34725_info_t * info)

get chip information

Parameters
[out]*infopointer to a tcs34725 info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 1294 of file driver_tcs34725.c.

◆ tcs34725_init()

uint8_t tcs34725_init ( tcs34725_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to a tcs34725 handle structure
Returns
status code
  • 0 success
  • 1 iic initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
Note
none

Definition at line 1095 of file driver_tcs34725.c.

◆ tcs34725_read_c()

uint8_t tcs34725_read_c ( tcs34725_handle_t * handle,
uint16_t * clear )

read the clear data

Parameters
[in]*handlepointer to a tcs34725 handle structure
[out]*clearpointer to a clear color buffer
Returns
status code
  • 0 success
  • 1 read clear failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1033 of file driver_tcs34725.c.

◆ tcs34725_read_rgb()

uint8_t tcs34725_read_rgb ( tcs34725_handle_t * handle,
uint16_t * red,
uint16_t * green,
uint16_t * blue )

read the rgb data

Parameters
[in]*handlepointer to a tcs34725 handle structure
[out]*redpointer to a red color buffer
[out]*greenpointer to a green color buffer
[out]*bluepointer to a blue color buffer
Returns
status code
  • 0 success
  • 1 read rgb failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 968 of file driver_tcs34725.c.

◆ tcs34725_read_rgbc()

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

Parameters
[in]*handlepointer to a tcs34725 handle structure
[out]*redpointer to a red color buffer
[out]*greenpointer to a green color buffer
[out]*bluepointer to a blue color buffer
[out]*clearpointer to a clear color buffer
Returns
status code
  • 0 success
  • 1 read rgbc failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 900 of file driver_tcs34725.c.

◆ tcs34725_set_gain()

uint8_t tcs34725_set_gain ( tcs34725_handle_t * handle,
tcs34725_gain_t gain )

set the adc gain

Parameters
[in]*handlepointer to a tcs34725 handle structure
[in]gainadc gain
Returns
status code
  • 0 success
  • 1 set gain failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 816 of file driver_tcs34725.c.

◆ tcs34725_set_power_on()

uint8_t tcs34725_set_power_on ( tcs34725_handle_t * handle,
tcs34725_bool_t enable )

enable or disable the power

Parameters
[in]*handlepointer to a tcs34725 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set power on failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 336 of file driver_tcs34725.c.

◆ tcs34725_set_rgbc()

uint8_t tcs34725_set_rgbc ( tcs34725_handle_t * handle,
tcs34725_bool_t enable )

enable or disable the rgbc adc

Parameters
[in]*handlepointer to a tcs34725 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set rgbc failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 255 of file driver_tcs34725.c.

◆ tcs34725_set_rgbc_integration_time()

uint8_t tcs34725_set_rgbc_integration_time ( tcs34725_handle_t * handle,
tcs34725_integration_time_t t )

set the rgbc adc integration time

Parameters
[in]*handlepointer to a tcs34725 handle structure
[in]tadc integration time
Returns
status code
  • 0 success
  • 1 set rgbc integration time failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 417 of file driver_tcs34725.c.

◆ tcs34725_set_wait()

uint8_t tcs34725_set_wait ( tcs34725_handle_t * handle,
tcs34725_bool_t enable )

enable or disable the wait time

Parameters
[in]*handlepointer to a tcs34725 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set wait failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 174 of file driver_tcs34725.c.

◆ tcs34725_set_wait_time()

uint8_t tcs34725_set_wait_time ( tcs34725_handle_t * handle,
tcs34725_wait_time_t t )

set the wait time

Parameters
[in]*handlepointer to a tcs34725 handle structure
[in]twait time
Returns
status code
  • 0 success
  • 1 set wait time failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 487 of file driver_tcs34725.c.