capwheel 2.0.0.0
Public function

Functions

void capwheel_cfg_setup (capwheel_cfg_t *cfg)
 Config Object Initialization function.
 
CAPWHEEL_RETVAL capwheel_init (capwheel_t *ctx, capwheel_cfg_t *cfg)
 Initialization function.
 
void capwheel_default_cfg (capwheel_t *ctx)
 Click Default Configuration function.
 
void capwheel_generic_write (capwheel_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void capwheel_generic_read (capwheel_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t capwheel_write_reg (capwheel_t *ctx, uint8_t register_address, uint8_t *data_in, uint8_t n_bytes)
 Generic Write function.
 
uint8_t capwheel_read_reg (capwheel_t *ctx, uint8_t register_address, uint8_t *data_out, uint8_t n_bytes)
 Generic Read function.
 
uint8_t capwheel_check_data_ready (capwheel_t *ctx)
 Data Ready Check function.
 
uint8_t capwheel_enable_chann (capwheel_t *ctx, uint16_t sel_chann)
 Channel Enable function.
 
void capwheel_get_data (capwheel_t *ctx, uint16_t *wheel_data)
 Data Get function.
 
void capwheel_set_output (capwheel_t *ctx, uint16_t input_data, uint8_t output_mode)
 Output Set function.
 
void capwheel_set_threshold (capwheel_t *ctx, uint8_t thresh_value)
 Threshold Set function.
 
void capwheel_reset (capwheel_t *ctx)
 Reset function.
 

Detailed Description

Function Documentation

◆ capwheel_cfg_setup()

void capwheel_cfg_setup ( capwheel_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.

◆ capwheel_check_data_ready()

uint8_t capwheel_check_data_ready ( capwheel_t * ctx)

Data Ready Check function.

Parameters
ctxClick object.
Returns
0 - Data is ready, 1 - Data is not ready

Function checks is conversion cycle done and is data ready for reading.

◆ capwheel_default_cfg()

void capwheel_default_cfg ( capwheel_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for CapWheel click.

◆ capwheel_enable_chann()

uint8_t capwheel_enable_chann ( capwheel_t * ctx,
uint16_t sel_chann )

Channel Enable function.

Parameters
ctxClick object.
sel_channSelects which channel be activated.
Returns
0x00 - OK, 0xFD - Wrong channel selection

Function puts the desired channel/channels to active state.

Note
selChann parameter has format 0b0000 00c9c8 c7c6c5c4 c3c2c1c0. 1 on the desired bit will put determined channel to active state.

◆ capwheel_generic_read()

void capwheel_generic_read ( capwheel_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.

◆ capwheel_generic_write()

void capwheel_generic_write ( capwheel_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.

◆ capwheel_get_data()

void capwheel_get_data ( capwheel_t * ctx,
uint16_t * wheel_data )

Data Get function.

Parameters
ctxClick object.
wheel_dataMemory where data be stored.

Function reads data from wheel 1 and stores this value in memory via output parameter.

◆ capwheel_init()

CAPWHEEL_RETVAL capwheel_init ( capwheel_t * ctx,
capwheel_cfg_t * cfg )

Initialization function.

Parameters
capwheelClick object.
cfgClick configuration structure.

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

◆ capwheel_read_reg()

uint8_t capwheel_read_reg ( capwheel_t * ctx,
uint8_t register_address,
uint8_t * data_out,
uint8_t n_bytes )

Generic Read function.

Parameters
ctxClick object.
register_addressAddress which from data be read.
data_outMemory where data be stored.
n_bytesNumber of bytes to be read.
Returns
0x00 - OK, 0xFF - Wrong address, 0xFE - Number of bytes is out of range

Function reads the determined number of bytes from the register.

◆ capwheel_reset()

void capwheel_reset ( capwheel_t * ctx)

Reset function.

Parameters
ctxClick object.

Function performs the device reset and puts the device back to normal operating mode.

◆ capwheel_set_output()

void capwheel_set_output ( capwheel_t * ctx,
uint16_t input_data,
uint8_t output_mode )

Output Set function.

Parameters
ctxClick object.
inputdataInput data which be showed on output LEDs.
outputdodeDetermines how input data be showed on output LEDs.

Function sets output LEDs depending on the input wheel data value in the way which is determined with the ouputMode parameter.

Note
Input data can be showed on two ways. First way includes brightness intensity changing of all LEDs. Second way includes number of activated LEDs changing, depending on the wheel input data.

◆ capwheel_set_threshold()

void capwheel_set_threshold ( capwheel_t * ctx,
uint8_t thresh_value )

Threshold Set function.

Parameters
ctxClick object.
thresh_valueDetermines touch and proximity sensitivity for all channels.

Function determines touch and proximity sensitivity (threshold) for all channels.

Note
Threshold value can be in range from 0x00 (most sensitive) to 0xFF (least sensitive).

◆ capwheel_write_reg()

uint8_t capwheel_write_reg ( capwheel_t * ctx,
uint8_t register_address,
uint8_t * data_in,
uint8_t n_bytes )

Generic Write function.

Parameters
ctxClick object.
register_addressAddress where data be written.
data_inData to be written.
n_bytesNumber of bytes to be written.
Returns
0x00 - OK, 0xFF - Wrong address, 0xFE - Number of bytes is out of range

Function writes the determined number of bytes to the register.