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

Committer:
JohnnyK
Date:
2020-11-02
Revision:
0:f2fda7f69e5a
Child:
1:ca8fdb4d4afc

File content as of revision 0:f2fda7f69e5a:

#include "TS_porting.h"

#include "mbed.h"

int TouchScreenPort::getADCvalue(int pin){
    return AnalogIn((PinName)pin).read() * 3300;
}

void TouchScreenPort::setDigitalPin(int pin, int dir, int value){
    PinDirection pDirection;
    if(dir == 0) pDirection = PIN_INPUT;
    else  pDirection = PIN_OUTPUT;
    DigitalInOut((PinName)pin,pDirection,PullDefault,value);
}