color16
2.1.0.0
|
API for configuring and manipulating Color 16 Click driver. More...
Modules | |
Color 16 Registers List | |
List of registers of Color 16 Click driver. | |
Color 16 Registers Settings | |
Settings for registers of Color 16 Click driver. | |
Color 16 MikroBUS Map | |
MikroBUS pin mapping of Color 16 Click driver. | |
Functions | |
void | color16_cfg_setup (color16_cfg_t *cfg) |
Color 16 configuration object setup function. More... | |
err_t | color16_init (color16_t *ctx, color16_cfg_t *cfg) |
Color 16 initialization function. More... | |
err_t | color16_default_cfg (color16_t *ctx) |
Color 16 default configuration function. More... | |
err_t | color16_generic_write (color16_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Color 16 I2C writing function. More... | |
err_t | color16_generic_read (color16_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Color 16 I2C reading function. More... | |
err_t | color16_write_register (color16_t *ctx, uint8_t reg, uint8_t data_in) |
Color 16 write register function. More... | |
err_t | color16_read_register (color16_t *ctx, uint8_t reg, uint8_t *data_out) |
Color 16 read register function. More... | |
err_t | color16_write_register_word (color16_t *ctx, uint8_t reg, uint16_t data_in) |
Color 16 write register word function. More... | |
err_t | color16_read_register_word (color16_t *ctx, uint8_t reg, uint16_t *data_out) |
Color 16 read register word function. More... | |
err_t | color16_check_communication (color16_t *ctx) |
Color 16 check communication function. More... | |
void | color16_set_ldr_pin (color16_t *ctx, uint8_t state) |
Color 16 set ldr pin function. More... | |
uint8_t | color16_get_int_pin (color16_t *ctx) |
Color 16 get int pin function. More... | |
err_t | color16_set_reg_bank_access (color16_t *ctx, uint8_t reg_bank) |
Color 16 set reg bank access function. More... | |
err_t | color16_disable_ext_led (color16_t *ctx) |
Color 16 disable ext led function. More... | |
err_t | color16_enable_ext_led (color16_t *ctx, uint8_t led_curr) |
Color 16 enable ext led function. More... | |
err_t | color16_set_integration_time_ms (color16_t *ctx, float int_time_ms) |
Color 16 set integration time ms function. More... | |
err_t | color16_set_wait_time_ms (color16_t *ctx, float wait_time_ms) |
Color 16 set wait time ms function. More... | |
err_t | color16_read_data (color16_t *ctx, color16_data_t *data_out) |
Color 16 read data function. More... | |
API for configuring and manipulating Color 16 Click driver.
void color16_cfg_setup | ( | color16_cfg_t * | cfg | ) |
Color 16 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See color16_cfg_t object definition for detailed explanation. |
err_t color16_check_communication | ( | color16_t * | ctx | ) |
Color 16 check communication function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See color16_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color16_default_cfg | ( | color16_t * | ctx | ) |
Color 16 default configuration function.
This function executes a default configuration of Color 16 click board.
[in] | ctx | : Click context object. See color16_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color16_disable_ext_led | ( | color16_t * | ctx | ) |
Color 16 disable ext led function.
This function disables the onboard LED.
[in] | ctx | : Click context object. See color16_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color16_enable_ext_led | ( | color16_t * | ctx, |
uint8_t | led_curr | ||
) |
Color 16 enable ext led function.
This function enables the onboard LED with the selected led driver current.
[in] | ctx | : Click context object. See color16_t object definition for detailed explanation. |
[in] | led_curr | : LED Driver current in mA [4-258]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color16_generic_read | ( | color16_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
Color 16 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 color16_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 color16_generic_write | ( | color16_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
Color 16 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 color16_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 color16_get_int_pin | ( | color16_t * | ctx | ) |
Color 16 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See color16_t object definition for detailed explanation. |
err_t color16_init | ( | color16_t * | ctx, |
color16_cfg_t * | cfg | ||
) |
Color 16 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See color16_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See color16_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color16_read_data | ( | color16_t * | ctx, |
color16_data_t * | data_out | ||
) |
Color 16 read data function.
This function checks if the spectral measurement data is ready and then reads data from all channels along with the STATUS and ASTATUS bytes.
[in] | ctx | : Click context object. See color16_t object definition for detailed explanation. |
[out] | data_out | : Spectral measurements data object. See color16_data_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color16_read_register | ( | color16_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
Color 16 read register function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See color16_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color16_read_register_word | ( | color16_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out | ||
) |
Color 16 read register word function.
This function reads a data word starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See color16_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data word. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color16_set_integration_time_ms | ( | color16_t * | ctx, |
float | int_time_ms | ||
) |
Color 16 set integration time ms function.
This function sets the integration time in milliseconds by setting the ATIME and ASTEP registers.
[in] | ctx | : Click context object. See color16_t object definition for detailed explanation. |
[in] | int_time_ms | : Integration time in milliseconds [from COLOR16_INTEGRATION_TIME_MIN to COLOR16_INTEGRATION_TIME_MAX]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void color16_set_ldr_pin | ( | color16_t * | ctx, |
uint8_t | state | ||
) |
Color 16 set ldr pin function.
This function sets the LDR pin logic state.
[in] | ctx | : Click context object. See color16_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t color16_set_reg_bank_access | ( | color16_t * | ctx, |
uint8_t | reg_bank | ||
) |
Color 16 set reg bank access function.
This function sets the register bank access.
[in] | ctx | : Click context object. See color16_t object definition for detailed explanation. |
[in] | reg_bank | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color16_set_wait_time_ms | ( | color16_t * | ctx, |
float | wait_time_ms | ||
) |
Color 16 set wait time ms function.
This function sets the wait time in milliseconds by setting the WTIME register.
[in] | ctx | : Click context object. See color16_t object definition for detailed explanation. |
[in] | wait_time_ms | : Wait time in milliseconds [from COLOR16_WAIT_TIME_MIN to COLOR16_WAIT_TIME_MAX]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color16_write_register | ( | color16_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
Color 16 write register function.
This function writes a desired data to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See color16_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. err_t color16_write_register_word | ( | color16_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in | ||
) |
Color 16 write register word function.
This function writes a data word starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See color16_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data word to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.