Things used in this project
This project explains how to use the Adafruit PiTFT capacitive touch screen for Raspberry Pi.
To support this screen, a kernel-mode display-only Driver was created establishes direct access to the Adafruit PiTFT display via SPI. The driver initializes the display and presents at 16 frames per second.
To allow for direct user interaction with the display, a User-Mode Touch Injection Background Service establishes touch input through an I2c bus and uses a HID injection driver to inject touch events. Touch capabilities include single point touch (pressing) and swiping. UWP XAML windows application running on the Pi will present without any changes.
1. Set up your PC and Raspberry Pi according to these instructions.
2. Next, match the pins of the Adafruit PiTFT to those of the Pi to mount the display.
From the initial setup, be sure to note your Raspberry Pi's IP address as this will be necessary going forward. This project currently requires that you build several drivers and user mode applications.
Please install the following environments:
1. Download the screen provider source code from https://github.com/ms-iot/ScreenProvider and extract to your file system. Note the location.
2. Open a command window, and change the directory to where you extracted the screen provider source code.
3. Navigate to the directory ScreenProvider\drivers\fixedkmdod\KMDOD.
4. Compile the spidisplay.asl file using the following command.
C:\Program Files (x86)\Windows Kits\10\Tools\x86\ACPIVerify\asl.exe" spidisplay.asl
5. Open the solution in the kmdod folder and compile this driver for ARM.
6. Open a run dialog and navigate to your Raspberry Pi over the network.
\\<your IP address>\C$
7. Create a directory called 'Deploy' on the Raspberry Pi and copy the following files from your computer to that new directory:
ACPITABL.dat SampleDisplay.inf SampleDisplay.sys
8. Connect to the Raspberry Pi using an SSH client as described here.
9. Change the directory to the path below and copy the the .DAT file from the directory created above.
The display driver should now have all the correct files. There are a few more steps to get it running.
Running the Display Driver:
1. Install the driver package in your terminal by running the command below. You can check to make sure it's added using
devcon dp_enum or delete it with
devcon dp_add C:\Deploy\sampledisplay.inf
2. Restart your Pi to see the display running.
1. Follow these instructions to setup the HID Injection driver.
HidInjector.exe from the project folder into the deploy folder.
3. Schedule the HidInjector to run on boot by running this command on the Raspberry Pi via SSH:
schtasks.exe /Create /SC ONSTART /TN \Microsoft\Windows\HidInjector\Start /TR %SystemRoot%\Deploy\HidInjector.exe
4. Restart your Raspberry Pi.
Congratulations, you are now able to run any UWP application on the Adafruit PiTFT touch display.
Diagram flow of the interaction between User and Kernel mode and SPI/I2c buses going to the Display.
Code package for display driver and touch to run UWP applications on Adafruit PiTFTC/C++
No preview (download only).
Did you replicate this project? Share it!I made one
Love this project? Think it could be improved? Tell us what you think!