View Source pmod_mtds (grisp v2.8.0)
GRiSP device driver for Digilent Pmod MTDS.
NOTE: This driver does not replicate all of the functionality found in the reference C++ driver. I hope it replicates enough that interested developers have templates for any further features they might want to add! Also, a warning: the C++ driver defines some constants (and even commands??) which are not supported by the device firmware.
For manuals and a C++ reference driver, see https://github.com/Digilent/vivado-library/tree/master/ip/Pmods/PmodMTDS_v1_0
Summary
Functions
Allocate a new bitmap (usually to back a surface).
Write the contents of one bitmap onto another.
Release a bitmap.
Blanks the MTDS to the indicated color.
Set the background draw color of a surface.
Set the foreground draw color of a surface.
Set the bitwise operator used to combine pen + bitmap when drawing.
Retrieve the current font of a surface.
Set the active font for a surface.
Draw a line on a surface from the current cursor position to a new one.
Move the cursor position on a surface.
Registers the caller for touch events for the indicated window.
Launch the MTDS driver.
Convert a human-readable font atom to a font() instance.
Generate a new surface (with no underlying bitmap).
Tether a surface to a backing bitmap.
Retrieve a surface handle to the global display.
Release a surface handle.
Write text on a surface at a given position.
Types
-type bitmap() :: 3238002688..3238002688 + 16777215.
-type font() :: 3271557120..3271557120 + 16777215.
-type stock_font() :: console.
-type surface() :: 3221225472..3221225472 + 16777215.
-type window() :: 3288334336..3288334336 + 16777215.
Functions
Allocate a new bitmap (usually to back a surface).
Write the contents of one bitmap onto another.
-spec bitmap_release(bitmap()) -> ok.
Release a bitmap.
-spec clear(Color :: color()) -> ok.
Blanks the MTDS to the indicated color.
Set the background draw color of a surface.
Set the foreground draw color of a surface.
Set the bitwise operator used to combine pen + bitmap when drawing.
Retrieve the current font of a surface.
Set the active font for a surface.
Draw a line on a surface from the current cursor position to a new one.
Move the cursor position on a surface.
Registers the caller for touch events for the indicated window.
-spec register(window()) -> ok.
-spec start_link(grisp_spi:bus(), any()) -> {ok, pid()} | ignore | {error, term()}.
Launch the MTDS driver.
-spec stock_font(stock_font()) -> font().
Convert a human-readable font atom to a font() instance.
-spec surface() -> {ok, surface()}.
Generate a new surface (with no underlying bitmap).
Tether a surface to a backing bitmap.
-spec surface_display() -> {ok, surface()}.
Retrieve a surface handle to the global display.
-spec surface_release(surface()) -> ok.
Release a surface handle.
Write text on a surface at a given position.