Component: Touch Screen (XPT2046) (Force)

From Flowcode Help
Jump to navigationJump to search
Author Matrix Ltd
Version 2.0
Category Force


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 Pack

SENSORS

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

Downloadable macro reference

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


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


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



Property reference

Fc9-prop-icon.png Properties
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 Scope Traces
Selects if the scope traces are automatically generated or not 
Fc9-type-7-icon.png Console Data
Selects if the console data is automatically generated or not 
Fc9-type-16-icon.png API