HTPC documentation and optimization for GP1212A02.
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, unsigned int aPixel);
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
109 enum TFontSizeLogical
131 EFontTransfer = 0x31,
137 //Specific to GP1212A02A
138 //General setting command
139 void SendCommandClear();
140 void SendCommandReset();
142 void BmpDataInput(TTarget aTarget, unsigned short aAddress, TDirection aDirection, unsigned short aSize, unsigned char* aPixels);
144 void SendCommandPower(TPowerStatus aPowerStatus);
146 void SendCommandClockSetting(TWeekDay aWeekDay, unsigned char aHour, unsigned char aMinute);
147 void SendCommandClockDisplay(TClockFormat aClockFormat, unsigned short aAddress, TFontSizeLogical aSize);
148 void SendCommandClockCancel();
150 void SendCommandDefineCharacter(TFontSize aFontSize, unsigned short aCharacterCode, unsigned char* aPixelData);
151 void SendCommandFontAction(TFontAction aFontAction);
152 void SendCommandSelectFontSize(TFontSizeLogical aFontSoze);
156 void BmpBoxSetting(TBmpBoxId aBoxId, unsigned short aAddress, int aWidth, int aHeight);
157 void BmpBoxSelect(TBmpBoxId aBoxId);
158 void BmpBoxDataMemoryTransfer(unsigned short aAddress);
159 void BmpBoxDataInput(unsigned short aSize, unsigned char* aPixels);
162 int ClockCharCount(TClockFormat aFormat);
163 int ClockCharWidthInPixels(TFontSizeLogical aSize);
164 int ClockCharHeightInPixels(TFontSizeLogical aSize);
165 unsigned short ClockCenterAddress(TClockFormat aFormat, TFontSizeLogical aSize);
167 int CharacterSizeInBytes(TFontSize aFontSize);
170 void RequestDeviceId();
171 void RequestFirmwareRevision();
172 void RequestPowerSupplyStatus();
174 void SetClockSetting();
178 unsigned char OffScreenY() const;
179 void OffScreenTranslation(unsigned char& aX, unsigned char& aY);
183 unsigned char iDisplayPositionX;
184 unsigned char iDisplayPositionY;
185 ///Off screen mode is the recommended default settings to avoid tearing.
186 ///Though turning it off can be useful for debugging
188 ///Frame differences algo is used to reduce USB bus traffic and improve frame rate in typical use case
189 bool iUseFrameDifferencing;
191 //FutabaVfdReport iReport;
193 //unsigned char iFrameBuffer[256*64];
194 BitArrayLow* iFrameNext;
195 BitArrayLow* iFrameCurrent;
196 BitArrayLow* iFramePrevious;
198 BitArrayLow* iFrameAlpha;
199 BitArrayLow* iFrameBeta;
200 BitArrayLow* iFrameGamma;
202 int iNeedFullFrameUpdate;
203 //unsigned char iFrameBeta[256*64];
204 //unsigned char *iFrontBuffer;
205 //unsigned char *iBackBuffer;
206 FutabaVfdReport iInputReport;
208 char iDeviceId[KFutabaMaxHidReportSize];
209 char iFirmwareRevision[KFutabaMaxHidReportSize];
212 unsigned short iNextFrameAddress;