color2 2.0.0.0
|
Functions | |
void | color2_cfg_setup (color2_cfg_t *cfg) |
Config Object Initialization function. | |
err_t | color2_init (color2_t *ctx, color2_cfg_t *cfg) |
Initialization function. | |
err_t | color2_default_cfg (color2_t *ctx) |
Click Default Configuration function. | |
err_t | color2_generic_write (color2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Color 2 I2C writing function. | |
err_t | color2_generic_read (color2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Color 2 I2C reading function. | |
err_t | color2_write_reg (color2_t *ctx, uint8_t reg, uint8_t data_in) |
Generic write data function. | |
err_t | color2_read_reg (color2_t *ctx, uint8_t reg, uint8_t *data_out) |
Generic read data function. | |
uint8_t | color2_get_int_pin (color2_t *ctx) |
Get int pin function. | |
err_t | color2_reset (color2_t *ctx) |
Reset default register value function. | |
err_t | color2_init_advanced (color2_t *ctx, uint8_t config1, uint8_t config2, uint8_t config3) |
Init advanced function. | |
err_t | color2_set_upper_threshold (color2_t *ctx, uint16_t upper_threshold) |
Function set upper threshold register. | |
err_t | color2_set_lower_hreshold (color2_t *ctx, uint16_t lower_threshold) |
Function set lower threshold register. | |
err_t | color2_read_upper_threshold (color2_t *ctx, uint16_t *upper_threshold) |
Function read upper threshold register. | |
err_t | color2_read_lower_threshold (color2_t *ctx, uint16_t *lower_threshold) |
Function read lower threshold register. | |
err_t | color2_read_rgb (color2_t *ctx, color2_rgb_t *rgb) |
Function read rgb data. | |
err_t | color2_read_status (color2_t *ctx, uint8_t *status) |
Function read status registe value. | |
void | color2_rgb_to_hsl (color2_t *ctx, color2_rgb_t *rgb, color2_hsl_t *hsl) |
Functions for read color value. | |
uint8_t | color2_get_color (color2_hsl_t *hsl) |
Functions for detect colors. | |
void color2_cfg_setup | ( | color2_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
err_t color2_default_cfg | ( | color2_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.err_t color2_generic_read | ( | color2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Color 2 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 color2_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 color2_generic_write | ( | color2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Color 2 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 color2_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. uint8_t color2_get_color | ( | color2_hsl_t * | hsl | ) |
Functions for detect colors.
ctx | Click object. |
hsl | : HSL (hue, saturation, lightness) input value. See color2_hsl_t object definition for detailed explanation. |
This function returns the color name flag from the input HSL color.
uint8_t color2_get_int_pin | ( | color2_t * | ctx | ) |
Get int pin function.
ctx | Click object. |
Function read INT pin logic state
err_t color2_init | ( | color2_t * | ctx, |
color2_cfg_t * | cfg ) |
Initialization function.
color2 | Click object. |
cfg | Click configuration structure. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.err_t color2_init_advanced | ( | color2_t * | ctx, |
uint8_t | config1, | ||
uint8_t | config2, | ||
uint8_t | config3 ) |
Init advanced function.
ctx | Click object. |
config1 | Register address config1 |
config2 | Register address config2 |
config3 | Register address config3 |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.err_t color2_read_lower_threshold | ( | color2_t * | ctx, |
uint16_t * | lower_threshold ) |
Function read lower threshold register.
ctx | Click object. |
lower_threshold | Lower Threshold 16-bit data |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.err_t color2_read_reg | ( | color2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Generic read data function.
ctx | Click object. |
reg | Register address |
data_out | Data from addressed register in ISL29125 |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.err_t color2_read_rgb | ( | color2_t * | ctx, |
color2_rgb_t * | rgb ) |
Function read rgb data.
ctx | Click object. |
rgb | RGB data See color2_rgb_t definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.err_t color2_read_status | ( | color2_t * | ctx, |
uint8_t * | status ) |
Function read status registe value.
ctx | Click object. |
status | 16-bit status data |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.err_t color2_read_upper_threshold | ( | color2_t * | ctx, |
uint16_t * | upper_threshold ) |
Function read upper threshold register.
ctx | Click object. |
upper_threshold | Upper Threshold 16-bit data |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.err_t color2_reset | ( | color2_t * | ctx | ) |
Reset default register value function.
ctx | Click object. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.void color2_rgb_to_hsl | ( | color2_t * | ctx, |
color2_rgb_t * | rgb, | ||
color2_hsl_t * | hsl ) |
Functions for read color value.
ctx | Click object. |
rgb | : RGB (red, green, blue) input value. See color2_rgb_t object definition for detailed explanation. |
hsl | : HSL (hue, saturation, lightness) input value. See color2_hsl_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.err_t color2_set_lower_hreshold | ( | color2_t * | ctx, |
uint16_t | lower_threshold ) |
Function set lower threshold register.
ctx | Click object. |
lower_threshold | Lower threshold |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.err_t color2_set_upper_threshold | ( | color2_t * | ctx, |
uint16_t | upper_threshold ) |
Function set upper threshold register.
ctx | Click object. |
upper_threshold | Upper threshold |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.err_t color2_write_reg | ( | color2_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Generic write data function.
ctx | Click object. |
reg | Register address |
data_in | Command to write |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.