Display auto detect implementation.
5 #ifndef FUTABA_GP1212A02_H
6 #define FUTABA_GP1212A02_H
8 #include "FutabaGP1212.h"
10 #include "FutabaGP1212.h"
11 #include "FutabaVfd.h"
14 GP1212A01A is a graphic display module using a FUTABA 256x64dots VFD.
15 The module do not include character ROM, the customer will compile the character
16 by themselves (from main system).
18 class GP1212A02A : public GP1212XXXX
27 virtual void SwapBuffers();
28 virtual void TurnPowerOn();
29 virtual void TurnPowerOff();
30 virtual bool SupportPowerOnOff(){return true;}
31 virtual void ShowClock();
32 virtual void HideClock();
33 virtual bool SupportClock(){return true;}
38 virtual void SetPixel(unsigned char aX, unsigned char aY, bool aOn);
39 virtual void SetAllPixels(unsigned char aPattern);
40 virtual int FrameBufferSizeInBytes() const {return KGP12xFrameBufferSizeInBytes;}
41 virtual void SetBrightness(int aBrightness);
44 virtual void Request(TMiniDisplayRequest aRequest);
49 void ToggleOffScreenMode();
50 void SetOffScreenMode(bool aOn);
51 bool OffScreenMode() const {return iOffScreenMode;}
53 void SetFrameDifferencing(bool aOn){iUseFrameDifferencing=aOn;}
54 bool FrameDifferencing() const {return iUseFrameDifferencing;}
56 TMiniDisplayRequest AttemptRequestCompletion();
57 FutabaVfdReport& InputReport() {return iInputReport;}
60 char* FirmwareRevision();
74 ETargetDisplayWindow=0x30,
75 ETargetDataMemory=0x31
119 //Specific to GP1212A02A
120 //General setting command
121 void SendCommandClear();
123 void BmpDataInput(TTarget aTarget, unsigned short aAddress, TDirection aDirection, unsigned short aSize, unsigned char* aPixels);
125 void SendCommandPower(TPowerStatus aPowerStatus);
127 void SendCommandClockSetting(TWeekDay aWeekDay, unsigned char aHour, unsigned char aMinute);
128 void SendCommandClockDisplay(TClockFormat aClockFormat, unsigned short aAddress, TClockSize aSize);
129 void SendCommandClockCancel();
133 void BmpBoxSetting(TBmpBoxId aBoxId, unsigned short aAddress, int aWidth, int aHeight);
134 void BmpBoxSelect(TBmpBoxId aBoxId);
135 void BmpBoxDataMemoryTransfer(unsigned short aAddress);
136 void BmpBoxDataInput(unsigned short aSize, unsigned char* aPixels);
139 int ClockCharCount(TClockFormat aFormat);
140 int ClockCharWidthInPixels(TClockSize aSize);
141 int ClockCharHeightInPixels(TClockSize aSize);
142 unsigned short ClockCenterAddress(TClockFormat aFormat, TClockSize aSize);
145 void RequestDeviceId();
146 void RequestFirmwareRevision();
147 void RequestPowerSupplyStatus();
149 void SetClockSetting();
153 unsigned char OffScreenY() const;
154 void OffScreenTranslation(unsigned char& aX, unsigned char& aY);
158 unsigned char iDisplayPositionX;
159 unsigned char iDisplayPositionY;
160 ///Off screen mode is the recommended default settings to avoid tearing.
161 ///Though turning it off can be useful for debugging
163 ///Frame differences algo is used to reduce USB bus traffic and improve frame rate in typical use case
164 bool iUseFrameDifferencing;
166 //FutabaVfdReport iReport;
168 //unsigned char iFrameBuffer[256*64];
169 BitArrayLow* iFrameNext;
170 BitArrayLow* iFrameCurrent;
171 BitArrayLow* iFramePrevious;
173 BitArrayLow* iFrameAlpha;
174 BitArrayLow* iFrameBeta;
175 BitArrayLow* iFrameGamma;
177 int iNeedFullFrameUpdate;
178 //unsigned char iFrameBeta[256*64];
179 //unsigned char *iFrontBuffer;
180 //unsigned char *iBackBuffer;
181 FutabaVfdReport iInputReport;
183 char iDeviceId[KFutabaMaxHidReportSize];
184 char iFirmwareRevision[KFutabaMaxHidReportSize];
187 unsigned short iNextFrameAddress;