color7 2.0.0.0
|
Functions | |
void | color7_cfg_setup (color7_cfg_t *cfg) |
Config Object Initialization function. | |
COLOR7_RETVAL | color7_init (color7_t *ctx, color7_cfg_t *cfg) |
Initialization function. | |
void | color7_default_cfg (color7_t *ctx) |
Click Default Configuration function. | |
void | color7_generic_write (color7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | color7_generic_read (color7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
float | color7_read_color_ratio (color7_t *ctx, uint8_t color) |
Functions for read color ratio. | |
float | color7_get_color_value (color7_t *ctx) |
Functions for read color value. | |
uint8_t | color7_get_color (color7_t *ctx) |
Functions for detect colors. | |
uint8_t | color7_get_interrupt_state (color7_t *ctx) |
Get interrut pin state. | |
void color7_cfg_setup | ( | color7_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void color7_default_cfg | ( | color7_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Color7 click.
- Register enable ** COLOR7_ENABLE_RGBC_INTERRUPT ** COLOR7_ENABLE_WAIT ** COLOR7_ENABLE_RGBC ** COLOR7_POWER_ON - Register ctrl ** COLOR7_CTRL_GAIN_x16 - RGBC time ** COLOR7_RGBC_TIME_700ms
void color7_generic_read | ( | color7_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 color7_generic_write | ( | color7_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 color7_get_color | ( | color7_t * | ctx | ) |
Functions for detect colors.
Color | flag |
Detect color PINK color - from 0.920 to 0.974 PURPLE color - from 0.6201 to 0.919 BLUE color - from 0.521 to 0.620 CYAN color - from 0.430 to 0.520 GREEN color - from 0.300 to 0.429 YELLOW color - from 0.019 to 0.200 RED color - from 0.0005 to 0.018
float color7_get_color_value | ( | color7_t * | ctx | ) |
Functions for read color value.
ctx | Click object. |
Color | value in HSL |
uint8_t color7_get_interrupt_state | ( | color7_t * | ctx | ) |
Get interrut pin state.
INT | pin state |
COLOR7_RETVAL color7_init | ( | color7_t * | ctx, |
color7_cfg_t * | cfg ) |
Initialization function.
color7 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
float color7_read_color_ratio | ( | color7_t * | ctx, |
uint8_t | color ) |
Functions for read color ratio.
ctx | Click object. |
color | Color register which be read |
color | ratio data |
Use this function when reading one color ratio