2.1 General APIs
The APIs defined in this sections are typically found in all touch projects and applicable mostly for all devices.
void touch_init(void)
Description: Initializes various touch library modules and other peripherals like timer etc. This function should e called during initialization phase typically before main while(1) loop.
Parameters:None
Return:None
void touch_process(void)
Description: This function monitors various flags used in touch.c file and calls touch libraries APIs accordingly. This is a scheduler for all touch related API calls. When timer gives a periodic interrupt, this function starts the touch measurement. When the touch measurement is completed, post-processing APIs are also called in this function. This function should be called as frequently as possible. In a typical application, this can be called in the main while(1) loop without any additional checks. In RTOS based application, this can be called in a task which is executed at shorter interval or when there is an interrupt occurs (either due to timer or due to touch measurement hardware - PTC, HCVD). Any delay in calling this function can affect response time.
Parameters:None
Return:None
void qtm_measure_complete_callback(void)
Description:This is the callback function passed to qtm_ptc_start_measurement_seq() API. When the touch measurement is completed, this function will be called. In this function, post processing flag is set which will be checked in touch_process().
Parameters:None
Return:None
void touch_timer_config(void)
Description: Configures timer (typically RTC) to give periodic interrupt to perform touch measurement.
Parameters:None
Return:None
void touch_timer_handler(void)
Description: This function is usually a callback function from RTC Handler. This function sets flag to start touch measurement. This function is also responsible for calling qtm_update_qtlib_timer() and qtm_update_gesture_2d_timer(). Various other application level timings (like low-power timeout) are also updated in this function.
Parameters:None
Return:None