DMD - Dot Matrix Display#
Hardware abstraction layer for dot matrix displays.
The DMD interface is the hardware abstraction layer for a physical display. The DMD interface provides functions for treating a connected display as a matrix of pixels of a specific size. The DMD provides functions for initializing the display hardware interface by calling DMD_init() and writing pixel data to the display by calling the function DMD_writeData().
DMD Drivers#
GLIB provides a DMD driver for the Sharp Memory LCD screens used on the Silicon Labs Starter Kits. This driver must be used together with the kit display drivers.
Modules#
Typedefs#
Configuration parameter for DMD_init.
Functions#
Initializes the DMD support for memory lcd display.
Get the dimensions of the display and of the current clipping area.
Sets the current clipping area.
Draws pixels to the display.
Draws a number of pixels of the same color to the display.
Turns off the display and puts it into sleep mode Does not turn off backlight.
Wakes up the display from sleep mode.
Set horizontal and vertical flip mode of display controller.
Select the active framebuffer DMD functions will draw in.
Get current framebuffer used by DMD for drawing (backbuffer).
Update the display device with contents of active framebuffer.
Macros#
Base of DMD error codes.
Successful call.
Driver not initialized correctly.
Driver is already initialized.
Length of data is larger than size of clip.
Pixel is outside current clipping area.
Clipping area is empty.
Wrong device code.
Memory error.
Error code expected, but didn't happen.
Test run failed.
Function or option not supported - yet.
Not enough memory.
Device code test.
Memory test.
Parameter checks test.
Color test.
Clipping test.
Typedef Documentation#
DMD_InitConfig#
typedef void DMD_InitConfig
Configuration parameter for DMD_init.
This typedef is defined 'void' and may be defined differently in the future.
Function Documentation#
DMD_init#
EMSTATUS DMD_init (DMD_InitConfig * initConfig)
Initializes the DMD support for memory lcd display.
Type | Direction | Argument Name | Description |
---|---|---|---|
DMD_InitConfig * | N/A | initConfig | Not used in this DMD module. |
Returns
DMD_OK on success, otherwise error code
DMD_getDisplayGeometry#
EMSTATUS DMD_getDisplayGeometry (DMD_DisplayGeometry ** geometry)
Get the dimensions of the display and of the current clipping area.
Type | Direction | Argument Name | Description |
---|---|---|---|
DMD_DisplayGeometry ** | [out] | geometry | Geometry structure |
Returns
DMD_OK on success, otherwise error code
DMD_setClippingArea#
EMSTATUS DMD_setClippingArea (uint16_t xStart, uint16_t yStart, uint16_t width, uint16_t height)
Sets the current clipping area.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | N/A | xStart | X coordinate of the upper left corner of the clipping area |
uint16_t | N/A | yStart | Y coordinate of the upper left corner of the clipping area |
uint16_t | N/A | width | Width of the clipping area |
uint16_t | N/A | height | Height of the clipping area |
Note
All coordinates given to writeData/writeColor/readData are relative to this clipping area.
Returns
DMD_OK on success, otherwise error code
DMD_writeData#
EMSTATUS DMD_writeData (uint16_t x, uint16_t y, const uint8_t data, uint32_t numPixels)
Draws pixels to the display.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | N/A | x | X coordinate of the first pixel to be written, relative to the clipping area |
uint16_t | N/A | y | Y coordinate of the first pixel to be written, relative to the clipping area |
const uint8_t | N/A | data | Array containing the pixel data. For monochrome displays, each 8-bit element contains 8 pixels values. For RGB displays, each bit in the array are one color component of the pixel, so that 3 bits represent one pixel. The pixels are ordered by increasing x coordinate, after the last pixel of a row, the next pixel will be the first pixel on the next row. |
uint32_t | N/A | numPixels | Number of pixels to be written |
Returns
DMD_OK on success, otherwise error code
DMD_writeColor#
EMSTATUS DMD_writeColor (uint16_t x, uint16_t y, uint8_t red, uint8_t green, uint8_t blue, uint32_t numPixels)
Draws a number of pixels of the same color to the display.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | N/A | x | X coordinate of the first pixel to be written, relative to the clipping area |
uint16_t | N/A | y | Y coordinate of the first pixel to be written, relative to the clipping area |
uint8_t | N/A | red | Red component of the color |
uint8_t | N/A | green | Green component of the color |
uint8_t | N/A | blue | Blue component of the color |
uint32_t | N/A | numPixels | Number of pixels to be written |
Returns
DMD_OK on success, otherwise error code
DMD_sleep#
EMSTATUS DMD_sleep (void )
Turns off the display and puts it into sleep mode Does not turn off backlight.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Returns
DMD_OK on success, otherwise error code
DMD_wakeUp#
EMSTATUS DMD_wakeUp (void )
Wakes up the display from sleep mode.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Returns
DMD_OK on success, otherwise error code
DMD_flipDisplay#
EMSTATUS DMD_flipDisplay (int horizontal, int vertical)
Set horizontal and vertical flip mode of display controller.
Type | Direction | Argument Name | Description |
---|---|---|---|
int | N/A | horizontal | Set to flip display horizontally |
int | N/A | vertical | Set to flip display vertically |
Returns
Returns DMD_OK if successful, error otherwise.
DMD_selectFramebuffer#
EMSTATUS DMD_selectFramebuffer (void * framebuffer)
Select the active framebuffer DMD functions will draw in.
Type | Direction | Argument Name | Description |
---|---|---|---|
void * | N/A | framebuffer | Pointer to the framebuffer to be selected as active framebuffer. |
Returns
Returns DMD_OK if successful, error otherwise.
DMD_getFrameBuffer#
EMSTATUS DMD_getFrameBuffer (void ** framebuffer)
Get current framebuffer used by DMD for drawing (backbuffer).
Type | Direction | Argument Name | Description |
---|---|---|---|
void ** | N/A | framebuffer | Pointer to a framebuffer array. Gets set to DMD's current buffer. |
Returns
DMD_OK on success
DMD_updateDisplay#
EMSTATUS DMD_updateDisplay (void )
Update the display device with contents of active framebuffer.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Only the dirty rows/lines are updated on the display device. Dirty rows/lines are those that have been written to since the last display update. When a new active framebuffer is selected, all lines/rows will be marked as dirty.
Returns
Returns DMD_OK if successful, error otherwise.