| Author
|
Matrix TSL
|
| Version
|
1.0
|
| Category
|
Development
|
Matrix Cap Touch Display component
A component to drive the capacitive touch display module as used in EM, 3PH PSU, CNC
Detailed description
No detailed description exists yet for this component
Examples
Auto Detect Port Number
This example auto detects and opens a COM Port based on preassigned USB Identifiers VID/PID.
For a known device the VID and PID can be found via Windows device manager.
Auto Detect Example
Macro reference
BluetoothConnectionStatus
|
BluetoothConnectionStatus
|
| Checks to see if the Bluetooth is connected to a master device
|
- BOOL
|
Return
|
BluetoothInit
|
BluetoothInit
|
| Startup up Bluetooth communications and assigns a friendly name
|
- STRING
|
Name
|
| Friendly device name
|
- VOID
|
Return
|
BluetoothReceiveArray
|
BluetoothReceiveArray
|
| Read an array of bytes from the Bluetooth connection Returns the number of bytes read from the file
|
- BYTE
|
Data
|
|
|
- UINT
|
Count
|
|
|
- UINT
|
Return
|
BluetoothSendArray
|
BluetoothSendArray
|
| Send an array of bytes via Bluetooth
|
- BYTE
|
Data
|
|
|
- UINT
|
Count
|
|
|
- VOID
|
Return
|
BluetoothUninit
|
BluetoothUninit
|
| Shots down Bluetooth communications
|
- VOID
|
Return
|
ClearDisplay
|
ClearDisplay
|
| Clears the display and resets the button count
|
- VOID
|
Return
|
DrawArc
|
DrawArc
|
| Draws an arc either as an outline or as a filled object.
|
- UINT
|
X1
|
| Center X coordinate
|
- UINT
|
Y1
|
| Center Y coordinate
|
- UINT
|
Radius
|
| Radius, distance of edge from the centre coordinates
|
- UINT
|
StartAngle
|
| Angle to start drawing, in degrees
|
- UINT
|
EndAngle
|
| Angle to end drawing, in degrees
|
- UINT
|
Resolution
|
| Number of lines to draw from the center to the outer edge, 0=Autofill
|
- BYTE
|
Transparent
|
| Chooses the transparency - 0 = Arc contains background colour, 1 = Arc contains previous pixel data.
|
- BYTE
|
Solid
|
| Chooses to fill with colour - 0 = Arc transparency data, 1 = Arc contains foreground colour.
|
- VOID
|
Return
|
DrawBitmap
|
DrawBitmap
|
| Draws a bitmap image loaded from the SD card FileInit must be called first to ensure the File System is setup.
|
- STRING
|
Filename
|
| Text label to draw on the button
|
- UINT
|
X1
|
|
|
- UINT
|
Y1
|
|
|
- BYTE
|
Transparency
|
| Set the button type
|
- BYTE
|
Orientation
|
|
|
- BYTE
|
Flip
|
|
|
- BYTE
|
Return
|
|
DrawButton
|
| Draws a button or slider that can be touched
|
- UINT
|
X
|
|
|
- UINT
|
Y
|
|
|
- UINT
|
Width
|
|
|
- UINT
|
Height
|
|
|
- BYTE
|
Type
|
| Set the button type: 0=Rect, 1=RoundRect, 2=Ellipse, 3=Bitmap, 4=VSlider, 5=HSlider, 6=RVSlider, 7=RHSlider
|
- BYTE
|
Font
|
| Range: 0-3
|
- BYTE
|
ThemeIndex
|
|
|
- STRING
|
Text
|
| Text label to draw on the button
|
- BYTE
|
SliderMode
|
| 0=HighlightOnly, 1=Highlight and Lowlight
|
- BYTE
|
Return
|
DrawEllipse
|
DrawEllipse
|
| Draws a ellipse centered around X,Y with radius X2,Y2
|
- UINT
|
X1
|
|
|
- UINT
|
Y1
|
|
|
- UINT
|
Width
|
|
|
- UINT
|
Height
|
|
|
- BOOL
|
Transparent
|
| When Solid=0 - 0 = Fill with Background / 1 = No Fill
|
- BOOL
|
Solid
|
| 0=Foreground for the outline only, 1=Fill with foreground
|
- VOID
|
Return
|
DrawGraph
|
DrawGraph
|
| Draws a line graph area on the display with or without grids. Uses the current foreground / background colours
|
- UINT
|
X
|
| X coordinate for top left of graph
|
- UINT
|
Y
|
| Y coordinate for top left of graph
|
- UINT
|
Width
|
| Width of graph in pixels
|
- UINT
|
Height
|
| Height of graph in pixels
|
- INT
|
MinX
|
| Minimum X Value - XY type only
|
- INT
|
MaxX
|
| Minimum X Value - XY type only
|
- INT
|
MinY
|
| Minimum Y Value
|
- INT
|
MaxY
|
| Maximum Y Value
|
- BYTE
|
Type
|
| 0=Scrolling, 1=XY
|
- BYTE
|
NumPoints
|
| Number of points per line - Scrolling Type Only
|
- BYTE
|
ThemeIndex
|
|
|
- BYTE
|
XMajor
|
| Major subdivisions count
|
- BYTE
|
XMinor
|
| Minor subdivisions count
|
- BYTE
|
YMajor
|
| Major subdivisions count
|
- BYTE
|
YMinor
|
| Minor subdivisions count
|
- VOID
|
Return
|
DrawLine
|
DrawLine
|
| Draws a single pixel thickness line
|
- UINT
|
X1
|
|
|
- UINT
|
Y1
|
|
|
- UINT
|
X2
|
|
|
- UINT
|
Y2
|
|
|
- VOID
|
Return
|
DrawPixel
|
DrawPixel
|
| Draws a single pixel in the foreground colour at X,Y
|
- UINT
|
X1
|
|
|
- UINT
|
Y1
|
|
|
- VOID
|
Return
|
DrawQRCode
|
DrawQRCode
|
| Draws a QR code with the specified data string embedded. Default size for the QR code is 33 x 33 @ a scaler of 1. Can be used to store up to 78 characters Recommend a scaler of 3 or 4. QR code should be drawn with a decent clear border around it to make it easier to scan.
|
- UINT
|
X
|
| Left hand side pixel coordinate
|
- UINT
|
Y
|
| Top side pixel coordinate
|
- BYTE
|
Scaler
|
| Size of each block in pixels
|
- STRING
|
Text
|
| Data to embed into the QR code. e.g. "www.flowcode.co.uk/EM"
|
- VOID
|
Return
|
DrawRectangle
|
DrawRectangle
|
| Draws a rectangle from X1,Y1 to X2,Y2
|
- UINT
|
X1
|
|
|
- UINT
|
Y1
|
|
|
- UINT
|
Width
|
|
|
- UINT
|
Height
|
|
|
- BOOL
|
Transparent
|
| When Solid=0 - 0 = Fill with Background / 1 = No Fill
|
- BOOL
|
Solid
|
| 0=Foreground for the outline only, 1=Fill with foreground
|
- VOID
|
Return
|
DrawRoundedRectangle
|
DrawRoundedRectangle
|
| Draws a rectangle with rounded corners
|
- UINT
|
X1
|
|
|
- UINT
|
Y1
|
|
|
- UINT
|
Width
|
|
|
- UINT
|
Height
|
|
|
- UINT
|
Radius
|
|
|
- BYTE
|
Transparent
|
| Chooses the transparency of the box - 0 = Box contains background colour, 1 = Box contains previous pixel data.
|
- BYTE
|
Solid
|
| Chooses to fill the box with colour - 0 = Box contains transparency data, 1 = Box contains foreground colour.
|
- VOID
|
Return
|
DrawString
|
DrawString
|
| Draws a string at the specified location in the specified font
|
- UINT
|
X1
|
|
|
- UINT
|
Y1
|
|
|
- STRING
|
Data
|
|
|
- BYTE
|
Font
|
|
|
- BOOL
|
Transparent
|
| 0=Draw background, 1=Do not draw background
|
- BYTE
|
Align
|
| 0=Left, 1=Center, 2=Right
|
- VOID
|
Return
|
FileCreate
|
FileCreate
|
| Creates an empty file on the file system
|
- STRING
|
Filename
|
| Text label to draw on the button
|
- BYTE
|
Return
|
FileDelete
|
FileDelete
|
| Deletes a file from the file system
|
- STRING
|
Filename
|
| Text label to draw on the button
|
- BYTE
|
Return
|
FileInit
|
FileInit
|
| Starts up the FAT file system access function for the SD card 0=OK
|
- BYTE
|
Return
|
FileOpen
|
FileOpen
|
| Opens a file ready for reading or writing
|
- STRING
|
Filename
|
| Text label to draw on the button
|
- BYTE
|
Return
|
FileReadArray
|
FileReadArray
|
| Read an array of bytes from the current open file Returns the number of bytes read from the file
|
- BYTE
|
Data
|
|
|
- UINT
|
Count
|
|
|
- UINT
|
Return
|
FileWriteArray
|
FileWriteArray
|
| Write an array of bytes to the current open file
|
- BYTE
|
Data
|
|
|
- UINT
|
Count
|
|
|
- VOID
|
Return
|
FolderOpen
|
FolderOpen
|
| Navigates the current directory to a folder We can use ",," to go up a level or "root" to go back to the root.
|
- STRING
|
Filename
|
| Text label to draw on the button
|
- BYTE
|
Return
|
GetAPIVersion
|
GetAPIVersion
|
|
|
- UINT
|
Return
|
GetCardPresent
|
GetCardPresent
|
| Checks to see if a SD card is inserted 1=Card Present, 0=No Card Present
|
- BOOL
|
Return
|
|
GetLastButtonPress
|
| Gets the button index of the last valid button press. 255 = No new touch detected
|
- BYTE
|
Return
|
GetLastRawTouchCoordinate
|
GetLastRawTouchCoordinate
|
| Gets the coordinates of the last touch. -1 = no new touch data available.
|
- INT
|
XY
|
|
|
- VOID
|
Return
|
GetSliderValue
|
GetSliderValue
|
| Gets the value of one of the slider buttons
|
- BYTE
|
ButtonID
|
| the ID of the slider button you want to read
|
- FLOAT
|
Return
|
Initialise
|
Initialise
|
|
|
- VOID
|
Return
|
ListenForTouch
|
ListenForTouch
|
| Enables a screen touch to interrupt the microcontroller using a UART RX interrupt. The master microcontroller must call this function and then enable UART RX interrupt.
|
- UINT
|
State
|
| 0=Off, 1=On
|
- BOOL
|
ButtonOnly
|
| 0=All Touches, 1=Buttons/Sliders only
|
- VOID
|
Return
|
SetBackgroundColour
|
SetBackgroundColour
|
| Sets the background draw colour
|
- BYTE
|
R
|
|
|
- BYTE
|
G
|
|
|
- BYTE
|
B
|
|
|
- VOID
|
Return
|
SetBacklightBrightness
|
SetBacklightBrightness
|
| Sets the brightness of the backlight
|
- BYTE
|
Brightness
|
| 0=Off, 255=Max
|
- VOID
|
Return
|
SetBitmapTransparencyColour
|
SetBitmapTransparencyColour
|
| Sets the RGB colour to use as a transparent mask when drawing bitmaps
|
- BYTE
|
R
|
|
|
- BYTE
|
G
|
|
|
- BYTE
|
B
|
|
|
- VOID
|
Return
|
|
SetButtonIntervalPeriod
|
| Sets the button repress interval in steps of 10ms
|
- UINT
|
Period
|
| Multiple of 10ms, default 50 = 500ms
|
- VOID
|
Return
|
SetColourPallet
|
SetColourPallet
|
| Sets the colour pallet for drawing buttons
|
- BYTE
|
ThemeIndex
|
| Range: 0 to 9
|
- BYTE
|
ForegroundR
|
|
|
- BYTE
|
ForegroundG
|
|
|
- BYTE
|
ForegroundB
|
|
|
- BYTE
|
BackgroundR
|
|
|
- BYTE
|
BackgroundG
|
|
|
- BYTE
|
BackgroundB
|
|
|
- BYTE
|
HighlightR
|
|
|
- BYTE
|
HighlightG
|
|
|
- BYTE
|
HighlightB
|
|
|
- BYTE
|
LowLightR
|
|
|
- BYTE
|
LowLightG
|
|
|
- BYTE
|
LowLightB
|
|
|
- VOID
|
Return
|
SetFontScaler
|
SetFontScaler
|
| Sets the brightness of the backlight
|
- BYTE
|
XScaler
|
| Width Multiplier Range: 1 to x
|
- BYTE
|
YScaler
|
| Height Multiplier Range: 1 to x
|
- VOID
|
Return
|
SetForegroundColour
|
SetForegroundColour
|
| Sets the foreground draw colour
|
- BYTE
|
R
|
|
|
- BYTE
|
G
|
|
|
- BYTE
|
B
|
|
|
- VOID
|
Return
|
SetGraphData
|
SetGraphData
|
| Draws a line graph area on the display with or without grids. Uses the current foreground / background colours
|
- BYTE
|
TraceIndex
|
| Range: 0-5 Max 6 traces
|
- INT
|
X
|
| X value - XY Graph Type Only
|
- INT
|
Y
|
| Y value
|
- VOID
|
Return
|
SetOrientation
|
SetOrientation
|
| Sets the display orientation
|
- BYTE
|
Orientation
|
| Range: 0 - 3
|
- VOID
|
Return
|
SetSliderValue
|
SetSliderValue
|
| Sets the value of one of the slider buttons
|
- BYTE
|
ButtonID
|
| the ID of the slider button you want to read
|
- FLOAT
|
Value
|
| Range: 0 to 1
|
- VOID
|
Return
|
UpdateButtonText
|
UpdateButtonText
|
| Redraws the selected button with the new text
|
- BYTE
|
ButtonIndex
|
| Range: 0 to NumButtons -1
|
- STRING
|
Text
|
|
|
- VOID
|
Return
|
|
UpdateButtonTheme
|
| Redraws the selected button in a new theme
|
- BYTE
|
ButtonIndex
|
| Range: 0 to NumButtons -1
|
- BYTE
|
ThemeIndex
|
| Range: 0 to 9
|
- VOID
|
Return
|
WifiAcceptClose
|
WifiAcceptClose
|
| Stops incoming socket requests from being accepted
|
- VOID
|
Return
|
WifiAcceptOpen
|
WifiAcceptOpen
|
| Allows incoming socket requests to be accepted
|
- BYTE
|
Return
|
WifiConnectToSSID
|
WifiConnectToSSID
|
| Connects to a remote WIFI network
|
- STRING
|
SSID
|
| Text label to draw on the button
|
- STRING
|
Password
|
|
|
- BYTE
|
Return
|
WifiCreateAccessPoint
|
WifiCreateAccessPoint
|
| Creates a local access point
|
- STRING
|
SSID
|
| Text label to draw on the button
|
- STRING
|
Password
|
|
|
- BYTE
|
Channel
|
| Range 1-14
|
- BYTE
|
Encryption
|
| Range 0-4 - 0=Open, 1=WEP, 2=WPAPSK, 2=WPA2PSK 3=WPAWPA2PSK
|
- BYTE
|
Return
|
WifiDisconnect
|
WifiDisconnect
|
| Disconnect from the current socket
|
- VOID
|
Return
|
WifiInit
|
WifiInit
|
| Startup up WIFI communications
|
- VOID
|
Return
|
WifiReadIP
|
WifiReadIP
|
| Collects the IP address from the WIFI as a string.
|
- STRING
|
Return
|
WifiReceiveArray
|
WifiReceiveArray
|
| Read an array of bytes from the WIFI connection Returns the number of bytes read from the file
|
- BYTE
|
Data
|
|
|
- UINT
|
Count
|
|
|
- UINT
|
Return
|
WifiScan
|
WifiScan
|
| Scans the WIFI network and returns the number of networks detected
|
- BYTE
|
Return
|
WifiScanEncryptionMode
|
WifiScanEncryptionMode
|
| Collects the encryption mode from one of the results of the Scan. 0=Open, 1=WEP, 2=WPA_PSK, 3=WPA2_PSK, 4=WPA_WPA2_PSK
|
- BYTE
|
Index
|
| Range: 0 - (Num Returned By WifiSSIDScan) - 1
|
- BYTE
|
Return
|
WifiScanSSID
|
WifiScanSSID
|
| Collects the SSID network name from one of the results of the Scan.
|
- BYTE
|
Index
|
| Range: 0 - (Num Returned By WifiSSIDScan) - 1
|
- STRING
|
Return
|
WifiScanSigStrength
|
WifiScanSigStrength
|
| Collects the signal strength from one of the results of the Scan
|
- BYTE
|
Index
|
| Range: 0 - (Num Returned By WifiSSIDScan) - 1
|
- INT
|
Return
|
WifiSendArray
|
WifiSendArray
|
| Send an array of bytes via WIFI
|
- BYTE
|
Data
|
|
|
- UINT
|
Count
|
|
|
- VOID
|
Return
|
WifiSocketClose
|
WifiSocketClose
|
| Close a socket
|
- VOID
|
Return
|
WifiSocketConnect
|
WifiSocketConnect
|
| Connect to a remote socket
|
- STRING
|
Address
|
|
|
- UINT
|
Port
|
|
|
- BYTE
|
Return
|
WifiSocketListen
|
WifiSocketListen
|
| Listens to a socket for incoming data
|
- UINT
|
Port
|
|
|
- BYTE
|
Return
|
WifiSocketOpen
|
WifiSocketOpen
|
| Opens a socket
|
- BYTE
|
Return
|
WifiUninit
|
WifiUninit
|
| Shots down Wifi communications
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
Rx Retry Count
|
| Number of times to retry and collect a reply from the display
|
|
Rx Timeout
|
| Amount of time to wait for each return byte
|
|
Connections
|
|
Channel
|
| UART Channel selector Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels. Hardware channels use the selected peripheral on-board the target microcontroller.
|
|
TX
|
| Pin to be used for Transmit data
|
|
TX Remap Pin
|
| Allows the hardware transmit pin to be configured from a list of available pins based on your target device,
|
|
RX
|
| Pin to be used for Receive data
|
|
RX Remap Pin
|
| Allows the hardware receive pin to be configured from a list of available pins based on your target device,
|
|
Simulation
|
|
Simulation Type
|
|
|
|
COM Port
|
| Lists all the current available COM port hardware on your PC.
|
Component Source Code
Please click here to download the component source project: FC_Comp_Source_CapTouchDIsplay.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_CapTouchDIsplay.fcfx