My board uses built-in SAMA5 TSD peripheral to interface with a resistive touchscreen on a 5" TFT. Early on I implemented (and had merged) an ioctl to allow the low level driver to scale the x/y data to match the display resolution but I am now finding it actually needs a multipoint calibration to get the accuracy required.

The maths for this is well documented and I found an MIT-licensed calibration solution for LVGL - which is what I'm using anyway. It works, but is not generic, and is mixing Apache and MIT licenses of course.

I was thinking that it might be a good idea to proffer a generic solution for this in NuttX but found:

1. NXWM already has this in principle (not tried it to be fair)
2. The sam tsd driver is not a generic driver, as such, so x/y data
   does not pass through an appropriate upper-half layer where
   calibration data might best live, and be used by any low level
   driver managing tsd interfaces (like, I think, the off-chip tsd
   controllers that are supported use)

My first thought is whether it might be feasible to run the NXWM system - to gain access to touchscreen calibration routines when needed - and then handover to lvgl. But it doesn't "feel" right but perhaps someone has done this?

Otherwise would it be a better idea to rework the sam tsd to pass through a/the generic upper half driver where calibration data can live, but leave it to the user app to implement the actual mechanism (graphical screens, but not tied to lvgl etc) to gather the required coefficients.

Thoughts?

Reply via email to