I just published the source code of my PiTFT touchscreen control that I start using on my Duet Wifi:
https://github.com/andrasbiro/duetPiLcd
It is really designed for my setup and my needs, but it might be useful for others, or better yet, inspire a more flexible solution