Implementation of TCS34725 RGB color sensor driver.
More...
Implementation of TCS34725 RGB color sensor 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_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.
- 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.
- 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.
- 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.
- 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.
- Parameters
-
| desc | - The device structure. |
- Returns
- 0 in case of success, error code otherwise.