EFM32 Giant Gecko Software Documentation  efm32gg-doc-5.1.2
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 /***************************************************************************/
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /*******************************************************************************
41  ******************************** DEFINES ************************************
42  ******************************************************************************/
43 
45 #define DISPLAY_EMSTATUS_OK (0)
46 #define DISPLAY_EMSTATUS_NOT_ENOUGH_MEMORY (DISPLAY_EMSTATUS_BASE | 1)
47 #define DISPLAY_EMSTATUS_OUT_OF_RANGE (DISPLAY_EMSTATUS_BASE | 2)
48 #define DISPLAY_EMSTATUS_INVALID_PARAMETER (DISPLAY_EMSTATUS_BASE | 3)
49 #define DISPLAY_EMSTATUS_NOT_SUPPORTED (DISPLAY_EMSTATUS_BASE | 4)
50 #define DISPLAY_EMSTATUS_NOT_INITIALIZED (DISPLAY_EMSTATUS_BASE | 5)
53 /*******************************************************************************
54  ******************************** ENUMS ************************************
55  ******************************************************************************/
56 
59 {
65 
66 
69 {
78 
79 
81 typedef void* DISPLAY_PixelMatrix_t;
82 
83 
84 /*******************************************************************************
85  ******************************* STRUCTS ***********************************
86  ******************************************************************************/
87 
89 typedef struct DISPLAY_Geometry_t
90 {
91  unsigned int width;
92  unsigned int stride;
94  unsigned int height;
96 
97 
98 /* Forward declaration of struct DISPLAY_Device_t in order to reference it
99  inside the typdef. */
100 struct DISPLAY_Device_t;
101 
106 typedef struct DISPLAY_Device_t
107 {
108  char* name;
114  EMSTATUS (*pDisplayPowerOn) (struct DISPLAY_Device_t* device,
115  bool on);
116 
119  EMSTATUS (*pPixelMatrixAllocate) (struct DISPLAY_Device_t* device,
120  unsigned int width,
121 #ifdef EMWIN_WORKAROUND
122  unsigned int userStride,
123 #endif
124  unsigned int height,
125  DISPLAY_PixelMatrix_t *pixelMatrix
126  );
127 
129  EMSTATUS (*pPixelMatrixFree) (struct DISPLAY_Device_t* device,
130  DISPLAY_PixelMatrix_t pixelMatrix);
131 
134  EMSTATUS (*pPixelMatrixDraw) (struct DISPLAY_Device_t* device,
135  DISPLAY_PixelMatrix_t pixelMatrix,
136  unsigned int startColumn,
137  unsigned int width,
138 #ifdef EMWIN_WORKAROUND
139  unsigned int userStride,
140 #endif
141  unsigned int startRow,
142  unsigned int height);
143 
145  EMSTATUS (*pPixelMatrixClear) (struct DISPLAY_Device_t* device,
146  DISPLAY_PixelMatrix_t pixelMatrix,
147  unsigned int width,
148  unsigned int height
149  );
150 
153  EMSTATUS (*pDriverRefresh) (struct DISPLAY_Device_t* device);
154 
156 
157 
163 typedef EMSTATUS (*pDisplayDeviceDriverInitFunction_t) (void);
164 
165 
166 /*******************************************************************************
167  ************************** FUNCTION PROTOTYPES **************************
168  ******************************************************************************/
169 
170 EMSTATUS DISPLAY_Init (void);
171 EMSTATUS DISPLAY_DriverRefresh (void);
172 EMSTATUS DISPLAY_DeviceGet (int displayDeviceNo,
173  DISPLAY_Device_t* device);
174 
175 #ifdef __cplusplus
176 }
177 #endif
178 
182 #endif /* _DISPLAY_H_ */
DISPLAY_ColourMode_t colourMode
Definition: display.h:110
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:145
DISPLAY_ColourMode_t
Definition: display.h:58
EMSTATUS(* pDriverRefresh)(struct DISPLAY_Device_t *device)
Definition: display.h:153
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:134
EMSTATUS DISPLAY_DriverRefresh(void)
Refresh all DISPLAY devices.
Definition: display.c:97
EMSTATUS(* pDisplayPowerOn)(struct DISPLAY_Device_t *device, bool on)
Definition: display.h:114
EMSTATUS(* pPixelMatrixFree)(struct DISPLAY_Device_t *device, DISPLAY_PixelMatrix_t pixelMatrix)
Definition: display.h:129
struct DISPLAY_Device_t DISPLAY_Device_t
unsigned int width
Definition: display.h:91
unsigned int stride
Definition: display.h:92
unsigned int height
Definition: display.h:94
DISPLAY_AddressMode_t
Definition: display.h:68
EMSTATUS(* pDisplayDeviceDriverInitFunction_t)(void)
Definition: display.h:163
EMSTATUS definitions.
Main configuration file for the DISPLAY driver software stack.
DISPLAY_Geometry_t geometry
Definition: display.h:109
EMSTATUS(* pPixelMatrixAllocate)(struct DISPLAY_Device_t *device, unsigned int width, unsigned int height, DISPLAY_PixelMatrix_t *pixelMatrix)
Definition: display.h:119
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:81
DISPLAY_AddressMode_t addressMode
Definition: display.h:111