Jump to content

Recommended way to configure extreme touch calibration?


phofman

Recommended Posts

Hi,

My cheap touch screen requires the extreme touch calibration for reasonable performance closer to the border. Please what is the recommended way to switch the initial calibration to the extreme version https://git.ugfx.io/Tectu/uGFX/src/master/src/ginput/ginput_mouse.c#L474 ? Please where is the recommended place to configure the GMOUSE_VFLG_CAL_EXTREMES flag to the GMouseVMT struct? I do not want to modify the library.

May I ask for removing the old not valid configuration https://wiki.ugfx.io/index.php/Touchscreen_Calibration#Extreme_coordinates from the wiki? It is a bit confusing.

Thanks a lot,

Pavel.

Link to comment
Share on other sites

The wiki should be correct I think for most touch drivers. Note this belongs in your mouse board file (not the general gfxconf.h file).

In the mouse driver itself it should use that board specified macro to set the extreme calibration flag in the drivers VMT flags when it is defining the VMT structure. It is possible that the mouse driver you are using has not implented that - if so let us know and we will fix it. I would have checked for you but you didn't mention which touch driver you are using.

Link to comment
Share on other sites

Hi, thanks a lot. I do not think that define is being used/queried anywhere within the ugfx source:

pavel@x220 ~/workspace/ChibiOS_16.1.8/demos/STM32/MAPLEMINI-UGFX/ugfx $ rgrep GINPUT_MOUSE_MAX_CALIBRATION_ERROR *
drivers/multiple/uGFXnetESP8266/ginput_lld_mouse_config.h:    #define GINPUT_MOUSE_MAX_CALIBRATION_ERROR        -1
drivers/multiple/uGFXnetESP8266/ginput_lld_mouse_config.h:    #define GINPUT_MOUSE_MAX_CALIBRATION_ERROR        2
drivers/multiple/uGFXnet/ginput_lld_mouse_config.h:    #define GINPUT_MOUSE_MAX_CALIBRATION_ERROR        -1
drivers/multiple/uGFXnet/ginput_lld_mouse_config.h:    #define GINPUT_MOUSE_MAX_CALIBRATION_ERROR        2

There is a post by Joel

My driver is the very standard ADS7843. I do not see setting the GMOUSE_VFLG_CAL_EXTREMES flag anywhere in the source code either, only reading/checking:

 

pavel@x220 ~/workspace/ChibiOS_16.1.8/demos/STM32/MAPLEMINI-UGFX/ugfx $ rgrep GMOUSE_VFLG_CAL_EXTREMES *
drivers/ginput/touch/MCU/gmouse_lld_MCU.c:        //GMOUSE_VFLG_DEFAULTFINGER|GMOUSE_VFLG_CAL_EXTREMES                    - Possible
drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp:                //GMOUSE_VFLG_CALIBRATE|GMOUSE_VFLG_CAL_EXTREMES|GMOUSE_VFLG_CAL_TEST|GMOUSE_VFLG_CAL_LOADFREE
drivers/multiple/Win32/gdisp_lld_Win32.c:                //GMOUSE_VFLG_CALIBRATE|GMOUSE_VFLG_CAL_EXTREMES|GMOUSE_VFLG_CAL_TEST|GMOUSE_VFLG_CAL_LOADFREE
drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c:                //GMOUSE_VFLG_CALIBRATE|GMOUSE_VFLG_CAL_EXTREMES|GMOUSE_VFLG_CAL_TEST|GMOUSE_VFLG_CAL_LOADFREE
drivers/multiple/X/gdisp_lld_X.c:                //GMOUSE_VFLG_CALIBRATE|GMOUSE_VFLG_CAL_EXTREMES|GMOUSE_VFLG_CAL_TEST|GMOUSE_VFLG_CAL_LOADFREE
src/ginput/ginput_driver_mouse.h:        #define GMOUSE_VFLG_CAL_EXTREMES    0x0020            // Use edge to edge calibration
src/ginput/ginput_mouse.c:        //if ((gmvmt(m)->d.flags & GMOUSE_VFLG_CAL_EXTREMES)) {

I appreciate your help.

Link to comment
Share on other sites

As mentioned in the post that you linked that really is a relic from older times. I updated the wiki article now.

It's correct that the driver has to use the GMOUSE_VFLG_CAL_EXTREMES flag to enable this feature. But that requires modifying the driver. The idea is that a well written driver would expose that feature as an option to the board file. That's currently not the case for the ADS7843 driver so you'd have to add that yourself.

I hope that helps. Don't hesitate to ask if you have any further questions.

Link to comment
Share on other sites

Thanks a lot, Joel. Would the GMOUSE_VFLG_CAL_EXTREMES flag go to #if  GINPUT_MOUSE_MAX_CALIBRATION_ERROR on line https://git.ugfx.io/Tectu/uGFX/src/master/drivers/ginput/touch/ADS7843/gmouse_lld_ADS7843.c#L52 ? I can send a patch to the driver, if you want to accept it. The reason I asked is I could not find this parameter check in any of the existing drivers and that confused me.

Ugfx (+chibios) works great and fast on my ILI9487 8-bit TFT + touch, all the demos. Thanks for the nice project.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...