|
color11 2.2.0
|
API for configuring and manipulating Color 11 Click driver. More...
Topics | |
| Color 11 Registers List | |
| List of registers of Color 11 Click driver. | |
| Color 11 Registers Settings | |
| Settings for registers of Color 11 Click driver. | |
| Color 11 MikroBUS Map | |
| MikroBUS pin mapping of Color 11 Click driver. | |
Functions | |
| void | color11_cfg_setup (color11_cfg_t *cfg) |
| Color 11 configuration object setup function. | |
| err_t | color11_init (color11_t *ctx, color11_cfg_t *cfg) |
| Color 11 initialization function. | |
| err_t | color11_default_cfg (color11_t *ctx) |
| Color 11 default configuration function. | |
| err_t | color11_generic_write (color11_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
| Color 11 I2C writing function. | |
| err_t | color11_generic_read (color11_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
| Color 11 I2C reading function. | |
| err_t | color11_get_identification (color11_t *ctx, color11_identification_t *id) |
| Color 11 get identification function. | |
| err_t | color11_set_als_thold (color11_t *ctx, uint16_t l_thold, uint16_t h_thold) |
| Color 11 set ALS interrupt threshold function. | |
| err_t | color11_set_power_ctrl (color11_t *ctx, color11_pwr_ctrl_t pwr, color11_pwr_ctrl_t aen, color11_pwr_ctrl_t wen, color11_pwr_ctrl_t fden) |
| Color 11 set power control function. | |
| err_t | color11_set_als_step (color11_t *ctx, uint32_t als_step) |
| Color 11 set ALS step function. | |
| err_t | color11_get_als_step (color11_t *ctx, uint32_t *als_step) |
| Color 11 get ALS step function. | |
| err_t | color11_set_als_wait (color11_t *ctx, uint8_t wait_time) |
| Color 11 set ALS wait time function. | |
| err_t | color11_set_als_time (color11_t *ctx, uint32_t als_time) |
| Color 11 set ALS integration time function. | |
| err_t | color11_get_als_time (color11_t *ctx, float *als_time) |
| Color 11 get ALS integration time function. | |
| err_t | color11_set_gain (color11_t *ctx, color11_again_t gain) |
| Color 11 set gain function. | |
| err_t | color11_get_gain (color11_t *ctx, uint8_t *gain) |
| Color 11 get gain function. | |
| err_t | color11_set_interrupt (color11_t *ctx, uint8_t intenab) |
| Color 11 set interrupt function. | |
| err_t | color11_get_data_valid_status (color11_t *ctx, uint8_t *status) |
| Color 11 get data valid status function. | |
| err_t | color11_get_als_data (color11_t *ctx, color11_als_data_t *als_data) |
| Color 11 get ALS data function. | |
| err_t | color11_get_ir (color11_t *ctx, float *ir) |
| Color 11 get IR data function. | |
| err_t | color11_get_illuminance (color11_t *ctx, float *lux) |
| Color 11 get illuminance function. | |
| uint8_t | color11_get_interrupt (color11_t *ctx) |
| Color 11 get interrupt function. | |
API for configuring and manipulating Color 11 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void color11_cfg_setup | ( | color11_cfg_t * | cfg | ) |
Color 11 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See color11_cfg_t object definition for detailed explanation. |
| err_t color11_default_cfg | ( | color11_t * | ctx | ) |
Color 11 default configuration function.
This function executes a default configuration of Color 11 Click board.
| [in] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t color11_generic_read | ( | color11_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out, | ||
| uint8_t | len ) |
Color 11 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 color11_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 color11_generic_write | ( | color11_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_in, | ||
| uint8_t | len ) |
Color 11 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 color11_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. | err_t color11_get_als_data | ( | color11_t * | ctx, |
| color11_als_data_t * | als_data ) |
Color 11 get ALS data function.
This function reads the all ALS channel and get ALS data values of the TCS3408, ALS/Color Sensor with Selective Flicker Detection on the Color 11 Click board™.
| [in] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
| [out] | als_data | : ALS data values. See color11_als_data_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t color11_get_als_step | ( | color11_t * | ctx, |
| uint32_t * | als_step ) |
Color 11 get ALS step function.
This function reads a ALS integration time step size of the TCS3408, ALS/Color Sensor with Selective Flicker Detection on the Color 11 Click board™.
| [in] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
| [out] | als_step | : Step size [2780-182000000ns]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t color11_get_als_time | ( | color11_t * | ctx, |
| float * | als_time ) |
Color 11 get ALS integration time function.
This function reads a ALS integration time of the TCS3408, ALS/Color Sensor with Selective Flicker Detection on the Color 11 Click board™.
| [in] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
| [in] | als_time | : ALS time [0-32768000us]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t color11_get_data_valid_status | ( | color11_t * | ctx, |
| uint8_t * | status ) |
Color 11 get data valid status function.
This function reads the data valid status of the TCS3408, ALS/Color Sensor with Selective Flicker Detection on the Color 11 Click board™.
| [in] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
| [out] | status | : Data valid status. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t color11_get_gain | ( | color11_t * | ctx, |
| uint8_t * | gain ) |
Color 11 get gain function.
This function reads the ALS sensitivity of the TCS3408, ALS/Color Sensor with Selective Flicker Detection on the Color 11 Click board™.
| [in] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
| [out] | gain | : ALS sensitivity [0-12]. See color11_again_t definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t color11_get_identification | ( | color11_t * | ctx, |
| color11_identification_t * | id ) |
Color 11 get identification function.
This function reads a identification data of the TCS3408, ALS/Color Sensor with Selective Flicker Detection on the Color 11 Click board™.
| [in] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
| [out] | id | : Identification data. See color11_identification_t definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t color11_get_illuminance | ( | color11_t * | ctx, |
| float * | lux ) |
Color 11 get illuminance function.
This function reads the all ALS channel and calculate illuminance data values of the TCS3408, ALS/Color Sensor with Selective Flicker Detection on the Color 11 Click board™.
| [in] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
| [out] | lux | : Illuminance [lux]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | uint8_t color11_get_interrupt | ( | color11_t * | ctx | ) |
Color 11 get interrupt function.
This function gets states of the Interrupt (INT) pin of the TCS3408, ALS/Color Sensor with Selective Flicker Detection on the Color 11 Click board™.
| [in] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
0 - Low pin state, 1 - High pin state. See #err_t definition for detailed explanation. | err_t color11_get_ir | ( | color11_t * | ctx, |
| float * | ir ) |
Color 11 get IR data function.
This function reads the all ALS channel and calculate color temperature of the TCS3408, ALS/Color Sensor with Selective Flicker Detection on the Color 11 Click board™.
| [in] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
| [out] | ir | : color temperature data values. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t color11_init | ( | color11_t * | ctx, |
| color11_cfg_t * | cfg ) |
Color 11 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See color11_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t color11_set_als_step | ( | color11_t * | ctx, |
| uint32_t | als_step ) |
Color 11 set ALS step function.
This function sets a ALS integration time step size of the TCS3408, ALS/Color Sensor with Selective Flicker Detection on the Color 11 Click board™.
| [in] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
| [out] | als_step | : Step size [2780-182000000ns]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t color11_set_als_thold | ( | color11_t * | ctx, |
| uint16_t | l_thold, | ||
| uint16_t | h_thold ) |
Color 11 set ALS interrupt threshold function.
This function sets the ALS interrupt low and high threshold data of the TCS3408, ALS/Color Sensor with Selective Flicker Detection on the Color 11 Click board™.
| [in] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
| [in] | l_thold | : ALS interrupt low threshold data [0-65535]. |
| [in] | h_thold | : ALS interrupt high threshold data [0-65535]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t color11_set_als_time | ( | color11_t * | ctx, |
| uint32_t | als_time ) |
Color 11 set ALS integration time function.
This function sets a ALS integration time of the TCS3408, ALS/Color Sensor with Selective Flicker Detection on the Color 11 Click board™.
| [in] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
| [in] | als_time | : ALS time [0-32768000us]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t color11_set_als_wait | ( | color11_t * | ctx, |
| uint8_t | wait_time ) |
Color 11 set ALS wait time function.
This function sets a ALS wait time data value of the TCS3408, ALS/Color Sensor with Selective Flicker Detection on the Color 11 Click board™.
| [in] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
| [in] | wait_time | : Wait time [0-255], 2.844ms×(wait+1). |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t color11_set_gain | ( | color11_t * | ctx, |
| color11_again_t | gain ) |
Color 11 set gain function.
This function sets the ALS sensitivity of the TCS3408, ALS/Color Sensor with Selective Flicker Detection on the Color 11 Click board™.
| [in] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
| [in] | gain | : ALS sensitivity [0-12]. See color11_again_t definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t color11_set_interrupt | ( | color11_t * | ctx, |
| uint8_t | intenab ) |
Color 11 set interrupt function.
This function enable interrupt status of the ALS, flicker, saturation or system detect of the TCS3408, ALS/Color Sensor with Selective Flicker Detection on the Color 11 Click board™.
| [in] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
| [in] | intenab | : Interrupt detect status. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t color11_set_power_ctrl | ( | color11_t * | ctx, |
| color11_pwr_ctrl_t | pwr, | ||
| color11_pwr_ctrl_t | aen, | ||
| color11_pwr_ctrl_t | wen, | ||
| color11_pwr_ctrl_t | fden ) |
Color 11 set power control function.
This function sets the power on the device and enable the functions of the TCS3408, ALS/Color Sensor with Selective Flicker Detection on the Color 11 Click board™.
| [in] | ctx | : Click context object. See color11_t object definition for detailed explanation. |
| [in] | pwr | : Power ON. See color11_pwr_ctrl_t definition for detailed explanation. |
| [in] | aen | : Enables ALS/Color. See color11_pwr_ctrl_t definition for detailed explanation. |
| [in] | wen | : Activates the wait time. See color11_pwr_ctrl_t definition for detailed explanation. |
| [in] | fden | : Activates flicker detection. See color11_pwr_ctrl_t definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.