I'm currently developing a NB application that communicates with a touch display connected via I2C to the 5270 board.
Unfortunately I'm not able to read/write data from/to the display. Here's my source code:
Code: Select all
int Hardware::ControlUnit::TouchDisplay::eDIPTFT43A::sendToDisplay(int length, char *textToSend)
{
BYTE readBuffer = 0x00;
int ret = 1;
this->i2cCommunication->initialize(0x00, 0x0E); // = I2CInit(0x00, 0x0E);
this->i2cCommunication->start(0x10, I2C_START_WRITE, 20); // Start I²C in order to write (= I2CStart(0x10, I2C_START_WRITE, 20);)
this->i2cCommunication->send(0x11, 2); // Send display start byte (= I2CSend(0x11, 2);)
this->i2cCommunication->send(length, 2); // Data length (= I2CSend(0x11, 2);)
this->i2cCommunication->sendString(length, textToSend, 20); // Text to send
// Restart I²C in order to read
this->i2cCommunication->restart(0x10, I2C_START_READ, 2);
if (this->i2cCommunication->read(readBuffer, 2) == 1)
{
if (readBuffer == EDIP_ACK) // = Acknowledge from display
{
ret = 0;
}
}
this->i2cCommunication->stop(); // = I2CStop();
return ret;
}
returns a 5 (= I2C_BUS_NOT_AVAIL ( 5 ) // A timeout occured while trying gain I2C bus control). I've connected a logic analyzer to see if there goes out any data
onto the bus. Nothing is being transmitted.
Regards