1.2.3 Acquisition Module APIs
touch_ret_t qtm_ptc_init_acquisition_module(qtm_acquisition_control_t* qtm_acq_control_ptr);
Description: This function initializes the Acquisition module and PTC.
Parameter: qtm_acquisition_control_t*
Return:touch_ret_t
Type | Description |
---|---|
qtm_acquisition_control_t* | Pointer to acquisition control structure |
Return:
Type | Description |
---|---|
touch_ret_t | Touch Library Return Status |
touch_ret_t qtm_ptc_qtlib_assign_signal_memory(uint16_t* qtm_signal_raw_data_ptr);
Description: Pass the pointer of an array. The unprocessed PTC output values for all the channels are stored in this array and used by qtm_acquisition_process() API
Parameter:
Type | Description |
---|---|
uint16_t* | Pointer to raw data array |
Return:
Type | Description |
---|---|
touch_ret_t | Touch Library Return Status |
touch_ret_t qtm_enable_sensor_node(qtm_acquisition_control_t* qtm_acq_control_ptr, uint16_t qtm_which_node_number);
Description: Enables a sensor node for measurement
Parameter:
Type | Description |
---|---|
qtm_acquisition_control_t* | Acquisition Module Control Pointer |
uint16_t | Node (Channel) number |
Return:
Type | Description |
---|---|
touch_ret_t | Touch Library Return Status |
touch_ret_t qtm_calibrate_sensor_node(qtm_acquisition_control_t* qtm_acq_control_ptr, uint16_t which_node_number);
Description: Configures the sensor for calibration. On the next measurement, the calibration process for this sensor will be started.
Parameter:
Type | Description |
---|---|
ptc_seq_acq_settings* | Acquisition Module Control Pointer |
uint16_t | Node (Channel) number |
Return:
Type | Description |
---|---|
touch_ret_t | Touch Library Return Status |
touch_ret_t qtm_ptc_start_measurement_seq(qtm_acquisition_control_t* qtm_acq_control_pointer, void (*measure_complete_callback) (void));
Description: Loads touch configurations for first channel and starts the measurment. Subsequent channels will be configured in PTC interrupt till all channels are measured. When measurment on all channel is completed, the callback funtion passed on this API will be called.
Parameter:
Type | Description |
---|---|
qtm_acquisition_control_t* | Acquisition Module Control Pointer |
void(*measure_complete_callback)(void) | Measure Complete callback function pointer |
Return:
Type | Description |
---|---|
touch_ret_t | Touch Library Return Status |
touch_ret_t qtm_acquisition_process(void);
Description: Processes the acquired values (signal) resulting from calling qtm_ptc_start_measurement_seq() API. This function should be called after the callback function, passed to qtm_ptc_start_measurement_seq(), is called by library.
Parameter: void
Return: touch_ret_t
Type | Description |
---|---|
touch_ret_t | Touch Library Return Status |
touch_ret_t qtm_autoscan_sensor_node(qtm_auto_scan_config_t* qtm_auto_scan_config_ptr, void (*auto_scan_callback)(void));
Description: Configures the PTC to start measurement using event system on a single node configured in qtm_auto_scan_config_ptr. When a touch is detected on the autoscan sensor, auto_scan_callback() will be called.
Parameter:
Type | Description |
---|---|
qtm_auto_scan_config_t* | Pointer to auto scan configuration structure. |
void(*auto_scan_callback)(void) | Autoscan Wakeup callback function pointer |
Return:
Type | Description |
---|---|
touch_ret_t | Touch Library Return Status |
touch_ret_t qtm_autoscan_node_cancel(void)
Description: Cancels Event-system based measurement.
Parameter: void
Return:
Type | Description |
---|---|
touch_ret_t | Touch Library Return Status |
void qtm_ptc_de_init(void)
Description: Clear PTC registers and set the library state to TOUCH_STATE_NULL. The library can only after a proper initialization after calling this API.
Parameter: void
Return: void
uint16_t qtm_DEVICE_FAMILY_acq_module_get_id(void)
Description: Returns the module ID
Parameter: void
Return:
Type | Description |
---|---|
uint16_t | Module ID |
uint8_t qtm_DEVICE_FAMILY_acq_module_get_version(void);
Description: Returns the module Firmware version
Parameter: void
Return:
Type | Description |
---|---|
uint8_t | Module Version |
void qtm_ptc_clear_interrupt(void);
Description: Clears the End-of-Conversion or Winodow-comparator interrupt flags
Parameter: void
Return: void
void qtm_DEVICE_FAMILY_ptc_handler_eoc(void)
Description: Captures the measurement, starts the next channels measurement. If EOC occurred for last channel, call callback passed in qtm_ptc_start_measurement_seq() API.
Parameter: void
Return: void
void qtm_DEVICE_FAMILY_ptc_handler_wcomp(void)
Description: Captures the measurement, calls the callback passed in qtm_autoscan_sensor_node() API.
Parameter: void
Return: void