Hitachi HD44780 Character LCD Controller

Schema identifier ($id): "http://devicetree.org/schemas/auxdisplay/hit,hd44780.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "Geert Uytterhoeven <geert@linux-m68k.org>"

The Hitachi HD44780 Character LCD Controller is commonly used on character LCDs that can display one or more lines of text. It exposes an M6800 bus interface, which can be used in either 4-bit or 8-bit mode. By using a GPIO expander it is possible to use the driver with one of the popular I2C expander boards based on the PCF8574 available for these displays. For an example see below.

Properties and child nodes (properties) #

compatible — required here #

Exact value (const): "hit,hd44780"

data-gpios — required here #

GPIO pins connected to the data signal lines DB0-DB7 (8-bit mode) or DB4-DB7 (4-bit mode) of the LCD Controller's bus interface.

Exactly one of these rules must match (oneOf) #

Rule 1

Maximum number of items (maxItems): 4

Rule 2

Maximum number of items (maxItems): 8

enable-gpios — required here #

GPIO pin connected to the "E" (Enable) signal line of the LCD Controller's bus interface.

Maximum number of items (maxItems): 1

rs-gpios — required here #

GPIO pin connected to the "RS" (Register Select) signal line of the LCD Controller's bus interface.

Maximum number of items (maxItems): 1

rw-gpios — not listed as required here #

GPIO pin connected to the "RW" (Read/Write) signal line of the LCD Controller's bus interface.

Maximum number of items (maxItems): 1

backlight-gpios — not listed as required here #

GPIO pin used for enabling the LCD's backlight.

Maximum number of items (maxItems): 1

display-height-chars — required here #

Height of the display, in character cells,

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Minimum value (minimum): 1

Maximum value (maximum): 4

display-width-chars — required here #

Width of the display, in character cells.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Minimum value (minimum): 1

Maximum value (maximum): 64

internal-buffer-width — not listed as required here #

Internal buffer width (default is 40 for displays with 1 or 2 lines, and display-width-chars for displays with more than 2 lines).

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Minimum value (minimum): 1

Maximum value (maximum): 64

Required in this object (required): "compatible", "data-gpios", "enable-gpios", "rs-gpios", "display-height-chars", "display-width-chars"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

Examples (examples) #

#include <dt-bindings/gpio/gpio.h>
display-controller {
    compatible = "hit,hd44780";

    data-gpios = <&hc595 0 GPIO_ACTIVE_HIGH>,
                 <&hc595 1 GPIO_ACTIVE_HIGH>,
                 <&hc595 2 GPIO_ACTIVE_HIGH>,
                 <&hc595 3 GPIO_ACTIVE_HIGH>;
    enable-gpios = <&hc595 4 GPIO_ACTIVE_HIGH>;
    rs-gpios = <&hc595 5 GPIO_ACTIVE_HIGH>;

    display-height-chars = <2>;
    display-width-chars = <16>;
};
#include <dt-bindings/gpio/gpio.h>
i2c {
    #address-cells = <1>;
    #size-cells = <0>;

    pcf8574: gpio-expander@27 {
        compatible = "nxp,pcf8574";
        reg = <0x27>;
        gpio-controller;
        #gpio-cells = <2>;
    };
};

display-controller {
    compatible = "hit,hd44780";
    display-height-chars = <2>;
    display-width-chars = <16>;
    data-gpios = <&pcf8574 4 GPIO_ACTIVE_HIGH>,
                 <&pcf8574 5 GPIO_ACTIVE_HIGH>,
                 <&pcf8574 6 GPIO_ACTIVE_HIGH>,
                 <&pcf8574 7 GPIO_ACTIVE_HIGH>;
    enable-gpios = <&pcf8574 2 GPIO_ACTIVE_HIGH>;
    rs-gpios = <&pcf8574 0 GPIO_ACTIVE_HIGH>;
    rw-gpios = <&pcf8574 1 GPIO_ACTIVE_HIGH>;
    backlight-gpios = <&pcf8574 3 GPIO_ACTIVE_HIGH>;
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

Edit this page