ex_lcd v0.3.0 ExLCD
ExLCD implements a standard API for controlling and displaying text on character matrix LCD display modules. ExLCD handles most modes and operations supported by common display modules.
ExLCD controls an assortment of displays by interacting with a driver module implementing the ExLCD.Driver behaviour. ExLCD has no direct support for controlling hardware and instead delegates low-level functions driver modules for the actual device.
Usage
ExLCD is implemented as a GenServer. Start it by calling ExLCD.start_link/1 and passing a tuple containing the name of the driver module in the first element and a map of configuration parameters in second element. See the driver module documentation for what configuration parameters it accepts.
Example:
alias ExLCD
ExLCD.start_link({ExLCD.HD44780, %{...}})
Summary
Functions
Clear the display
Program a custom character glyph
Disable a display feature
Enable a display feature
Home the cursor position to row 0, col 0
Move the cursor 1 or some number of columns to the left of its current position
Move the cursor 1 or some number of columns to the right of its current position
Position the cursor at a specified row and colum
Scroll the display contents left by 1 or some number of columns
Scroll the display contents right by 1 or some number of columns
Start the ExLCD GenServer to manage the display
Stop the driver and release hardware resources
Write a string or charlist to the display at the current cursor position
Types
Functions
Program a custom character glyph.
Custom glyphs may not be supported by all displays. Check the driver to see if it is on yours. Pass a custome character index or slot number and a list of integers representing the glyph bitmap data. Format of the bitmap data and the numbering of the character slots is highly dependent on the display controller. Refer to the driver module for details.
Example:
iex> ExLCD.create_char(0, [0x7F, 0x7F, 0x7F, 0x7F,
...> 0x7F, 0x7F, 0x7F, 0x7F])
:ok
Disable a display feature.
Example:
iex> ExLCD.disable(:blink)
:ok
Enable a display feature.
Example:
iex> ExLCD.enable(:display)
:ok
Move the cursor 1 or some number of columns to the left of its current position.
Example:
iex> ExLCD.move_left(4)
:ok
Move the cursor 1 or some number of columns to the right of its current position.
Example:
iex> ExLCD.move_right(1)
:ok
Position the cursor at a specified row and colum
Example:
iex> ExLCD.move_to(2, 12)
:ok
Scroll the display contents left by 1 or some number of columns.
Example:
iex> ExLCD.scroll_right(6)
:ok
Scroll the display contents right by 1 or some number of columns.
Example:
iex> ExLCD.scroll_right(6)
:ok
Start the ExLCD GenServer to manage the display.
Pass a tuple containing the name of the driver module in the first element and a map of configuration parameters in second element. See the driver module documentation for what configuration parameters it accepts.
Example:
alias ExLCD
ExLCD.start_link({ExLCD.HD44780, %{...}})