Difference between revisions of "Component: Touch Screen (XPT2046) (Graphical Library)"

From Flowcode Help
Jump to navigationJump to search
 
Line 78: Line 78:
 
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==
 
==Macro reference==

Latest revision as of 08:55, 19 January 2024

Author Matrix Ltd
Version 2.0
Category Graphical Library


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.

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

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. FC6 Icon.png GLCD 4.3 Touch

Example using the XPT2046 touchscreen driver IC with a 7" TFT Display using the SSD1963 Graphical LCD Controller. FC6 Icon.png GLCD 7 Touch

Macro reference

Initialise

Fc9-comp-macro.png Initialise
Activates the SPI peripheral and claims control over the I/O pins. 
Fc9-void-icon.png - VOID Return


ReadCoord

Fc9-comp-macro.png ReadCoord
Reads a coordinate returned from the Sample Sensor macro. Coordinate is scaled to the X/Y Pixel bounds specified. 
Fc9-u8-icon.png - BYTE Coordinate
0 = X, 1 = Y, 2 = Pressure 
Fc9-u16-icon.png - UINT Return


SampleSensor

Fc9-comp-macro.png SampleSensor
Reads the touch controller and returns true if there is currently a touch in progress. The touch coordinates can be read using the ReadCoord macro. Return 0 = No Touch, 1 = Touch in progress 
Fc9-u8-icon.png - BYTE Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png LinkTo
 
Fc9-conn-icon.png Bus Settings
Fc9-type-16-icon.png Channel
SPI Channel selector 
Fc9-type-16-icon.png Prescale
Prescale option selector 
Fc9-conn-icon.png Connections
Fc9-type-5-icon.png MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
Fc9-type-5-icon.png MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
Fc9-type-5-icon.png CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
Fc9-type-5-icon.png CS / SS
Chip Select / Slave Select Pin Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device.  
Fc9-conn-icon.png Configuration
Fc9-type-16-icon.png Analogue Mode
 
Fc9-type-21-icon.png X Pixel
 
Fc9-type-21-icon.png Y Pixel
 
Fc9-type-7-icon.png Flip X
 
Fc9-type-7-icon.png Flip Y
 
Fc9-conn-icon.png Simulation
Fc9-type-10-icon.png Label
Label used to identify the component on the panel. 
Fc9-type-7-icon.png Enable Interrupt
Allows the simulated display to fire an interrupt to allow you to action inputs as they happen. 
Fc9-type-22-icon.png Interrupt Macro
Macro called when the simulated display fires an interrupt. 
Fc9-type-7-icon.png Simulate Comms
Allows the SPI communications to be simulated and piped through an API to real world hardware.