Linux kernel driver for auxiliary displays based on led controllers such as tm16xx family and alike
See Device Table
Other similar controllers may already be compatible using one of these identifiers.
- Shenzhen Titan Micro Electronics Co., Ltd.
- Fuzhou Fuda Hisi Microelectronics Co., Ltd.
- Wuxi i-Core Electronics Co., Ltd.
- Princeton Technology Corporation
- princeton,pt6964 (datasheet)
- Shenzhen Winrise Technology Co., Ltd.
- winrise,hbs658 (datasheet)
graph TD;
subgraph "User Space"
A["display-service - systemd service"]
end
subgraph "Kernel Space"
B["tm16xx - Kernel Driver Module"]
end
subgraph "Hardware"
C["display-controller - tm16xx Chip"]
end
A -->|leds class sysfs interface| B
B -->|Device Tree Node - I2C or SPI| C
-
User Space:
display-service: A systemd service running in user space, interacting with the kernel driver via the sysfs interface.
-
Kernel Space:
tm16xx: The kernel driver module that exposes control interfaces through sysfs, allowing user-space applications to control the display hardware.
-
Hardware:
display-controller: The actual tm16xx chip that manages the display.
-
User Space to Kernel Space:
- The
display-serviceinteracts with thetm16xxkernel driver via the sysfs LEDs class interface, typically found under/sys/class/leds/.
- The
-
Kernel Space to Hardware:
- The
tm16xxdriver relies on the device tree node (which defines hardware properties) to communicate with the display controller, using either I2C or SPI.
- The
Linux kernel headers installed
armbian-configThen go to Software -> Headers
See Kconfig for kernel configuration.
Depending on the icons configured for the auxiliary display, additional led triggers modules are required by display-service:
| Usage | LEDs | Trigger | Module | Config |
|---|---|---|---|---|
| Time seperator blink | colon |
timer |
ledtrig_timer |
CONFIG_LEDS_TRIGGER_TIMER=y or m |
| Network activity | lan, wlan, bluetooth |
netdev |
ledtrig_netdev |
CONFIG_LEDS_TRIGGER_NETDEV=y or m |
| USB activity | usb |
usbport |
ledtrig-usbport |
CONFIG_USB_LEDS_TRIGGER_USBPORT=y or m |
| SD/MMC activity | sd |
mmc0 |
mmc_core |
CONFIG_MMC=y or m |
git clone https://github.com/jefflessard/tm16xx-display.git-
Find your device in the Device Table
-
Update your dtb
Option 1: Use device tree overlay, if supported
- Build overlay
# This will create the overlay in release/{YOUR_DEVICE_NAME}.dtbo
make {YOUR_DEVICE_NAME}.dtbo - Copy dtbo in
/boot/overlay-user/
cp release/{YOUR_DEVICE_NAME}.dtbo /boot/overlay-user/tm16xx.dtbo- Edit
/boot/armbianEnv.txtto load the overlay
user_overlays=tm16xx
Option 2: Create an updated dtb
- Copy your current dtb file to
original.dtb:
# run this command only once.
# we must always start from the
# original dtb when merging overlay
make extract-dtb ORIGINAL_DTB=original.dtb- Merge the display dtb overlay with your current dtb
# This will create the dtb in release/{YOUR_DEVICE_NAME}.dtb
make {YOUR_DEVICE_NAME}.dtb ORIGINAL_DTB=original.dtb
# Replace your current dtb with the new dtb, for example:
#cp release/{YOUR_DEVICE_NAME}.dtb /boot/dtb/{YOUR_DTB_PATH}.dtb- Reboot to apply changes
rebootOption 1: build and install in a single command
Builds then installs module and service
make installOption 2: step by step commands
make module
make module-install
make service-installdisplay-service -c3 phase display check
- Check that all leds are ON
- Check the order of digits and segment mapping (you should see "1234")
- Check each led name (ex: LAN icon is ON while "LAN" text is shown on the digits)
Convert existing OpenVFD vfd.conf
Existing compatible OpenVFD vfd-configurations are already converted. Find them in the Device Table
./vfdconf-convert {path_to_your_vfd.conf_file} devices/{your_device_name}.dtso./vfdconf-convert -r {path_to_vfd-configurations_directory} devicesSee device tree bindings documentation: titanmec,tm16xx.yaml.
Start:
systemctl start displayStop:
systemctl stop displayRestart:
systemctl restart displaydisplay-service -t "{your_message}"Just edit the shell script at /usr/sbin/display-service
# turn on display
cat /sys/class/leds/display/max_brightness > /sys/class/leds/display/brightness
# dim brightness display
# value between 1 and max_brightness (usually 8)
echo 1 > /sys/class/leds/display/brightness
# turn off display
echo 0 > /sys/class/leds/display/brightness
# write text on the display (supports 7-segment ascii mapping)
echo "boot" > /sys/class/leds/display/value
# clear the display text
echo > /sys/class/leds/display/value
# list available leds/symbols
ls /sys/class/leds/display\:\:*
# turn on a specific led/symbol
echo 1 > /sys/class/leds/display\:\:lan/brightness
# turn off a specific led/symbol
echo 0 > /sys/class/leds/display\:\:lan/brightness
# automatically turn on/off usb led when usb device is connected on a specific port
echo usbport > /sys/class/leds/display::usb/trigger
echo 1 > /sys/class/leds/display::usb/ports/usb1-port1
# turn on led on wifi connect + blink on activity (requires ledtrig-netdev module)
echo netdev > /sys/class/leds/display::wlan/trigger
echo wlan0 > /sys/class/leds/display::wlan/device_name
echo 1 > /sys/class/leds/display::wlan/link
echo 1 > /sys/class/leds/display::wlan/rx
echo 1 > /sys/class/leds/display::wlan/tx