MDM166AA: Clock and Clear adjustments.
2 #include "MiniDisplay.h"
3 #include "FutabaGP1212A01.h"
4 #include "FutabaGP1212A02.h"
5 #include "FutabaMDM166AA.h"
8 Make sure you update this list when adding a new display.
9 The order has to match the one from TMiniDisplayType.
11 wchar_t* KDisplayNames[]=
17 L"Unknown display device"
20 MiniDisplayDevice MiniDisplayOpen(TMiniDisplayType aType, bool aAutoDetect)
22 GraphicDisplay* device=NULL;
26 case EMiniDisplayAutoDetect:
27 case EMiniDisplayFutabaGP1212A01:
28 device=new GP1212A01A();
31 case EMiniDisplayFutabaGP1212A02:
32 device=new GP1212A02A();
35 case EMiniDisplayFutabaMDM166AA:
36 device=new MDM166AA();
39 case EMiniDisplayAutoDetectFailed:
40 //Auto detect sequence failed
45 int success = device->Open();
52 //Go recursive for auto detect
53 int typeValue=(int)aType;
55 TMiniDisplayType nextType=(TMiniDisplayType)typeValue;
56 return MiniDisplayOpen(nextType,aAutoDetect);
64 //Open & Close functions
65 MiniDisplayDevice MiniDisplayOpen(TMiniDisplayType aType)
67 bool autoDetect=aType==EMiniDisplayAutoDetect;
68 //If we want auto detect we need to pass in our first display type
69 //If we don't want auto detect we just pass in the given display type.
70 return MiniDisplayOpen((autoDetect?EMiniDisplayFutabaGP1212A01:aType),autoDetect);
76 void MiniDisplayClose(MiniDisplayDevice aDevice)
78 delete ((GraphicDisplay*)aDevice);
82 int MiniDisplayTypeCount()
84 return EMiniDisplayAutoDetectFailed;
88 wchar_t* MiniDisplayTypeName(TMiniDisplayType aType)
90 if (aType>=EMiniDisplayAutoDetectFailed)
92 return KDisplayNames[EMiniDisplayAutoDetectFailed];
95 return KDisplayNames[aType];
99 void MiniDisplayClear(MiniDisplayDevice aDevice)
106 ((GraphicDisplay*)aDevice)->Clear();
110 void MiniDisplayFill(MiniDisplayDevice aDevice)
117 ((GraphicDisplay*)aDevice)->Fill();
121 void MiniDisplaySwapBuffers(MiniDisplayDevice aDevice)
128 ((GraphicDisplay*)aDevice)->SwapBuffers();
131 //-------------------------------------------------------------
132 int MiniDisplayMaxBrightness(MiniDisplayDevice aDevice)
139 return ((GraphicDisplay*)aDevice)->MaxBrightness();
142 //-------------------------------------------------------------
143 int MiniDisplayMinBrightness(MiniDisplayDevice aDevice)
150 return ((GraphicDisplay*)aDevice)->MinBrightness();
153 //-------------------------------------------------------------
154 void MiniDisplaySetBrightness(MiniDisplayDevice aDevice, int aBrightness)
161 ((GraphicDisplay*)aDevice)->SetBrightness(aBrightness);
164 //-------------------------------------------------------------
165 int MiniDisplayWidthInPixels(MiniDisplayDevice aDevice)
172 return ((GraphicDisplay*)aDevice)->WidthInPixels();
175 //-------------------------------------------------------------
176 int MiniDisplayHeightInPixels(MiniDisplayDevice aDevice)
183 return ((GraphicDisplay*)aDevice)->HeightInPixels();
186 //-------------------------------------------------------------
187 void MiniDisplaySetPixel(MiniDisplayDevice aDevice, int aX, int aY, unsigned int aPixel)
189 //aValue&=0x00FFFFFF; //Filter out alpha component
190 return ((GraphicDisplay*)aDevice)->SetPixel(aX,aY,aPixel);
193 //-------------------------------------------------------------
194 wchar_t* MiniDisplayVendor(MiniDisplayDevice aDevice)
196 return ((GraphicDisplay*)aDevice)->Vendor();
199 //-------------------------------------------------------------
200 wchar_t* MiniDisplayProduct(MiniDisplayDevice aDevice)
202 return ((GraphicDisplay*)aDevice)->Product();
205 //-------------------------------------------------------------
206 wchar_t* MiniDisplaySerialNumber(MiniDisplayDevice aDevice)
208 return ((GraphicDisplay*)aDevice)->SerialNumber();
211 //-------------------------------------------------------------
212 void MiniDisplayRequest(MiniDisplayDevice aDevice, TMiniDisplayRequest aRequest)
214 ((GraphicDisplay*)aDevice)->Request(aRequest);
217 //-------------------------------------------------------------
218 bool MiniDisplayRequestPending(MiniDisplayDevice aDevice)
220 return ((GraphicDisplay*)aDevice)->RequestPending();
223 //-------------------------------------------------------------
224 TMiniDisplayRequest MiniDisplayCurrentRequest(MiniDisplayDevice aDevice)
226 return ((GraphicDisplay*)aDevice)->CurrentRequest();
229 //-------------------------------------------------------------
230 void MiniDisplayCancelRequest(MiniDisplayDevice aDevice)
232 ((GraphicDisplay*)aDevice)->CancelRequest();
235 //-------------------------------------------------------------
236 TMiniDisplayRequest MiniDisplayAttemptRequestCompletion(MiniDisplayDevice aDevice)
238 return ((GraphicDisplay*)aDevice)->AttemptRequestCompletion();
241 //-------------------------------------------------------------
242 char* MiniDisplayDeviceId(MiniDisplayDevice aDevice)
244 return ((GraphicDisplay*)aDevice)->DeviceId();
247 //-------------------------------------------------------------
248 char* MiniDisplayFirmwareRevision(MiniDisplayDevice aDevice)
250 return ((GraphicDisplay*)aDevice)->FirmwareRevision();
253 //-------------------------------------------------------------
254 bool MiniDisplayPowerSupplyStatus(MiniDisplayDevice aDevice)
256 return ((GraphicDisplay*)aDevice)->IsPowerOn();
259 //-------------------------------------------------------------
260 void MiniDisplayPowerOn(MiniDisplayDevice aDevice)
262 ((GraphicDisplay*)aDevice)->TurnPowerOn();
265 //-------------------------------------------------------------
266 void MiniDisplayPowerOff(MiniDisplayDevice aDevice)
268 ((GraphicDisplay*)aDevice)->TurnPowerOff();
271 //-------------------------------------------------------------
272 bool MiniDisplaySupportPowerOnOff(MiniDisplayDevice aDevice)
274 return ((GraphicDisplay*)aDevice)->SupportPowerOnOff();
277 //-------------------------------------------------------------
278 void MiniDisplayShowClock(MiniDisplayDevice aDevice)
280 ((GraphicDisplay*)aDevice)->ShowClock();
283 //-------------------------------------------------------------
284 void MiniDisplayHideClock(MiniDisplayDevice aDevice)
286 ((GraphicDisplay*)aDevice)->HideClock();
289 //-------------------------------------------------------------
290 bool MiniDisplaySupportClock(MiniDisplayDevice aDevice)
292 return ((GraphicDisplay*)aDevice)->SupportClock();
295 //-------------------------------------------------------------
296 int MiniDisplayIconCount(MiniDisplayDevice aDevice, TMiniDisplayIconType aIcon)
298 return ((GraphicDisplay*)aDevice)->IconCount(aIcon);
301 //-------------------------------------------------------------
302 int MiniDisplayIconStatusCount(MiniDisplayDevice aDevice, TMiniDisplayIconType aIcon)
304 return ((GraphicDisplay*)aDevice)->IconStatusCount(aIcon);
307 //-------------------------------------------------------------
308 void MiniDisplaySetIconStatus(MiniDisplayDevice aDevice, TMiniDisplayIconType aIcon, int aIndex, int aStatus)
310 ((GraphicDisplay*)aDevice)->SetIconStatus(aIcon,aIndex,aStatus);