color4 2.1.0.0
|
API for configuring and manipulating Color 4 Click driver. More...
Topics | |
Color 4 Registers List | |
List of registers of Color 4 Click driver. | |
Color 4 Registers Settings | |
Settings for registers of Color 4 Click driver. | |
Color 4 MikroBUS Map | |
MikroBUS pin mapping of Color 4 Click driver. | |
Functions | |
void | color4_cfg_setup (color4_cfg_t *cfg) |
Color 4 configuration object setup function. | |
err_t | color4_init (color4_t *ctx, color4_cfg_t *cfg) |
Color 4 initialization function. | |
err_t | color4_default_cfg (color4_t *ctx) |
Color 4 default configuration function. | |
err_t | color4_generic_write (color4_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Color 4 I2C writing function. | |
err_t | color4_generic_read (color4_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Color 4 I2C reading function. | |
err_t | color4_set_config (color4_t *ctx, color4_config_t config) |
Color 4 set configuration function. | |
err_t | color4_get_config (color4_t *ctx, color4_config_t *config) |
Color 4 get configuration function. | |
err_t | color4_get_color_data (color4_t *ctx, color4_ch_color_t ch_color, uint16_t *color_data) |
Color 4 get color data function. | |
err_t | color4_get_ambient_light (color4_t *ctx, float *ambient_light) |
Color 4 get ambient light level function. | |
err_t | color4_get_cct (color4_t *ctx, float *cct) |
Color 4 get CCT data function. | |
API for configuring and manipulating Color 4 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void color4_cfg_setup | ( | color4_cfg_t * | cfg | ) |
Color 4 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See color4_cfg_t object definition for detailed explanation. |
err_t color4_default_cfg | ( | color4_t * | ctx | ) |
Color 4 default configuration function.
This function executes a default configuration: Integration time 320ms, no trigger, auto mode and enable color sensor of Color 4 click board™.
[in] | ctx | : Click context object. See color4_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color4_generic_read | ( | color4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Color 4 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See color4_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color4_generic_write | ( | color4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Color 4 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See color4_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color4_get_ambient_light | ( | color4_t * | ctx, |
float * | ambient_light ) |
Color 4 get ambient light level function.
This function reads the ambient light data and calculate of the VEML6040 RGBW Color Sensor with I2C Interface on the Color 4 click board™.
[in] | ctx | : Click context object. See color4_t object definition for detailed explanation. |
[out] | ambient_light | : Ambient light level in Lux. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color4_get_cct | ( | color4_t * | ctx, |
float * | cct ) |
Color 4 get CCT data function.
This function reads the RGB color data and calculate the correlated color temperature (empirical approach) of the VEML6040 RGBW Color Sensor with I2C Interface on the Color 4 click board™.
[in] | ctx | : Click context object. See color4_t object definition for detailed explanation. |
[out] | cct | : Correlated color temperature. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color4_get_color_data | ( | color4_t * | ctx, |
color4_ch_color_t | ch_color, | ||
uint16_t * | color_data ) |
Color 4 get color data function.
This function reads color data of the desired channel from which the data will be converted of the VEML6040 RGBW Color Sensor with I2C Interface on the Color 4 click board™.
[in] | ctx | : Click context object. See color4_t object definition for detailed explanation. |
[in] | ch_color | : Channel from which the data will be converted. |
[out] | color_data | : Color data reads from the channel. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color4_get_config | ( | color4_t * | ctx, |
color4_config_t * | config ) |
Color 4 get configuration function.
This function reads the configuration data of the VEML6040 RGBW Color Sensor with I2C Interface on the Color 4 click board™.
[in] | ctx | : Click context object. See color4_t object definition for detailed explanation. |
[out] | config | : Sensor configuration object. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color4_init | ( | color4_t * | ctx, |
color4_cfg_t * | cfg ) |
Color 4 initialization function.
This function initializes all necessary pins and peripherals used for this click board™.
[out] | ctx | : Click context object. See color4_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See color4_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color4_set_config | ( | color4_t * | ctx, |
color4_config_t | config ) |
Color 4 set configuration function.
This function executes a configuration of the VEML6040 RGBW Color Sensor with I2C Interface on the Color 4 click board™.
[in] | ctx | : Click context object. See color4_t object definition for detailed explanation. |
[in] | config | : Sensor configuration object. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.