EFM32 Giant Gecko Software Documentation  efm32gg-doc-4.2.1
display.h
Go to the documentation of this file.
1 /**************************************************************************/
18 #ifndef _DISPLAY_H_
19 #define _DISPLAY_H_
20 
21 #include <stdbool.h>
22 #include <stdint.h>
23 #include "emstatus.h"
24 #include "displayconfigall.h"
25 
26 /***************************************************************************/
31 /***************************************************************************/
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /*******************************************************************************
43  ******************************** DEFINES ************************************
44  ******************************************************************************/
45 
47 #define DISPLAY_EMSTATUS_OK (0)
48 #define DISPLAY_EMSTATUS_NOT_ENOUGH_MEMORY (DISPLAY_EMSTATUS_BASE | 1)
49 #define DISPLAY_EMSTATUS_OUT_OF_RANGE (DISPLAY_EMSTATUS_BASE | 2)
50 #define DISPLAY_EMSTATUS_INVALID_PARAMETER (DISPLAY_EMSTATUS_BASE | 3)
51 #define DISPLAY_EMSTATUS_NOT_SUPPORTED (DISPLAY_EMSTATUS_BASE | 4)
52 #define DISPLAY_EMSTATUS_NOT_INITIALIZED (DISPLAY_EMSTATUS_BASE | 5)
55 /*******************************************************************************
56  ******************************** ENUMS ************************************
57  ******************************************************************************/
58 
61 {
67 
68 
71 {
80 
81 
83 typedef void* DISPLAY_PixelMatrix_t;
84 
85 
86 /*******************************************************************************
87  ******************************* STRUCTS ***********************************
88  ******************************************************************************/
89 
91 typedef struct DISPLAY_Geometry_t
92 {
93  unsigned int width;
94  unsigned int stride;
96  unsigned int height;
98 
99 
100 /* Forward declaration of struct DISPLAY_Device_t in order to reference it
101  inside the typdef. */
102 struct DISPLAY_Device_t;
103 
108 typedef struct DISPLAY_Device_t
109 {
110  char* name;
116  EMSTATUS (*pDisplayPowerOn) (struct DISPLAY_Device_t* device,
117  bool on);
118 
121  EMSTATUS (*pPixelMatrixAllocate) (struct DISPLAY_Device_t* device,
122  unsigned int width,
123 #ifdef EMWIN_WORKAROUND
124  unsigned int userStride,
125 #endif
126  unsigned int height,
127  DISPLAY_PixelMatrix_t *pixelMatrix
128  );
129 
131  EMSTATUS (*pPixelMatrixFree) (struct DISPLAY_Device_t* device,
132  DISPLAY_PixelMatrix_t pixelMatrix);
133 
136  EMSTATUS (*pPixelMatrixDraw) (struct DISPLAY_Device_t* device,
137  DISPLAY_PixelMatrix_t pixelMatrix,
138  unsigned int startColumn,
139  unsigned int width,
140 #ifdef EMWIN_WORKAROUND
141  unsigned int userStride,
142 #endif
143  unsigned int startRow,
144  unsigned int height);
145 
147  EMSTATUS (*pPixelMatrixClear) (struct DISPLAY_Device_t* device,
148  DISPLAY_PixelMatrix_t pixelMatrix,
149  unsigned int width,
150  unsigned int height
151  );
152 
155  EMSTATUS (*pDriverRefresh) (struct DISPLAY_Device_t* device);
156 
158 
159 
165 typedef EMSTATUS (*pDisplayDeviceDriverInitFunction_t) (void);
166 
167 
168 /*******************************************************************************
169  ************************** FUNCTION PROTOTYPES **************************
170  ******************************************************************************/
171 
172 EMSTATUS DISPLAY_Init (void);
173 EMSTATUS DISPLAY_DriverRefresh (void);
174 EMSTATUS DISPLAY_DeviceGet (int displayDeviceNo,
175  DISPLAY_Device_t* device);
176 
177 #ifdef __cplusplus
178 }
179 #endif
180 
184 #endif /* _DISPLAY_H_ */
DISPLAY_ColourMode_t colourMode
Definition: display.h:112
EMSTATUS DISPLAY_Init(void)
Initialize the DISPLAY module.
Definition: display.c:64
EMSTATUS(* pPixelMatrixClear)(struct DISPLAY_Device_t *device, DISPLAY_PixelMatrix_t pixelMatrix, unsigned int width, unsigned int height)
Definition: display.h:147
DISPLAY_ColourMode_t
Definition: display.h:60
EMSTATUS(* pDriverRefresh)(struct DISPLAY_Device_t *device)
Definition: display.h:155
EMSTATUS(* pPixelMatrixDraw)(struct DISPLAY_Device_t *device, DISPLAY_PixelMatrix_t pixelMatrix, unsigned int startColumn, unsigned int width, unsigned int startRow, unsigned int height)
Definition: display.h:136
EMSTATUS DISPLAY_DriverRefresh(void)
Refresh all DISPLAY devices.
Definition: display.c:97
EMSTATUS(* pDisplayPowerOn)(struct DISPLAY_Device_t *device, bool on)
Definition: display.h:116
EMSTATUS(* pPixelMatrixFree)(struct DISPLAY_Device_t *device, DISPLAY_PixelMatrix_t pixelMatrix)
Definition: display.h:131
struct DISPLAY_Device_t DISPLAY_Device_t
unsigned int width
Definition: display.h:93
unsigned int stride
Definition: display.h:94
unsigned int height
Definition: display.h:96
DISPLAY_AddressMode_t
Definition: display.h:70
EMSTATUS(* pDisplayDeviceDriverInitFunction_t)(void)
Definition: display.h:165
EMSTATUS definitions.
Main configuration file for the DISPLAY driver software stack.
DISPLAY_Geometry_t geometry
Definition: display.h:111
EMSTATUS(* pPixelMatrixAllocate)(struct DISPLAY_Device_t *device, unsigned int width, unsigned int height, DISPLAY_PixelMatrix_t *pixelMatrix)
Definition: display.h:121
struct DISPLAY_Geometry_t DISPLAY_Geometry_t
EMSTATUS DISPLAY_DeviceGet(int displayDeviceNo, DISPLAY_Device_t *device)
Get the display device data structure corresponding to the device number.
Definition: display.c:139
void * DISPLAY_PixelMatrix_t
Definition: display.h:83
DISPLAY_AddressMode_t addressMode
Definition: display.h:113