Touch

Getting Started ›› Tools ›› TFT_Graphic_Lib ››
Parent Previous Next

Touch



1. Select and fill the following information:


- Controller - Select the touch controller used in your TFT display to determine the appropriate driver. Supported controllers include:

- XPT2046

- ADS7843  (identical to XPT2046)

- Interface - Choose the type of interface for data transfer with the touch IC:

- SPI_SW - Software SPI protocol (Bit-banging). Touch ICs typically require slower speeds and specific delays, so using HW SPI offers little speed advantage over Bit-banging. Some or all of the Touch SPI pins can be shared with HW SPI1 or SPI2 ports. If any pins are shared, the HW SPI port will be temporarily disabled during touch communication and re-enabled afterward. Alternatively, use any other available pins.

- Average Points - Specify the number of times to read and average touch points. Measuring a single touch point takes only a few microseconds, while human reaction is typically slower, allowing flexibility. A higher count increases RAM usage and slows down coordinate calculation. Reasonable range: 2 to 16.

- Median Distance - Set the maximum allowed distance between the median point and any point in the averaging array for inclusion in the calculation. After collecting the number of points specified in "Average Points," only those within the "Median Distance" in the X and Y directions will contribute to the average calculation. Setting this value too low might result in capturing only the median point, which may not reflect the array’s center. For more details, search "Average vs. Median."

- T CS ... T SCLK - Specify the pins for SW SPI communication.

- Threshold - Define the minimum force required on the touchscreen for a touch event to be considered valid. Reasonable range: 500 to 1500.


2. Generate defines


Click "ADD DEFINE" to generate a list of defines and symbols to include in Positron.


3. Copy defines to Positron


Select and copy all generated defines from the text box, and paste them at the beginning of your Positron code, before including TFT_Graphic_Lib.inc. If needed, you can clear the text box by deleting all lines.






Created with the Personal Edition of HelpNDoc: Easily share your documentation with the world through a beautiful website