150 #ifndef ADA_TSC2046_H 151 #define ADA_TSC2046_H 155 #include <Adafruit_BusIO_Register.h> 156 #include <Adafruit_SPIDevice.h> 275 void begin(
int spiChipSelect, SPIClass *the_spi = &SPI,
276 uint32_t xResistance = 400,
277 uint32_t spiFrequency = 2L * 1000L * 1000L);
297 void setVRef(
float vRef);
315 void setTouchedThreshold(
float rTouchThreshold);
359 void enableInterrupts(
bool enable);
367 float readTemperatureC();
375 float readTemperatureF();
386 float readBatteryVoltage();
407 float readAuxiliaryVoltage();
421 float effectiveVRef();
425 Adafruit_SPIDevice *_spiDev;
427 int64_t _spiFrequency;
428 uint32_t _xResistance;
435 float _touchedThreshold = 100000.f;
437 bool _interruptsEnabled =
true;
440 float readTemperatureK();
444 uint16_t readCoord(uint8_t channelSelect);
448 uint16_t readExtra(uint8_t channelSelect);
450 static uint16_t parse12BitValue(uint8_t spiUpperByte, uint8_t spiLowerByte);
474 uint8_t enableOrIdleADC : 1;
477 uint8_t enableInternalVRef : 1;
486 uint8_t singleEndedRef : 1;
489 uint8_t use8BitConv : 1;
Class for interfacing with a TSC2046 touchscreen controller.
Definition: Adafruit_TSC2046.h:240
float xPercent()
The X-coordinate as a percentage. Note that physical touchscreens vary, and the range of yours may no...
Definition: Adafruit_TSC2046.cpp:29
int16_t y
The full scale raw Y coordinate from the touchscreen. For the Y-coordinate as a percentage, see TSPoint::yPercent. If the touchscreen is not being touched, this value is meaningless.
Definition: Adafruit_TSC2046.h:186
The type returned by Adafruit_TSC2046::getPoint.
Definition: Adafruit_TSC2046.h:164
float z
The resistance measurement that corresponds to the pressure currently exerted on the touchscreen...
Definition: Adafruit_TSC2046.h:194
float yPercent()
The Y-coordinate as a percentage. Note that physical touchscreens vary, and the range of yours may no...
Definition: Adafruit_TSC2046.cpp:31
TSPoint(int16_t x, int16_t y, float z)
Create a new TSPoint with these exact values. You usually don't need to call this constructor in user...
Definition: Adafruit_TSC2046.cpp:23
int16_t x
The full scale raw X coordinate from the touchscreen. For the X-coordinate as a percentage, see TSPoint::xPercent. If the touchscreen is not being touched, this value is meaningless.
Definition: Adafruit_TSC2046.h:180