2D Surface (One-Finger Touch) Charge Sharing (CS) Module
The 2D Surface (One-Finger Touch) Charge Sharing (CS) Module in Microchip’s Touch Modular Library enables capacitive touch detection and position tracking on a 2D surface using a matrix of electrodes. This module is designed for single-finger operation and is commonly used for touchpads, sliders, and gesture interfaces.
Surface CS/1T Typedefs and Data Structures
scr_resolution_t
Description: This enumeration defines the scroller resolution setting.
scr_deadband_t
Description: This enumeration defines the scroller dead-band percentage setting.
qtm_surface_cs_control_t
Description: This structure serves as the top-level container for surface configuration. Contains pointers to data and configuration structures.
qtm_surface_contact_data_t
Description: This structure contains the run-time data for touch surface.
More Info: The following describes the individual members of the structure:
| Parameter | Size | Range/Options | Usage |
|---|---|---|---|
| qt_surface_status | 1 byte | Bit field Bit 7: Reburst required | Reburst Required = 1 indicates that further measurements are required to resolve/update contact status |
| Bit 6: — | — | ||
| Bit 5: POS_V_DEC | Vertical position decreased | ||
| Bit 4: POS_V_INC | Vertical position increased | ||
| Bit 3: POS_H_DEC | Horizontal position decreased | ||
| Bit 2: POS_H_INC | Horizontal position increased | ||
| Bit 1: POS_CHANGE | Change in reported position | ||
| Bit 0: Touch detection | Touch Detection = 1 indicates that a touch contact is present on the surface | ||
| h_position_abs | 2 bytes | 0 to 4095 | Apparent horizontal position |
| h_position | 2 bytes | 0 to 4095 | Motion filtered horizontal position |
| v_position_abs | 2 bytes | 0 to 4095 | Apparent vertical position |
| v_position | 2 bytes | 0 to 4095 | Motion filtered vertical position |
| contact_size | 2 bytes | — | Sum of touch deltas at contact location |
qtm_surface_cs_config_t
Description: This structure defines the configuration parameters for the touch surface.
More Info: The following describes the individual members of the structure:
| Parameter | Size | Range/Options | Usage |
|---|---|---|---|
| start_key_h | 2 bytes | 0 to 65534 | Start key of horizontal axis |
| number_of_keys_h | 1 byte | 0 to 255 | The number of keys forming horizontal axis |
| start_key_v | 2 bytes | 0 to 65534 | Start key of vertical axis |
| number_of_keys_v | 1 byte | 0 to 255 | The number of keys forming vertical axis |
| resol_deadband | 1 byte | Bits 7:4 = Resolution 2 to 12 bits | Full-scale position resolution reported for the axis |
| position_hysteresis | 1 byte | 0 to 255 | The minimum travel distance to be reported after contact or direction change Applies to Horizontal and Vertical |
| position_filter | 1 byte | Bits7:5: — | — |
| Bit 4: Median Filter | Median filter enable | ||
| Bit3 : — | — | ||
| Bit 2: — | — | ||
| Bits 1:0: IIR Config | IIR Config0 = None1 = 25%2 = 50%3 = 75%. | ||
| contact_min_threshold | 2 bytes | 0 to 65535 | The minimum contact size measurement for persistent contact tracking Contact size is the sum of neighboring keys’ touch deltas forming the touch contact |
| *qtm_touch_key_data | Pointer2/4 bytes | qtm_touch_key_data_t | Pointer to touch key data for the underlying set of touch keys |
Surface CS/1T APIs
The Surface CS/1T Application Programming Interfaces (APIs) refer to the APIs for the 2D Surface (One-Finger Touch) CS Module in the Touch Modular Library. These APIs allow you to initialize, configure, process, and retrieve touch data from a 2D mutual-capacitance touch surface (matrix) supporting single-finger tracking.
qtm_init_surface_cs
Description: This function initializes a surface module.
Parameter:
| Type | Description |
|---|---|
| qtm_surface_cs_control_t * | Pointer to Surface Module Control Structure |
Return:
| Type | Description |
|---|---|
| touch_ret_t | Touch Library Return Status |
qtm_surface_cs_process
Description: * This function performs surface processing * Calculates X and Y position for the surface *. It must be called after qtm_key_sensors_process() has been executed.
Parameter:
| Type | Description |
|---|---|
| qtm_surface_cs_control_t * | Pointer to Surface Module Control Structure |
Return:
| Type | Description |
|---|---|
| touch_ret_t | Touch Library Return Status |
qtm_get_surface_cs_module_id
Description: This function returns the module ID.
Parameter: void
Return:
| Type | Description |
|---|---|
| uint16_t | Module ID |
qtm_get_surface_cs_module_ver
Description: This function returns the module firmware version.
Parameter: void
Return:
| Type | Description |
|---|---|
| uint8_t | Module Version |