The wait in mci_WaitForEvent will delay all card transactions.

Dependencies:   FATFileSystem

Fork of EALib by EmbeddedArtists AB

Embed: (wiki syntax)

« Back to documentation index

TSC2046 Class Reference

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 12 of file TSC2046.h.


Constructor & Destructor Documentation

TSC2046 ( PinName  mosi,
PinName  miso,
PinName  sck,
PinName  cs 
)

Constructor.

Parameters:
mosiSPI MOSI pin
misoSPI MISO pin
sckSPI SCK pin
cschip-select pin

Definition at line 52 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:
valueslist with calibration values
numValuesthe 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 209 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 126 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:
valuescalibration values will be written to this list
numValuesthe 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 226 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:
xthe x coordinate is written to this argument
ythe y coordinate is written to this argument
Returns:
true if the request was successful; otherwise false

Implements TouchPanel.

Definition at line 134 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:
widththe width of the touch panel. This is usually the same as the width of the display
heightthe 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 72 of file TSC2046.cpp.

bool read ( touchCoordinate_t &  coord ) [virtual]

Read coordinates from the touch panel.

Parameters:
coordpointer to coordinate object. The read coordinates will be written to this object.

Implements TouchPanel.

Definition at line 91 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:
morePointstrue is written to this argument if there are more calibrations points available; otherwise it will be false
timeoutmaximum 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 152 of file TSC2046.cpp.