Update version of EALib.

Dependencies:   FATFileSystem

Fork of EALib by IONX

Embed: (wiki syntax)

« Back to documentation index

AR1021 Class Reference

AR1021 Class Reference

Microchip Touch Screen Controller (AR1021). More...

#include <AR1021.h>

Inherits TouchPanel.

Public Member Functions

 AR1021 (PinName mosi, PinName miso, PinName sck, PinName cs, PinName siq)
 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.

Detailed Description

Microchip Touch Screen Controller (AR1021).

Please note that this touch panel has an on-board storage for calibration data. Once a successful calibration has been performed it is not needed to do additional calibrations since the stored calibration data will be used.

Definition at line 30 of file AR1021.h.


Constructor & Destructor Documentation

AR1021 ( PinName  mosi,
PinName  miso,
PinName  sck,
PinName  cs,
PinName  siq 
)

Constructor.

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

Definition at line 76 of file AR1021.cpp.


Member Function Documentation

bool calibrateStart (  ) [virtual]

Start to calibrate the display.

Returns:
true if the request was successful; otherwise false

Implements TouchPanel.

Definition at line 184 of file AR1021.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 244 of file AR1021.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 111 of file AR1021.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 99 of file AR1021.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 276 of file AR1021.cpp.