• Stars
    star
    322
  • Rank 130,398 (Top 3 %)
  • Language
    Shell
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Driver for the Pimoroni HyperPixel 4.0" Touchscreen Display

HyperPixel 4.0" Drivers

HyperPixel 4.0 is an 800x480 or 720x720 pixel DPI display for Raspberry Pi, with optional capacitive touchscreen. The drivers/instructions in this repo are written for and tested with Raspberry Pi OS, and are not guaranteed to work with other operating systems.

Installing / Uninstalling (Bullseye / Linux Kernel 5.15 or later)

Raspberry Pi OS Bullseye includes major changes to how DPI display drivers work. If you're using an image dated 04/04/2022 or later, it will come with Hyperpixel drivers baked in and you don't need to run the legacy installer. You can set up display and touch by adding a few lines to your boot/config.txt:

PSA: HyperPixel 4 (Square & Rectangular) on Raspberry Pi OS 2022-04-04

⚠️Note that touch rotation commands will not currently work with on the square variant, and that the current kernel drivers will only work with newer square boards (marked Hyperpixel XP).

Installing / Uninstalling (Legacy)

This repository contains several branches for different combinations of Pi and HyperPixel4 boards.

You should use our one-line installer to install HyperPixel4 Rectangular and Square:

curl -sSL https://get.pimoroni.com/hyperpixel4 | bash

When prompted, pick the combination of Pi and touchscreen that you're planning to use.

Note: A HyperPixel4 setup for Pi 3B+ or earlier will not readily work if you move it over to a Pi 4, you should run this installer again to update the drivers.

Manual Installation

Here's a list of active branches and which Pi/display combination they support:

  • pi3 - Pi 3B+ and earlier, HyperPixel4 Rectangular
  • pi4 - Pi 4 & Pi 400, HyperPixel4 Rectangular, use hyperpixel4-rotate to rotate once installed
  • square - Pi 3B+ and earlier, HyperPixel4 Square (for boards manufactured 2020 and earlier)
  • square-pi4 - Pi 4 & Pi 400, HyperPixel4 Square (for boards manufactured 2020 and earlier)
  • square-2021 - Pi 3B+ and earlier, HyperPixel4 Square (for boards manufactured 2021 and later)
  • square-pi4-2021 - Pi 4 & Pi 400, HyperPixel4 Square (for boards manufactured 2021 and later)

To clone a specific branch to your Pi, run:

git clone https://github.com/pimoroni/hyperpixel4 -b <branch name>

Then cd hyperpixel4 and run sudo ./install.sh to install it.

Rotation

Rotation on Pi 4

HyperPixel4 is a portait display, so on first boot it will start in portrait mode with the USB ports at the top.

On Pi 4 we can take advantage of the rotation available in Display Configuration, and provide you with a command for setting both display and touch rotation together.

To rotate HyperPixel4 on a Pi 4 use the hyperpixel4-rotate command.

Landscape mode, HDMI/power ports on the bottom:

hyperpixel4-rotate left

Landscape mode, HDMI/power ports on the top:

hyperpixel4-rotate right

Portrait mode, USB ports on the top:

hyperpixel4-rotate normal

Portrait mode, USB ports on the bottom:

hyperpixel4-rotate inverted

If you're running this command over SSH you should prefix it with DISPLAY=:0.0

180 Degree Rotation on Pi 3

Note: You must build the latest dtoverlay file to enable rotation support:

  1. Go into src
  2. run make to build a new hyperpixel4.dtbo with rotation support
  3. copy the overlay with sudo cp hyperpixel4.dtbo /boot/overlays/

To rotate your HyperPixel4 you must edit /boot/config.txt and change the following lines:

  1. Change dtoverlay=hyperpixel4 to dtoverlay=hyperpixel4:rotate
  2. Change display_rotate=3 to display_rotate=1

This will rotate both the display and the touchscreen input to match.

If you're using a non-touchscreen HyperPixel4 you need only change display_rotate.

Totally Manual Rotation

⚠️ for Xorg-based operating systems running on Pi 4 and Pi 400 ⚠️ must have dtoverlay=vc4-fkms-v3d in /boot/config.txt

Rotation on the fly

You can use xrandr and xinput to rotate the display and touchscreen in turn.

