TS library is for the 4-wire resistive Touch Screen (without an interface) which is usually included on TFT LCD like are MCUFriend displays.

Committer:
JohnnyK
Date:
Sun Jan 17 15:58:15 2021 +0000
Revision:
1:ca8fdb4d4afc
Parent:
0:f2fda7f69e5a
Corrections - include guards was added

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JohnnyK 0:f2fda7f69e5a 1 #include "TS_porting.h"
JohnnyK 0:f2fda7f69e5a 2
JohnnyK 0:f2fda7f69e5a 3 int TouchScreenPort::getADCvalue(int pin){
JohnnyK 0:f2fda7f69e5a 4 return AnalogIn((PinName)pin).read() * 3300;
JohnnyK 0:f2fda7f69e5a 5 }
JohnnyK 0:f2fda7f69e5a 6
JohnnyK 0:f2fda7f69e5a 7 void TouchScreenPort::setDigitalPin(int pin, int dir, int value){
JohnnyK 0:f2fda7f69e5a 8 PinDirection pDirection;
JohnnyK 0:f2fda7f69e5a 9 if(dir == 0) pDirection = PIN_INPUT;
JohnnyK 0:f2fda7f69e5a 10 else pDirection = PIN_OUTPUT;
JohnnyK 0:f2fda7f69e5a 11 DigitalInOut((PinName)pin,pDirection,PullDefault,value);
JohnnyK 0:f2fda7f69e5a 12 }