TS library is for the 4-wire resistive Touch Screen (without an interface) which is usually included on TFT LCD like are MCUFriend displays.
Diff: TS.h
- Revision:
- 1:ca8fdb4d4afc
- Parent:
- 0:f2fda7f69e5a
--- a/TS.h Mon Nov 02 21:14:08 2020 +0000 +++ b/TS.h Sun Jan 17 15:58:15 2021 +0000 @@ -20,7 +20,7 @@ #define XP D8 #define RD A0 -TS_config config = {2955,325,3070,470,240,320}; +TS_config config = {2955,325,3070,470,240,320}; // that are minimum and maxim mV for all axis TouchScreen ts(YP,YM,XP,XM,config); int main() @@ -40,6 +40,9 @@ * @/code */ +#ifndef TS_H +#define TS_H + #include "TS_porting.h" struct TS_point{ @@ -65,13 +68,14 @@ }; + struct TS_config{ - unsigned int TS_adc_Xmax, - TS_adc_Xmin, - TS_adc_Ymax, - TS_adc_Ymin, - TFTWIDTH, - TFTHEIGHT; + unsigned int TS_adc_Xmax, // max value for X in mV + TS_adc_Xmin, // max value for X in mV + TS_adc_Ymax, // max value for Y in mV + TS_adc_Ymin, // min value for Y in mV + TFTWIDTH, // Display width + TFTHEIGHT; // Display height }; @@ -96,7 +100,7 @@ /** Set the orientation * - * @param orientation It is set via the struct TS_Orientation + * @param orientation It is set via the TS_Orientation enum * TS_PORTRAITE(default), TS_LANDSCAPE,TS_PORTRAITE_REV and TS_LANDSCAPE_REV */ void setOrientation(TS_Orientation orientation); @@ -130,4 +134,4 @@ /** ADC Y value normalization*/ float nrm_adcY(unsigned int y); }; - +#endif \ No newline at end of file