sl@8: // sl@8: // sl@8: // sl@8: sl@8: #ifndef FUTABA_GP1212A02_H sl@8: #define FUTABA_GP1212A02_H sl@8: sl@8: #include "FutabaGP1212.h" sl@8: sl@10: #include "FutabaGP1212.h" sl@10: #include "FutabaVfd.h" sl@10: sl@10: /** sl@10: GP1212A01A is a graphic display module using a FUTABA 256x64dots VFD. sl@10: The module do not include character ROM, the customer will compile the character sl@10: by themselves (from main system). sl@10: */ sl@10: class GP1212A02A : public GP1212XXXX sl@10: { sl@10: public: sl@10: sl@10: GP1212A02A(); sl@10: ~GP1212A02A(); sl@10: sl@10: //From DisplayBase sl@10: int Open(); sl@10: virtual void SwapBuffers(); sl@10: sl@10: //From GraphicDisplay sl@10: virtual void SetPixel(unsigned char aX, unsigned char aY, bool aOn); sl@10: virtual void SetAllPixels(unsigned char aPattern); sl@10: virtual int FrameBufferSizeInBytes() const {return KGP12xFrameBufferSizeInBytes;} sl@10: virtual void BitBlit(const BitArray& aBitmap, int aSrcWidth, int aSrcHeight, int aTargetX, int aTargetY) const; sl@10: virtual void SetBrightness(int aBrightness); sl@10: virtual void Clear(); sl@10: virtual void Fill(); sl@10: sl@10: //Specific to GP1212A01A sl@10: void SetPixelBlock(unsigned char aX, unsigned char aY, int aHeight, int aSize, unsigned char aValue); sl@10: void SetPixelBlock(unsigned char aX, unsigned char aY, int aHeight, int aSize, unsigned char* aPixels); sl@10: //Define display position within our display RAM sl@10: void SetDisplayPosition(unsigned char aX, unsigned char aY); sl@10: unsigned char DisplayPositionX() const {return iDisplayPositionX;} sl@10: unsigned char DisplayPositionY() const {return iDisplayPositionY;} sl@10: sl@10: // sl@10: void RequestDeviceId(); sl@10: void RequestFirmwareRevision(); sl@10: void RequestPowerSupplyStatus(); sl@10: // sl@10: void ToggleOffScreenMode(); sl@10: void SetOffScreenMode(bool aOn); sl@10: bool OffScreenMode() const {return iOffScreenMode;} sl@10: // sl@10: void SetFrameDifferencing(bool aOn){iUseFrameDifferencing=aOn;} sl@10: bool FrameDifferencing() const {return iUseFrameDifferencing;} sl@11: // sl@10: TMiniDisplayRequest AttemptRequestCompletion(); sl@10: FutabaVfdReport& InputReport() {return iInputReport;} sl@10: bool PowerOn(); sl@10: char* DeviceId(); sl@10: char* FirmwareRevision(); sl@10: sl@10: private: sl@10: enum DW sl@10: { sl@10: DW1=0xC0, sl@10: DW2=0xD0 sl@10: }; sl@10: sl@10: void SetDisplayPosition(DW aDw,unsigned char aX, unsigned char aY); sl@10: unsigned char OffScreenY() const; sl@10: void SendClearCommand(); sl@10: void OffScreenTranslation(unsigned char& aX, unsigned char& aY); sl@10: void ResetBuffers(); sl@10: void SendModifiedPixelBlocks(); sl@10: sl@10: private: sl@10: unsigned char iDisplayPositionX; sl@10: unsigned char iDisplayPositionY; sl@10: ///Off screen mode is the recommended default settings to avoid tearing. sl@10: ///Though turning it off can be useful for debugging sl@10: bool iOffScreenMode; sl@10: ///Frame differences algo is used to reduce USB bus traffic and improve frame rate in typical use case sl@10: bool iUseFrameDifferencing; sl@10: /// sl@10: //FutabaVfdReport iReport; sl@10: /// sl@10: //unsigned char iFrameBuffer[256*64]; sl@10: BitArray* iFrameNext; sl@10: BitArray* iFrameCurrent; sl@10: BitArray* iFramePrevious; sl@10: // sl@10: BitArray* iFrameAlpha; sl@10: BitArray* iFrameBeta; sl@10: BitArray* iFrameGamma; sl@10: // sl@10: int iNeedFullFrameUpdate; sl@10: //unsigned char iFrameBeta[256*64]; sl@10: //unsigned char *iFrontBuffer; sl@10: //unsigned char *iBackBuffer; sl@10: FutabaVfdReport iInputReport; sl@10: // sl@10: char iDeviceId[KFutabaMaxHidReportSize]; sl@10: char iFirmwareRevision[KFutabaMaxHidReportSize]; sl@10: bool iPowerOn; sl@10: }; sl@10: sl@8: sl@8: sl@8: #endif