AvaloniaUI on Raspberry PI Part 1/2 - setting up 5" Touch Screen for use with framebuffer

This is instruction how to set up raspberry PI with 5" LCD touch screen with XPT2046 touch controller.

In order to follow this setup it is expected that you have already set up raspbian. Screen should be connected to raspberry pi PIN connector as well as with HDMI adapter.

It should look something like this

IMG_1830.png

The requirements is not to install X server but use framebuffer and run apps without the need to run X-Server.

Raspbian version from august 2020 supports this screen out of the box so without any config you should be able to get the video working ok.

In order to fully support touch functionality you should be using Waveshare driver for this screen, it is available on waveshare.com/wiki/5inch_HDMI_LCD.

As instructed there you should download and install driver from their site.

git clone github.com/waveshare/LCD-show.git

cd LCD-show/

chmod +x LCD5-show

./LCD5-show

This should provoke automatic reboot, and touch should be enabled now.

As far as I can see that changed /boot/config.txt and added the following.

hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapx$
hdmi_drive=1
hdmi_force_hotplug=1

Now we should be having fully funcitonal screen with touch enabled, so let's prepare to run . Net apps and AvaloniaUI apps on native linux with framebuffer.