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