lpcware

GT911 capacitive touch screen  and lpc1768

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by dariush_abbasi868 on Mon Jul 27 04:18:48 MST 2015
Hi ,
I  want to run GT911 capacitive touch screen by i2c 

int xflag = 0;
static I2C_XFER_T xfer;
uint8_t tx[10], rx[10];
//******************************

i2c_app_init(I2C1, SPEED_400KHZ);

i2c_set_mode(i2cDev, 0);

//****************************************************

/* Setup I2C parameters to send 3 bytes of data */
xfer.slaveAddr = 0xBa;
tx[0] = 0x81;
tx[1] = 0x4B;

tx[2] = 0x00;
tx[3] = 0x00;
xfer.txBuff = &tx[0];

/* Send data */
Chip_I2C_MasterSend(i2cDev, xfer.slaveAddr, xfer.txBuff, 3);
//Chip_I2C_MasterSend(i2cDev, xfer.slaveAddr, tx, 4);


/* Setup I2C parameters to receive 2 bytes of data */
xfer.slaveAddr=0xbb;
xfer.rxBuff = &rx[0];
xfer.rxSz = 2;
Chip_I2C_MasterRead(i2cDev, xfer.slaveAddr, xfer.rxBuff, xfer.rxSz);

But last function(Chip_I2C_MasterRead) return 0 that means nothing received

If any body has experience of working with any kind of capacitive touch screen and can help me , It will be of his/her kindness .

Outcomes