For HyperPixel Square, substitute the device name with "pointer:generic ft5x06 (11)".

Left

DISPLAY=:0.0 xrandr --output DSI-1 --rotate left
DISPLAY=:0.0 xinput set-prop "pointer:Goodix Capacitive TouchScreen" "libinput Calibration Matrix" 0 -1 1 1 0 0 0 0 1

Right

DISPLAY=:0.0 xrandr --output DSI-1 --rotate right
DISPLAY=:0.0 xinput set-prop "pointer:Goodix Capacitive TouchScreen" "libinput Calibration Matrix" 0 1 0 -1 0 1 0 0 1

Normal

DISPLAY=:0.0 xrandr --output DSI-1 --rotate normal
DISPLAY=:0.0 xinput set-prop "pointer:Goodix Capacitive TouchScreen" "libinput Calibration Matrix" 1 0 0 0 1 0 0 0 1

Inverted

DISPLAY=:0.0 xrandr --output DSI-1 --rotate inverted
DISPLAY=:0.0 xinput set-prop "pointer:Goodix Capacitive TouchScreen" "libinput Calibration Matrix" -1 0 1 0 -1 1 0 0 1

Persisting Rotation

Add the relevant settings from above into /usr/share/X11/xorg.conf.d/88-hyperpixel4.conf.

You will need the device name:

  • "Goodix Capacitive TouchScreen" for HyperPixel 4 Rectangular
  • "generic ft5x06 (11)" for HyperPixel 4 Square

And the 9 numbers from the "Calibration Matrix", eg: -1 0 1 0 -1 1 0 0 1

Plus the rotation direction for the monitor.

Section "InputClass"
	Identifier "libinput HyperPixel4 Rectangular"
	MatchProduct "Goodix Capacitive TouchScreen"
	Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1"
EndSection

Section "Monitor"
	Identifier "DSI-1"
	Option "Rotate" "left"
EndSection

If you're using lightdm (the default window manager on Raspberry Pi OS) and it's calling /usr/share/dispsetup.sh you'll need to either disable that call in /etc/lightdm/lightdm.conf or change dispsetup.sh to just exit 0. Removing dispsetup.sh will break lightdm and boot you to a black screen of death.

  • ⚠️ Running "Screen Configuration" will re-create dispsetup.sh and override your Xorg settings
  • ⚠️ Removing dispsetup.sh from /etc/lightdm/lightdm.conf will prevent "Screen Configuration" settings for persisting.
  • You should probably use hyperpixel4-rotate unless you really know what you're doing!

Troubleshooting

Where possible we are collecting known FAQs under the notice label in our issue tracker.

Notice Issue Tracker

If your issue is not covered by one of these provided by our team and community then we ask you to provide some debugging information using the following oneliner:

curl -sSL https://raw.githubusercontent.com/pimoroni/hyperpixel4/master/hyperpixel4-debug.sh | bash

Then file a bug report.

More Repositories

1

pimoroni-pico

Libraries and examples to support Pimoroni Pico add-ons in C++ and MicroPython.
C
1,249
star
2

inky

Combined library for V2/V3 Inky pHAT and Inky wHAT.
Python
569
star
3

enviroplus-python

Python library for the Enviro+ environmental monitoring board
Shell
383
star
4

unicorn-hat

Python library for Unicorn pHAT and HAT. 32 or 64 blinding ws2812 pixels for your Raspberry Pi
C
363
star
5

blinkt

Python Library for Blinkt; 8 APA102 LEDs for your Raspberry Pi
C
304
star
6

fanshim-python

Python library for the Fan SHIM for Raspberry Pi
Python
294
star
7

bme680-python

Python library for the BME680 gas, temperature, humidity and pressure sensor.
Python
261
star
8

pirate-audio

Examples and documentation for the Pirate Audio range of Raspberry Pi add-ons
Python
239
star
9

phew

Python
204
star
10

st7789-python

Python library to control an ST7789 240x240 1.3" TFT LCD display.
Python
193
star
11

keybow-firmware

Keybow Firmware for the Raspberry Pi Zero
C
180
star
12

unicorn-hat-hd

Python library and examples for Unicorn HAT HD
Python
173
star
13

scroll-phat-hd

