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_GP1212A01_H
21 #define FUTABA_GP1212A01_H
23 #include "FutabaGP1212.h"
24 #include "FutabaVfd.h"
27 GP1212A01A is a graphic display module using a FUTABA 256x64dots VFD.
28 The module do not include character ROM, the customer will compile the character
29 by themselves (from main system).
31 class GP1212A01A : public GP1212XXXX
42 //From FutabaGraphicVfd
43 virtual void SetPixel(unsigned char aX, unsigned char aY, unsigned int aPixel);
44 virtual void SetAllPixels(unsigned char aPattern);
45 virtual int FrameBufferSizeInBytes() const {return KGP12xFrameBufferSizeInBytes;}
46 //virtual void BitBlit(const BitArray& aBitmap, int aSrcWidth, int aSrcHeight, int aTargetX, int aTargetY) const;
48 virtual void SetBrightness(int aBrightness);
52 //Specific to GP1212A01A
53 void SetPixelBlock(unsigned char aX, unsigned char aY, int aHeight, int aSize, unsigned char aValue);
54 void SetPixelBlock(unsigned char aX, unsigned char aY, int aHeight, int aSize, unsigned char* aPixels);
55 //Define display position within our display RAM
56 void SetDisplayPosition(unsigned char aX, unsigned char aY);
57 unsigned char DisplayPositionX() const {return iDisplayPositionX;}
58 unsigned char DisplayPositionY() const {return iDisplayPositionY;}
62 virtual void Request(TMiniDisplayRequest aRequest);
64 void ToggleOffScreenMode();
65 void SetOffScreenMode(bool aOn);
66 bool OffScreenMode() const {return iOffScreenMode;}
68 void SetFrameDifferencing(bool aOn){iUseFrameDifferencing=aOn;}
69 bool FrameDifferencing() const {return iUseFrameDifferencing;}
71 TMiniDisplayRequest AttemptRequestCompletion();
72 FutabaVfdReport& InputReport() {return iInputReport;}
75 void RequestDeviceId();
76 void RequestFirmwareRevision();
77 void RequestPowerSupplyStatus();
87 void SetDisplayPosition(DW aDw,unsigned char aX, unsigned char aY);
88 unsigned char OffScreenY() const;
89 void SendClearCommand();
90 void OffScreenTranslation(unsigned char& aX, unsigned char& aY);
92 void SendModifiedPixelBlocks();
95 unsigned char iDisplayPositionX;
96 unsigned char iDisplayPositionY;
97 ///Off screen mode is the recommended default settings to avoid tearing.
98 ///Though turning it off can be useful for debugging
100 ///Frame differences algo is used to reduce USB bus traffic and improve frame rate in typical use case
101 bool iUseFrameDifferencing;
103 //FutabaVfdReport iReport;
105 //unsigned char iFrameBuffer[256*64];
106 BitArrayHigh* iFrameNext;
107 BitArrayHigh* iFrameCurrent;
108 BitArrayHigh* iFramePrevious;
110 BitArrayHigh* iFrameAlpha;
111 BitArrayHigh* iFrameBeta;
112 BitArrayHigh* iFrameGamma;
114 int iNeedFullFrameUpdate;
115 //unsigned char iFrameBeta[256*64];
116 //unsigned char *iFrontBuffer;
117 //unsigned char *iBackBuffer;
118 FutabaVfdReport iInputReport;