This is a simple library for the STMPE610 touchscreen controller used by the Adafruit 2.8" TFT LCD shield
Diff: SPI_STMPE610.h
- Revision:
- 0:b5211f22867b
diff -r 000000000000 -r b5211f22867b SPI_STMPE610.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SPI_STMPE610.h Wed May 26 19:08:27 2021 +0000 @@ -0,0 +1,41 @@ +//******************************************************************************************** +// * +// This software is distributed as an example, "AS IS", in the hope that it could * +// be useful, WITHOUT ANY WARRANTY of any kind, express or implied, included, but * +// not limited, to the warranties of merchantability, fitness for a particular * +// purpose, and non infringiment. In no event shall the authors be liable for any * +// claim, damages or other liability, arising from, or in connection with this software. * +// * +//********************************************************************************************/ + + + +#ifndef SPI_STMPE610_H +#define SPI_STMPE610_H + +#include "mbed.h" + + +class SPI_STMPE610 +{ + +public: + + SPI_STMPE610(PinName mosi, PinName miso, PinName sclk, PinName cs); + + bool GetPoint(uint16_t *X, uint16_t *Y); + + +private: + + SPI m_spi; + DigitalOut m_cs; + + bool GetRawPoint(uint16_t *X, uint16_t *Y); + uint8_t Read8(uint8_t Addr); + uint16_t Read16(uint8_t Addr); + void Write8(uint8_t Addr, uint8_t Data); + +}; + +#endif /* SPI_STMPE610_H */ \ No newline at end of file