Scroller Module
The scroller module in Microchip’s Touch Modular Library provides support for position sensing on linear sliders and rotary wheels. It processes touch data from multiple sensor nodes to calculate the finger’s position and state, enabling smooth and accurate slider/wheel interfaces.
Scroller Module Typedefs
scroller_resolution_t
{
SCR_RESOL_2_BIT = 2,
SCR_RESOL_3_BIT,
SCR_RESOL_4_BIT,
SCR_RESOL_5_BIT,
SCR_RESOL_6_BIT,
SCR_RESOL_7_BIT,
SCR_RESOL_8_BIT,
SCR_RESOL_9_BIT,
SCR_RESOL_10_BIT,
SCR_RESOL_11_BIT,
SCR_RESOL_12_BIT
} scroller_resolution_t;
Description: Defines the resolution of the scroller in bits.
A value of 8 indicates 256 positions.
The scroller value will be reported from 0 to 255.
scroller_deadband_t
{
SCR_DB_NONE,
SCR_DB_1_PERCENT,
SCR_DB_2_PERCENT,
SCR_DB_3_PERCENT,
SCR_DB_4_PERCENT,
SCR_DB_5_PERCENT,
SCR_DB_6_PERCENT,
SCR_DB_7_PERCENT,
SCR_DB_8_PERCENT,
SCR_DB_9_PERCENT,
SCR_DB_10_PERCENT,
SCR_DB_11_PERCENT,
SCR_DB_12_PERCENT,
SCR_DB_13_PERCENT,
SCR_DB_14_PERCENT,
SCR_DB_15_PERCENT
} scroller_deadband_t;
Description: Defines the inactive area in percentage on both ends of the Slider where no change in position is reported.
If the dead band is 10, then the inactive area is 10% of the slider length on each end.
Dead band is not applicable for Wheel.
qtm_scroller_group_data_t
{
uint8_t scroller_group_status;
} qtm_scroller_group_data_t;
Description: Data - Group of scrollers
qtm_scroller_data_t
{
uint8_t scroller_status;
uint8_t right_hyst;
uint8_t left_hyst;
uint16_t raw_position;
uint16_t position;
uint16_t contact_size;
} qtm_scroller_data_t;
Description: Data - Each slider / wheel
qtm_scroller_control_t
{
qtm_scroller_group_data_t *qtm_scroller_group_data;
qtm_scroller_group_config_t *qtm_scroller_group_config;
qtm_scroller_data_t *qtm_scroller_data;
qtm_scroller_config_t *qtm_scroller_config;
} qtm_scroller_control_t;
Description: Container
Scroller Module Data Structures
qtm_scroller_group_config_t
{
qtm_touch_key_data_t *qtm_touch_key_data;
uint8_t num_scrollers;
} qtm_scroller_group_config_t;
Description: Configuration - Group of scrollers
More Info: Here is a description of each of the elements in this structure:
| meter | Size | Range/Options | Usage |
|---|---|---|---|
| *qtm_touch_key_data | Pointer 2/4 bytes | qtm_touch_key_data_t | Pointer to touch key data for the underlying set of touch keys |
| num_scrollers | 1 byte | 1-to-255* | The number of scrollers implemented in this group |
qtm_scroller_config_t
{
uint8_t type;
uint16_t start_key;
uint8_t number_of_keys;
uint8_t resol_deadband;
uint8_t position_hysteresis;
uint16_t contact_min_threshold;
} qtm_scroller_config_t;
Description: Configuration - Each slider / wheel
More Info: Here is a description of each of the elements in this structure:
| Parameter | Size | Range/Options | Usage |
|---|---|---|---|
| type | 1 byte | 0 = Linear Slider 1 = Wheel | Type of scroller |
| start_key | 2 bytes | 0-to-65535* | The key number that forms the first component key of the scroller |
| number_of_keys | 1 byte | 2-to-255 | The number of component keys to form the scroller The minimum number of keys required to make a slider is two, and the minimum number of keys to make a wheel is three |
| resol_deadband | 1 byte | Bits 7:4 = Resolution 2 to 12 bits | Full-scale position resolution reported for the scroller |
| Bits 3:0 = Dead band 0% to 15% (each side) | The size of the edge correction dead bands as a percentage of the full scale range | ||
| position_hysteresis | 1 byte | 0-to-255 | The minimum travel distance to be reported after contact or direction change |
| contact_min_threshold | 2 bytes | 0-to-65535 | The minimum contact size measurement for persistent contact tracking The contact size is the sum of two neighboring keys’ touch deltas, forming the touch contact |
Scroller Module Status and Output Data
scroller_group_status
{
uint8_t scroller_group_status;
} qtm_scroller_group_data_t;
Description: Group Configuration of Scroller Status
More Info: Here is a description of each of the elements in this structure:
| Parameter | Size | Range/Options | Usage |
|---|---|---|---|
| scroller_group_status | 1 byte | Bit field Bit 7: Reburst required Bit 0: Touch detection | Reburst Required = 1 Indicates that one or more scrollers in the group require a reburst of sensors Touch Detection = 1 Indicates that one or more scrollers in the group are in ‘Touch Detect’ |
qtm_scroller_data_t
{
uint8_t scroller_status;
uint8_t right_hyst;
uint8_t left_hyst;
uint16_t raw_position;
uint16_t position;
uint16_t contact_size;
} qtm_scroller_data_t;
Description: Individual key sensor data
More Info: Here is a description of each of the elements in this structure:
| Parameter | Size | Range/Options | Usage |
|---|---|---|---|
| scroller_status | 1 byte | Bit field Bit 7: Reburst required Bit 1: Contact moved Bit 0: Touch detection | Reburst Required = 1 Indicates that one or more scrollers in the group require a reburst of sensors Touch contact reported position has changed Touch Detection = 1 Indicates that one or more scrollers in the group are in ‘Touch Detect’ |
| right_hyst | 1 byte | Hysteresis limit | Indicates when a contact is moving ‘Right’, i.e., the direction of increasing touch position |
| left_hyst | 1 byte | Hysteresis limit | Indicates when a contact is moving ‘Left’, i.e., the direction of reducing touch position |
| raw_position | 2 bytes | 0-to-4095 | The calculated location of the touch contact prior to motion filtering |
| position | 2 bytes | 0-to-4095 | The calculated location of the touch contact after motion filtering |
| contact_size | 2 bytes | 0-to-65535 | The sum of two neighbouring keys’ touch deltas comprising the touch contact |
Scroller Module APIs
qtm_init_scroller_module
Description: Initialize a Scroller Module
Parameter: qtm_scroller_control_t* - Pointer to Scroller Module Control Structure
Return: touch_ret_t - Touch Library Return Status
qtm_scroller_process
Description:
Performs Scroller Processing
Calculates position for all the scrollers
Should be called after calling qtm_key_sensors_process()
Parameter: qtm_scroller_control_t* - Pointer to Scroller Module Control Structure
Return: touch_ret_t - Touch Library Return Status
qtm_get_scroller_module_id
Description: Returns the module ID
Parameter: void
Return: uint16_t - Module ID
qtm_get_scroller_module_ver
Description: Returns the module firmware version
Parameter: void
Return: uint8_t - Module Version