color3
2.0.0.0
|
Functions | |
void | color3_cfg_setup (color3_cfg_t *cfg) |
Config Object Initialization function. More... | |
COLOR3_RETVAL | color3_init (color3_t *ctx, color3_cfg_t *cfg) |
Initialization function. More... | |
void | color3_generic_write (color3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. More... | |
void | color3_generic_read (color3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. More... | |
void | color3_normal_wr_byte (color3_t *ctx, uint8_t wr_addr, uint8_t wr_data) |
Generic read function. More... | |
void | color3_special_wr_byte (color3_t *ctx, uint8_t wr_addr, uint8_t wr_data) |
Special write byte function. More... | |
uint8_t | color3_read_byte (color3_t *ctx, uint8_t rd_addr) |
Read byte function. More... | |
void | color3_normal_wr_data (color3_t *ctx, uint8_t wr_addr, uint16_t wr_data) |
Normal write data function. More... | |
void | color3_special_wr_data (color3_t *ctx, uint8_t wr_addr, uint16_t wr_data) |
Special write function. More... | |
uint16_t | color3_read_data (color3_t *ctx, uint8_t rd_addr) |
Read data function. More... | |
void | color3_write_enable_register (color3_t *ctx, uint8_t wr_data) |
Write Enable Register function. More... | |
uint8_t | color3_read_enable_register (color3_t *ctx) |
Read Enable Register function. More... | |
void | color3_write_rgbc_timing_register (color3_t *ctx, uint8_t wr_data) |
Write RGBC Timing Register function. More... | |
uint8_t | color3_read_rgbc_timing_register (color3_t *ctx) |
Read RGBC Timing Register function. More... | |
void | color3_write_proxy_timing_register (color3_t *ctx) |
Write Proximity Timing Register function. More... | |
uint8_t | color3_read_proxy_timing_register (color3_t *ctx) |
Read Proximity Timing Register function. More... | |
void | color3_write_wait_time_register (color3_t *ctx, uint8_t wr_data) |
Write Wait Time Register function. More... | |
uint8_t | color3_read_wait_time_register (color3_t *ctx) |
Read Wait Time Register function. More... | |
void | color3_set_inter_trsh_lo_val (color3_t *ctx, uint16_t wr_data) |
RGBC interrupt threshold low value function. More... | |
void | color3_set_inter_trsh_hi_val (color3_t *ctx, uint16_t wr_data) |
RGBC interrupt threshold high value function. More... | |
void | color3_set_proxy_inter_trsh_lo_val (color3_t *ctx, uint16_t wr_data) |
Proximity interrupt threshold low value function. More... | |
void | color3_set_proxy_inter_trsh_hi_val (color3_t *ctx, uint16_t wr_data) |
Proximity interrupt threshold high value function. More... | |
void | color3_set_interrupt_persistence (color3_t *ctx, uint8_t int_pers) |
Set Interrupt persistence persistence function. More... | |
uint8_t | color3_read_interrupt_persistence (color3_t *ctx) |
Read Interrupt persistence function. More... | |
void | color3_setproxy_interrupt_persistence (color3_t *ctx, uint8_t int_pers) |
Set Proximity interrupt persistence function. More... | |
uint8_t | color3_read_proxy_interrupt_persistence (color3_t *ctx) |
Read Proximity interrupt persistence function. More... | |
void | color3_setLongWait (color3_t *ctx, uint8_t lon_wait) |
Set long wait function. More... | |
uint8_t | color3_read_long_wait (color3_t *ctx) |
Read long wait function. More... | |
void | color3_write_pulse_cnt (color3_t *ctx, uint8_t pulse_cnt) |
Write Proximity Pulse Count function. More... | |
uint8_t | color3_read_pulse_cnt (color3_t *ctx) |
Read Proximity Pulse Count function. More... | |
void | color3_write_rgbc_gain (color3_t *ctx, uint8_t gain_val) |
Write RGBC Gain Value function. More... | |
uint8_t | color3_read_rgbc_gain (color3_t *ctx) |
Read RGBC Gain Value function. More... | |
void | color3_set_diode_select (color3_t *ctx, uint8_t dio_sel) |
Set Diode Selection function. More... | |
uint8_t | color3_get_diode_select (color3_t *ctx) |
Get Diode Selection function. More... | |
void | color3_set_led_str (color3_t *ctx, uint8_t led_str) |
Set LED Strength function. More... | |
uint8_t | color3_read_led_str (color3_t *ctx) |
Read LED Strength function. More... | |
uint8_t | color3_read_dev_id (color3_t *ctx) |
Read device ID function. More... | |
uint8_t | color3_read_dev_stat (color3_t *ctx) |
Read device status function. More... | |
uint16_t | color3_read_clear_data (color3_t *ctx) |
Read clear data function. More... | |
uint16_t | color3_read_red_data (color3_t *ctx) |
Read red data function. More... | |
uint16_t | color3_read_green_data (color3_t *ctx) |
Read green data function. More... | |
uint16_t | color3_read_blue_data (color3_t *ctx) |
Read blue data function. More... | |
uint16_t | color3_read_proxy_data (color3_t *ctx) |
ead proximity data function. More... | |
uint8_t | color3_get_inter_state (color3_t *ctx) |
Get Interrupt state function. More... | |
void | color3_set_default_settings (color3_t *ctx) |
Default settings function. More... | |
void | color3_get_rgb_data (color3_t *ctx, uint16_t *red_data, uint16_t *green_data, uint16_t *blue_data) |
Get color data function. More... | |
float | color3_get_color_ratio (color3_t *ctx, uint16_t color_data) |
Get color ratio function. More... | |
float | color3_get_color_value (color3_t *ctx) |
Get color value function. More... | |
void | color3_get_crgb_data (color3_t *ctx, color3_const_t *data_const) |
Get CRBG data function. More... | |
uint8_t | color3_get_color (float color_value) |
Detect color. More... | |
void color3_cfg_setup | ( | color3_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void color3_generic_read | ( | color3_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 color3_generic_write | ( | color3_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 color3_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 color3_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 color3_get_color_ratio | ( | color3_t * | ctx, |
uint16_t | color_data | ||
) |
Get color ratio function.
ctx | Click object. |
color_data | 16-bit data that represents colorr data. |
@description This function reads data from the desired register.
float color3_get_color_value | ( | color3_t * | ctx | ) |
Get color value function.
ctx | Click object. |
@description Function is used to calculate HSL color.
void color3_get_crgb_data | ( | color3_t * | ctx, |
color3_const_t * | data_const | ||
) |
Get CRBG data function.
ctx | Click object. |
clear_data | 16-bit data that represents clear data. |
red_data | 16-bit data that represents red data. |
green_data | 16-bit data that represents green data. |
blue_data | 16-bit data that represents blue data. |
@description Function is used to read clear, red, blue and green data values.
uint8_t color3_get_diode_select | ( | color3_t * | ctx | ) |
Get Diode Selection function.
ctx | Click object. |
@description Function is used to check diode selection.
uint8_t color3_get_inter_state | ( | color3_t * | ctx | ) |
Get Interrupt state function.
ctx | Click object. |
@description Function is used to check if an interrupt has occured.
void color3_get_rgb_data | ( | color3_t * | ctx, |
uint16_t * | red_data, | ||
uint16_t * | green_data, | ||
uint16_t * | blue_data | ||
) |
Get color data function.
ctx | Click object. |
red_data | 16-bit data that represents red data. |
green_data | 16-bit data that represents green data. |
blue_data | 16-bit data that represents blue data. |
@description Function is used to read red, green and blue data.
COLOR3_RETVAL color3_init | ( | color3_t * | ctx, |
color3_cfg_t * | cfg | ||
) |
Initialization function.
color3 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void color3_normal_wr_byte | ( | color3_t * | ctx, |
uint8_t | wr_addr, | ||
uint8_t | wr_data | ||
) |
Generic read function.
ctx | Normal write byte function. |
wrAddr | 8-bit register address. |
wrData | 8-bit data to be written into register. |
@description Function writes 2 bytes of data, with normal settings.
void color3_normal_wr_data | ( | color3_t * | ctx, |
uint8_t | wr_addr, | ||
uint16_t | wr_data | ||
) |
Normal write data function.
ctx | Click object. |
wr_addr | 8-bit register address. |
wr_ata | 16-bit data to be written into registers. |
@description Function writes 2 bytes of data, with normal settings.
uint16_t color3_read_blue_data | ( | color3_t * | ctx | ) |
Read blue data function.
ctx | Click object. |
@description Function is used to read blue data.
uint8_t color3_read_byte | ( | color3_t * | ctx, |
uint8_t | rd_addr | ||
) |
Read byte function.
ctx | Click object. |
rd_addr | 8-bit register address. |
@description Function reads single byte of data from specified register.
uint16_t color3_read_clear_data | ( | color3_t * | ctx | ) |
Read clear data function.
ctx | Click object. |
@description Function is used to read clear data.
uint16_t color3_read_data | ( | color3_t * | ctx, |
uint8_t | rd_addr | ||
) |
Read data function.
ctx | Click object. |
rd_addr | 8-bit register address. |
@description Function reads 2 bytes of data from specified registers.
uint8_t color3_read_dev_id | ( | color3_t * | ctx | ) |
Read device ID function.
ctx | Click object. |
@description Function is used to read the device's unique ID number.
uint8_t color3_read_dev_stat | ( | color3_t * | ctx | ) |
Read device status function.
ctx | Click object. |
@description Function is used to read the contents of device status register.
uint8_t color3_read_enable_register | ( | color3_t * | ctx | ) |
Read Enable Register function.
ctx | Click object. |
@description Function is used to read from enable register.
uint16_t color3_read_green_data | ( | color3_t * | ctx | ) |
Read green data function.
ctx | Click object. |
@description Function is used to read green data.
uint8_t color3_read_interrupt_persistence | ( | color3_t * | ctx | ) |
Read Interrupt persistence function.
ctx | Click object. |
@description Function is used to check RGBC interrupt persistence settings.
uint8_t color3_read_led_str | ( | color3_t * | ctx | ) |
Read LED Strength function.
ctx | Click object. |
@description Function is used to check LED drive strength.
uint8_t color3_read_long_wait | ( | color3_t * | ctx | ) |
Read long wait function.
ctx | Click object. |
@description Function is used to check if the long wait is enabled or disabled.
uint16_t color3_read_proxy_data | ( | color3_t * | ctx | ) |
ead proximity data function.
ctx | Click object. |
@description Function is used to read proximity data.
uint8_t color3_read_proxy_interrupt_persistence | ( | color3_t * | ctx | ) |
Read Proximity interrupt persistence function.
ctx | Click object. |
@description Function is used to check proximity interrupt persistence settings.
uint8_t color3_read_proxy_timing_register | ( | color3_t * | ctx | ) |
Read Proximity Timing Register function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description Function is used to read from proximity timing register.
uint8_t color3_read_pulse_cnt | ( | color3_t * | ctx | ) |
Read Proximity Pulse Count function.
ctx | Click object. |
@description Function is used to check set number of proximity pulses that will be transmitted.
uint16_t color3_read_red_data | ( | color3_t * | ctx | ) |
Read red data function.
ctx | Click object. |
@description Function is used to read red data.
uint8_t color3_read_rgbc_gain | ( | color3_t * | ctx | ) |
Read RGBC Gain Value function.
ctx | Click object. |
@description Function is used to check RGBC Gain Value.
uint8_t color3_read_rgbc_timing_register | ( | color3_t * | ctx | ) |
Read RGBC Timing Register function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description Function is used to read from RGBC timing register..
uint8_t color3_read_wait_time_register | ( | color3_t * | ctx | ) |
Read Wait Time Register function.
ctx | Click object. |
@description Function is used to read from wait time register.
void color3_set_default_settings | ( | color3_t * | ctx | ) |
Default settings function.
ctx | Click object. |
@description Function is used to apply default settings.
void color3_set_diode_select | ( | color3_t * | ctx, |
uint8_t | dio_sel | ||
) |
Set Diode Selection function.
ctx | Click object. |
dio_sel | 8-bit data that is written into control register. |
@description Function is used to perform diode selection.
void color3_set_inter_trsh_hi_val | ( | color3_t * | ctx, |
uint16_t | wr_data | ||
) |
RGBC interrupt threshold high value function.
ctx | Click object. |
wr_data | 16-bit data to be written into RGBC interrupt threshold high value registers. |
@description Function is used to set RGBC interrupt threshold high value.
void color3_set_inter_trsh_lo_val | ( | color3_t * | ctx, |
uint16_t | wr_data | ||
) |
RGBC interrupt threshold low value function.
ctx | Click object. |
wr_data | 16-bit data to be written into RGBC interrupt threshold low value registers. |
@description Function is used to set RGBC interrupt threshold low value.
void color3_set_interrupt_persistence | ( | color3_t * | ctx, |
uint8_t | int_pers | ||
) |
Set Interrupt persistence persistence function.
ctx | Click object. |
int_pers | 8-bit data to be written into wait time register. |
@description Function is used to control the filtering interrupt capabilities of the device.
void color3_set_led_str | ( | color3_t * | ctx, |
uint8_t | led_str | ||
) |
Set LED Strength function.
ctx | Click object. |
led_str | 8-bit data that is written into control register. |
@description Function is used to set LED drive strength.
void color3_set_proxy_inter_trsh_hi_val | ( | color3_t * | ctx, |
uint16_t | wr_data | ||
) |
Proximity interrupt threshold high value function.
ctx | Click object. |
wr_data | 16-bit data to be written into proximity interrupt threshold high value registers. |
@description Function is used to set proximity interrupt threshold high value.
void color3_set_proxy_inter_trsh_lo_val | ( | color3_t * | ctx, |
uint16_t | wr_data | ||
) |
Proximity interrupt threshold low value function.
ctx | Click object. |
wr_data | 16-bit data to be written into proximity interrupt threshold low value registers. |
@description Function is used to set proximity interrupt threshold low value.
void color3_setLongWait | ( | color3_t * | ctx, |
uint8_t | lon_wait | ||
) |
Set long wait function.
ctx | Click object. |
lon_wait | 8-bit data that is written into configuration register. |
@description Function is used to enable or disable long wait by writing into configuration register.
void color3_setproxy_interrupt_persistence | ( | color3_t * | ctx, |
uint8_t | int_pers | ||
) |
Set Proximity interrupt persistence function.
ctx | Click object. |
int_pers | 8-bit data that represents proximity interrupt persistence. |
@description Function is used to control the filtering interrupt capabilities of the device.
void color3_special_wr_byte | ( | color3_t * | ctx, |
uint8_t | wr_addr, | ||
uint8_t | wr_data | ||
) |
Special write byte function.
ctx | Click object. |
wrAddr | 8-bit register address. |
wrData | 8-bit data to be written into register. |
@description Function writes 2 bytes of data, with special settings.
void color3_special_wr_data | ( | color3_t * | ctx, |
uint8_t | wr_addr, | ||
uint16_t | wr_data | ||
) |
Special write function.
ctx | Click object. |
wr_addr | 8-bit register address. |
wr_data | 16-bit data to be written into registers. |
@description Function writes 2 bytes of data, with special settings.
void color3_write_enable_register | ( | color3_t * | ctx, |
uint8_t | wr_data | ||
) |
Write Enable Register function.
ctx | Click object. |
wr_data | 8-bit data to be written into enable register. |
@description Function is used to write into enable register.
void color3_write_proxy_timing_register | ( | color3_t * | ctx | ) |
Write Proximity Timing Register function.
ctx | Click object. |
wr_data | 8-bit data to be written into proximity timing register. |
@description Function is used to write into proximity timing register.
void color3_write_pulse_cnt | ( | color3_t * | ctx, |
uint8_t | pulse_cnt | ||
) |
Write Proximity Pulse Count function.
ctx | Click object. |
pulse_cnt | 8-bit data that is written into proximity pulse count register. |
@description Function sets the number of proximity pulses that will be transmitted.
void color3_write_rgbc_gain | ( | color3_t * | ctx, |
uint8_t | gain_val | ||
) |
Write RGBC Gain Value function.
ctx | Click object. |
gain_val | 8-bit data that is written into control register. |
@description Function is used to set RGBC Gain Value.
void color3_write_rgbc_timing_register | ( | color3_t * | ctx, |
uint8_t | wr_data | ||
) |
Write RGBC Timing Register function.
ctx | Click object. |
wr_data | 8-bit data to be written into RGBC timing register. |
@description Function is used to write into RGBC timing register.
void color3_write_wait_time_register | ( | color3_t * | ctx, |
uint8_t | wr_data | ||
) |
Write Wait Time Register function.
ctx | Click object. |
wr_data | 8-bit data to be written into wait time register. |
@description Function is used to write into wait time register.