Две этикетки

This commit is contained in:
Beslan
2022-02-20 12:14:43 +03:00
parent fd7be6b644
commit 6a60cfb872
3 changed files with 213 additions and 193 deletions

View File

@@ -11,166 +11,170 @@ ILI9341::ILI9341(PinName MOSI, PinName MISO, PinName SCK, PinName DC, PinName RS
rst = 1; rst = 1;
osDelay(10); ThisThread::sleep_for(10ms);
// (void)osDelay(10);
rst = 0; rst = 0;
osDelay(10); ThisThread::sleep_for(10ms);
// osDelay(10);
rst = 1; rst = 1;
osDelay(10); ThisThread::sleep_for(10ms);
// osDelay(10);
LCD_WR_REG(0x01); //software reset LCD_WR_REG(0x01U); //software reset
osDelay(50); ThisThread::sleep_for(50ms);
LCD_WR_REG(0x28); // osDelay(50);
LCD_WR_REG(0x28U);
// display off // display off
//--------------------------------------------------------- //---------------------------------------------------------
// magic? // magic?
LCD_WR_REG(0xcf); LCD_WR_REG(0xcfU);
LCD_WR_Data(0x00); LCD_WR_Data(0x00U);
LCD_WR_Data(0x83); LCD_WR_Data(0x83U);
LCD_WR_Data(0x30); LCD_WR_Data(0x30U);
LCD_WR_REG(0xed); LCD_WR_REG(0xedU);
LCD_WR_Data(0x64); LCD_WR_Data(0x64U);
LCD_WR_Data(0x03); LCD_WR_Data(0x03U);
LCD_WR_Data(0x12); LCD_WR_Data(0x12U);
LCD_WR_Data(0x81); LCD_WR_Data(0x81U);
LCD_WR_REG(0xe8); LCD_WR_REG(0xe8U);
LCD_WR_Data(0x85); LCD_WR_Data(0x85U);
LCD_WR_Data(0x01); LCD_WR_Data(0x01U);
LCD_WR_Data(0x79); LCD_WR_Data(0x79U);
LCD_WR_REG(0xcb); LCD_WR_REG(0xcbU);
LCD_WR_Data(0x39); LCD_WR_Data(0x39U);
LCD_WR_Data(0x2c); LCD_WR_Data(0x2cU);
LCD_WR_Data(0x00); LCD_WR_Data(0x00U);
LCD_WR_Data(0x34); LCD_WR_Data(0x34U);
LCD_WR_Data(0x02); LCD_WR_Data(0x02U);
LCD_WR_REG(0xf7); LCD_WR_REG(0xf7U);
LCD_WR_Data(0x20); LCD_WR_Data(0x20U);
LCD_WR_REG(0xea); LCD_WR_REG(0xeaU);
LCD_WR_Data(0x00); LCD_WR_Data(0x00U);
LCD_WR_Data(0x00); LCD_WR_Data(0x00U);
//------------power control------------------------------ //------------power control------------------------------
LCD_WR_REG(0xc0); //power control LCD_WR_REG(0xc0U); //power control
LCD_WR_Data(0x26); LCD_WR_Data(0x26U);
LCD_WR_REG(0xc1); //power control LCD_WR_REG(0xc1U); //power control
LCD_WR_Data(0x11); LCD_WR_Data(0x11U);
//--------------VCOM //--------------VCOM
LCD_WR_REG(0xc5); //vcom control LCD_WR_REG(0xc5U); //vcom control
LCD_WR_Data(0x35); //35 LCD_WR_Data(0x35U); //35
LCD_WR_Data(0x3e); //3E LCD_WR_Data(0x3eU); //3E
LCD_WR_REG(0xc7); //vcom control LCD_WR_REG(0xc7U); //vcom control
LCD_WR_Data(0xbe); // 0x94 LCD_WR_Data(0xbeU); // 0x94
//------------memory access control------------------------ //------------memory access control------------------------
LCD_WR_REG(0x36); LCD_WR_REG(0x36U);
// memory access control // memory access control
LCD_WR_Data(0xE8U); //Поворот экрана на 0 градусов LCD_WR_Data(0xE8U); //Поворот экрана на 0 градусов
// LCD_WR_Data(0x28U); //Поворот экрана на 180 градусов // LCD_WR_Data(0x28U); //Поворот экрана на 180 градусов
LCD_WR_REG(0x3a); // pixel format set LCD_WR_REG(0x3aU); // pixel format set
LCD_WR_Data(0x55); //16bit /pixel LCD_WR_Data(0x55U); //16bit /pixel
//----------------- frame rate------------------------------ //----------------- frame rate------------------------------
LCD_WR_REG(0xb1); LCD_WR_REG(0xb1U);
// frame rate // frame rate
LCD_WR_Data(0x00U); LCD_WR_Data(0x00U);
LCD_WR_Data(0x1BU); //70 LCD_WR_Data(0x1BU); //70
//----------------Gamma--------------------------------- //----------------Gamma---------------------------------
LCD_WR_REG(0xf2); // 3Gamma Function Disable LCD_WR_REG(0xf2U); // 3Gamma Function Disable
LCD_WR_Data(0x08); LCD_WR_Data(0x08U);
LCD_WR_REG(0x26); LCD_WR_REG(0x26U);
LCD_WR_Data(0x01); // gamma set 4 gamma curve 01/02/04/08 LCD_WR_Data(0x01U); // gamma set 4 gamma curve 01/02/04/08
LCD_WR_REG(0xE0); //positive gamma correction LCD_WR_REG(0xE0U); //positive gamma correction
LCD_WR_Data(0x1f); LCD_WR_Data(0x1fU);
LCD_WR_Data(0x1a); LCD_WR_Data(0x1aU);
LCD_WR_Data(0x18); LCD_WR_Data(0x18U);
LCD_WR_Data(0x0a); LCD_WR_Data(0x0aU);
LCD_WR_Data(0x0f); LCD_WR_Data(0x0fU);
LCD_WR_Data(0x06); LCD_WR_Data(0x06U);
LCD_WR_Data(0x45); LCD_WR_Data(0x45U);
LCD_WR_Data(0x87); LCD_WR_Data(0x87U);
LCD_WR_Data(0x32); LCD_WR_Data(0x32U);
LCD_WR_Data(0x0a); LCD_WR_Data(0x0aU);
LCD_WR_Data(0x07); LCD_WR_Data(0x07U);
LCD_WR_Data(0x02); LCD_WR_Data(0x02U);
LCD_WR_Data(0x07); LCD_WR_Data(0x07U);
LCD_WR_Data(0x05); LCD_WR_Data(0x05U);
LCD_WR_Data(0x00); LCD_WR_Data(0x00U);
LCD_WR_REG(0xE1); //negamma correction LCD_WR_REG(0xE1U); //negamma correction
LCD_WR_Data(0x00); LCD_WR_Data(0x00U);
LCD_WR_Data(0x25); LCD_WR_Data(0x25U);
LCD_WR_Data(0x27); LCD_WR_Data(0x27U);
LCD_WR_Data(0x05); LCD_WR_Data(0x05U);
LCD_WR_Data(0x10); LCD_WR_Data(0x10U);
LCD_WR_Data(0x09); LCD_WR_Data(0x09U);
LCD_WR_Data(0x3a); LCD_WR_Data(0x3aU);
LCD_WR_Data(0x78); LCD_WR_Data(0x78U);
LCD_WR_Data(0x4d); LCD_WR_Data(0x4dU);
LCD_WR_Data(0x05); LCD_WR_Data(0x05U);
LCD_WR_Data(0x18); LCD_WR_Data(0x18U);
LCD_WR_Data(0x0d); LCD_WR_Data(0x0dU);
LCD_WR_Data(0x38); LCD_WR_Data(0x38U);
LCD_WR_Data(0x3a); LCD_WR_Data(0x3aU);
LCD_WR_Data(0x1f); LCD_WR_Data(0x1fU);
//--------------ddram --------------------- //--------------ddram ---------------------
LCD_WR_REG(0x2a); LCD_WR_REG(0x2aU);
// column set // column set
// size = 239 // size = 239
LCD_WR_Data(0x00); LCD_WR_Data(0x00U);
LCD_WR_Data(0x00); LCD_WR_Data(0x00U);
LCD_WR_Data(0x00); LCD_WR_Data(0x00U);
LCD_WR_Data(0xEF); LCD_WR_Data(0xEFU);
LCD_WR_REG(0x2b); LCD_WR_REG(0x2bU);
// page address set // page address set
// size = 319 // size = 319
LCD_WR_Data(0x00); LCD_WR_Data(0x00U);
LCD_WR_Data(0x00); LCD_WR_Data(0x00U);
LCD_WR_Data(0x01); LCD_WR_Data(0x01U);
LCD_WR_Data(0x3F); LCD_WR_Data(0x3FU);
// LCD_WR_REG(0x34); // LCD_WR_REG(0x34);
//LCD_WR_REG(0x35); //LCD_WR_REG(0x35);
// tearing effect off // tearing effect off
// tearing effect on // tearing effect on
// LCD_WR_REG(0xb4); // display inversion // LCD_WR_REG(0xb4); // display inversion
// LCD_WR_Data(0x00); // LCD_WR_Data(0x00);
LCD_WR_REG(0xb7); //entry mode set LCD_WR_REG(0xb7U); //entry mode set
LCD_WR_Data(0x07); LCD_WR_Data(0x07U);
//-----------------display--------------------- //-----------------display---------------------
LCD_WR_REG(0xb6); LCD_WR_REG(0xb6U);
// display function control // display function control
LCD_WR_Data(0x0a); LCD_WR_Data(0x0aU);
LCD_WR_Data(0x82); LCD_WR_Data(0x82U);
LCD_WR_Data(0x27); LCD_WR_Data(0x27U);
LCD_WR_Data(0x00); LCD_WR_Data(0x00U);
LCD_WR_REG(0x11); //sleep out LCD_WR_REG(0x11U); //sleep out
osDelay(100); ThisThread::sleep_for(100ms);
LCD_WR_REG(0x29); // display on LCD_WR_REG(0x29U); // display on
} }
void ILI9341::LCD_WR_Data(uint8_t Data) { void ILI9341::LCD_WR_Data(uint8_t Data) {
dc = 1; dc = 1;
dispPort.write(Data); (void)dispPort.write(static_cast<int>(Data));
} }
void ILI9341::LCD_WR_REG(uint8_t Reg) { void ILI9341::LCD_WR_REG(uint8_t Reg) {
dc = 0; dc = 0;
dispPort.write(Reg); (void)dispPort.write(static_cast<int>(Reg));
} }
void void
ILI9341::LCD_setaddress(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) //set coordinate for print or other function ILI9341::LCD_setaddress(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) //set coordinate for print or other function
{ {
LCD_WR_REG(0x2A); LCD_WR_REG(0x2AU);
LCD_WR_Data(x1 >> 8); LCD_WR_Data(x1 >> 8U);
LCD_WR_Data(x1); LCD_WR_Data(static_cast<uint8_t>(x1));
LCD_WR_Data(x2 >> 8); LCD_WR_Data(x2 >> 8U);
LCD_WR_Data(x2); LCD_WR_Data(static_cast<uint8_t>(x2));
LCD_WR_REG(0x2B); LCD_WR_REG(0x2BU);
LCD_WR_Data(y1 >> 8); LCD_WR_Data(y1 >> 8U);
LCD_WR_Data(y1); LCD_WR_Data(static_cast<uint8_t>(y1));
LCD_WR_Data(y2 >> 8); LCD_WR_Data(y2 >> 8U);
LCD_WR_Data(y2); LCD_WR_Data(static_cast<uint8_t>(y2));
LCD_WR_REG(0x2C); //memory write LCD_WR_REG(0x2CU); //memory write
} }
void ILI9341::transmitData(const uint8_t *pixels, uint16_t x, uint16_t y, uint16_t w, uint16_t h) { void ILI9341::transmitData(const uint8_t *pixels, uint16_t x, uint16_t y, uint16_t w, uint16_t h) {

View File

@@ -1,11 +1,11 @@
#include "tsc2046.h" #include "tsc2046.h"
#define CMD_X 0xD1 constexpr char CMD_X=0xD1U;
#define CMD_Y 0x91 constexpr char CMD_Y=0x91U;
#define CMD_ENABLE_IRQ 0x80 constexpr char CMD_ENABLE_IRQ=0x80U;
#define RESCALE_FACTOR 1000000 #define RESCALE_FACTOR 1000000
#define EE_MEM_ADDR 400 constexpr uint32_t EE_MEM_ADDR=400U;
const constexpr auto dispWidth = 320; const constexpr auto dispWidth = 320;
const constexpr auto dispHeight = 240; const constexpr auto dispHeight = 240;
@@ -18,33 +18,36 @@ const constexpr auto yd1 = (10 * dispHeight) / 100;
const constexpr auto yd2 = (50 * dispHeight) / 100; const constexpr auto yd2 = (50 * dispHeight) / 100;
const constexpr auto yd3 = (90 * dispHeight) / 100; const constexpr auto yd3 = (90 * dispHeight) / 100;
TSC2046::TSC2046(EEPROM* mem, PinName MOSI, PinName MISO, PinName SCK, PinName CS, PinName INT) TSC2046::TSC2046(EEPROM* mem, PinName MOSI, PinName MISO, PinName SCK, PinName CS, PinName INT):
tpPort(MOSI, MISO, SCK),
tpCS(CS),
tpInt(INT, PullUp)
{ {
tpPort = new SPI(MOSI, MISO, SCK); // tpPort = new SPI(MOSI, MISO, SCK);
tpCS = new DigitalOut(CS); // tpCS = new DigitalOut(CS);
tpInt = new DigitalIn(INT, PullUp); // tpInt = new DigitalIn(INT, PullUp);
eeprom = mem; eeprom = mem;
eeprom->read(EE_MEM_ADDR, (uint8_t*)&touchCoeff, sizeof(touchCoeff)); eeprom->read(EE_MEM_ADDR, reinterpret_cast<uint8_t*>(&touchCoeff), sizeof(touchCoeff));
if (touchCoeff.touchIsCalibrated > 2) if (touchCoeff.touchIsCalibrated > 2U) { touchCoeff.touchIsCalibrated = false; }
touchCoeff.touchIsCalibrated = false;
readValue(CMD_ENABLE_IRQ); // Enable IRQ (void)readValue(CMD_ENABLE_IRQ); // Enable IRQ
} }
void TSC2046::GetRawXY(uint16_t* X, uint16_t* Y) void TSC2046::GetRawXY(uint16_t* X, uint16_t* Y)
{ {
readValue(CMD_X); // Dummy read - disable PenIRQ (void)readValue(CMD_X); // Dummy read - disable PenIRQ
*X = readValue(CMD_X); // Read X-Value *X = readValue(CMD_X); // Read X-Value
readValue(CMD_Y); // Dummy read - disable PenIRQ (void)readValue(CMD_Y); // Dummy read - disable PenIRQ
*Y = readValue(CMD_Y); // Read Y-Value *Y = readValue(CMD_Y); // Read Y-Value
readValue(CMD_ENABLE_IRQ); // Enable IRQ (void)readValue(CMD_ENABLE_IRQ); // Enable IRQ
} }
void TSC2046::GetXY(int32_t* X, int32_t* Y) void TSC2046::GetXY(int32_t* X, int32_t* Y)
{ {
uint16_t x, y; uint16_t x;
uint16_t y;
if (DetectTouch()) { if (DetectTouch()) {
GetRawXY(&x, &y); GetRawXY(&x, &y);
*X = (touchCoeff.cali_A * x + touchCoeff.cali_B * y + touchCoeff.cali_C) / RESCALE_FACTOR; *X = (touchCoeff.cali_A * x + touchCoeff.cali_B * y + touchCoeff.cali_C) / RESCALE_FACTOR;
@@ -52,116 +55,129 @@ void TSC2046::GetXY(int32_t* X, int32_t* Y)
} }
} }
uint16_t TSC2046::readValue(uint16_t port) uint16_t TSC2046::readValue(char port)
{ {
static char txbuf[3] = { 0 }; static char txbuf[3] = { 0U };
static char rxbuf[3] = { 0 }; static char rxbuf[3] = { 0U };
txbuf[0] = port; txbuf[0] = port;
tpCS->write(0); tpCS.write(0);
tpPort->write(txbuf, 3, rxbuf, 3); (void)tpPort.write(txbuf, 3, rxbuf, 3);
tpCS->write(1); tpCS.write(1);
return ((uint16_t)rxbuf[1] << 5) | (rxbuf[2] >> 3); return ((uint16_t)rxbuf[1] << 5) | (rxbuf[2] >> 3);
} }
bool TSC2046::DetectTouch() bool TSC2046::DetectTouch()
{ {
return !tpInt->read(); return !tpInt.read();
} }
void TSC2046::coeffCalc() void TSC2046::coeffCalc()
{ {
double temp1;
double temp1, temp2; double temp2;
double cal_A = 0.0, cal_B = 0.0, cal_C = 0.0, cal_D = 0.0, cal_E = 0.0, cal_F = 0.0; double cal_A = 0.0;
double cal_B = 0.0;
double cal_C = 0.0;
double cal_D = 0.0;
double cal_E = 0.0;
double cal_F = 0.0;
//A //A
temp1 = ((double)xd1 * ((double)yt2 - (double)yt3)) + ((double)xd2 * ((double)yt3 - (double)yt1)) + ((double)xd3 * ((double)yt1 - (double)yt2)); temp1 = (static_cast<double>(xd1) * (static_cast<double>(yt2) - static_cast<double>(yt3))) + (static_cast<double>(xd2)
temp2 = ((double)xt1 * ((double)yt2 - (double)yt3)) + ((double)xt2 * ((double)yt3 - (double)yt1)) + ((double)xt3 * ((double)yt1 - (double)yt2)); * (static_cast<double>(yt3) - static_cast<double>(yt1))) + (static_cast<double>(xd3)
* (static_cast<double>(yt1) - static_cast<double>(yt2)));
temp2 = (static_cast<double>(xt1) * (static_cast<double>(yt2) - static_cast<double>(yt3))) + (static_cast<double>(xt2)
* (static_cast<double>(yt3) - static_cast<double>(yt1))) + (static_cast<double>(xt3) *
(static_cast<double>(yt1) - static_cast<double>(yt2)));
cal_A = temp1 / temp2; cal_A = temp1 / temp2;
touchCoeff.cali_A = (int32_t)((double)cal_A * RESCALE_FACTOR); touchCoeff.cali_A = static_cast<int32_t>(cal_A * RESCALE_FACTOR);
//B //B
temp1 = (cal_A * ((double)xt3 - (double)xt2)) + (double)xd2 - (double)xd3; temp1 = (cal_A * (static_cast<double>(xt3) - static_cast<double>(xt2))) + static_cast<double>(xd2) - static_cast<double>(xd3);
temp2 = (double)yt2 - (double)yt3; temp2 = static_cast<double>(yt2) - static_cast<double>(yt3);
cal_B = temp1 / temp2; cal_B = temp1 / temp2;
touchCoeff.cali_B = (int32_t)((double)cal_B * RESCALE_FACTOR); touchCoeff.cali_B = static_cast<int32_t>(cal_B * RESCALE_FACTOR);
//C //C
cal_C = (double)xd3 - (cal_A * (double)xt3) - (cal_B * (double)yt3); cal_C = static_cast<double>(xd3) - (cal_A * static_cast<double>(xt3)) - (cal_B * static_cast<double>(yt3));
touchCoeff.cali_C = (int32_t)(cal_C * RESCALE_FACTOR); touchCoeff.cali_C = static_cast<int32_t>(cal_C * RESCALE_FACTOR);
//D //D
temp1 = ((double)yd1 * ((double)yt2 - (double)yt3)) + ((double)yd2 * ((double)yt3 - (double)yt1)) + ((double)yd3 * ((double)yt1 - (double)yt2)); temp1 = (static_cast<double>(yd1) * (static_cast<double>(yt2) - static_cast<double>(yt3))) + (static_cast<double>(yd2)
temp2 = ((double)xt1 * ((double)yt2 - (double)yt3)) + ((double)xt2 * ((double)yt3 - (double)yt1)) + ((double)xt3 * ((double)yt1 - (double)yt2)); * (static_cast<double>(yt3) - static_cast<double>(yt1))) + (static_cast<double>(yd3)
cal_D = (double)temp1 / (double)temp2; * (static_cast<double>(yt1) - static_cast<double>(yt2)));
touchCoeff.cali_D = (int32_t)(cal_D * RESCALE_FACTOR); temp2 = (static_cast<double>(xt1) * (static_cast<double>(yt2) - static_cast<double>(yt3))) + (static_cast<double>(xt2)
* (static_cast<double>(yt3) - static_cast<double>(yt1))) + (static_cast<double>(xt3)
* (static_cast<double>(yt1) - static_cast<double>(yt2)));
cal_D = static_cast<double>(temp1) / static_cast<double>(temp2);
touchCoeff.cali_D = static_cast<int32_t>(cal_D * RESCALE_FACTOR);
//E //E
temp1 = (cal_D * ((double)xt3 - (double)xt2)) + (double)yd2 - (double)yd3; temp1 = (cal_D * (static_cast<double>(xt3) - static_cast<double>(xt2))) + static_cast<double>(yd2) - static_cast<double>(yd3);
temp2 = (double)yt2 - (double)yt3; temp2 = static_cast<double>(yt2) - static_cast<double>(yt3);
cal_E = (double)temp1 / (double)temp2; cal_E = static_cast<double>(temp1) / static_cast<double>(temp2);
touchCoeff.cali_E = (int32_t)(cal_E * RESCALE_FACTOR); touchCoeff.cali_E = static_cast<int32_t>(cal_E * RESCALE_FACTOR);
//F //F
cal_F = (double)yd3 - cal_D * (double)xt3 - cal_E * (double)yt3; cal_F = static_cast<double>(yd3) - cal_D * static_cast<double>(xt3) - cal_E * static_cast<double>(yt3);
touchCoeff.cali_F = (int32_t)(cal_F * RESCALE_FACTOR); touchCoeff.cali_F = static_cast<int32_t>(cal_F * RESCALE_FACTOR);
} }
uint16_t TSC2046::getXd1(void) int TSC2046::getXd1()
{ {
return xd1; return xd1;
} }
uint16_t TSC2046::getXd2(void) int TSC2046::getXd2()
{ {
return xd2; return xd2;
} }
uint16_t TSC2046::getXd3(void) int TSC2046::getXd3()
{ {
return xd3; return xd3;
} }
uint16_t TSC2046::getYd1(void) int TSC2046::getYd1()
{ {
return yd1; return yd1;
} }
uint16_t TSC2046::getYd2(void) int TSC2046::getYd2()
{ {
return yd2; return yd2;
} }
uint16_t TSC2046::getYd3(void) int TSC2046::getYd3()
{ {
return yd3; return yd3;
} }
void TSC2046::setXt1(uint32_t xt1) void TSC2046::setXt1(uint32_t _xt1)
{ {
this->xt1 = xt1; this->xt1 = _xt1;
} }
void TSC2046::setXt2(uint32_t xt2) void TSC2046::setXt2(uint32_t _xt2)
{ {
this->xt2 = xt2; this->xt2 = _xt2;
} }
void TSC2046::setXt3(uint32_t xt3) void TSC2046::setXt3(uint32_t _xt3)
{ {
this->xt3 = xt3; this->xt3 = _xt3;
} }
void TSC2046::setYt1(uint32_t yt1) void TSC2046::setYt1(uint32_t _yt1)
{ {
this->yt1 = yt1; this->yt1 = _yt1;
} }
void TSC2046::setYt2(uint32_t yt2) void TSC2046::setYt2(uint32_t _yt2)
{ {
this->yt2 = yt2; this->yt2 = _yt2;
} }
void TSC2046::setYt3(uint32_t yt3) void TSC2046::setYt3(uint32_t _yt3)
{ {
this->yt3 = yt3; this->yt3 = _yt3;
} }
bool TSC2046::getCalibrated() bool TSC2046::getCalibrated() const
{ {
return touchCoeff.touchIsCalibrated; return touchCoeff.touchIsCalibrated;
} }
@@ -169,5 +185,5 @@ bool TSC2046::getCalibrated()
void TSC2046::setCalibrated() void TSC2046::setCalibrated()
{ {
touchCoeff.touchIsCalibrated = true; touchCoeff.touchIsCalibrated = true;
eeprom->write(EE_MEM_ADDR, (uint8_t*)&touchCoeff, sizeof(touchCoeff)); eeprom->write(EE_MEM_ADDR, reinterpret_cast<uint8_t *>(&touchCoeff), sizeof(touchCoeff));
} }

View File

@@ -7,21 +7,21 @@ public:
void GetXY(int32_t* X, int32_t* Y); void GetXY(int32_t* X, int32_t* Y);
uint16_t getXd1(void); static int getXd1();
uint16_t getXd2(void); static int getXd2();
uint16_t getXd3(void); static int getXd3();
uint16_t getYd1(void); static int getYd1();
uint16_t getYd2(void); static int getYd2();
uint16_t getYd3(void); static int getYd3();
void setXt1(uint32_t xt1); void setXt1(uint32_t _xt1);
void setXt2(uint32_t xt2); void setXt2(uint32_t _xt2);
void setXt3(uint32_t xt3); void setXt3(uint32_t _xt3);
void setYt1(uint32_t yt1); void setYt1(uint32_t _yt1);
void setYt2(uint32_t yt2); void setYt2(uint32_t _yt2);
void setYt3(uint32_t yt3); void setYt3(uint32_t _yt3);
void setCalibrated(); void setCalibrated();
bool getCalibrated(); bool getCalibrated() const;
bool DetectTouch(); bool DetectTouch();
@@ -49,9 +49,9 @@ private:
uint32_t yt2; uint32_t yt2;
uint32_t yt3; uint32_t yt3;
SPI* tpPort; SPI tpPort;
DigitalOut* tpCS; DigitalOut tpCS;
DigitalIn* tpInt; DigitalIn tpInt;
EEPROM* eeprom; EEPROM* eeprom;
uint16_t readValue(uint16_t port); uint16_t readValue(char port);
}; };