3.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: Initializes a touch key sensor and assigns the acquisition node pointer (to get the signal value).

Parameter:

TypeDescription
qtm_touch_key_control_t *Pointer to the 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, executing touch detect state machine for all the keys. This routine is also responsible for performing drifting, anti-touch recalibration, Max-On-Duration (MOD), etc. It must be called after calling qtm_acquisition_process() (if frequency hopping is used, then after the frequency hop process function).

Parameter:

TypeDescription
qtm_touch_key_control_t *Pointer to the 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 (e.g., 20 ms and pass 20 as the value).

Parameter:

TypeDescription
uint16_tTimelapse since last call in milliseconds

Return: None.

uint16_t qtm_get_touch_keys_module_id(void)

Description: Returns the module ID.

Parameter: None.

Return:

TypeDescription
uint16_tModule ID

uint8_t qtm_get_touch_keys_module_ver(void)

Description: Returns the module firmware version.

Parameter: None.

Return:

TypeDescription
uint8_tModule version