Skip to content

FD628 and similar compatible LED controller driver used in LibreELEC

Notifications You must be signed in to change notification settings

LibreELEC/linux_openvfd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linux OpenVFD

License Note This is the LibreELEC fork of Arthur Libermans linux_openvfd driver. It is intentionally forked at a point in time when the codebase was "GPL-2.0-or-later" as marked in openvfd_drv.c (at the time, this is the only file in the repo marked with license). In commit d753dd2 the creator has applied a GPLv3 license, thus rendering the linux_openvfd driver license incompatible with the GPL-2.0 (only) Linux kernel. We also note that intial commit f8bd53c imports existing code from another author who would need to endorse such a license change. In the event of a license rethink we will be happy to change our upstream source. Until then, this repo will remain kernel compatible, and we welcome user pull-requests to add additional config files.

This repository contains source code for the FD628 (datasheet) and similar LED display controllers. The FD628 is often used in Android TV boxes with a 7-segment display. Although the FD628 has support for a multitude of configurations the current implementation supports only common cathode and common anode displays with 7 segments. The driver can also support the FD650 which uses a variation of the I2C communication protocol and HD44780 text-based LCD displays using an I2C backpack.

Displays are configured from userspace using a device-specific .conf that identifies the GPIO pins connected to the display controller and different visual and electrical layouts that need to be set.

Known configurations can be found in the 'conf' directory of this repository. Where possible files have been named to match corresponding device-tree names, e.g.

meson-gxl-s905w-tanix-tx3-mini.conf pairs with meson-gxl-s905w-tanix-tx3-mini.dts

The configuration file consists of several entries:

vfd_gpio_clk / vfd_gpio_dat / vfd_gpio_stb

These tell the driver which GPIO pins are connected to the controller pins. Each entry must have 3 values:

  1. Index of the GPIO bank. Amlogic SoCs usually have 2x banks where index 0 refers to banks and 1 to ao-bank.
  2. Pin number in the GPIO bank as an integer or hex value. If you have pin names but not the numeric values you'll need to look them up. Here are links to pin names/numbers for the S912, S905X, S905D, S905W and S905.
  3. Reserved, should be 0.

e.g. the configuration used with the A95X R2 box:

vfd_gpio_clk='0,14,0'
vfd_gpio_dat='0,15,0'
vfd_gpio_stb='1,9,0'

vfd_chars

Displays can have different layouts and can be connected in different ways to the controller. This entry allows you to configure the driver so clock digits appear in the correct order, and icons (if the display has them) are displayed. The indexes start from 0 (0 indexed).

The internal layout of the driver is as follows:

  1. Dots/Icons that display device state such as WiFi/Ethernet status or whether a USB drive is connected, etc.
  2. Hours x10
  3. Hours
  4. Minutes x10
  5. Minutes

e.g. the configuration used with the A95X R2 box:

vfd_chars='4,0,1,2,3'

vfd_dot_bits

This allows you to set the order in which Dots/Icons are displayed by the driver. In most cases (so far) this entry will use the default 0-6 order. It only needs changing if the wrong icon is displayed for a specific status. This entry is 0 indexed.

e.g. the configuration used in the A95X R2 box:

vfd_dot_bits='0,1,2,3,4,5,6'

vfd_display_type

This defines which type of display your device has, its electrical layout (common cathode or anode), and the controller type. It is important to set this correctly else you may see scrambled, inverted, or incomplete digits or missing icons. The values are all 0 indexed.

  1. Display type:
    • A display like the Sunvell T95U.
    • A display like the Sunvell T95m (similar to T95U but icons are positioned differently and digits are inverted).
    • A display like the X92 Android TV Box. This display has a common anode electrical layout.
    • A display like the A95X R2 and Abox A1 Max.
    • A display like the T95K or Tap 1 which does not have icons.
  2. Reserved: must be 0.
  3. Flags:
    • Bit 0 - When set to 1 the driver will address the display as a common anode unit. If this bit is set incorrectly the display will usually show garbage.
    • Bit 1-5 - Reserved, should be 0.
    • Bit 6 - When set to 1 the driver uses a slower frequency to communicate with the display controller.
    • Bit 7 - Reserved, should be 0.
  4. Controller:
    • FD628 and compatible controllers.
    • FD620.
    • TM1618.

e.g. some known configurations:

vfd_display_type='0x03,0x00,0x00,0x00' - A95X R2
vfd_display_type='0x02,0x00,0x01,0x00' - X92
vfd_display_type='0x04,0x00,0x00,0x01' - T95K

About

FD628 and similar compatible LED controller driver used in LibreELEC

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published