color2  2.0.0.0
Functions
Public function

Functions

void color2_cfg_setup (color2_cfg_t *cfg)
 Config Object Initialization function. More...
 
COLOR2_RETVAL color2_init (color2_t *ctx, color2_cfg_t *cfg)
 Initialization function. More...
 
void color2_default_cfg (color2_t *ctx)
 Click Default Configuration function. More...
 
void color2_write_data (color2_t *ctx, uint8_t address, uint8_t write_command)
 Generic write data function. More...
 
uint8_t color2_read_data (color2_t *ctx, uint8_t address)
 Generic read data function. More...
 
uint8_t color2_reset (color2_t *ctx)
 Reset default register value function. More...
 
uint8_t color2_init_advanced (color2_t *ctx, uint8_t config1, uint8_t config2, uint8_t config3)
 Generic read data function. More...
 
void color2_set_upper_threshold (color2_t *ctx, uint16_t upper_threshold)
 Function set upper threshold register. More...
 
void color2_set_lower_hreshold (color2_t *ctx, uint16_t lower_threshold)
 Function set lower threshold register. More...
 
uint16_t color2_read_upper_threshold (color2_t *ctx)
 Function read upper threshold register. More...
 
uint16_t color2_read_lower_threshold (color2_t *ctx)
 Function read lower threshold register. More...
 
float color2_read_red (color2_t *ctx)
 Function read red color data. More...
 
float color2_read_green (color2_t *ctx)
 Function read green color data. More...
 
float color2_read_blue (color2_t *ctx)
 Function read blue color data. More...
 
uint8_t color2_read_status (color2_t *ctx)
 Function read status registe value. More...
 
float color2_get_color_value (color2_t *ctx)
 Functions for read color value. More...
 
uint8_t color2_get_color (float color_value)
 Functions for detect colors. More...
 

Detailed Description

Function Documentation

◆ color2_cfg_setup()

void color2_cfg_setup ( color2_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ color2_default_cfg()

void color2_default_cfg ( color2_t ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Color2 click.

◆ color2_get_color()

uint8_t color2_get_color ( float  color_value)

Functions for detect colors.

Parameters
ctxClick object.
color_valuecolor value in HSL
Return values
Colorflag

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

◆ color2_get_color_value()

float color2_get_color_value ( color2_t ctx)

Functions for read color value.

Parameters
ctxClick object.
Return values
Colorvalue in HSL

This functions reas 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.

◆ color2_init()

COLOR2_RETVAL color2_init ( color2_t ctx,
color2_cfg_t cfg 
)

Initialization function.

Parameters
color2Click object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ color2_init_advanced()

uint8_t color2_init_advanced ( color2_t ctx,
uint8_t  config1,
uint8_t  config2,
uint8_t  config3 
)

Generic read data function.

Parameters
ctxClick object.
config1Register address config1
config2Register address config2
config3Register address config3
Returns
0 if ERROR; 1 if OK

Function read byte of data from register address of ISL29125

◆ color2_read_blue()

float color2_read_blue ( color2_t ctx)

Function read blue color data.

Parameters
ctxClick object.
Returns
16-bit blue color data

Function read blue color data from ISL29125

◆ color2_read_data()

uint8_t color2_read_data ( color2_t ctx,
uint8_t  address 
)

Generic read data function.

Parameters
ctxClick object.
addressRegister address
Returns
Data from addressed register in ISL29125

Function read byte of data from register address of ISL29125

◆ color2_read_green()

float color2_read_green ( color2_t ctx)

Function read green color data.

Parameters
ctxClick object.
Returns
16-bit green color data

Function read green color data from ISL29125

◆ color2_read_lower_threshold()

uint16_t color2_read_lower_threshold ( color2_t ctx)

Function read lower threshold register.

Parameters
ctxClick object.
Returns
Lower Threshold 16-bit data

Function read lower threshold register from ISL29125

◆ color2_read_red()

float color2_read_red ( color2_t ctx)

Function read red color data.

Parameters
ctxClick object.
Returns
16-bit red color data

Function read red color data from ISL29125

◆ color2_read_status()

uint8_t color2_read_status ( color2_t ctx)

Function read status registe value.

Parameters
ctxClick object.
Returns
16-bit status data

Function read status registe value from ISL29125

◆ color2_read_upper_threshold()

uint16_t color2_read_upper_threshold ( color2_t ctx)

Function read upper threshold register.

Parameters
ctxClick object.
Returns
Upper Threshold 16-bit data

Function read upper threshold register from ISL29125

◆ color2_reset()

uint8_t color2_reset ( color2_t ctx)

Reset default register value function.

Parameters
ctxClick object.
Returns
0 if ERROR; 1 if OK

Reset default register value function ISL29125

◆ color2_set_lower_hreshold()

void color2_set_lower_hreshold ( color2_t ctx,
uint16_t  lower_threshold 
)

Function set lower threshold register.

Parameters
ctxClick object.
lowerThresholdlowerThreshold register address

Function set lower threshold register of ISL29125

◆ color2_set_upper_threshold()

void color2_set_upper_threshold ( color2_t ctx,
uint16_t  upper_threshold 
)

Function set upper threshold register.

Parameters
ctxClick object.
upperThresholdupperThreshold register address

Function set upper threshold register of ISL29125

◆ color2_write_data()

void color2_write_data ( color2_t ctx,
uint8_t  address,
uint8_t  write_command 
)

Generic write data function.

Parameters
ctxClick object.
addressRegister address
writeCommandCommand to write

Function write byte of data to ISL29125