Appendix E - Touch Key Module API Reference

------------------------------------------------------------------------------
touch_ret_t qtm_init_sensor_key(qtm_touch_key_control_t* qtm_lib_key_group_ptr, uint8_t which_sensor_key, qtm_acq_node_data_t* acq_lib_node_ptr)
------------------------------------------------------------------------------
Purpose: Initialize a touch key sensor
Input  : Pointer to key group control data, key number, pointers to sensor node status and signal
Output : TOUCH_SUCCESS
Notes  : none

------------------------------------------------------------------------------
touch_ret_t qtm_key_sensors_process(qtm_touch_key_control_t* qtm_lib_key_group_ptr)
------------------------------------------------------------------------------
Purpose: Sensor key post-processing (touch detect state machine)
Input  : Pointer to key group control data
Output : TOUCH_SUCCESS
Notes  : none

------------------------------------------------------------------------------
touch_ret_t qtm_key_suspend(uint16_t which_sensor_key, qtm_touch_key_control_t* qtm_lib_key_group_ptr)
------------------------------------------------------------------------------
Purpose: Suspends acquisition measurements for the key
Input  : Key number, Pointer to key group control data
Output : TOUCH_SUCCESS
Notes  : Used to suspend the key temporarily, like to save the power by avoiding the continuous scan on all the sensors. A single key can be defined to act as wake up sensor and other key sensors can be suspended using this API. This API function works in association with resume API function

------------------------------------------------------------------------------
touch_ret_t qtm_key_resume(uint16_t which_sensor_key, qtm_touch_key_control_t* qtm_lib_key_group_ptr)
------------------------------------------------------------------------------
Purpose: Resumes acquisition measurements for the key
Input  : Key number, Pointer to key group control data
Output : TOUCH_SUCCESS
Notes  : Can be used along with suspend API function to avoid scanning of sensors temporarily. For instance, some of the keys may be suspended from scanning during the idle time and resumes based on touch on a defined key 

------------------------------------------------------------------------------
void update_qtlib_timer(uint16_t time_elapsed_since_update)
------------------------------------------------------------------------------
Purpose: Updates local variable with time period
Input  : Number of ms since last update
Output : none
Notes  : none

------------------------------------------------------------------------------
uint16_t qtm_get_touch_keys_module_id(void)
------------------------------------------------------------------------------
Purpose: Returns the module ID
Input  : none
Output : Module ID
Notes  : none

------------------------------------------------------------------------------
uint8_t qtm_get_touch_keys_module_ver(void)
------------------------------------------------------------------------------
Purpose: Returns the module Firmware version
Input  : none
Output : Module ID - Upper nibble major / Lower nibble minor 
Notes  : none

------------------------------------------------------------------------------