egui touch calibration

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

egui touch calibration

Jump to solution
1,330 Views
Toe
Contributor IV

I am a little confused by some things on a 240x320 screen.  Our display comes oriented in portrait mode, so the built in touch calibration is misleading when following the xr, xl, yu, yd inputs from the display.  Calibrating in portrait mode causes the x and y count per pixel to be divided by the wrong value.  The code is in d4d_low.c

 

snip:

...// Calculate number of (bits / pixel) * 16 for Xd4d_tchCalib.TouchScreenXBitsPerPixelx16 = (Word)((dX * 16)/(D4D_SCREEN_SIZE_LONGER_SIDE - D4DTCH_CALIB_CROSS_OFFSET * 2));// Does number of ADC bits per pixel in X seem reasonable?if (d4d_tchCalib.TouchScreenXBitsPerPixelx16 < ((16 * p_tchRawLimits->rawDataScale) / D4D_SCREEN_SIZE_LONGER_SIDE))        {    // Calculate number of (bits / pixel) * 16 for Y    d4d_tchCalib.TouchScreenYBitsPerPixelx16 = (Word)((dY * 16)/(D4D_SCREEN_SIZE_SHORTER_SIDE - D4DTCH_CALIB_CROSS_OFFSET * 2));    // Does number of ADC bits per pixel in Y seem reasonable?    if (d4d_tchCalib.TouchScreenYBitsPerPixelx16 < ((16 * p_tchRawLimits->rawDataScale) / D4D_SCREEN_SIZE_SHORTER_SIDE))...

 

Since this screen we are using defaults to "portrait" the x and y are reversed.  x is the shorter side and when displaying this during calibration the text would be reversed as well.

 

This isn't a hard fix, just commenting that it might be helpful to make this more configurable in the user_cfg.

0 Kudos
Reply
1 Solution
1,088 Views
Gargy
NXP Employee
NXP Employee

Hi,

 you absolutely right, thank you for the feedback.

By the way three days ago I found some issue because I start test on 800x480 pixels LCD in portrait mode.

 

Thank you

 

View solution in original post

0 Kudos
Reply
1 Reply
1,089 Views
Gargy
NXP Employee
NXP Employee

Hi,

 you absolutely right, thank you for the feedback.

By the way three days ago I found some issue because I start test on 800x480 pixels LCD in portrait mode.

 

Thank you

 

0 Kudos
Reply