]> git.plutz.net Git - blast/blob - modules/display_ws5inch.mk
c34ea702376a8d051241785a81b26ce2a90caf18
[blast] / modules / display_ws5inch.mk
1 define display_ws5inch_boot :=
2
3 # Waveshare 5 Inch Display
4 hdmi_group=2
5 hdmi_mode=87
6 hdmi_cvt=800 480 60 6 0 0 0
7 hdmi_drive=1
8 dtparam=i2c_arm=on
9 dtparam=spi=on
10 enable_uart=1
11 dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900
12 endef
13
14 define display_ws5inch_cfg :=
15 Section "InputClass"
16         Identifier "evdev touchscreen catchall"
17         MatchIsTouchscreen "on"
18         Option  "Calibration"   "200 3950 250 4000"
19         MatchDevicePath "/dev/input/event*"
20         Driver "evdev"
21 EndSection
22 endef
23
24 export display_ws5inch_boot display_ws5inch_cfg
25
26 PACKAGES += xserver-xorg-input-evdev xinput xinput-calibrator
27
28 .PHONY: _display_ws5inch
29 _config: _display_ws5inch
30 _display_ws5inch: ${CFGROOT} _copy _mount
31         printf '%s\n' "$${display_ws5inch_boot}" >>"$${CFGROOT}/boot/config.txt"
32         mkdir -p "$${CFGROOT}/usr/share/X11/xorg.conf.d/"
33         printf '%s\n' "$${display_ws5inch_cfg}" >"$${CFGROOT}/usr/share/X11/xorg.conf.d/45-evdev.conf"