Update version of EALib.
Dependencies: FATFileSystem
Fork of EALib by
TSC2046 Class Reference
Texas Instruments Touch Screen Controller (TSC2046). More...
#include <TSC2046.h>
Inherits TouchPanel.
Public Member Functions | |
TSC2046 (PinName mosi, PinName miso, PinName sck, PinName cs) | |
Constructor. | |
virtual bool | init (uint16_t width, uint16_t height) |
Initialize the touch controller. | |
virtual bool | read (touchCoordinate_t &coord) |
Read coordinates from the touch panel. | |
virtual bool | calibrateStart () |
Start to calibrate the display. | |
virtual bool | getNextCalibratePoint (uint16_t *x, uint16_t *y) |
Get the next calibration point. | |
virtual bool | waitForCalibratePoint (bool *morePoints, uint32_t timeout) |
Wait for a calibration point to have been pressed and recored. | |
bool | calibrate (touchCoordinate_t *values, int numValues) |
Calibrate the touch panel with already gathered calibration values. | |
bool | getCalibrationValues (touchCoordinate_t *values, int numValues) |
Get calibration values for the calibration points used by this touch panel. |
Detailed Description
Texas Instruments Touch Screen Controller (TSC2046).
Definition at line 27 of file TSC2046.h.
Constructor & Destructor Documentation
TSC2046 | ( | PinName | mosi, |
PinName | miso, | ||
PinName | sck, | ||
PinName | cs | ||
) |
Constructor.
- Parameters:
-
mosi SPI MOSI pin miso SPI MISO pin sck SPI SCK pin cs chip-select pin
Definition at line 67 of file TSC2046.cpp.
Member Function Documentation
bool calibrate | ( | touchCoordinate_t * | values, |
int | numValues | ||
) |
Calibrate the touch panel with already gathered calibration values.
The list with calibration points must at one point have been retrieved by calling getCalibrationValues;
- Parameters:
-
values list with calibration values numValues the size of the list must match the number of calibration points needed for this touch panel (TSC2046_NUM_CALIB_POINTS)
- Returns:
- true if the request was successful; otherwise false
Definition at line 224 of file TSC2046.cpp.
bool calibrateStart | ( | ) | [virtual] |
Start to calibrate the display.
- Returns:
- true if the request was successful; otherwise false
Implements TouchPanel.
Definition at line 141 of file TSC2046.cpp.
bool getCalibrationValues | ( | touchCoordinate_t * | values, |
int | numValues | ||
) |
Get calibration values for the calibration points used by this touch panel.
This method may only be called after a successful calibration has been performed.
The list with values can be written to persistent storage and used to calibrate the display without involving the user.
- Parameters:
-
values calibration values will be written to this list numValues the size of the list must match the number of calibration points needed for this touch panel (TSC2046_NUM_CALIB_POINTS)
- Returns:
- true if the request was successful; otherwise false
Definition at line 241 of file TSC2046.cpp.
bool getNextCalibratePoint | ( | uint16_t * | x, |
uint16_t * | y | ||
) | [virtual] |
Get the next calibration point.
Draw an indicator on the screen at the coordinates and ask the user to press/click on the indicator. Please note that waitForCalibratePoint() must be called after this method.
- Parameters:
-
x the x coordinate is written to this argument y the y coordinate is written to this argument
- Returns:
- true if the request was successful; otherwise false
Implements TouchPanel.
Definition at line 149 of file TSC2046.cpp.
bool init | ( | uint16_t | width, |
uint16_t | height | ||
) | [virtual] |
Initialize the touch controller.
This method must be called before calibrating or reading data from the controller
- Parameters:
-
width the width of the touch panel. This is usually the same as the width of the display height the height of the touch panel. This is usually the same as the height of the display.
- Returns:
- true if the request was successful; otherwise false
Implements TouchPanel.
Definition at line 87 of file TSC2046.cpp.
bool read | ( | touchCoordinate_t & | coord ) | [virtual] |
Read coordinates from the touch panel.
- Parameters:
-
coord pointer to coordinate object. The read coordinates will be written to this object.
Implements TouchPanel.
Definition at line 106 of file TSC2046.cpp.
bool waitForCalibratePoint | ( | bool * | morePoints, |
uint32_t | timeout | ||
) | [virtual] |
Wait for a calibration point to have been pressed and recored.
This method must be called just after getNextCalibratePoint().
- Parameters:
-
morePoints true is written to this argument if there are more calibrations points available; otherwise it will be false timeout maximum number of milliseconds to wait for a calibration point. Set this argument to 0 to wait indefinite.
- Returns:
- true if the request was successful; otherwise false
Implements TouchPanel.
Definition at line 167 of file TSC2046.cpp.
Generated on Thu Jul 14 2022 09:42:14 by 1.7.2