color 2.0.0.0
|
Functions | |
void | color_cfg_setup (color_cfg_t *cfg) |
Config Object Initialization function. | |
COLOR_RETVAL | color_init (color_t *ctx, color_cfg_t *cfg) |
Initialization function. | |
void | color_default_cfg (color_t *ctx) |
Click Default Configuration function. | |
void | color_generic_write (color_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | color_generic_read (color_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | color_write_byte (color_t *ctx, uint8_t reg, uint8_t data_to_write) |
Write one byte to register. | |
uint16_t | color_read_data (color_t *ctx, uint8_t reg) |
Read 16-bit data from register. | |
float | color_read_color_ratio (color_t *ctx, uint8_t color) |
Read color ratio from register. | |
float | color_get_color_value (color_t *ctx) |
Functions for read color value. | |
uint8_t | color_get_color (float color_value) |
Detect color. | |
uint8_t | color_get_interrupt (color_t *ctx) |
Get interrupt pin state. | |
void | color_set_led (color_t *ctx, uint8_t red, uint8_t green, uint8_t blue) |
Functions for set Led lights. | |
void color_cfg_setup | ( | color_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void color_default_cfg | ( | color_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Color click.
void color_generic_read | ( | color_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void color_generic_write | ( | color_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
uint8_t color_get_color | ( | float | color_value | ) |
Detect color.
color_value | Color value in HSL. |
@description This function determines which color is read by click sensor after color_get_color_value() function has been invoked previously.
Detect color ORANGE color - from 0.992 to 0.999 RED color - from 0.9750 to 0.9919 PINK color - from 0.920 to 0.9749 PURPLE color - from 0.6201 to 0.919 BLUE color - from 0.521 to 0.6200 CYAN color - from 0.4700 to 0.520 GREEN color - from 0.210 to 0.469 YELLOW color - from 0.0650 to 0.209
float color_get_color_value | ( | color_t * | ctx | ) |
Functions for read color value.
ctx | Click object. |
@description This function reads 3 color filters and clear filters and converts the resulting color from RGBC to HSL. The color range is between 0.0650 and 1.0000.
uint8_t color_get_interrupt | ( | color_t * | ctx | ) |
Get interrupt pin state.
ctx | Click object. |
@description This function reads interrupt pin state.
COLOR_RETVAL color_init | ( | color_t * | ctx, |
color_cfg_t * | cfg ) |
Initialization function.
color | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
float color_read_color_ratio | ( | color_t * | ctx, |
uint8_t | color ) |
Read color ratio from register.
ctx | Click object. |
color | Color to get ratio for. |
@description This function reads desired color ratio from register.
uint16_t color_read_data | ( | color_t * | ctx, |
uint8_t | reg ) |
Read 16-bit data from register.
ctx | Click object. |
reg | Register in which the data will be written. |
@description This function reads 2 bytes from register.
void color_set_led | ( | color_t * | ctx, |
uint8_t | red, | ||
uint8_t | green, | ||
uint8_t | blue ) |
Functions for set Led lights.
ctx | Click object. |
red | Enable/disable red LED. |
green | Enable/disable green LED. |
blue | Enable/disable blue LED. |
@description This function enables and disables LEDs.
void color_write_byte | ( | color_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_to_write ) |
Write one byte to register.
ctx | Click object. |
reg | Register in which the data will be written. |
data_to_write | Data which be written to the register. |
@description This function writes one byte to register.