color13
2.0.0.0
|
API for configuring and manipulating Color 13 Click driver. More...
Modules | |
Color 13 Registers List | |
List of registers of Color 13 Click driver. | |
Color 13 Registers Settings | |
Settings for registers of Color 13 Click driver. | |
Color 13 MikroBUS Map | |
MikroBUS pin mapping of Color 13 Click driver. | |
Functions | |
void | color13_cfg_setup (color13_cfg_t *cfg) |
Color 13 configuration object setup function. More... | |
err_t | color13_init (color13_t *ctx, color13_cfg_t *cfg) |
Color 13 initialization function. More... | |
err_t | color13_generic_write (color13_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
Color 13 I2C writing function. More... | |
err_t | color13_generic_read (color13_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
Color 13 I2C reading function. More... | |
uint8_t | color13_get_int (color13_t *ctx) |
Get interrupt pin state. More... | |
err_t | color13_get_proximity (color13_t *ctx, uint16_t *ps_data) |
Read proximity data from device. More... | |
err_t | color13_get_als (color13_t *ctx, float *als_data) |
Read lux data from device. More... | |
err_t | color13_ls_color (color13_t *ctx, uint8_t ls_reg, uint32_t *ls_data) |
Read ls data from color registers. More... | |
err_t | color13_get_rgb_ir (color13_t *ctx, color13_color_t *color_data) |
Read color data from device. More... | |
float | color13_get_als_resolution (color13_t *ctx) |
Get resolution for the lux calculation. More... | |
API for configuring and manipulating Color 13 Click driver.
void color13_cfg_setup | ( | color13_cfg_t * | cfg | ) |
Color 13 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See color13_cfg_t object definition for detailed explanation. |
err_t color13_generic_read | ( | color13_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len | ||
) |
Color 13 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 color13_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t color13_generic_write | ( | color13_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len | ||
) |
Color 13 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 color13_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.err_t color13_get_als | ( | color13_t * | ctx, |
float * | als_data | ||
) |
Read lux data from device.
This function reads adc data and calculates lux data from device.
[in] | ctx | : Click context object. See color13_t object definition for detailed explanation. |
[out] | als_data | : Output read data. |
0
- Success, -1
- Error.float color13_get_als_resolution | ( | color13_t * | ctx | ) |
Get resolution for the lux calculation.
Function reads configuration from device and returns corresponding lux resolution, and sets member lux_resolution of context object.
[in,out] | ctx | : Click context object. See color13_t object definition for detailed explanation. |
[out] | ps_data | : Output read data. |
uint8_t color13_get_int | ( | color13_t * | ctx | ) |
Get interrupt pin state.
Read int_pin state.
[in] | ctx | : Click context object. See color13_t object definition for detailed explanation. |
err_t color13_get_proximity | ( | color13_t * | ctx, |
uint16_t * | ps_data | ||
) |
Read proximity data from device.
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 color13_t object definition for detailed explanation. |
[out] | ps_data | : Output read data. |
0
- Success, -1
- Error, -2
- Overflow, -4
- Error configuration.err_t color13_get_rgb_ir | ( | color13_t * | ctx, |
color13_color_t * | color_data | ||
) |
Read color data from device.
This function reads red, green, blue, and ir registers data and sets data in color_data object.
[in] | ctx | : Click context object. See color13_t object definition for detailed explanation. |
[out] | color_data | : Color data object. See color13_color_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t color13_init | ( | color13_t * | ctx, |
color13_cfg_t * | cfg | ||
) |
Color 13 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See color13_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See color13_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t color13_ls_color | ( | color13_t * | ctx, |
uint8_t | ls_reg, | ||
uint32_t * | ls_data | ||
) |
Read ls data from color registers.
This function reads data from reg, green, blue or ir registers and returns data to ls_data.
[in] | ctx | : Click context object. See color13_t object definition for detailed explanation. |
[in] | ls_reg | : LSB register address of data. |
[out] | ls_data | : Output read data. |
0
- Success, -1
- Error, -3
- Error Parameter.