This is a simple library for the STMPE610 touchscreen controller used by the Adafruit 2.8" TFT LCD shield
SPI_STMPE610.h@0:b5211f22867b, 2021-05-26 (annotated)
- Committer:
- EasyCAT
- Date:
- Wed May 26 19:08:27 2021 +0000
- Revision:
- 0:b5211f22867b
first release
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
EasyCAT | 0:b5211f22867b | 1 | //******************************************************************************************** |
EasyCAT | 0:b5211f22867b | 2 | // * |
EasyCAT | 0:b5211f22867b | 3 | // This software is distributed as an example, "AS IS", in the hope that it could * |
EasyCAT | 0:b5211f22867b | 4 | // be useful, WITHOUT ANY WARRANTY of any kind, express or implied, included, but * |
EasyCAT | 0:b5211f22867b | 5 | // not limited, to the warranties of merchantability, fitness for a particular * |
EasyCAT | 0:b5211f22867b | 6 | // purpose, and non infringiment. In no event shall the authors be liable for any * |
EasyCAT | 0:b5211f22867b | 7 | // claim, damages or other liability, arising from, or in connection with this software. * |
EasyCAT | 0:b5211f22867b | 8 | // * |
EasyCAT | 0:b5211f22867b | 9 | //********************************************************************************************/ |
EasyCAT | 0:b5211f22867b | 10 | |
EasyCAT | 0:b5211f22867b | 11 | |
EasyCAT | 0:b5211f22867b | 12 | |
EasyCAT | 0:b5211f22867b | 13 | #ifndef SPI_STMPE610_H |
EasyCAT | 0:b5211f22867b | 14 | #define SPI_STMPE610_H |
EasyCAT | 0:b5211f22867b | 15 | |
EasyCAT | 0:b5211f22867b | 16 | #include "mbed.h" |
EasyCAT | 0:b5211f22867b | 17 | |
EasyCAT | 0:b5211f22867b | 18 | |
EasyCAT | 0:b5211f22867b | 19 | class SPI_STMPE610 |
EasyCAT | 0:b5211f22867b | 20 | { |
EasyCAT | 0:b5211f22867b | 21 | |
EasyCAT | 0:b5211f22867b | 22 | public: |
EasyCAT | 0:b5211f22867b | 23 | |
EasyCAT | 0:b5211f22867b | 24 | SPI_STMPE610(PinName mosi, PinName miso, PinName sclk, PinName cs); |
EasyCAT | 0:b5211f22867b | 25 | |
EasyCAT | 0:b5211f22867b | 26 | bool GetPoint(uint16_t *X, uint16_t *Y); |
EasyCAT | 0:b5211f22867b | 27 | |
EasyCAT | 0:b5211f22867b | 28 | |
EasyCAT | 0:b5211f22867b | 29 | private: |
EasyCAT | 0:b5211f22867b | 30 | |
EasyCAT | 0:b5211f22867b | 31 | SPI m_spi; |
EasyCAT | 0:b5211f22867b | 32 | DigitalOut m_cs; |
EasyCAT | 0:b5211f22867b | 33 | |
EasyCAT | 0:b5211f22867b | 34 | bool GetRawPoint(uint16_t *X, uint16_t *Y); |
EasyCAT | 0:b5211f22867b | 35 | uint8_t Read8(uint8_t Addr); |
EasyCAT | 0:b5211f22867b | 36 | uint16_t Read16(uint8_t Addr); |
EasyCAT | 0:b5211f22867b | 37 | void Write8(uint8_t Addr, uint8_t Data); |
EasyCAT | 0:b5211f22867b | 38 | |
EasyCAT | 0:b5211f22867b | 39 | }; |
EasyCAT | 0:b5211f22867b | 40 | |
EasyCAT | 0:b5211f22867b | 41 | #endif /* SPI_STMPE610_H */ |