color18
2.1.0.0
|
API for configuring and manipulating Color 18 Click driver. More...
Modules | |
Color 18 Registers List | |
List of registers of Color 18 Click driver. | |
Color 18 Registers Settings | |
Settings for registers of Color 18 Click driver. | |
Color 18 MikroBUS Map | |
MikroBUS pin mapping of Color 18 Click driver. | |
Functions | |
void | color18_cfg_setup (color18_cfg_t *cfg) |
Color 18 configuration object setup function. More... | |
err_t | color18_init (color18_t *ctx, color18_cfg_t *cfg) |
Color 18 initialization function. More... | |
err_t | color18_default_cfg (color18_t *ctx) |
Color 18 default configuration function. More... | |
err_t | color18_write_regs (color18_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Color 18 write regs function. More... | |
err_t | color18_read_regs (color18_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Color 18 read regs function. More... | |
err_t | color18_write_reg (color18_t *ctx, uint8_t reg, uint8_t data_in) |
Color 18 write reg function. More... | |
err_t | color18_read_reg (color18_t *ctx, uint8_t reg, uint8_t *data_out) |
Color 18 read reg function. More... | |
err_t | color18_write_reg_word (color18_t *ctx, uint8_t reg, uint16_t data_in) |
Color 18 write reg word function. More... | |
err_t | color18_read_reg_word (color18_t *ctx, uint8_t reg, uint16_t *data_out) |
Color 18 read reg word function. More... | |
err_t | color18_check_communication (color18_t *ctx) |
Color 18 check communication function. More... | |
void | color18_set_vsync_pin (color18_t *ctx, uint8_t state) |
Color 18 set vsync pin state function. More... | |
uint8_t | color18_get_int_pin (color18_t *ctx) |
Color 18 get int pin state function. More... | |
err_t | color18_soft_reset (color18_t *ctx) |
Color 18 soft reset function. More... | |
err_t | color18_clear_fifo (color18_t *ctx) |
Color 18 clear fifo function. More... | |
err_t | color18_read_fifo_size (color18_t *ctx, uint16_t *fifo_size) |
Color 18 read fifo size function. More... | |
err_t | color18_read_data (color18_t *ctx, color18_data_t *data_out) |
Color 18 read data function. More... | |
API for configuring and manipulating Color 18 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void color18_cfg_setup | ( | color18_cfg_t * | cfg | ) |
Color 18 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See color18_cfg_t object definition for detailed explanation. |
err_t color18_check_communication | ( | color18_t * | ctx | ) |
Color 18 check communication function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See color18_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color18_clear_fifo | ( | color18_t * | ctx | ) |
Color 18 clear fifo function.
This function clears the FIFO buffers and interrupts.
[in] | ctx | : Click context object. See color18_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color18_default_cfg | ( | color18_t * | ctx | ) |
Color 18 default configuration function.
This function executes a default configuration of Color 18 click board.
[in] | ctx | : Click context object. See color18_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t color18_get_int_pin | ( | color18_t * | ctx | ) |
Color 18 get int pin state function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See color18_t object definition for detailed explanation. |
err_t color18_init | ( | color18_t * | ctx, |
color18_cfg_t * | cfg | ||
) |
Color 18 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See color18_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See color18_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color18_read_data | ( | color18_t * | ctx, |
color18_data_t * | data_out | ||
) |
Color 18 read data function.
This function checks if the color measurement data are ready for all channels and reads them.
[in] | ctx | : Click context object. See color18_t object definition for detailed explanation. |
[out] | data_out | : Color measurements data object. See color18_data_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color18_read_fifo_size | ( | color18_t * | ctx, |
uint16_t * | fifo_size | ||
) |
Color 18 read fifo size function.
This function reads the number of data bytes available to read from FIFO.
[in] | ctx | : Click context object. See color18_t object definition for detailed explanation. |
[out] | fifo_size | : Number of data bytes available to read from FIFO. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color18_read_reg | ( | color18_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
Color 18 read reg function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See color18_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 color18_read_reg_word | ( | color18_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out | ||
) |
Color 18 read reg word function.
This function reads a data word starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See color18_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 color18_read_regs | ( | color18_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
Color 18 read regs 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 color18_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. void color18_set_vsync_pin | ( | color18_t * | ctx, |
uint8_t | state | ||
) |
Color 18 set vsync pin state function.
This function sets the VSYNC pin state.
[in] | ctx | : Click context object. See color18_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t color18_soft_reset | ( | color18_t * | ctx | ) |
Color 18 soft reset function.
This function executes the defice software reset command.
[in] | ctx | : Click context object. See color18_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t color18_write_reg | ( | color18_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
Color 18 write reg function.
This function writes a desired data to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See color18_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 color18_write_reg_word | ( | color18_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in | ||
) |
Color 18 write reg word function.
This function writes a data word starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See color18_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. err_t color18_write_regs | ( | color18_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
Color 18 write regs 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 color18_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.