Difference between revisions of "Component: Touch Screen (XPT2046) (Graphical Library)"
From Flowcode Help
Jump to navigationJump to search (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix Ltd |- | width="20%" style="color:gray;" | Version | 2.0 |- | width="20%" style="color:gray...") |
|||
| (12 intermediate revisions by 2 users not shown) | |||
| Line 5: | Line 5: | ||
|- | |- | ||
| width="20%" style="color:gray;" | Version | | width="20%" style="color:gray;" | Version | ||
| − | | | + | | 13.13 |
|- | |- | ||
| width="20%" style="color:gray;" | Category | | width="20%" style="color:gray;" | Category | ||
| Line 15: | Line 15: | ||
Low level routines for controlling or interacting with the XPT2046 touch screen controller IC found on a lot of common low cost resistive touch screen products. | Low level routines for controlling or interacting with the XPT2046 touch screen controller IC found on a lot of common low cost resistive touch screen products. | ||
| − | == | + | ==Version information== |
| + | |||
| + | Library Version, Component Version, Date, Author, Info | ||
| + | 12, 1.0, 26-07-24, BR, Removed ghost greay square connection line | ||
| + | 13, 13.0, 20-02-25, MW, Sample sensor now retuns the pressure value instead 0 or 1 | ||
| − | |||
==Detailed description== | ==Detailed description== | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| Line 38: | Line 51: | ||
==Examples== | ==Examples== | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| Line 56: | Line 79: | ||
Example using the XPT2046 touchscreen driver IC with a 4.3" TFT Display using the SSD1963 Graphical LCD Controller. | Example using the XPT2046 touchscreen driver IC with a 4.3" TFT Display using the SSD1963 Graphical LCD Controller. | ||
{{Fcfile|GLCD4.3_Touch.fcfx|GLCD 4.3 Touch}} | {{Fcfile|GLCD4.3_Touch.fcfx|GLCD 4.3 Touch}} | ||
| + | |||
Example using the XPT2046 touchscreen driver IC with a 7" TFT Display using the SSD1963 Graphical LCD Controller. | Example using the XPT2046 touchscreen driver IC with a 7" TFT Display using the SSD1963 Graphical LCD Controller. | ||
{{Fcfile|GLCD7_Touch.fcfx|GLCD 7 Touch}} | {{Fcfile|GLCD7_Touch.fcfx|GLCD 7 Touch}} | ||
| − | == | + | ==Macro reference== |
| + | ===Initialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Activates the SPI peripheral and claims control over the I/O pins. |
|- | |- | ||
|- | |- | ||
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
| + | ===ReadCoord=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 92: | Line 118: | ||
| + | ===SampleSensor=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SampleSensor''' |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Reads the touch controller and returnsthe pressure value of touch in progress. The touch coordinates can be read using the ReadCoord macro. Return 0 = No Touch, >=1 Touch in progress |
|- | |- | ||
|- | |- | ||
| − | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
| − | |||
| − | |||
| Line 211: | Line 236: | ||
| colspan="2" | Allows the SPI communications to be simulated and piped through an API to real world hardware. | | colspan="2" | Allows the SPI communications to be simulated and piped through an API to real world hardware. | ||
|} | |} | ||
| + | |||
| + | ==Component Source Code== | ||
| + | |||
| + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_TouchScreen_XPT2046.fcfx FC_Comp_Source_TouchScreen_XPT2046.fcfx] | ||
| + | |||
| + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_TouchScreen_XPT2046.fcfx FC_Comp_Source_TouchScreen_XPT2046.fcfx] | ||
Latest revision as of 08:59, 9 June 2025
| Author | Matrix Ltd |
| Version | 13.13 |
| Category | Graphical Library |
Contents
Touch Screen (XPT2046) component
Low level routines for controlling or interacting with the XPT2046 touch screen controller IC found on a lot of common low cost resistive touch screen products.
Version information
Library Version, Component Version, Date, Author, Info 12, 1.0, 26-07-24, BR, Removed ghost greay square connection line 13, 13.0, 20-02-25, MW, Sample sensor now retuns the pressure value instead 0 or 1
Detailed description
No detailed description exists yet for this component
Examples
Example using the XPT2046 touchscreen driver IC with a 4.3" TFT Display using the SSD1963 Graphical LCD Controller.
GLCD 4.3 Touch
Example using the XPT2046 touchscreen driver IC with a 7" TFT Display using the SSD1963 Graphical LCD Controller.
GLCD 7 Touch
Macro reference
Initialise
| Initialise | |
| Activates the SPI peripheral and claims control over the I/O pins. | |
| Return | |
ReadCoord
| ReadCoord | |
| Reads a coordinate returned from the Sample Sensor macro. Coordinate is scaled to the X/Y Pixel bounds specified. | |
| Coordinate | |
| 0 = X, 1 = Y, 2 = Pressure | |
| Return | |
SampleSensor
Property reference
Component Source Code
Please click here to download the component source project: FC_Comp_Source_TouchScreen_XPT2046.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_TouchScreen_XPT2046.fcfx