libyggdrasil  v1.0.0
color_sensor.h
Go to the documentation of this file.
1  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * _____.___. .___ .__.__ *
3  * \__ | | ____ ____ __| _/___________ _____|__| | *
4  * / | |/ ___\ / ___\ / __ |\_ __ \__ \ / ___/ | | *
5  * \____ / /_/ > /_/ > /_/ | | | \// __ \_\___ \| | |__ *
6  * / ______\___ /\___ /\____ | |__| (____ /____ >__|____/ *
7  * \/ /_____//_____/ \/ \/ \/ *
8  * - Yggdrasil - *
9  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
10  * This software can be used by students and other personal of the *
11  * Bern University of Applied Sciences under the terms of the MIT *
12  * license. *
13  * For other persons this software is under the terms of the GNU *
14  * General Public License version 2. *
15  * *
16  * Copyright © 2021, Bern University of Applied Sciences. *
17  * All rights reserved. *
18  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
26 #pragma once
27 
28 #include <c/yggdrasil/types.h>
29 
41 };
42 
50  ColorSensorGain_60x = 0x03
51 };
52 
60 
68 
76 
82 
87 
94 
101 
110 
yggdrasil_ColorSensor_StartConversion
C_LINKAGE u16 yggdrasil_ColorSensor_StartConversion(void)
Start a conversion and returns the set integration time.
yggdrasil_ColorSensor_GetColor16
C_LINKAGE RGBA16 yggdrasil_ColorSensor_GetColor16(bool restartConversion)
Get the color values and start a new measurement (optional)
ColorSensorGain_1x
@ ColorSensorGain_1x
No gain.
Definition: color_sensor.h:47
u16
uint16_t u16
Definition: types.h:37
ColorSensorGain_60x
@ ColorSensorGain_60x
60x gain
Definition: color_sensor.h:50
ColorSensorGain
ColorSensorGain
Gain settings.
Definition: color_sensor.h:46
ColorSensorIntegrationTime_2_4ms
@ ColorSensorIntegrationTime_2_4ms
2.4ms - 1 cycle
Definition: color_sensor.h:34
ColorSensorIntegrationTime_154ms
@ ColorSensorIntegrationTime_154ms
154ms - 64 cycles
Definition: color_sensor.h:39
yggdrasil_ColorSensor_IsDone
C_LINKAGE bool yggdrasil_ColorSensor_IsDone(void)
Used to poll a conversion.
yggdrasil_ColorSensor_SetIntegrationTime
C_LINKAGE void yggdrasil_ColorSensor_SetIntegrationTime(enum ColorSensorIntegrationTime integrationTime)
Set the integration time.
RGBA16
RGBA16 color type.
Definition: types.h:41
yggdrasil_ColorSensor_Init
C_LINKAGE bool yggdrasil_ColorSensor_Init(void)
Initialization of the TCS3472 color sensor.
types.h
ColorSensorIntegrationTime
ColorSensorIntegrationTime
Integration time = (256 - IntegrationTime) * 2.4ms.
Definition: color_sensor.h:33
yggdrasil_ColorSensor_Enable
C_LINKAGE void yggdrasil_ColorSensor_Enable(void)
Enable the sensor.
yggdrasil_ColorSensor_GetColor8
C_LINKAGE RGBA8 yggdrasil_ColorSensor_GetColor8(bool restartConversion)
Get the color values and start a new measurement (optional)
ColorSensorIntegrationTime_101ms
@ ColorSensorIntegrationTime_101ms
101ms - 42 cycles
Definition: color_sensor.h:38
yggdrasil_ColorSensor_Disable
C_LINKAGE void yggdrasil_ColorSensor_Disable(void)
Disables the sensor.
ColorSensorIntegrationTime_700ms
@ ColorSensorIntegrationTime_700ms
700ms - 256 cycles
Definition: color_sensor.h:40
ColorSensorIntegrationTime_10ms
@ ColorSensorIntegrationTime_10ms
10ms - 4 cycles
Definition: color_sensor.h:35
ColorSensorGain_4x
@ ColorSensorGain_4x
4x gain
Definition: color_sensor.h:48
ColorSensorIntegrationTime_24ms
@ ColorSensorIntegrationTime_24ms
24ms - 10 cycles
Definition: color_sensor.h:36
C_LINKAGE
#define C_LINKAGE
Definition: attributes.h:43
yggdrasil_ColorSensor_SetGain
C_LINKAGE void yggdrasil_ColorSensor_SetGain(enum ColorSensorGain gain)
Set the gain.
ColorSensorIntegrationTime_50ms
@ ColorSensorIntegrationTime_50ms
50ms - 20 cycles
Definition: color_sensor.h:37
RGBA8
RGBA8 color type.
Definition: types.h:31
ColorSensorGain_16x
@ ColorSensorGain_16x
16x gain
Definition: color_sensor.h:49