Hi Jozef,
I have the touchscreen working, but it's performance is poor. Sometimes it does not catch button presses and sometimes it seems to respond to a button press when the button is released. At first I thought this was due to my implementation on the Vybrid, but then we started using EGUI 3.0 on our Kinetis project and it has the same behavior. Our Kinetis project is > 2 years old and well tested, so there is something causing a problem in EGUI 3.0 or MQX 4.1 or the combination.
To get the Vybrid HW interface working I used sample code for the I2C from the bottom of this post: I2C Vybrid Code? I then built wrappers around the functions to make them compatible with what the D4D low level drivers were looking for with something like this:
// Address related functions
void HwIIC_SetAddress(Byte address)
{
HwIIC_Address = address;
}
// Multi Byte read Write functions - 8 bit device address mode
Byte HwIIC_MultiReadBytes(Byte regAdr, Byte *pData, Byte cnt)
{
Byte returnValue;
returnValue = (Byte) i2c_read (I2C0, HwIIC_Address, regAdr, pData, cnt);
return (returnValue);
}
Byte HwIIC_MultiWriteBytes(Byte regAdr, Byte *pData, Byte cnt)
{
Byte returnValue;
returnValue = (Byte) i2c_write (I2C0, HwIIC_Address, regAdr, pData, cnt);
return (returnValue);
}
All of that seems to be working perfectly, but there seems to be almost a race condition between the CRtouch chip changing its state and the D4D code that is using that state to control the screen.
Thanks.