Python library for Scroll pHAT HD
Python
159
star
14

explorer-hat

Python library for Explorer HAT
Python
158
star
15

badger2040

Examples and firmware for Badger 2040 and Badger 2040 W
Python
154
star
16

displayotron

Libraries and examples for the Display-o-Tron 3000 and Display-o-Tron HAT
Python
145
star
17

picosystem

PicoSystem libraries and examples.
C++
136
star
18

piglow

Python library & examples for the Pimoroni PiGlow
Python
133
star
19

inky-phat

Python library for Inky pHAT
Python
126
star
20

clean-shutdown

Python daemon to watch a GPIO pin and trigger a clean shutdown.
Shell
125
star
21

automation-hat

Python library and examples for the Pimoroni Automation HAT, pHAT and HAT Mini
Python
116
star
22

enviro

Python
108
star
23

enviro-phat

Python libraries and examples for the Pimoroni Enviro pHAT
Python
106
star
24

scroll-phat

Library and examples for Scroll pHAT. 11x5 LEDs of goodness!
Python
103
star
25

pantilt-hat

Python library for the Pimoroni PanTilt servo and lighting HAT
Python
102
star
26

phat-beat

Python library for PHAT BEAT - A stereo DAC, AMP and VU for the Raspberry Pi
Python
99
star
27

hyperpixel

Setup for the Pimoroni Hyper Pixel 800x480 pixel multi-touch display
Python
96
star
28

vl53l1x-python

Python library for the VL53L1X Laser Ranger
C
91
star
29

pmk-circuitpython

Python
88
star
30

skywriter-hat

Skywriter python libraries and examples
Python
87
star
31

pico-boilerplate

A boilerplate C++, CMake project for the Raspberry Pi Pico.
CMake
79
star
32

rainbow-hat

Python library and examples for the Pimoroni Rainbow HAT
Python
73
star
33

pibrella

Pibrella python library & examples
Python
71
star
34

breakout-garden

Documentation, software, and examples for the Breakout Garden ecosystem.
Shell
70
star
35

keybow2040-circuitpython

CircuitPython library for the Pimoroni Keybow 2040
Python
68
star
36

bme280-python

Python library for the BME280 temperature, pressure and humidity sensor
Python
63
star
37

picade-hat

Picade HAT input daemon and setup script
Shell
60
star
38

pivumeter

ALSA plugin for displaying VU meters on various Raspberry Pi add-ons - derived from ameter
Shell
59
star
39

grow-python

Python libs for controlling the Grow HATs
Python
56
star
40

adxl345-python

Python library for the ADXL345
Python
55
star
41

bmp280-python

Python library for the BMP280 temperature, pressure, and altitude sensor.
Python
55
star
42

python-multitouch

Multi-touch pure Python driver for the official 7" touchscreen display.
Python
55
star
43

Piano-HAT

Python library and examples for Piano HAT Raspberry Pi Add-on board
Python
53
star
44

speaker-phat

Software installer for Speaker pHAT
Python
51
star
45

pms5003-python

Python library for the PMS5003 particulate sensor
Shell
50
star
46

microdot-phat

Python Library and Examples for Micro Dot pHAT. A 6-matrix driver for retro 5x7 displays!
Python
49
star
47

icm20948-python

Python library for the Pimoroni ICM20948 breakout
Shell
48
star
48

pidi-spotify

Python
46
star
49

picovision

C++
46
star
50

PanTiltFacetracker

Face Tracking for the Adafruit Mini Pan Tilt kit and Raspberry Pi camera
Python
44
star
51

unicornhatmini-python

Python library for the Pimoroni Unicorn HAT Mini RGB LED Display
Python
42
star
52

Picade-Sketch

Picade Arduino sketch
C++
39
star
53

eagle

Custom Eagle parts that we've created where needed. Please feel free to use, extend, and share! (CC v3.0 Share-Alike You are welcome to use this library for commercial purposes.)
39
star
54

trackball-python

Python library for the Pimoroni Track Ball Breakout
Python
36
star
55

sgp30-python

Python library for the SGP30 air quality sensor
Shell
35
star
56

button-shim

Python library and examples for the Pimoroni Button SHIM
Python
33
star
57

keybow-python

