GP1212A02: Adding select font size command.
2 #include "MiniDisplay.h"
3 #include "FutabaGP1212A01.h"
4 #include "FutabaGP1212A02.h"
7 MiniDisplayDevice MiniDisplayOpen(TMiniDisplayType aType, bool aAutoDetect)
9 GraphicDisplay* device=NULL;
13 case EMiniDisplayAutoDetect:
14 case EMiniDisplayFutabaGP1212A01:
15 device=new GP1212A01A();
18 case EMiniDisplayFutabaGP1212A02:
19 device=new GP1212A02A();
22 case EMiniDisplayAutoDetectFailed:
23 //Auto detect sequence failed
28 int success = device->Open();
35 //Go recursive for auto detect
36 int typeValue=(int)aType;
38 TMiniDisplayType nextType=(TMiniDisplayType)typeValue;
39 return MiniDisplayOpen(nextType,aAutoDetect);
47 //Open & Close functions
48 MiniDisplayDevice MiniDisplayOpen(TMiniDisplayType aType)
50 bool autoDetect=aType==EMiniDisplayAutoDetect;
51 //If we want auto detect we need to pass in our first display type
52 //If we don't want auto detect we just pass in the given display type.
53 return MiniDisplayOpen((autoDetect?EMiniDisplayFutabaGP1212A01:aType),autoDetect);
61 void MiniDisplayClose(MiniDisplayDevice aDevice)
63 delete ((GraphicDisplay*)aDevice);
67 void MiniDisplayClear(MiniDisplayDevice aDevice)
74 ((GraphicDisplay*)aDevice)->Clear();
78 void MiniDisplayFill(MiniDisplayDevice aDevice)
85 ((GraphicDisplay*)aDevice)->Fill();
89 void MiniDisplaySwapBuffers(MiniDisplayDevice aDevice)
96 ((GraphicDisplay*)aDevice)->SwapBuffers();
99 //-------------------------------------------------------------
100 int MiniDisplayMaxBrightness(MiniDisplayDevice aDevice)
107 return ((GraphicDisplay*)aDevice)->MaxBrightness();
110 //-------------------------------------------------------------
111 int MiniDisplayMinBrightness(MiniDisplayDevice aDevice)
118 return ((GraphicDisplay*)aDevice)->MinBrightness();
121 //-------------------------------------------------------------
122 void MiniDisplaySetBrightness(MiniDisplayDevice aDevice, int aBrightness)
129 ((GraphicDisplay*)aDevice)->SetBrightness(aBrightness);
132 //-------------------------------------------------------------
133 int MiniDisplayWidthInPixels(MiniDisplayDevice aDevice)
140 return ((GraphicDisplay*)aDevice)->WidthInPixels();
143 //-------------------------------------------------------------
144 int MiniDisplayHeightInPixels(MiniDisplayDevice aDevice)
151 return ((GraphicDisplay*)aDevice)->HeightInPixels();
154 //-------------------------------------------------------------
155 void MiniDisplaySetPixel(MiniDisplayDevice aDevice, int aX, int aY, int aValue)
157 //aValue&=0x00FFFFFF; //Filter out alpha component
158 return ((GraphicDisplay*)aDevice)->SetPixel(aX,aY,aValue);
161 //-------------------------------------------------------------
162 wchar_t* MiniDisplayVendor(MiniDisplayDevice aDevice)
164 return ((GraphicDisplay*)aDevice)->Vendor();
167 //-------------------------------------------------------------
168 wchar_t* MiniDisplayProduct(MiniDisplayDevice aDevice)
170 return ((GraphicDisplay*)aDevice)->Product();
173 //-------------------------------------------------------------
174 wchar_t* MiniDisplaySerialNumber(MiniDisplayDevice aDevice)
176 return ((GraphicDisplay*)aDevice)->SerialNumber();
179 //-------------------------------------------------------------
180 void MiniDisplayRequest(MiniDisplayDevice aDevice, TMiniDisplayRequest aRequest)
182 ((GraphicDisplay*)aDevice)->Request(aRequest);
185 //-------------------------------------------------------------
186 bool MiniDisplayRequestPending(MiniDisplayDevice aDevice)
188 return ((GraphicDisplay*)aDevice)->RequestPending();
191 //-------------------------------------------------------------
192 TMiniDisplayRequest MiniDisplayCurrentRequest(MiniDisplayDevice aDevice)
194 return ((GraphicDisplay*)aDevice)->CurrentRequest();
197 //-------------------------------------------------------------
198 void MiniDisplayCancelRequest(MiniDisplayDevice aDevice)
200 ((GraphicDisplay*)aDevice)->CancelRequest();
203 //-------------------------------------------------------------
204 TMiniDisplayRequest MiniDisplayAttemptRequestCompletion(MiniDisplayDevice aDevice)
206 return ((GraphicDisplay*)aDevice)->AttemptRequestCompletion();
209 //-------------------------------------------------------------
210 char* MiniDisplayDeviceId(MiniDisplayDevice aDevice)
212 return ((GraphicDisplay*)aDevice)->DeviceId();
215 //-------------------------------------------------------------
216 char* MiniDisplayFirmwareRevision(MiniDisplayDevice aDevice)
218 return ((GraphicDisplay*)aDevice)->FirmwareRevision();
221 //-------------------------------------------------------------
222 bool MiniDisplayPowerSupplyStatus(MiniDisplayDevice aDevice)
224 return ((GraphicDisplay*)aDevice)->IsPowerOn();
227 //-------------------------------------------------------------
228 void MiniDisplayPowerOn(MiniDisplayDevice aDevice)
230 ((GraphicDisplay*)aDevice)->TurnPowerOn();
233 //-------------------------------------------------------------
234 void MiniDisplayPowerOff(MiniDisplayDevice aDevice)
236 ((GraphicDisplay*)aDevice)->TurnPowerOff();
239 //-------------------------------------------------------------
240 bool MiniDisplaySupportPowerOnOff(MiniDisplayDevice aDevice)
242 return ((GraphicDisplay*)aDevice)->SupportPowerOnOff();
245 //-------------------------------------------------------------
246 void MiniDisplayShowClock(MiniDisplayDevice aDevice)
248 ((GraphicDisplay*)aDevice)->ShowClock();
251 //-------------------------------------------------------------
252 void MiniDisplayHideClock(MiniDisplayDevice aDevice)
254 ((GraphicDisplay*)aDevice)->HideClock();
257 //-------------------------------------------------------------
258 bool MiniDisplaySupportClock(MiniDisplayDevice aDevice)
260 return ((GraphicDisplay*)aDevice)->SupportClock();