Header file of TCS34725 Driver.
More...
#include <stdint.h>
#include "no_os_i2c.h"
#include "no_os_util.h"
Header file of TCS34725 Driver.
- Author
- Monica Constandachi (monic.nosp@m.a.co.nosp@m.nstan.nosp@m.dach.nosp@m.i@ana.nosp@m.log..nosp@m.com)
Copyright 2026(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
◆ TCS34725_AIHTH
| #define TCS34725_AIHTH 0x07 |
◆ TCS34725_AIHTL
| #define TCS34725_AIHTL 0x06 |
◆ TCS34725_AILTH
| #define TCS34725_AILTH 0x05 |
◆ TCS34725_AILTL
| #define TCS34725_AILTL 0x04 |
◆ TCS34725_ATIME
| #define TCS34725_ATIME 0x01 |
◆ TCS34725_BDATAH
| #define TCS34725_BDATAH 0x1B |
◆ TCS34725_BDATAL
| #define TCS34725_BDATAL 0x1A |
◆ TCS34725_CDATAH
| #define TCS34725_CDATAH 0x15 |
◆ TCS34725_CDATAL
| #define TCS34725_CDATAL 0x14 |
◆ TCS34725_COMMAND_BIT
| #define TCS34725_COMMAND_BIT 0x80 |
◆ TCS34725_COMMAND_INC
| #define TCS34725_COMMAND_INC 0x20 |
◆ TCS34725_CONFIG
| #define TCS34725_CONFIG 0x0D |
◆ TCS34725_CONTROL
| #define TCS34725_CONTROL 0x0F |
◆ TCS34725_ENABLE
| #define TCS34725_ENABLE 0x00 |
◆ TCS34725_ENABLE_AEN
◆ TCS34725_ENABLE_PON
◆ TCS34725_GDATAH
| #define TCS34725_GDATAH 0x19 |
◆ TCS34725_GDATAL
| #define TCS34725_GDATAL 0x18 |
◆ TCS34725_ID
◆ TCS34725_PERS
| #define TCS34725_PERS 0x0C |
◆ TCS34725_RDATAH
| #define TCS34725_RDATAH 0x17 |
◆ TCS34725_RDATAL
| #define TCS34725_RDATAL 0x16 |
◆ TCS34725_STATUS
| #define TCS34725_STATUS 0x13 |
◆ TCS34725_WTIME
| #define TCS34725_WTIME 0x03 |
◆ tcs34725_get_rgbc()
| int tcs34725_get_rgbc |
( |
struct tcs34725_desc * | desc, |
|
|
uint16_t * | r, |
|
|
uint16_t * | g, |
|
|
uint16_t * | b, |
|
|
uint16_t * | c ) |
Read the current RGB color sample.
Read the current RGBC sample (clear, red, green, blue).
- Parameters
-
| desc | - The device structure. |
| r | - The red component. |
| g | - The green component. |
| b | - The blue component. |
| c | - The clear component. |
- Returns
- 0 in case of success, error code otherwise.
◆ tcs34725_init()
Initialize the device structure.
Initialize the device structure
- Parameters
-
| desc | - The device structure to be initialized. |
| init_param | - Initialization parameter for the device descriptor. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ tcs34725_reg_read()
| int tcs34725_reg_read |
( |
struct tcs34725_desc * | desc, |
|
|
uint8_t | addr, |
|
|
uint8_t * | val ) |
Read the raw value of a register.
Read a register value
- Parameters
-
| desc | - The device structure. |
| addr | - The register's address. |
| val | - The value to be read. |
- Returns
- 0 in case of success, negative error code otherwise
◆ tcs34725_reg_write()
| int tcs34725_reg_write |
( |
struct tcs34725_desc * | desc, |
|
|
uint8_t | addr, |
|
|
uint8_t | val ) |
Write a raw value to a register.
Write a register value
- Parameters
-
| desc | - The device structure. |
| addr | - The register's address. |
| val | - The value to be written. |
- Returns
- 0 in case of success, error code otherwise
◆ tcs34725_remove()
Free the device descriptor.
Free the device descriptor
- Parameters
-
| desc | - The device structure. |
- Returns
- 0 in case of success, error code otherwise.