Hi,
I am using CW10.10, eGUI 2.1, TWR_LCD on the tower with 52259. I had all this working on the old MQX and old eGUI various, so the hardware should be right.
I have made the following changes to d4d_user_cfg.h
// Low level touch screen driver
#define D4D_LLD_TCH d4dtch_resistive_mqx
//#define D4D_LLD_TCH_HW not_used_in_mqx
In main.cabove lcd_task (its not called d4d_task)
//CN17062011 Start
const ADC_INIT_STRUCT adc_init = {
ADC_RESOLUTION_12BIT,// ADC_RESOLUTION_DEFAULT, /* resolution */
};
extern TCHRES_INIT_STRUCT _bsp_tchscr_resistive_init;
//CN17062011 End
I added the following to lcd_task (first thing it does)
//CN17062011 Start
adc_file = fopen(BSP_TCHRES_ADC_DEVICE, (const char*)&adc_init);
if( adc_file == NULL )
{
_mqx_exit(0);
}
// ioctl( adc_file, ADC_IOCTL_CALIBRATE, NULL ); //THIS COMMAND DOES NOT WORK AS ITS NOT SUPPORTED IN 52259
_io_tchres_install("tchscr:", &_bsp_tchscr_resisitve_init, adc_file );
////CN17062011 End
You will notice that ACD_IOCTL_CALIBRATE is not supported in 52259, do we need to do something else here?
So, when I run the project, the calibration just flash's each cross hair and moves on to the next as if it is being touched, but they all have the same value. If I measure the ADC pins, they sit at 0V, then jump up for a 'blip' as the software takes a measurement (I guess). If I hold my finger on the screen, the values come up and change (but the same for each cross hair as it still just always flicks between them all)... I don't know what to do now... I can 'force' it to calibrate by quickly trying to catch each cross hair as it flash's up, but the touch screen doesnt work once it loads.