Display auto detect implementation.
10 const int KMaxDisplayStringLength = 256;
13 Define an interface to some basic display functionality
15 class DisplayBase: public HidDevice
18 DisplayBase():iRequest(EMiniDisplayRequestNone),iPowerOn(false)
21 iFirmwareRevision[0]=0;
24 virtual ~DisplayBase(){};
27 virtual void Close()=0;
29 virtual int MinBrightness() const=0;
30 virtual int MaxBrightness() const=0;
31 virtual void SetBrightness(int aBrightness)=0;
32 virtual void Clear()=0;
33 virtual void Fill()=0;
35 virtual void SwapBuffers()=0;
38 virtual void Request(TMiniDisplayRequest /*aRequest*/){ /*No request supported by default*/ };
39 virtual TMiniDisplayRequest AttemptRequestCompletion()=0;
41 virtual TMiniDisplayRequest CurrentRequest(){return iRequest;}
42 virtual void CancelRequest(){iRequest=EMiniDisplayRequestNone;}
43 virtual bool RequestPending(){return iRequest!=EMiniDisplayRequestNone;}
45 virtual bool IsPowerOn() {return iPowerOn;}
46 virtual char* DeviceId() {return iDeviceId;}
47 virtual char* FirmwareRevision() {return iFirmwareRevision;}
49 virtual void TurnPowerOn(){}
50 virtual void TurnPowerOff(){}
51 virtual bool SupportPowerOnOff(){return false;}
53 virtual void ShowClock(){}
54 virtual void HideClock(){}
55 virtual bool SupportClock(){return false;}
58 void SetRequest(TMiniDisplayRequest aRequest) { iRequest=aRequest; }
61 char iDeviceId[KMaxDisplayStringLength];
62 char iFirmwareRevision[KMaxDisplayStringLength];
67 TMiniDisplayRequest iRequest;
73 class GraphicDisplay : public DisplayBase
76 virtual int WidthInPixels() const=0;
77 virtual int HeightInPixels() const=0;
78 virtual void SetPixel(unsigned char aX, unsigned char aY, bool aOn)=0;
79 virtual void SetAllPixels(unsigned char aOn)=0;
80 virtual int FrameBufferSizeInBytes() const=0;
81 //virtual int BitBlit(unsigned char* aSrc, unsigned char aSrcWidth, unsigned char aSrcHeight, unsigned char aTargetX, unsigned char aTargetY) const=0;