touchkey4 2.0.0.0

Functions

void touchkey4_cfg_setup (touchkey4_cfg_t *cfg)
 Config Object Initialization function.
 
TOUCHKEY4_RETVAL touchkey4_init (touchkey4_t *ctx, touchkey4_cfg_t *cfg)
 Initialization function.
 
void touchkey4_default_cfg (touchkey4_t *ctx)
 Click Default Configuration function.
 
void touchkey4_write_reg (touchkey4_t *ctx, const uint8_t register_address, const uint8_t transfer_data)
 Generic Write function.
 
void touchkey4_read_reg (touchkey4_t *ctx, const uint8_t register_address, uint8_t *data_out, const uint8_t n_bytes)
 Generic Read function.
 
uint8_t touchkey4_receive_byte (touchkey4_t *ctx, const uint8_t register_address)
 Read byte function.
 
void touchkey4_detect_touch (touchkey4_t *ctx, uint8_t *input_sens)
 Touch Detect function.
 
void touchkey4_set_active_mode (touchkey4_t *ctx, const uint8_t analog_gain, const uint8_t en_input1, const uint8_t en_input2, const uint8_t en_input3)
 Active Mode Set function.
 
void touchkey4_set_standby_mode (touchkey4_t *ctx, const uint8_t analog_gain, const uint8_t en_input1, const uint8_t en_input2, const uint8_t en_input3)
 Standby Mode Set function.
 
void touchkey4_set_combo_mode (touchkey4_t *ctx, const uint8_t analog_gain, const uint8_t en_input1, const uint8_t en_input2, const uint8_t en_input3)
 Combo Mode Set function.
 
void touchkey4_set_deep_sleep_mode (touchkey4_t *ctx)
 DeepSleep Mode Set function.
 
uint8_t touchkey4_check_interrupt (touchkey4_t *ctx)
 Interrupt Check function.
 

Detailed Description

Function Documentation

◆ touchkey4_cfg_setup()

void touchkey4_cfg_setup ( touchkey4_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.

◆ touchkey4_check_interrupt()

uint8_t touchkey4_check_interrupt ( touchkey4_t * ctx)

Interrupt Check function.

Parameters
ctxClick object.
Returns
State of ALERT pin, 0 or 1.

@description This function checks interrupt state (ALERT pin).

◆ touchkey4_default_cfg()

void touchkey4_default_cfg ( touchkey4_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function sets some registers to certain values in order to initialize device.

◆ touchkey4_detect_touch()

void touchkey4_detect_touch ( touchkey4_t * ctx,
uint8_t * input_sens )

Touch Detect function.

Parameters
ctxClick object.
input_sensResults of detecting touch on sensor inputs.

@description This function detects touch on sensor inputs and checks is touch detected or released. If noise occured on determined input, the touch will not be detected.

◆ touchkey4_init()

TOUCHKEY4_RETVAL touchkey4_init ( touchkey4_t * ctx,
touchkey4_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ touchkey4_read_reg()

void touchkey4_read_reg ( touchkey4_t * ctx,
const uint8_t register_address,
uint8_t * data_out,
const uint8_t n_bytes )

Generic Read function.

Parameters
ctxClick object.
register_addressAddress which from data be read.
data_outBuffer where data be stored.
n_bytesNumber of bytes which be read.

@description This function reads data from register.

◆ touchkey4_receive_byte()

uint8_t touchkey4_receive_byte ( touchkey4_t * ctx,
const uint8_t register_address )

Read byte function.

Parameters
ctxClick object.
register_addressAddress which from data be read.
Return values
Readbyte

@description This function reads data from register.

◆ touchkey4_set_active_mode()

void touchkey4_set_active_mode ( touchkey4_t * ctx,
const uint8_t analog_gain,
const uint8_t en_input1,
const uint8_t en_input2,
const uint8_t en_input3 )

Active Mode Set function.

Parameters
ctxClick object.
analog_gainPossible gain value is 1, 2, 4 or 8.
en_input1Enable or disable sensor input 1.
en_input2Enable or disable sensor input 2.
en_input3Enable or disable sensor input 3.

@description This function puts device in Active mode and enables desired inputs in Active mode.

Note
 1 - enable sensor input, 0 - disable sensor input 

◆ touchkey4_set_combo_mode()

void touchkey4_set_combo_mode ( touchkey4_t * ctx,
const uint8_t analog_gain,
const uint8_t en_input1,
const uint8_t en_input2,
const uint8_t en_input3 )

Combo Mode Set function.

Parameters
ctxClick object.
analog_gainPossible gain value is 1, 2, 4 or 8.
en_input1Enable or disable sensor input 1.
en_input2Enable or disable sensor input 2.
en_input3Enable or disable sensor input 3.

@description Function puts device in Combo mode (Active and Standby) and enables desired inputs in Active mode, Standby mode or both modes.

Note
 0 - disable input, 1 - enable input in Standby mode, 3 - enable input in Active mode,
      5 - enable input in both modes 

◆ touchkey4_set_deep_sleep_mode()

void touchkey4_set_deep_sleep_mode ( touchkey4_t * ctx)

DeepSleep Mode Set function.

Parameters
ctxClick object.

@description This function puts device in DeepSleep mode.

Note
 In this mode the I2C communication will not work and the sensor inputs will not detect touch. 

◆ touchkey4_set_standby_mode()

void touchkey4_set_standby_mode ( touchkey4_t * ctx,
const uint8_t analog_gain,
const uint8_t en_input1,
const uint8_t en_input2,
const uint8_t en_input3 )

Standby Mode Set function.

Parameters
ctxClick object.
analog_gainPossible gain value is 1, 2, 4 or 8.
en_input1Enable or disable sensor input 1.
en_input2Enable or disable sensor input 2.
en_input3Enable or disable sensor input 3.

@description This function puts device in Standby mode and enables desired inputs in Standby mode.

Note
 1 - enable sensor input, 0 - disable sensor input 

◆ touchkey4_write_reg()

void touchkey4_write_reg ( touchkey4_t * ctx,
const uint8_t register_address,
const uint8_t transfer_data )

Generic Write function.

Parameters
ctxClick object.
register_addressAddress where data be written.
transfer_dataData which be written.

@description This function writes one byte to register.