captouch5 2.0.0.0

Functions

void captouch5_cfg_setup (captouch5_cfg_t *cfg)
 Config Object Initialization function.
 
CAPTOUCH5_RETVAL captouch5_init (captouch5_t *ctx, captouch5_cfg_t *cfg)
 Initialization function.
 
void captouch5_default_cfg (captouch5_t *ctx, T_CAPTOUCH5_DEVICE_CONFIG *device_cfg)
 Click Default Configuration function.
 
void captouch5_generic_write (captouch5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void captouch5_generic_read (captouch5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void captouch5_device_config (captouch5_t *ctx, T_CAPTOUCH5_DEVICE_CONFIG *device_cfg)
 Function for configuring device.
 
uint16_t captouch5_read_two_bytes (captouch5_t *ctx, uint8_t reg_addr)
 Generic read 16bit data function.
 
void captouch5_write_two_bytes (captouch5_t *ctx, uint8_t reg_addr, uint16_t data_buf)
 Generic write 16bit data function.
 
uint8_t captouch5_read_byte (captouch5_t *ctx, uint8_t reg_addr)
 Generic read 8bit data function.
 
void captouch5_write_byte (captouch5_t *ctx, uint8_t reg_addr, uint8_t data_buf)
 Generic write 8bit data function.
 
uint8_t captouch5_process (captouch5_t *ctx)
 Function for checking error.
 
uint16_t captouch5_get_device_id (captouch5_t *ctx)
 Function for geting device id.
 
uint8_t captouch5_get_family_id (captouch5_t *ctx)
 Function for geting family id.
 
void captouch5_read_button_status (captouch5_t *ctx, T_CAPTOUCH5_BUTTONS *buttons)
 Function read button status.
 
uint16_t captouch5_read_slider_position (captouch5_t *ctx)
 Function for reading slider position.
 
void captouch5_software_reset (captouch5_t *ctx)
 Function to reset device.
 
void captouch5_config_sensors (captouch5_t *ctx, uint16_t sens_data)
 Function for configuring sensor.
 
void captouch5_config_slider (captouch5_t *ctx, uint8_t slider_data)
 Function for configuring slider.
 

Detailed Description

Function Documentation

◆ captouch5_cfg_setup()

void captouch5_cfg_setup ( captouch5_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.

◆ captouch5_config_sensors()

void captouch5_config_sensors ( captouch5_t * ctx,
uint16_t sens_data )

Function for configuring sensor.

Parameters
ctxClick object.
sens_dataData for configuring.

@description This function performs sensor configuration.

◆ captouch5_config_slider()

void captouch5_config_slider ( captouch5_t * ctx,
uint8_t slider_data )

Function for configuring slider.

Parameters
ctxClick object.
slider_dataData for configuring.

@description This function performs slider configuration.

◆ captouch5_default_cfg()

void captouch5_default_cfg ( captouch5_t * ctx,
T_CAPTOUCH5_DEVICE_CONFIG * device_cfg )

Click Default Configuration function.

Parameters
ctxClick object.
device_cfgClick configuration structure

@description This function executes default configuration for CapTouch5 click.

◆ captouch5_device_config()

void captouch5_device_config ( captouch5_t * ctx,
T_CAPTOUCH5_DEVICE_CONFIG * device_cfg )

Function for configuring device.

Parameters
ctxClick object.
device_cfgPointer to structure data which will be written.

@description This function performs basic device configuration.

◆ captouch5_generic_read()

void captouch5_generic_read ( captouch5_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.

◆ captouch5_generic_write()

void captouch5_generic_write ( captouch5_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.

◆ captouch5_get_device_id()

uint16_t captouch5_get_device_id ( captouch5_t * ctx)

Function for geting device id.

Parameters
ctxClick object.
Returns
CAPTOUCH5_DEVICE_ID

@description This function gets device id.

◆ captouch5_get_family_id()

uint8_t captouch5_get_family_id ( captouch5_t * ctx)

Function for geting family id.

Parameters
ctxClick object.
Returns
CAPTOUCH5_FAMILY_ID

@description This function gets family id of click object ctx.

◆ captouch5_init()

CAPTOUCH5_RETVAL captouch5_init ( captouch5_t * ctx,
captouch5_cfg_t * cfg )

Initialization function.

Parameters
captouch5Click object.
cfgClick configuration structure.

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

◆ captouch5_process()

uint8_t captouch5_process ( captouch5_t * ctx)

Function for checking error.

Parameters
ctxClick object.
Returns
CAPTOUCH5_ERROR or CAPTOUCH5_NO_ERROR

@description This function checks error occurence.

◆ captouch5_read_button_status()

void captouch5_read_button_status ( captouch5_t * ctx,
T_CAPTOUCH5_BUTTONS * buttons )

Function read button status.

Parameters
ctxClick object.
buttonsPointer to struct wich will accept data read from device.

@description This function reads button status.

◆ captouch5_read_byte()

uint8_t captouch5_read_byte ( captouch5_t * ctx,
uint8_t reg_addr )

Generic read 8bit data function.

Parameters
ctxClick object.
reg_addrRegister address from which data should be read.
Returns
8bit data from reg_addr.

@description This function reads 8bit data from address reg_addr.

◆ captouch5_read_slider_position()

uint16_t captouch5_read_slider_position ( captouch5_t * ctx)

Function for reading slider position.

Parameters
ctxClick object.
Returns
Data from slider.

@description This function reads slider position.

◆ captouch5_read_two_bytes()

uint16_t captouch5_read_two_bytes ( captouch5_t * ctx,
uint8_t reg_addr )

Generic read 16bit data function.

Parameters
ctxClick object.
reg_addrRegister from which data should be read.
Returns
16bit data from reg_addr.

@description This function reads 16bit data from reg_addr address.

◆ captouch5_software_reset()

void captouch5_software_reset ( captouch5_t * ctx)

Function to reset device.

Parameters
ctxClick object.

@description This function resets device.

◆ captouch5_write_byte()

void captouch5_write_byte ( captouch5_t * ctx,
uint8_t reg_addr,
uint8_t data_buf )

Generic write 8bit data function.

Parameters
ctxClick object.
reg_addrRegister where data should be written.
data_bufOUTPUT data.

@description This function writes 8bit data from data_buf to address reg_addr.

◆ captouch5_write_two_bytes()

void captouch5_write_two_bytes ( captouch5_t * ctx,
uint8_t reg_addr,
uint16_t data_buf )

Generic write 16bit data function.

Parameters
ctxClick object.
reg_addrRegister where data should be written.
data_bufOUTPUT data.

@description This function writes 16bit data data_buf to address reg_addr.