color9 2.0.0.0
Public function

Functions

void color9_cfg_setup (color9_cfg_t *cfg)
 Config Object Initialization function.
 
COLOR9_RETVAL color9_init (color9_t *ctx, color9_cfg_t *cfg)
 Initialization function.
 
void color9_write (color9_t *ctx, uint8_t reg_addr, uint8_t r_data)
 Generic write function.
 
uint8_t color9_read (color9_t *ctx, uint8_t reg_addr)
 Generic read function.
 
void color9_sw_reset (color9_t *ctx)
 Software reset function.
 
uint32_t color9_get_Ir (color9_t *ctx)
 Get value of IR measurement reading.
 
uint32_t color9_get_green (color9_t *ctx)
 Gets value of Green measurement reading.
 
uint32_t color9_get_blue (color9_t *ctx)
 Gets value of Blue measurement reading.
 
uint32_t color9_get_red (color9_t *ctx)
 Gets value of Red measurement reading.
 
uint8_t color9_get_status_reg (color9_t *ctx)
 Status register value.
 
void color9_meas_rate (color9_t *ctx, uint8_t resolution, uint8_t meas_rate)
 Configure measurement rates.
 
void color9_reg_ctrl (color9_t *ctx, uint8_t cfg)
 Function for setting the main configuration register.
 
void color9_set_gain (color9_t *ctx, uint8_t g_setting)
 Function for gain setting.
 
void color9_int_config (color9_t *ctx, uint8_t int_select, uint8_t int_mode, uint8_t cfg_setting)
 Interrupt configuration.
 
void color9_sample_compare (color9_t *ctx, uint8_t num_of_compares)
 Configre number of compares between samples.
 
uint32_t color9_read_32 (color9_t *ctx, uint8_t reg_addr)
 Generic read function for 32 bits.
 
void color9_write_32 (color9_t *ctx, uint8_t reg_addr, uint32_t treas_val)
 Generic write function for 32 bits.
 
void color9_similarity_count (color9_t *ctx, uint8_t sim_set)
 Similarity count.
 
void color9_upper_tresset (color9_t *ctx, uint32_t set_val)
 Upper Tresset.
 
void color9_lower_tresset (color9_t *ctx, uint32_t set_val)
 Lower Tresset.
 

Detailed Description

Function Documentation

◆ color9_cfg_setup()

void color9_cfg_setup ( color9_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.

◆ color9_get_blue()

uint32_t color9_get_blue ( color9_t * ctx)

Gets value of Blue measurement reading.

Parameters
color9Click object.
Returns
Result.

@description This function gets Blue measurement reading.

◆ color9_get_green()

uint32_t color9_get_green ( color9_t * ctx)

Gets value of Green measurement reading.

Parameters
color9Click object.
Returns
Result.

@description This function gets Green measurement reading.

◆ color9_get_Ir()

uint32_t color9_get_Ir ( color9_t * ctx)

Get value of IR measurement reading.

Parameters
color9Click object.
Returns
Result

@description This function gets IR reading.

◆ color9_get_red()

uint32_t color9_get_red ( color9_t * ctx)

Gets value of Red measurement reading.

Parameters
color9Click object.
Returns
Result.

@description This function gets Red measurement reading.

◆ color9_get_status_reg()

uint8_t color9_get_status_reg ( color9_t * ctx)

Status register value.

Parameters
color9Click object.
Returns
Result.

@description This function gets status register value.

◆ color9_init()

COLOR9_RETVAL color9_init ( color9_t * ctx,
color9_cfg_t * cfg )

Initialization function.

Parameters
color9Click object.
cfgClick configuration structure.

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

◆ color9_int_config()

void color9_int_config ( color9_t * ctx,
uint8_t int_select,
uint8_t int_mode,
uint8_t cfg_setting )

Interrupt configuration.

Parameters
color9Click object.
int_selectSelects interrupt.
int_modeSelects mode.
cfg_settingConfiguration settings.

@description This function configures interrupt.

◆ color9_lower_tresset()

void color9_lower_tresset ( color9_t * ctx,
uint32_t set_val )

Lower Tresset.

Parameters
color9Click object.
set_valLower tresset value.

@description Sets lower tresset value.

◆ color9_meas_rate()

void color9_meas_rate ( color9_t * ctx,
uint8_t resolution,
uint8_t meas_rate )

Configure measurement rates.

Parameters
color9Click object.
resolutionResolution.
meas_rateMeasurement rate.

@description This function configures measurement rate.

◆ color9_read()

uint8_t color9_read ( color9_t * ctx,
uint8_t reg_addr )

Generic read function.

Parameters
color9Click object.
reg_addrRegister address to read from.
Returns
Result
@description This function reads from given address.

◆ color9_read_32()

uint32_t color9_read_32 ( color9_t * ctx,
uint8_t reg_addr )

Generic read function for 32 bits.

Parameters
color9Click object.
reg_addrAddress form which we read 32 bits.

@description This reads 32 bits from given address.

◆ color9_reg_ctrl()

void color9_reg_ctrl ( color9_t * ctx,
uint8_t cfg )

Function for setting the main configuration register.

Parameters
color9Click object.
cfgConfiguration register.

@description This function configures the main configuration register.

◆ color9_sample_compare()

void color9_sample_compare ( color9_t * ctx,
uint8_t num_of_compares )

Configre number of compares between samples.

Parameters
color9Click object.
num_of_comparesNumber of compares.

@description This function configures interrupt.

◆ color9_set_gain()

void color9_set_gain ( color9_t * ctx,
uint8_t g_setting )

Function for gain setting.

Parameters
color9Click object.
g_settingsGain settings.

@description This function configures the gain settings.

◆ color9_similarity_count()

void color9_similarity_count ( color9_t * ctx,
uint8_t sim_set )

Similarity count.

Parameters
color9Click object.
sim_setSet similarity.

@description This function sets the similarity.

◆ color9_sw_reset()

void color9_sw_reset ( color9_t * ctx)

Software reset function.

Parameters
color9Click object.

@description This function resets the software.

◆ color9_upper_tresset()

void color9_upper_tresset ( color9_t * ctx,
uint32_t set_val )

Upper Tresset.

Parameters
color9Click object.
set_valUpper tresset value.

@description Sets upper tresset value.

◆ color9_write()

void color9_write ( color9_t * ctx,
uint8_t reg_addr,
uint8_t r_data )

Generic write function.

Parameters
color9Click object.
reg_addrRegister address to write to.
reg_dataData to write to register address.

@description This function writes data to given address.

◆ color9_write_32()

void color9_write_32 ( color9_t * ctx,
uint8_t reg_addr,
uint32_t treas_val )

Generic write function for 32 bits.

Parameters
color9Click object.
reg_addrAddress to write to 32 bits.
treas_valValue to be written.

@description This function writes 32 bits to given address.