MDM166AA: Clock is now synchronized at the second.
5 #ifndef FUTABA_MDM166AA_H
6 #define FUTABA_MDM166AA_H
11 const int KMDM166AAWidthInPixels = 96;
12 const int KMDM166AAHeightInPixels = 16;
13 const int KMDM166AAPixelsPerByte = 8;
14 const int KMDM166AAFrameBufferSizeInBytes = KMDM166AAWidthInPixels*KMDM166AAHeightInPixels/KMDM166AAPixelsPerByte; //96*16/8=192
15 const int KMDM166AAFrameBufferPixelCount = KMDM166AAWidthInPixels*KMDM166AAHeightInPixels;
19 MDM166AA is a graphic display module using a FUTABA 96x16dots VFD.
21 class MDM166AA : public FutabaGraphicDisplay
29 virtual void SwapBuffers();
31 virtual int MinBrightness() const {return 0;}
32 virtual int MaxBrightness() const {return 2;}
33 virtual void SetBrightness(int aBrightness);
35 virtual void ShowClock();
36 virtual void HideClock();
37 virtual bool SupportClock(){return true;}
40 virtual int WidthInPixels() const {return KMDM166AAWidthInPixels;}
41 virtual int HeightInPixels() const {return KMDM166AAHeightInPixels;}
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 KMDM166AAFrameBufferSizeInBytes;}
48 virtual void Request(TMiniDisplayRequest aRequest);
51 void ToggleOffScreenMode();
52 void SetOffScreenMode(bool aOn);
53 bool OffScreenMode() const {return iOffScreenMode;}
71 //Specific to MDM166AA
72 //General setting command
73 void SendCommandClear();
74 void SendCommandReset();
77 void SendCommandSetClockData(unsigned char aHour, unsigned char aMinute);
78 void SendCommandClockDisplay(TClockSize aClockSize, TClockFormat aClockFormat);
79 void AttemptClockSynchronization();
82 void SendCommandSetAddressCounter(unsigned char aAddressCounter);
83 void SendCommandWriteGraphicData(int aSize, unsigned char* aPixels);
85 void RequestDeviceId();
86 void RequestFirmwareRevision();
87 void RequestPowerSupplyStatus();
94 ///Off screen mode is the recommended default settings to avoid tearing.
95 ///Though turning it off can be useful for debugging
97 ///We use this flag to align display clock seconds with system time
98 bool iNeedAccurateClockData;
100 BitArrayLow* iFrameNext;
101 BitArrayLow* iFrameCurrent;
102 BitArrayLow* iFramePrevious;
104 BitArrayLow* iFrameAlpha; //owned
105 BitArrayLow* iFrameBeta; //owned
106 BitArrayLow* iFrameGamma; //owned