1.5.4 Keys Module APIs

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)

Description: Initialize a touch key sensor and assigns the acquisition node pointer (to get the signal value)

Parameter:

TypeDescription
qtm_touch_key_control_t*Pointer to Keys Module Control Structure.
uint8_tWhich key.
qtm_acq_node_data_t*This nodes corresponding Acquisition data.

Return:

TypeDescription
touch_ret_tTouch Library Return Status

touch_ret_t qtm_key_sensors_process(qtm_touch_key_control_t* qtm_lib_key_group_ptr)

Description: Performs key sensors processing - executes touch detect state machine for all the keys. This function is also responsible for performing drifting, anti-touch recalibration, Max-On-Duration (MOD) etc. Should be called after calling qtm_acquisition_process() (if frequency hopping is used, then after frequency hop process function).

Parameter:

TypeDescription
qtm_touch_key_control_t*Pointer to Keys Module Control Structure.

Return:

TypeDescription
touch_ret_tTouch Library Return Status

touch_ret_t qtm_key_suspend(uint16_t which_sensor_key, qtm_touch_key_control_t* qtm_lib_key_group_ptr)

Description: Suspends touch measurements for the key.

Parameter:

TypeDescription
uint16_tWhich key.
qtm_touch_key_control_t*Pointer to Keys Module Control Structure.

Return:

TypeDescription
touch_ret_tTouch Library Return Status

touch_ret_t qtm_key_resume(uint16_t which_sensor_key, qtm_touch_key_control_t* qtm_lib_key_group_ptr)

Description: Resumes touch measurements for the key.

Parameter:

TypeDescription
uint16_tWhich key.
qtm_touch_key_control_t*Pointer to Keys Module Control Structure.

Return:

TypeDescription
touch_ret_tTouch Library Return Status

void update_qtlib_timer(uint16_t time_elapsed_since_update)

Description: The internal time tracking variable will be updated and used for computing various time based functioning like Drift and MOD. It is recommended to call this function periodically (like 20msec and pass 20 as the value).

Parameter:

TypeDescription
uint16_tTimelapse since last call in millisecond.

Return: void

uint16_t qtm_get_touch_keys_module_id(void)

Description: Returns the module ID

Parameter: void

Return:

TypeDescription
uint16_tModule ID

uint8_t qtm_get_touch_keys_module_ver(void)

Description: Returns the module Firmware version

Parameter: void

Return:

TypeDescription
uint8_tModule Version