3.1.2.3 Acquisition Module APIs
touch_ret_t qtm_ptc_init_acquisition_module(qtm_acquisition_control_t* qtm_acq_control_ptr);
Description: 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: Passes the pointer of an array. The unprocessed PTC output values for all the
channels are stored in this array and used by the 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 the first channel and starts the measurement. Subsequent channels will be configured in the PTC interrupt until all channels are measured. When measurement on all channel is completed, the callback function 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 the
qtm_ptc_start_measurement_seq() API. This function must be called after
the callback function, passed to qtm_ptc_start_measurement_seq(), is called
by library.
Parameter: None.
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
auto-scan sensor, auto_scan_callback() will be called.
Parameter:
| Type | Description |
|---|---|
qtm_auto_scan_config_t* | Pointer to the auto scan configuration structure |
void(*auto_scan_callback)(void) | Auto-scan wake-up 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: None.
Return:
| Type | Description |
|---|---|
touch_ret_t | Touch library return status |
void qtm_ptc_de_init(void)
Description: Clears PTC registers and sets the library state to TOUCH_STATE_NULL. The library can only after a proper initialization after calling this API.
Parameter: None.
Return: None.
uint16_t qtm_DEVICE_FAMILY_acq_module_get_id(void)
Description: Returns the module ID.
Parameter: None.
Return:
| Type | Description |
|---|---|
uint16_t | Module ID |
uint8_t qtm_DEVICE_FAMILY_acq_module_get_version(void);
Description: Returns the module firmware version.
Parameter: None.
Return:
| Type | Description |
|---|---|
uint8_t | Module version |
void qtm_ptc_clear_interrupt(void);
Description: Clears the End-of-Conversion (EoC) or Window comparator interrupt flags.
Parameter: None.
Return: None.
void qtm_DEVICE_FAMILY_ptc_handler_eoc(void)
Description: Captures the measurement and starts the next channel measurement. If EOC
occurred for last channel, call the callback passed in the
qtm_ptc_start_measurement_seq() API.
Parameter: None.
Return: None.
void qtm_DEVICE_FAMILY_ptc_handler_wcomp(void)
Description: Captures the measurement and calls the callback passed in the
qtm_autoscan_sensor_node() API.
Parameter: None.
Return: None.
