Hi,
I would like to disable the FT5336 touchscreen programmatically and then re-enable it again at a later point in my code.
The reason why i'd like to do this is because I am using the F7 Disco Serial Audio Interface which also uses I2C line. I find that once I have finished playing the audio file, my code hangs in the while loop of the stm32f7_i2c.c "i2cRead" function. Is this a bug or something?
// Transmit the whole buffer
for (i = 0; i < length; i++) {
while (!(i2c->ISR & I2C_ISR_RXNE)); //<-- hangs here
data[i] = i2c->RXDR;
}
For now, as a temporary solution, I am happy to disable the touchscreen driver whilst the audio is playing and then re-enable it once the track has finished.
Looking in "gmouse_lld_FT5336.c" I see the following:
const GMouseVMT const GMOUSE_DRIVER_VMT[1] = {{
{
GDRIVER_TYPE_TOUCH,
GMOUSE_VFLG_TOUCH | GMOUSE_VFLG_ONLY_DOWN | GMOUSE_VFLG_POORUPDOWN,
sizeof(GMouse) + GMOUSE_FT5336_BOARD_DATA_SIZE,
_gmouseInitDriver,
_gmousePostInitDriver,
_gmouseDeInitDriver
},
1, // z_max - (currently?) not supported
0, // z_min - (currently?) not supported
1, // z_touchon
0, // z_touchoff
{ // pen_jitter
GMOUSE_FT5336_PEN_CALIBRATE_ERROR, // calibrate
GMOUSE_FT5336_PEN_CLICK_ERROR, // click
GMOUSE_FT5336_PEN_MOVE_ERROR // move
},
{ // finger_jitter
GMOUSE_FT5336_FINGER_CALIBRATE_ERROR, // calibrate
GMOUSE_FT5336_FINGER_CLICK_ERROR, // click
GMOUSE_FT5336_FINGER_MOVE_ERROR // move
},
ft5336Init, // init
0, // deinit //<--- Do I need to write/add an ft5336DeInit function and add it here.
ft5336ReadXYZ, // get
0, // calsave
0 // calload
}};
I'm not sure really sure how to go about de-initialising the driver. should I be adding a deinit function and calling it from my code? I feel as though this is supposed to be something very trivial but I am struggling a bit.
Thank you for your time.