Python library for the Pimoroni Keybow 3 and 12 key mechanical keyboard add-ons for Raspberry Pi
Python
32
star
58

led-shim

Python library for the Pimoroni LED SHIM
Python
31
star
59

pimoroni-pico-rp2350

MicroPython builds for Pimoroni Pico 2 / RP2350 boards.
Python
30
star
60

hyperpixel2r

Shell
30
star
61

picade

All Picade related stuff.
C
30
star
62

displayhatmini-python

Python library for the Pimoroni Display HAT Mini
Shell
30
star
63

gfx-hat

Python library for the Pimoroni GFX HAT
Python
29
star
64

fourletter-phat

Python library for the Pimoroni Four Letter pHAT
Python
28
star
65

drum-hat

Python library for the Pimoroni Drum HAT Raspberry Pi Add-on board.
Python
27
star
66

pmw3901-python

Python library for the PWM3901 optical flow-rate sensor
Python
26
star
67

rp_usbdisplay

Binary drivers for the RoboPeak/DFRobot 2.8 USB TFT, version 2
C
25
star
68

i2cdevice-python

Domain-specific language for describing smbus/i2c register maps
Python
24
star
69

flotilla-python

Python library for the Pimoroni Flotilla plug-and-play electronics ecosystem
Python
24
star
70

mote

Mote - drivers for the plug and play USB APA102 controller
Python
24
star
71

PiratePython

PiratePython: a minimal Raspbian for Python programmers
C
24
star
72

hyperpixel2r-python

Shell
23
star
73

propeller-hat

Propeller HAT library code, examples, documentation and SPIN source
Propeller Spin
23
star
74

weatherhat-python

Python
22
star
75

trilobot-python

Python
21
star
76

mopidy-raspberry-gpio

Mopidy GPIO Control Plugin for the Raspberry Pi (Using RPi.GPIO)
Python
21
star
77

pico-circuitpython-examples

CircuitPython examples for Pimoroni RP2040 boards.
Python
20
star
78

internet-of-seeds

The code that runs our IKEA VΓ„XER Internet of Seeds
Python
20
star
79

max30105-python

Python library for the Pimoroni MAX30105 breakout
Python
19
star
80

as7262-python

Python library for the as7262 spectral sensor breakout
Python
17
star
81

node-red-nodes

Node-RED nodes for Pimoroni products
JavaScript
17
star
82

Raspberry-Pi-Web-RGB

Simple Raspberry Pi RGB LED control from your Web Browser using Python and Flask
HTML
17
star
83

plasma

Plasma LED driver, FX Sequencer and plugins
Python
16
star
84

fonts-python

Python font packaging framework
Python
15
star
85

vl53l5cx-python

CTypes Python bindings for the VL53L5CX
C
15
star
86

yukon

Python
15
star
87

pa1010d-python

Python library for the Pimoroni PA1010D GPS Breakout
Shell
15
star
88

ltr559-python

Python library for the LTR-559 optical presence/proximity sensor
Python
14
star
89

programming-trinket-with-raspberry-pi

Programming Adafruit's Trinket (3v3) directly from a Raspberry Pi
C
13
star
90

drv2605-python

Python library for the Pimoroni Haptic Vibes DRV2605 breakout
Python
12
star
91

touch-phat

Python library and examples for Pimoroni Touch pHAT - six touch sensitive buttons to control your project.
Python
12
star
92

mote-phat

Drive four channels of APA102 pixels from your Pi Zero with Pimoroni Mote pHAT
Python
12
star
93

rgbmatrix5x5-python

Python library for the Pimoroni 5x5 RGB Matrix Breakout
Python
12
star
94

pimoroni-pico-stubs

Python
11
star
95

pms5003-micropython

Python
11
star
96

pidi-plugins

🎡 plugins for Pirate Display. A mopidy/mpd album art downloader/displayer.
Python
11
star
97

mopidy-pidi

Mopidy plugin host for pidi display plugins.
Python
11
star
98

sn3218

Python library for the SN3218 18-channel LED driver
Python
10
star
99

bh1745-python

Python library for the bh1745 colour sensor breakout
Python
10
star
100

EnviroPlus-FeatherWing

CircuitPython library for the Enviro+ FeatherWing
Python
10
star