MDM166AA swap buffers now working.
5 #ifndef FUTABA_GP1212A02_H
6 #define FUTABA_GP1212A02_H
8 #include "FutabaGP1212.h"
12 GP1212A02A is a graphic display module using a FUTABA 256x64dots VFD.
13 The module will support the interface of I2C, RS-232C and USB2.0 communications.
14 The module include flash ROM (4Mbyte), the customer will definable the BMP data and download
16 It realizes displaying a Japanese font (refer to Table-24) and BMP by I2C, RS-232C or USB2.0
17 communications. Other font tables (ex. Chinese, Korean, European and custom font) can be appended to
19 Since a DC/DC converter is included, 5V power source is required to operate the module.
21 class GP1212A02A : public GP1212XXXX
30 virtual void SwapBuffers();
31 virtual void TurnPowerOn();
32 virtual void TurnPowerOff();
33 virtual bool SupportPowerOnOff(){return true;}
34 virtual void ShowClock();
35 virtual void HideClock();
36 virtual bool SupportClock(){return true;}
41 virtual void SetPixel(unsigned char aX, unsigned char aY, unsigned int aPixel);
42 virtual void SetAllPixels(unsigned char aPattern);
43 virtual int FrameBufferSizeInBytes() const {return KGP12xFrameBufferSizeInBytes;}
44 virtual void SetBrightness(int aBrightness);
47 virtual void Request(TMiniDisplayRequest aRequest);
52 void ToggleOffScreenMode();
53 void SetOffScreenMode(bool aOn);
54 bool OffScreenMode() const {return iOffScreenMode;}
56 void SetFrameDifferencing(bool aOn){iUseFrameDifferencing=aOn;}
57 bool FrameDifferencing() const {return iUseFrameDifferencing;}
59 TMiniDisplayRequest AttemptRequestCompletion();
60 FutabaVfdReport& InputReport() {return iInputReport;}
63 char* FirmwareRevision();
77 ETargetDisplayWindow=0x30,
78 ETargetDataMemory=0x31
112 enum TFontSizeLogical
134 EFontTransfer = 0x31,
140 //Specific to GP1212A02A
141 //General setting command
142 void SendCommandClear();
143 void SendCommandReset();
145 void BmpDataInput(TTarget aTarget, unsigned short aAddress, TDirection aDirection, unsigned short aSize, unsigned char* aPixels);
147 void SendCommandPower(TPowerStatus aPowerStatus);
149 void SendCommandClockSetting(TWeekDay aWeekDay, unsigned char aHour, unsigned char aMinute);
150 void SendCommandClockDisplay(TClockFormat aClockFormat, unsigned short aAddress, TFontSizeLogical aSize);
151 void SendCommandClockCancel();
153 void SendCommandDefineCharacter(TFontSize aFontSize, unsigned short aCharacterCode, unsigned char* aPixelData);
154 void SendCommandFontAction(TFontAction aFontAction);
155 void SendCommandSelectFontSize(TFontSizeLogical aFontSoze);
159 void BmpBoxSetting(TBmpBoxId aBoxId, unsigned short aAddress, int aWidth, int aHeight);
160 void BmpBoxSelect(TBmpBoxId aBoxId);
161 void BmpBoxDataMemoryTransfer(unsigned short aAddress);
162 void BmpBoxDataInput(unsigned short aSize, unsigned char* aPixels);
165 int ClockCharCount(TClockFormat aFormat);
166 int ClockCharWidthInPixels(TFontSizeLogical aSize);
167 int ClockCharHeightInPixels(TFontSizeLogical aSize);
168 unsigned short ClockCenterAddress(TClockFormat aFormat, TFontSizeLogical aSize);
170 int CharacterSizeInBytes(TFontSize aFontSize);
173 void RequestDeviceId();
174 void RequestFirmwareRevision();
175 void RequestPowerSupplyStatus();
177 void SetClockSetting();
181 unsigned char OffScreenY() const;
182 void OffScreenTranslation(unsigned char& aX, unsigned char& aY);
186 unsigned char iDisplayPositionX;
187 unsigned char iDisplayPositionY;
188 ///Off screen mode is the recommended default settings to avoid tearing.
189 ///Though turning it off can be useful for debugging
191 ///Frame differences algo is used to reduce USB bus traffic and improve frame rate in typical use case
192 bool iUseFrameDifferencing;
194 //FutabaVfdReport iReport;
196 //unsigned char iFrameBuffer[256*64];
197 BitArrayLow* iFrameNext;
198 BitArrayLow* iFrameCurrent;
199 BitArrayLow* iFramePrevious;
201 BitArrayLow* iFrameAlpha;
202 BitArrayLow* iFrameBeta;
203 BitArrayLow* iFrameGamma;
205 int iNeedFullFrameUpdate;
206 //unsigned char iFrameBeta[256*64];
207 //unsigned char *iFrontBuffer;
208 //unsigned char *iBackBuffer;
209 FutabaVfdReport iInputReport;
211 char iDeviceId[KFutabaMaxHidReportSize];
212 char iFirmwareRevision[KFutabaMaxHidReportSize];
215 unsigned short iNextFrameAddress;