Module stm32f4xx_hal::fsmc_lcd

source ·
Expand description

LCD interface using the Flexible Memory Controller (FMC) / Flexible Static Memory Controller (FSMC)

This module is only available if the fsmc_lcd feature is enabled and the target microcontroller has an FMC or FSMC

This driver is compatible with many LCD driver chips that support the Intel 8080 interface (also called Display Bus Interface (DBI) type B) with a 16-bit data bus.

Here are some examples of compatible LCD drivers:

  • Sitronix ST7735S
  • Sitronix ST7789VI
  • Ilitek ILI9327
  • Ilitek ILI9320
  • Himax HX8357-B

Higher-level driver code can add support for specific LCD driver integrated circuits.

For an overview of how this interface works, see application note AN2790.

Pins

To interface with 1-4 LCDs, you will need:

  • 16 data pins (0 through 15), shared among all the LCDs
  • One NEx (chip select) pin per LCD (up to 4)
  • One Ax (address) pin, shared among all the LCDs. This pin is used to select data or command mode.
    • You can also supply up to 4 address pins, but they will always have the same output.
    • Caution: Due to hardware limitations, address line A25 cannot be used.
  • One NOE (read enable) pin, shared among all the LCDs
  • One NWE (write enable) pin, shared among all the LCDs

Timing

Because the correct timing depends on the specific LCD controller and the wiring between the microcontroller and LCD controller, this driver does not try to calculate the correct timing settings. Instead, it exposes the access modes and timing options that the STM32F4 hardware supports.

The default access mode is mode C. For an example timing diagram, refer to reference manual RM0090, figures 443 and 444 (on page 1562), or your microcontroller reference manual.

Access modes A, B, and D are also supported.

Basic operation

  1. Create an LcdPins object containing the pins used to communicate with the LCD

  2. Create default Timing objects for the write and read timing

    a. (Optional) Adjust the timing to make read and write operations faster, within the limits of the wiring and LCD controller

  3. Pass the FSMC peripheral object, pins, read timing, and write timing to FsmcLcd::new. This function will return an FsmcLcd and one or more Lcd objects.

  4. Use the returned Lcd object(s) to configure the controller(s) and display graphics

Structs

Enums

Traits

  • One, two, three, or four address pins
  • One, two, three, or four chip select pins
  • A set of data pins
  • A set of pins that can be used with the FSMC
  • A sub-bank of bank 1, with its own chip select output