Loading...
Searching...
No Matches
tcs37727.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015 PHYTEC Messtechnik GmbH
3 * SPDX-FileCopyrightText: 2017 Freie Universität Berlin
4 * SPDX-License-Identifier: LGPL-2.1-only
5 */
6
7#pragma once
8
25
26#include <stdint.h>
27
28#include "periph/i2c.h"
29
30#ifdef __cplusplus
31extern "C"
32{
33#endif
34
38#define TCS37727_I2C_ADDRESS 0x29
39
52#ifndef CONFIG_TCS37727_ATIME_DEFAULT
53#define CONFIG_TCS37727_ATIME_DEFAULT 200000
54#endif
56
60typedef struct {
61 uint32_t red;
62 uint32_t green;
63 uint32_t blue;
64 uint32_t clear;
65 uint32_t lux;
66 uint32_t ct;
68
72typedef struct {
74 uint8_t addr;
75 uint32_t atime;
77
81typedef struct {
83 int again;
85
89enum {
93};
94
114
121
130
142
143#ifdef __cplusplus
144}
145#endif
146
uint_fast8_t i2c_t
Default i2c_t type definition.
Definition i2c.h:155
void tcs37727_set_rgbc_standby(const tcs37727_t *dev)
Set RGBC disable, this deactivates periodic RGBC measurements.
void tcs37727_set_rgbc_active(const tcs37727_t *dev)
Set RGBC enable, this activates periodic RGBC measurements.
void tcs37727_read(const tcs37727_t *dev, tcs37727_data_t *data)
Read sensor's data.
int tcs37727_init(tcs37727_t *dev, const tcs37727_params_t *params)
Initialize the given TCS37727 sensor.
@ TCS37727_NODEV
no TCS37727 device found on the bus
Definition tcs37727.h:92
@ TCS37727_NOBUS
access to the configured I2C bus failed
Definition tcs37727.h:91
@ TCS37727_OK
everything worked as expected
Definition tcs37727.h:90
Low-level I2C peripheral driver interface definition.
Struct for storing TCS37727 sensor data.
Definition tcs37727.h:60
uint32_t green
IR compensated channels green.
Definition tcs37727.h:62
uint32_t red
IR compensated channels red.
Definition tcs37727.h:61
uint32_t clear
channels clear
Definition tcs37727.h:64
uint32_t blue
IR compensated channels blue.
Definition tcs37727.h:63
uint32_t ct
Color temperature.
Definition tcs37727.h:66
uint32_t lux
Lux.
Definition tcs37727.h:65
TCS37727 configuration parameters.
Definition tcs37727.h:72
uint8_t addr
the sensors address on the I2C bus
Definition tcs37727.h:74
uint32_t atime
conversion time in microseconds
Definition tcs37727.h:75
i2c_t i2c
I2C bus the sensor is connected to.
Definition tcs37727.h:73
Device descriptor for TCS37727 sensors.
Definition tcs37727.h:81
tcs37727_params_t p
device configuration
Definition tcs37727.h:82
int again
amount of gain
Definition tcs37727.h:83