objc

drivers_tcs3472.h
Go to the documentation of this file.
1 
10 #pragma once
11 #include <runtime-hw/hw.h>
12 #include <stdbool.h>
13 #include <stdint.h>
14 
16 // TYPES
17 
22 typedef enum {
23  TCS3472_GAIN_1X = 0x00,
24  TCS3472_GAIN_4X = 0x01,
28 
33 typedef enum {
41 
46 typedef struct {
47  uint16_t red;
48  uint16_t green;
49  uint16_t blue;
50  uint16_t clear;
52 
57 typedef struct {
61 
63 // LIFECYCLE
64 
79 
92 
99 
101 // DATA ACQUISITION
102 
void driver_tcs3472_finalize(driver_tcs3472_t *driver)
Finalize and power down the TCS3472 sensor.
uint16_t red
Red channel value (0-65535)
bool driver_tcs3472_init(driver_tcs3472_t *driver, hw_i2c_t *i2c)
Initialize the TCS3472 sensor with default settings.
driver_tcs3472_integration_time_t integration
Integration time setting.
TCS3472 RGBC color data.
driver_tcs3472_gain_t
TCS3472 gain settings.
bool driver_tcs3472_read(driver_tcs3472_t *driver, driver_tcs3472_rgbc_t *data)
Read RGBC color data.
700ms - max sensitivity
Hardware interface abstraction layer.
uint16_t blue
Blue channel value (0-65535)
driver_tcs3472_integration_time_t
TCS3472 integration time presets.
I2C adapter.
Definition: i2c.h:28
uint16_t clear
Clear (unfiltered) channel value (0-65535)
bool driver_tcs3472_init_with_config(driver_tcs3472_t *driver, hw_i2c_t *i2c, driver_tcs3472_gain_t gain, driver_tcs3472_integration_time_t integration)
Initialize the TCS3472 sensor with custom settings.
TCS3472 sensor driver structure.
uint16_t green
Green channel value (0-65535)
hw_i2c_t i2c
I2C bus handle.