libyggdrasil
v1.0.0
|
Driver to use the TCS3472 color sensor. More...
#include <c/yggdrasil/types.h>
Go to the source code of this file.
Enumerations | |
enum | ColorSensorIntegrationTime { ColorSensorIntegrationTime_2_4ms = 0xFF, ColorSensorIntegrationTime_10ms = 0xFB, ColorSensorIntegrationTime_24ms = 0xF6, ColorSensorIntegrationTime_50ms = 0xEB, ColorSensorIntegrationTime_101ms = 0xD5, ColorSensorIntegrationTime_154ms = 0xC0, ColorSensorIntegrationTime_700ms = 0x00 } |
Integration time = (256 - IntegrationTime) * 2.4ms. More... | |
enum | ColorSensorGain { ColorSensorGain_1x = 0x00, ColorSensorGain_4x = 0x01, ColorSensorGain_16x = 0x02, ColorSensorGain_60x = 0x03 } |
Gain settings. More... | |
Functions | |
C_LINKAGE bool | yggdrasil_ColorSensor_Init (void) |
Initialization of the TCS3472 color sensor. More... | |
C_LINKAGE void | yggdrasil_ColorSensor_SetIntegrationTime (enum ColorSensorIntegrationTime integrationTime) |
Set the integration time. More... | |
C_LINKAGE void | yggdrasil_ColorSensor_SetGain (enum ColorSensorGain gain) |
Set the gain. More... | |
C_LINKAGE void | yggdrasil_ColorSensor_Enable (void) |
Enable the sensor. More... | |
C_LINKAGE void | yggdrasil_ColorSensor_Disable (void) |
Disables the sensor. More... | |
C_LINKAGE u16 | yggdrasil_ColorSensor_StartConversion (void) |
Start a conversion and returns the set integration time. More... | |
C_LINKAGE bool | yggdrasil_ColorSensor_IsDone (void) |
Used to poll a conversion. More... | |
C_LINKAGE RGBA8 | yggdrasil_ColorSensor_GetColor8 (bool restartConversion) |
Get the color values and start a new measurement (optional) More... | |
C_LINKAGE RGBA16 | yggdrasil_ColorSensor_GetColor16 (bool restartConversion) |
Get the color values and start a new measurement (optional) More... | |
Driver to use the TCS3472 color sensor.
enum ColorSensorGain |
Integration time = (256 - IntegrationTime) * 2.4ms.
C_LINKAGE void yggdrasil_ColorSensor_Disable | ( | void | ) |
Disables the sensor.
C_LINKAGE void yggdrasil_ColorSensor_Enable | ( | void | ) |
Enable the sensor.
Get the color values and start a new measurement (optional)
restartConversion | Restart a measurement after reading with the same setting |
Get the color values and start a new measurement (optional)
restartConversion | Restart a measurement after reading with the same setting |
C_LINKAGE bool yggdrasil_ColorSensor_Init | ( | void | ) |
Initialization of the TCS3472 color sensor.
C_LINKAGE bool yggdrasil_ColorSensor_IsDone | ( | void | ) |
Used to poll a conversion.
C_LINKAGE void yggdrasil_ColorSensor_SetGain | ( | enum ColorSensorGain | gain | ) |
Set the gain.
gain | Gain value |
C_LINKAGE void yggdrasil_ColorSensor_SetIntegrationTime | ( | enum ColorSensorIntegrationTime | integrationTime | ) |
Set the integration time.
integrationTime | Integration time value |