color15
2.0.0.0
|
API for configuring and manipulating Color 15 Click driver. More...
Modules | |
Color 15 Registers List | |
List of registers of Color 15 Click driver. | |
Color 15 Registers Settings | |
Settings for registers of Color 15 Click driver. | |
Color 15 MikroBUS Map | |
MikroBUS pin mapping of Color 15 Click driver. | |
Functions | |
void | color15_cfg_setup (color15_cfg_t *cfg) |
Color 15 configuration object setup function. More... | |
err_t | color15_init (color15_t *ctx, color15_cfg_t *cfg) |
Color 15 initialization function. More... | |
err_t | color15_default_cfg (color15_t *ctx) |
Color 15 default configuration function. More... | |
err_t | color15_generic_write (color15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Color 15 I2C writing function. More... | |
err_t | color15_generic_read (color15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Color 15 I2C reading function. More... | |
err_t | color15_write_register (color15_t *ctx, uint8_t reg, uint8_t data_in) |
Color 15 write register function. More... | |
err_t | color15_read_register (color15_t *ctx, uint8_t reg, uint8_t *data_out) |
Color 15 read register function. More... | |
err_t | color15_check_communication (color15_t *ctx) |
Color 15 check communication function. More... | |
uint8_t | color15_get_int_pin (color15_t *ctx) |
Color 15 get int pin function. More... | |
err_t | color15_clear_interrupt (color15_t *ctx) |
Color 15 clear interrupt function. More... | |
err_t | color15_set_wait_time (color15_t *ctx, uint16_t wait_time) |
Color 15 set wait time function. More... | |
err_t | color15_set_cls_time (color15_t *ctx, uint8_t clsconv, uint8_t int_time) |
Color 15 set cls time function. More... | |
err_t | color15_get_data (color15_t *ctx, color15_channels_t *channels) |
Color 15 get data function. More... | |
uint8_t | color15_get_color (color15_hsl_t *hsl) |
Color 15 get color function. More... | |
void | color15_rgbw_to_hsl (color15_t *ctx, color15_channels_t *rgbw, color15_hsl_t *hsl) |
Color 15 rgbw to hsl function. More... | |
API for configuring and manipulating Color 15 Click driver.
void color15_cfg_setup | ( | color15_cfg_t * | cfg | ) |
Color 15 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See color15_cfg_t object definition for detailed explanation. |
err_t color15_check_communication | ( | color15_t * | ctx | ) |
Color 15 check communication function.
This function checks the communication by reading and verifying the product ID.
[in] | ctx | : Click context object. See color15_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color15_clear_interrupt | ( | color15_t * | ctx | ) |
Color 15 clear interrupt function.
This function clears all interrupt flags from INT_FLAG register.
[in] | ctx | : Click context object. See color15_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color15_default_cfg | ( | color15_t * | ctx | ) |
Color 15 default configuration function.
This function executes a default configuration of Color 15 click board.
[in] | ctx | : Click context object. See color15_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color15_generic_read | ( | color15_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
Color 15 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See color15_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color15_generic_write | ( | color15_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
Color 15 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See color15_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t color15_get_color | ( | color15_hsl_t * | hsl | ) |
Color 15 get color function.
This function returns the color name flag from the input HSL color.
[out] | hsl | : HSL (hue, saturation, lightness) input value. See color15_hsl_t object definition for detailed explanation. |
err_t color15_get_data | ( | color15_t * | ctx, |
color15_channels_t * | channels | ||
) |
Color 15 get data function.
This function reads data from 5 channels (Red, Green, Blue, White, IR).
[in] | ctx | : Click context object. See color15_t object definition for detailed explanation. |
[out] | channels | : Channels output (Red, Green, Blue, White, IR). See color15_channels_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t color15_get_int_pin | ( | color15_t * | ctx | ) |
Color 15 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See color15_t object definition for detailed explanation. |
err_t color15_init | ( | color15_t * | ctx, |
color15_cfg_t * | cfg | ||
) |
Color 15 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See color15_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See color15_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color15_read_register | ( | color15_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
Color 15 read register function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See color15_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output data read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void color15_rgbw_to_hsl | ( | color15_t * | ctx, |
color15_channels_t * | rgbw, | ||
color15_hsl_t * | hsl | ||
) |
Color 15 rgbw to hsl function.
This function converts RGBW (red, green, blue, white) to HSL (hue, saturation, lightness) color value.
[in] | ctx | : Click context object. See color15_t object definition for detailed explanation. |
[out] | rgbw | : RGBW (red, green, blue, white) input value. See color15_channels_t object definition for detailed explanation. |
[out] | hsl | : HSL (hue, saturation, lightness) input value. See color15_hsl_t object definition for detailed explanation. |
err_t color15_set_cls_time | ( | color15_t * | ctx, |
uint8_t | clsconv, | ||
uint8_t | int_time | ||
) |
Color 15 set cls time function.
This function sets the cls time and output data resolution in ctx->resolution.
[in] | ctx | : Click context object. See color15_t object definition for detailed explanation. |
[in] | clsconv | : CLSCONV bits settings [0x00-0x0F]. |
[in] | int_time | : INT_TIME bits settings [0x00-0x03]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color15_set_wait_time | ( | color15_t * | ctx, |
uint16_t | wait_time | ||
) |
Color 15 set wait time function.
This function sets the wait time.
[in] | ctx | : Click context object. See color15_t object definition for detailed explanation. |
[in] | wait_time | : Wait time in milliseconds [10-2560]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color15_write_register | ( | color15_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
Color 15 write register function.
This function writes a desired data to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See color15_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.