Trying to sort out our interop nicely.
2 // Copyright (C) 2014-2015 Stéphane Lenclud.
4 // This file is part of MiniDisplay.
6 // MiniDisplay is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
11 // MiniDisplay is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with MiniDisplay. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef FUTABA_GP1212A02_H
21 #define FUTABA_GP1212A02_H
23 #include "FutabaGP1212.h"
24 #include "FutabaVfd.h"
27 GP1212A02A is a graphic display module using a FUTABA 256x64dots VFD.
28 The module will support the interface of I2C, RS-232C and USB2.0 communications.
29 The module include flash ROM (4Mbyte), the customer will definable the BMP data and download
31 It realizes displaying a Japanese font (refer to Table-24) and BMP by I2C, RS-232C or USB2.0
32 communications. Other font tables (ex. Chinese, Korean, European and custom font) can be appended to
34 Since a DC/DC converter is included, 5V power source is required to operate the module.
36 class GP1212A02A : public GP1212XXXX
45 virtual void SwapBuffers();
46 virtual void TurnPowerOn();
47 virtual void TurnPowerOff();
48 virtual bool SupportPowerOnOff(){return true;}
49 virtual void ShowClock();
50 virtual void HideClock();
51 virtual bool SupportClock(){return true;}
52 virtual void SetBrightness(int aBrightness);
55 virtual TMiniDisplayRequest AttemptRequestCompletion();
56 virtual void Request(TMiniDisplayRequest aRequest);
61 virtual void SetPixel(unsigned char aX, unsigned char aY, unsigned int aPixel);
62 virtual void SetAllPixels(unsigned char aPattern);
63 virtual int FrameBufferSizeInBytes() const {return KGP12xFrameBufferSizeInBytes;}
68 void ToggleOffScreenMode();
69 void SetOffScreenMode(bool aOn);
70 bool OffScreenMode() const {return iOffScreenMode;}
72 void SetFrameDifferencing(bool aOn){iUseFrameDifferencing=aOn;}
73 bool FrameDifferencing() const {return iUseFrameDifferencing;}
74 FutabaVfdReport& InputReport() {return iInputReport;}
88 ETargetDisplayWindow=0x30,
89 ETargetDataMemory=0x31
123 enum TFontSizeLogical
145 EFontTransfer = 0x31,
151 //Specific to GP1212A02A
152 //General setting command
153 void SendCommandClear();
154 void SendCommandReset();
156 void BmpDataInput(TTarget aTarget, unsigned short aAddress, TDirection aDirection, unsigned short aSize, unsigned char* aPixels);
158 void SendCommandPower(TPowerStatus aPowerStatus);
160 void SendCommandClockSetting(TWeekDay aWeekDay, unsigned char aHour, unsigned char aMinute);
161 void SendCommandClockDisplay(TClockFormat aClockFormat, unsigned short aAddress, TFontSizeLogical aSize);
162 void SendCommandClockCancel();
164 void SendCommandDefineCharacter(TFontSize aFontSize, unsigned short aCharacterCode, unsigned char* aPixelData);
165 void SendCommandFontAction(TFontAction aFontAction);
166 void SendCommandSelectFontSize(TFontSizeLogical aFontSoze);
170 void BmpBoxSetting(TBmpBoxId aBoxId, unsigned short aAddress, int aWidth, int aHeight);
171 void BmpBoxSelect(TBmpBoxId aBoxId);
172 void BmpBoxDataMemoryTransfer(unsigned short aAddress);
173 void BmpBoxDataInput(unsigned short aSize, unsigned char* aPixels);
176 int ClockCharCount(TClockFormat aFormat);
177 int ClockCharWidthInPixels(TFontSizeLogical aSize);
178 int ClockCharHeightInPixels(TFontSizeLogical aSize);
179 unsigned short ClockCenterAddress(TClockFormat aFormat, TFontSizeLogical aSize);
181 int CharacterSizeInBytes(TFontSize aFontSize);
184 void RequestDeviceId();
185 void RequestFirmwareRevision();
186 void RequestPowerSupplyStatus();
188 void SetClockSetting();
192 unsigned char OffScreenY() const;
193 void OffScreenTranslation(unsigned char& aX, unsigned char& aY);
197 unsigned char iDisplayPositionX;
198 unsigned char iDisplayPositionY;
199 ///Off screen mode is the recommended default settings to avoid tearing.
200 ///Though turning it off can be useful for debugging
202 ///Frame differences algo is used to reduce USB bus traffic and improve frame rate in typical use case
203 bool iUseFrameDifferencing;
205 //FutabaVfdReport iReport;
207 //unsigned char iFrameBuffer[256*64];
208 BitArrayLow* iFrameNext;
209 BitArrayLow* iFrameCurrent;
210 BitArrayLow* iFramePrevious;
212 BitArrayLow* iFrameAlpha;
213 BitArrayLow* iFrameBeta;
214 BitArrayLow* iFrameGamma;
216 int iNeedFullFrameUpdate;
218 FutabaVfdReport iInputReport;
220 unsigned short iNextFrameAddress;