TS library is for the 4-wire resistive Touch Screen (without an interface) which is usually included on TFT LCD like are MCUFriend displays.
TS_porting.cpp@0:f2fda7f69e5a, 2020-11-02 (annotated)
- Committer:
- JohnnyK
- Date:
- Mon Nov 02 21:14:08 2020 +0000
- Revision:
- 0:f2fda7f69e5a
- Child:
- 1:ca8fdb4d4afc
First release - beta
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JohnnyK | 0:f2fda7f69e5a | 1 | #include "TS_porting.h" |
JohnnyK | 0:f2fda7f69e5a | 2 | |
JohnnyK | 0:f2fda7f69e5a | 3 | #include "mbed.h" |
JohnnyK | 0:f2fda7f69e5a | 4 | |
JohnnyK | 0:f2fda7f69e5a | 5 | int TouchScreenPort::getADCvalue(int pin){ |
JohnnyK | 0:f2fda7f69e5a | 6 | return AnalogIn((PinName)pin).read() * 3300; |
JohnnyK | 0:f2fda7f69e5a | 7 | } |
JohnnyK | 0:f2fda7f69e5a | 8 | |
JohnnyK | 0:f2fda7f69e5a | 9 | void TouchScreenPort::setDigitalPin(int pin, int dir, int value){ |
JohnnyK | 0:f2fda7f69e5a | 10 | PinDirection pDirection; |
JohnnyK | 0:f2fda7f69e5a | 11 | if(dir == 0) pDirection = PIN_INPUT; |
JohnnyK | 0:f2fda7f69e5a | 12 | else pDirection = PIN_OUTPUT; |
JohnnyK | 0:f2fda7f69e5a | 13 | DigitalInOut((PinName)pin,pDirection,PullDefault,value); |
JohnnyK | 0:f2fda7f69e5a | 14 | } |