no-OS
Loading...
Searching...
No Matches
tcs34725.c File Reference

Implementation of TCS34725 RGB color sensor driver. More...

#include "tcs34725.h"
#include "no_os_delay.h"
#include "no_os_error.h"
#include "no_os_util.h"
#include "no_os_units.h"
#include "no_os_alloc.h"
#include "no_os_print_log.h"
Include dependency graph for tcs34725.c:

Functions

int tcs34725_init (struct tcs34725_desc **desc, struct tcs34725_init_param *init_param)
 Initialize the device structure.
 
int tcs34725_reg_read (struct tcs34725_desc *desc, uint8_t addr, uint8_t *val)
 Read the raw value of a register.
 
int tcs34725_reg_write (struct tcs34725_desc *desc, uint8_t addr, uint8_t val)
 Write a raw value to a register.
 
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.
 
int tcs34725_remove (struct tcs34725_desc *desc)
 Free the device descriptor.
 

Detailed Description

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

Function Documentation

◆ 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()

int tcs34725_init ( struct tcs34725_desc ** desc,
struct tcs34725_init_param * init_param )

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()

int tcs34725_remove ( struct tcs34725_desc * desc)

Free the device descriptor.

Parameters
desc- The device structure.
Returns
0 in case of success, error code otherwise.