Documentation / devicetree / bindings / auxdisplay / hit,hd44780.yaml


Based on kernel version 6.11. Page generated on 2024-09-24 08:21 EST.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/auxdisplay/hit,hd44780.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Hitachi HD44780 Character LCD Controller

maintainers:
  - Geert Uytterhoeven <geert@linux-m68k.org>

description:
  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:
  compatible:
    const: hit,hd44780

  data-gpios:
    description:
      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.
    oneOf:
      - maxItems: 4
      - maxItems: 8

  enable-gpios:
    description:
      GPIO pin connected to the "E" (Enable) signal line of the LCD
      Controller's bus interface.
    maxItems: 1

  rs-gpios:
    description:
      GPIO pin connected to the "RS" (Register Select) signal line of the LCD
      Controller's bus interface.
    maxItems: 1

  rw-gpios:
    description:
      GPIO pin connected to the "RW" (Read/Write) signal line of the LCD
      Controller's bus interface.
    maxItems: 1

  backlight-gpios:
    description: GPIO pin used for enabling the LCD's backlight.
    maxItems: 1

  display-height-chars:
    description: Height of the display, in character cells,
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 1
    maximum: 4

  display-width-chars:
    description: Width of the display, in character cells.
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 1
    maximum: 64

  internal-buffer-width:
    description:
      Internal buffer width (default is 40 for displays with 1 or 2 lines, and
      display-width-chars for displays with more than 2 lines).
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 1
    maximum: 64

required:
  - compatible
  - data-gpios
  - enable-gpios
  - rs-gpios
  - display-height-chars
  - display-width-chars

additionalProperties: false

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>;
    };