color3 2.0.0.0
|
Functions | |
void | color3_cfg_setup (color3_cfg_t *cfg) |
Config Object Initialization function. | |
err_t | color3_init (color3_t *ctx, color3_cfg_t *cfg) |
Initialization function. | |
err_t | color3_generic_write (color3_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Generic write function. | |
err_t | color3_generic_read (color3_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Generic read function. | |
void | color3_normal_wr_byte (color3_t *ctx, uint8_t wr_addr, uint8_t wr_data) |
Generic read function. | |
void | color3_special_wr_byte (color3_t *ctx, uint8_t wr_addr, uint8_t wr_data) |
Special write byte function. | |
uint8_t | color3_read_byte (color3_t *ctx, uint8_t rd_addr) |
Read byte function. | |
void | color3_normal_wr_data (color3_t *ctx, uint8_t wr_addr, uint16_t wr_data) |
Normal write data function. | |
void | color3_special_wr_data (color3_t *ctx, uint8_t wr_addr, uint16_t wr_data) |
Special write function. | |
uint16_t | color3_read_data (color3_t *ctx, uint8_t rd_addr) |
Read data function. | |
void | color3_write_enable_reg (color3_t *ctx, uint8_t wr_data) |
Write Enable Register function. | |
uint8_t | color3_read_enable_reg (color3_t *ctx) |
Read Enable Register function. | |
void | color3_write_rgbc_timing_reg (color3_t *ctx, uint8_t wr_data) |
Write RGBC Timing Register function. | |
uint8_t | color3_read_rgbc_timing_reg (color3_t *ctx) |
Read RGBC Timing Register function. | |
void | color3_write_prox_timing_reg (color3_t *ctx) |
Write Proximity Timing Register function. | |
uint8_t | color3_read_prox_timing_reg (color3_t *ctx) |
Read Proximity Timing Register function. | |
void | color3_write_wait_time_reg (color3_t *ctx, uint8_t wr_data) |
Write Wait Time Register function. | |
uint8_t | color3_read_wait_time_reg (color3_t *ctx) |
Read Wait Time Register function. | |
void | color3_set_inter_trsh_lo (color3_t *ctx, uint16_t wr_data) |
RGBC interrupt threshold low value function. | |
void | color3_set_inter_trsh_hi (color3_t *ctx, uint16_t wr_data) |
RGBC interrupt threshold high value function. | |
void | color3_set_prox_inter_trsh_lo (color3_t *ctx, uint16_t wr_data) |
Proximity interrupt threshold low value function. | |
void | color3_set_prox_inter_trsh_hi (color3_t *ctx, uint16_t wr_data) |
Proximity interrupt threshold high value function. | |
void | color3_set_int_pers (color3_t *ctx, uint8_t int_pers) |
Set Interrupt persistence persistence function. | |
uint8_t | color3_read_int_pers (color3_t *ctx) |
Read Interrupt persistence function. | |
void | color3_set_prox_int_pers (color3_t *ctx, uint8_t int_pers) |
Set Proximity interrupt persistence function. | |
uint8_t | color3_read_prox_int_pers (color3_t *ctx) |
Read Proximity interrupt persistence function. | |
void | color3_set_long_wait (color3_t *ctx, uint8_t lon_wait) |
Set long wait function. | |
uint8_t | color3_read_long_wait (color3_t *ctx) |
Read long wait function. | |
void | color3_write_pulse_cnt (color3_t *ctx, uint8_t pulse_cnt) |
Write Proximity Pulse Count function. | |
uint8_t | color3_read_pulse_cnt (color3_t *ctx) |
Read Proximity Pulse Count function. | |
void | color3_write_rgbc_gain (color3_t *ctx, uint8_t gain) |
Write RGBC Gain Value function. | |
uint8_t | color3_read_rgbc_gain (color3_t *ctx) |
Read RGBC Gain Value function. | |
void | color3_set_diode_select (color3_t *ctx, uint8_t dio_sel) |
Set Diode Selection function. | |
uint8_t | color3_get_diode_select (color3_t *ctx) |
Get Diode Selection function. | |
void | color3_set_led_str (color3_t *ctx, uint8_t led_str) |
Set LED Strength function. | |
uint8_t | color3_read_led_str (color3_t *ctx) |
Read LED Strength function. | |
uint8_t | color3_read_dev_id (color3_t *ctx) |
Read device ID function. | |
uint8_t | color3_read_dev_stat (color3_t *ctx) |
Read device status function. | |
uint16_t | color3_read_clear_data (color3_t *ctx) |
Read clear data function. | |
uint16_t | color3_read_red_data (color3_t *ctx) |
Read red data function. | |
uint16_t | color3_read_green_data (color3_t *ctx) |
Read green data function. | |
uint16_t | color3_read_blue_data (color3_t *ctx) |
Read blue data function. | |
uint16_t | color3_read_prox_data (color3_t *ctx) |
ead proximity data function. | |
uint8_t | color3_get_inter_state (color3_t *ctx) |
Get Interrupt state function. | |
void | color3_set_default_settings (color3_t *ctx) |
Default settings function. | |
void | color3_get_rgb_data (color3_t *ctx, uint16_t *red_data, uint16_t *green_data, uint16_t *blue_data) |
Get color data function. | |
float | color3_get_color_ratio (color3_t *ctx, uint16_t color_data) |
Get color ratio function. | |
err_t | color3_get_rgbc_data (color3_t *ctx, color3_channels_t *channels) |
Color 3 get rgbc data function. | |
uint8_t | color3_get_color (color3_hsl_t *hsl) |
Color 3 get color function. | |
void | color3_rgbc_to_hsl (color3_t *ctx, color3_channels_t *rgbc, color3_hsl_t *hsl) |
Color 3 rgbc to hsl function. | |
void color3_cfg_setup | ( | color3_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
err_t color3_generic_read | ( | color3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_out | Output data buf |
len | Number of the bytes to be read |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.err_t color3_generic_write | ( | color3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_in | Data buf to be written. |
len | Number of the bytes in data buf. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.uint8_t color3_get_color | ( | color3_hsl_t * | hsl | ) |
Color 3 get color function.
This function returns the color name flag from the input HSL color.
[out] | hsl | : HSL (hue, saturation, lightness) input value. See color3_hsl_t object definition for detailed explanation. |
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. |
This function reads data from the desired register.
uint8_t color3_get_diode_select | ( | color3_t * | ctx | ) |
Get Diode Selection function.
ctx | Click object. |
Function is used to check diode selection.
uint8_t color3_get_inter_state | ( | color3_t * | ctx | ) |
Get Interrupt state function.
ctx | Click object. |
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. |
Function is used to read red, green and blue data.
err_t color3_get_rgbc_data | ( | color3_t * | ctx, |
color3_channels_t * | channels ) |
Color 3 get rgbc data function.
This function reads data from 4 channels (Red, Green, Blue, Clear).
[in] | ctx | : Click context object. See color3_t object definition for detailed explanation. |
[out] | channels | : Channels output (Red, Green, Blue, Clear). See color3_channels_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color3_init | ( | color3_t * | ctx, |
color3_cfg_t * | cfg ) |
Initialization function.
color3 | Click object. |
cfg | Click configuration structure. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
Function is used to read the contents of device status register.
uint8_t color3_read_enable_reg | ( | color3_t * | ctx | ) |
Read Enable Register function.
ctx | Click object. |
Function is used to read from enable register.
uint16_t color3_read_green_data | ( | color3_t * | ctx | ) |
Read green data function.
ctx | Click object. |
Function is used to read green data.
uint8_t color3_read_int_pers | ( | color3_t * | ctx | ) |
Read Interrupt persistence function.
ctx | Click object. |
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. |
Function is used to check LED drive strength.
uint8_t color3_read_long_wait | ( | color3_t * | ctx | ) |
Read long wait function.
ctx | Click object. |
Function is used to check if the long wait is enabled or disabled.
uint16_t color3_read_prox_data | ( | color3_t * | ctx | ) |
ead proximity data function.
ctx | Click object. |
Function is used to read proximity data.
uint8_t color3_read_prox_int_pers | ( | color3_t * | ctx | ) |
Read Proximity interrupt persistence function.
ctx | Click object. |
Function is used to check proximity interrupt persistence settings.
uint8_t color3_read_prox_timing_reg | ( | 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 |
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. |
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. |
Function is used to read red data.
uint8_t color3_read_rgbc_gain | ( | color3_t * | ctx | ) |
Read RGBC Gain Value function.
ctx | Click object. |
Function is used to check RGBC Gain Value.
uint8_t color3_read_rgbc_timing_reg | ( | 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 |
Function is used to read from RGBC timing register..
uint8_t color3_read_wait_time_reg | ( | color3_t * | ctx | ) |
Read Wait Time Register function.
ctx | Click object. |
Function is used to read from wait time register.
void color3_rgbc_to_hsl | ( | color3_t * | ctx, |
color3_channels_t * | rgbc, | ||
color3_hsl_t * | hsl ) |
Color 3 rgbc to hsl function.
This function converts RGBC (red, green, blue, clear) to HSL (hue, saturation, lightness) color value.
[in] | ctx | : Click context object. See color3_t object definition for detailed explanation. |
[out] | rgbc | : RGBC (red, green, blue, clear) input value. See color3_channels_t object definition for detailed explanation. |
[out] | hsl | : HSL (hue, saturation, lightness) input value. See color3_hsl_t object definition for detailed explanation. |
void color3_set_default_settings | ( | color3_t * | ctx | ) |
Default settings function.
ctx | Click object. |
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. |
Function is used to perform diode selection.
void color3_set_int_pers | ( | 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. |
Function is used to control the filtering interrupt capabilities of the device.
void color3_set_inter_trsh_hi | ( | 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. |
Function is used to set RGBC interrupt threshold high value.
void color3_set_inter_trsh_lo | ( | 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. |
Function is used to set RGBC interrupt threshold low value.
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. |
Function is used to set LED drive strength.
void color3_set_long_wait | ( | 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. |
Function is used to enable or disable long wait by writing into configuration register.
void color3_set_prox_int_pers | ( | 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. |
Function is used to control the filtering interrupt capabilities of the device.
void color3_set_prox_inter_trsh_hi | ( | 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. |
Function is used to set proximity interrupt threshold high value.
void color3_set_prox_inter_trsh_lo | ( | 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. |
Function is used to set proximity interrupt threshold low value.
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. |
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. |
Function writes 2 bytes of data, with special settings.
void color3_write_enable_reg | ( | 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. |
Function is used to write into enable register.
void color3_write_prox_timing_reg | ( | color3_t * | ctx | ) |
Write Proximity Timing Register function.
ctx | Click object. |
wr_data | 8-bit data to be written into proximity timing register. |
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. |
Function sets the number of proximity pulses that will be transmitted.
void color3_write_rgbc_gain | ( | color3_t * | ctx, |
uint8_t | gain ) |
Write RGBC Gain Value function.
ctx | Click object. |
gain | 8-bit data that is written into control register. |
Function is used to set RGBC Gain Value.
void color3_write_rgbc_timing_reg | ( | 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. |
Function is used to write into RGBC timing register.
void color3_write_wait_time_reg | ( | 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. |
Function is used to write into wait time register.