Autonomous QTouch Sensor API Flow for UC3L

For the Autonomous QTouch operation, the CAT_CLK must be setup appropriately as a first step.  The Autonomous QTouch and Common configuration parameters in the touch_config_at32uc3l.h configuration must then be set up.  

The touch_at_sensors_init API initializes the QTouch Library as well as the CAT module for the Autonomous QTouch sensor related pin, register and Global Sensor configuration.  The Autonomous QTouch Sensor can be enabled at any time by the Host Application.  Once the Autonomous QTouch Sensor is enabled, the CAT module performs measurements on this sensor continuously to detect a Touch Status.  When an IN_TOUCH or OUT_OF_TOUCH status is detected, the QTouch Library calls the touch_at_status_change_interrupt_callback function to indicate the status to the Host application.  It is possible to enable and disable Autonomous QTouch sensor multiple times in the Host application by using the touch_at_sensor_enable and touch_at_sensor_disable API.

Figure 1. Autonomous QTouch API Flow diagram