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.
114
of file platform/middleware/glib/dmd/dmd.h
Function Documentation#
DMD_init#
EMSTATUS DMD_init (DMD_InitConfig * initConfig)
Initializes the DMD support for memory lcd display.
N/A | initConfig | Not used in this DMD module. |
Returns
DMD_OK on success, otherwise error code
158
of file platform/middleware/glib/dmd/dmd.h
DMD_getDisplayGeometry#
EMSTATUS DMD_getDisplayGeometry (DMD_DisplayGeometry ** geometry)
Get the dimensions of the display and of the current clipping area.
[out] | geometry | Geometry structure |
Returns
DMD_OK on success, otherwise error code
170
of file platform/middleware/glib/dmd/dmd.h
DMD_setClippingArea#
EMSTATUS DMD_setClippingArea (uint16_t xStart, uint16_t yStart, uint16_t width, uint16_t height)
Sets the current clipping area.
N/A | xStart | X coordinate of the upper left corner of the clipping area |
N/A | yStart | Y coordinate of the upper left corner of the clipping area |
N/A | width | Width of the clipping area |
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
195
of file platform/middleware/glib/dmd/dmd.h
DMD_writeData#
EMSTATUS DMD_writeData (uint16_t x, uint16_t y, const uint8_t data, uint32_t numPixels)
Draws pixels to the display.
N/A | x | X coordinate of the first pixel to be written, relative to the clipping area |
N/A | y | Y coordinate of the first pixel to be written, relative to the clipping area |
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. |
N/A | numPixels | Number of pixels to be written |
Returns
DMD_OK on success, otherwise error code
222
of file platform/middleware/glib/dmd/dmd.h
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.
N/A | x | X coordinate of the first pixel to be written, relative to the clipping area |
N/A | y | Y coordinate of the first pixel to be written, relative to the clipping area |
N/A | red | Red component of the color |
N/A | green | Green component of the color |
N/A | blue | Blue component of the color |
N/A | numPixels | Number of pixels to be written |
Returns
DMD_OK on success, otherwise error code
260
of file platform/middleware/glib/dmd/dmd.h
DMD_sleep#
EMSTATUS DMD_sleep (void )
Turns off the display and puts it into sleep mode Does not turn off backlight.
N/A |
Returns
DMD_OK on success, otherwise error code
271
of file platform/middleware/glib/dmd/dmd.h
DMD_wakeUp#
EMSTATUS DMD_wakeUp (void )
Wakes up the display from sleep mode.
N/A |
Returns
DMD_OK on success, otherwise error code
280
of file platform/middleware/glib/dmd/dmd.h
DMD_flipDisplay#
EMSTATUS DMD_flipDisplay (int horizontal, int vertical)
Set horizontal and vertical flip mode of display controller.
N/A | horizontal | Set to flip display horizontally |
N/A | vertical | Set to flip display vertically |
Returns
Returns DMD_OK if successful, error otherwise.
295
of file platform/middleware/glib/dmd/dmd.h
DMD_selectFramebuffer#
EMSTATUS DMD_selectFramebuffer (void * framebuffer)
Select the active framebuffer DMD functions will draw in.
N/A | framebuffer | Pointer to the framebuffer to be selected as active framebuffer. |
Returns
Returns DMD_OK if successful, error otherwise.
307
of file platform/middleware/glib/dmd/dmd.h
DMD_getFrameBuffer#
EMSTATUS DMD_getFrameBuffer (void ** framebuffer)
Get current framebuffer used by DMD for drawing (backbuffer).
N/A | framebuffer | Pointer to a framebuffer array. Gets set to DMD's current buffer. |
Returns
DMD_OK on success
320
of file platform/middleware/glib/dmd/dmd.h
DMD_updateDisplay#
EMSTATUS DMD_updateDisplay (void )
Update the display device with contents of active framebuffer.
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.
334
of file platform/middleware/glib/dmd/dmd.h
Macro Definition Documentation#
ECODE_DMD_BASE#
#define ECODE_DMD_BASEValue:
0x00000000
Base of DMD error codes.
67
of file platform/middleware/glib/dmd/dmd.h
DMD_OK#
#define DMD_OKValue:
0x00000000
Successful call.
71
of file platform/middleware/glib/dmd/dmd.h
DMD_ERROR_DRIVER_NOT_INITIALIZED#
#define DMD_ERROR_DRIVER_NOT_INITIALIZEDValue:
(ECODE_DMD_BASE | 0x0001)
Driver not initialized correctly.
73
of file platform/middleware/glib/dmd/dmd.h
DMD_ERROR_DRIVER_ALREADY_INITIALIZED#
#define DMD_ERROR_DRIVER_ALREADY_INITIALIZEDValue:
(ECODE_DMD_BASE | 0x0002)
Driver is already initialized.
75
of file platform/middleware/glib/dmd/dmd.h
DMD_ERROR_TOO_MUCH_DATA#
#define DMD_ERROR_TOO_MUCH_DATAValue:
(ECODE_DMD_BASE | 0x0003)
Length of data is larger than size of clip.
77
of file platform/middleware/glib/dmd/dmd.h
DMD_ERROR_PIXEL_OUT_OF_BOUNDS#
#define DMD_ERROR_PIXEL_OUT_OF_BOUNDSValue:
(ECODE_DMD_BASE | 0x0004)
Pixel is outside current clipping area.
79
of file platform/middleware/glib/dmd/dmd.h
DMD_ERROR_EMPTY_CLIPPING_AREA#
#define DMD_ERROR_EMPTY_CLIPPING_AREAValue:
(ECODE_DMD_BASE | 0x0005)
Clipping area is empty.
81
of file platform/middleware/glib/dmd/dmd.h
DMD_ERROR_WRONG_DEVICE_CODE#
#define DMD_ERROR_WRONG_DEVICE_CODEValue:
(ECODE_DMD_BASE | 0x0006)
Wrong device code.
83
of file platform/middleware/glib/dmd/dmd.h
DMD_ERROR_MEMORY_ERROR#
#define DMD_ERROR_MEMORY_ERRORValue:
(ECODE_DMD_BASE | 0x0007)
Memory error.
85
of file platform/middleware/glib/dmd/dmd.h
DMD_ERROR_NO_ERROR_CODE#
#define DMD_ERROR_NO_ERROR_CODEValue:
(ECODE_DMD_BASE | 0x0008)
Error code expected, but didn't happen.
87
of file platform/middleware/glib/dmd/dmd.h
DMD_ERROR_TEST_FAILED#
#define DMD_ERROR_TEST_FAILEDValue:
(ECODE_DMD_BASE | 0x0009)
Test run failed.
89
of file platform/middleware/glib/dmd/dmd.h
DMD_ERROR_NOT_SUPPORTED#
#define DMD_ERROR_NOT_SUPPORTEDValue:
(ECODE_DMD_BASE | 0x000a)
Function or option not supported - yet.
91
of file platform/middleware/glib/dmd/dmd.h
DMD_ERROR_NOT_ENOUGH_MEMORY#
#define DMD_ERROR_NOT_ENOUGH_MEMORYValue:
(ECODE_DMD_BASE | 0x000b)
Not enough memory.
93
of file platform/middleware/glib/dmd/dmd.h
DMD_TEST_DEVICE_CODE#
#define DMD_TEST_DEVICE_CODEValue:
0x00000001
Device code test.
97
of file platform/middleware/glib/dmd/dmd.h
DMD_TEST_MEMORY#
#define DMD_TEST_MEMORYValue:
0x00000002
Memory test.
99
of file platform/middleware/glib/dmd/dmd.h
DMD_TEST_PARAMETER_CHECKS#
#define DMD_TEST_PARAMETER_CHECKSValue:
0x00000004
Parameter checks test.
101
of file platform/middleware/glib/dmd/dmd.h
DMD_TEST_COLORS#
#define DMD_TEST_COLORSValue:
0x00000008
Color test.
103
of file platform/middleware/glib/dmd/dmd.h
DMD_TEST_CLIPPING#
#define DMD_TEST_CLIPPINGValue:
0x00000010
Clipping test.
105
of file platform/middleware/glib/dmd/dmd.h