color8 2.0.0.0
Public function

Functions

void color8_cfg_setup (color8_cfg_t *cfg)
 Config Object Initialization function.
 
COLOR8_RETVAL color8_init (color8_t *ctx, color8_cfg_t *cfg)
 Initialization function.
 
void color8_generic_write (color8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void color8_generic_read (color8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void color8_write_byte (color8_t *ctx, uint8_t reg, uint8_t w_data)
 Functions for write one byte in register.
 
uint8_t color8_read_byte (color8_t *ctx, uint8_t reg)
 Functions for read one byte data from register.
 
uint8_t color8_get_interrupt (color8_t *ctx)
 Functions get interrupt.
 
uint16_t color8_read_data (color8_t *ctx, uint8_t reg_data)
 Functions for read data from register.
 
float color8_get_color_value (color8_t *ctx)
 Functions for read color value.
 
uint8_t color8_get_color (color8_t *ctx, float color_value)
 Functions for detect colors.
 

Detailed Description

Function Documentation

◆ color8_cfg_setup()

void color8_cfg_setup ( color8_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ color8_generic_read()

void color8_generic_read ( color8_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ color8_generic_write()

void color8_generic_write ( color8_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ color8_get_color()

uint8_t color8_get_color ( color8_t * ctx,
float color_value )

Functions for detect colors.

Parameters
ctxClick object.
color_valueColor value in HSL.

@description This function detect colors. PINK color - from 0.920 to 0.974 PURPLE color - from 0.6201 to 0.919 BLUE color - from 0.521 to 0.620 CYAN color - from 0.430 to 0.520 GREEN color - from 0.300 to 0.429 YELLOW color - from 0.019 to 0.200 RED color - from 0.0005 to 0.018

◆ color8_get_color_value()

float color8_get_color_value ( color8_t * ctx)

Functions for read color value.

Parameters
ctxClick object.

@description This functions reads 3 color filters and Clear Filters and converts the resulting color from RGB to HSL. The color range is between 0.00 and 1.0000.

◆ color8_get_interrupt()

uint8_t color8_get_interrupt ( color8_t * ctx)

Functions get interrupt.

Parameters
ctxClick object.

@description This function gets interrupt.

◆ color8_init()

COLOR8_RETVAL color8_init ( color8_t * ctx,
color8_cfg_t * cfg )

Initialization function.

Parameters
color8Click object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ color8_read_byte()

uint8_t color8_read_byte ( color8_t * ctx,
uint8_t reg )

Functions for read one byte data from register.

Parameters
ctxClick object.
regRegister address.

@description This function reads one byte data from register.

◆ color8_read_data()

uint16_t color8_read_data ( color8_t * ctx,
uint8_t reg_data )

Functions for read data from register.

Parameters
ctxClick object.
reg_dataRegister in which the data will be written.

@description This function reads data from register.

◆ color8_write_byte()

void color8_write_byte ( color8_t * ctx,
uint8_t reg,
uint8_t w_data )

Functions for write one byte in register.

Parameters
ctxClick object.
regRegister address.
w_dataData which be written in the register.

@description This function writes one byte in register.