Adding C# interop project and NuGet package.
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_MDM166AA_H
21 #define FUTABA_MDM166AA_H
23 #include "FutabaVfd.h"
26 const int KMDM166AAWidthInPixels = 96;
27 const int KMDM166AAHeightInPixels = 16;
28 const int KMDM166AAPixelsPerByte = 8;
29 const int KMDM166AAFrameBufferSizeInBytes = KMDM166AAWidthInPixels*KMDM166AAHeightInPixels/KMDM166AAPixelsPerByte; //96*16/8=192
30 const int KMDM166AAFrameBufferPixelCount = KMDM166AAWidthInPixels*KMDM166AAHeightInPixels;
34 MDM166AA is a graphic display module using a FUTABA 96x16dots VFD.
36 class MDM166AA : public FutabaGraphicDisplay
44 virtual void SwapBuffers();
46 virtual int MinBrightness() const {return 0;}
47 virtual int MaxBrightness() const {return 2;}
48 virtual void SetBrightness(int aBrightness);
50 virtual void ShowClock();
51 virtual void HideClock();
52 virtual bool SupportClock(){return true;}
54 virtual int IconCount(TMiniDisplayIconType aIcon);
55 virtual int IconStatusCount(TMiniDisplayIconType aIcon);
56 virtual void SetIconStatus(TMiniDisplayIconType aIcon, int aIndex, int aStatus);
59 virtual int WidthInPixels() const {return KMDM166AAWidthInPixels;}
60 virtual int HeightInPixels() const {return KMDM166AAHeightInPixels;}
62 virtual void SetPixel(unsigned char aX, unsigned char aY, unsigned int aPixel);
63 virtual void SetAllPixels(unsigned char aPattern);
64 virtual int FrameBufferSizeInBytes() const {return KMDM166AAFrameBufferSizeInBytes;}
67 virtual void Request(TMiniDisplayRequest aRequest);
70 void ToggleOffScreenMode();
71 void SetOffScreenMode(bool aOn);
72 bool OffScreenMode() const {return iOffScreenMode;}
75 void SetIconNetworkSignal(int aIndex, int aStatus);
76 void SetIconInternet(int aIndex, int aStatus);
77 void SetIconEmail(int aIndex, int aStatus);
78 void SetIconMute(int aIndex, int aStatus);
79 void SetIconVolumeLabel(int aIndex, int aStatus);
80 void SetIconVolume(int aIndex, int aStatus);
81 void SetIconPlay(int aIndex, int aStatus);
82 void SetIconPause(int aIndex, int aStatus);
83 void SetIconRecording(int aIndex, int aStatus);
104 EIconRecording = 0x02,
108 EIconNetworkMast = 0x06,
109 EIconNetworkSignalLow = 0x07,
110 EIconNetworkSignalMid = 0x08,
111 EIconNetworkSignalHigh = 0x09,
112 EIconVolumeLabel = 0x0A,
113 EIconVolumeLevel01 = 0x0B,
114 EIconVolumeLevel02 = 0x0C,
115 EIconVolumeLevel03 = 0x0D,
116 EIconVolumeLevel04 = 0x0E,
117 EIconVolumeLevel05 = 0x0F,
118 EIconVolumeLevel06 = 0x10,
119 EIconVolumeLevel07 = 0x11,
120 EIconVolumeLevel08 = 0x12,
121 EIconVolumeLevel09 = 0x13,
122 EIconVolumeLevel10 = 0x14,
123 EIconVolumeLevel11 = 0x15,
124 EIconVolumeLevel12 = 0x16,
125 EIconVolumeLevel13 = 0x17,
126 EIconVolumeLevel14 = 0x18,
127 EIconFirst = EIconPlay,
128 EIconLast = EIconVolumeLevel14,
141 void SetAllIcons(TIconStatus aStatus);
143 //Specific to MDM166AA
144 //General setting command
145 void SendCommandClear();
146 void SendCommandReset();
149 void SendCommandSetClockData(unsigned char aHour, unsigned char aMinute);
150 void SendCommandClockDisplay(TClockSize aClockSize, TClockFormat aClockFormat);
151 void AttemptClockSynchronization();
154 void SendCommandSetAddressCounter(unsigned char aAddressCounter);
155 void SendCommandWriteGraphicData(int aSize, unsigned char* aPixels);
157 //Icon/Symbol command
158 void SendCommandSymbolControl(TIconId aIconId, TIconStatus aStatus);
160 void RequestDeviceId();
161 void RequestFirmwareRevision();
162 void RequestPowerSupplyStatus();
169 ///Off screen mode is the recommended default settings to avoid tearing.
170 ///Though turning it off can be useful for debugging
172 ///We use this flag to align display clock seconds with system time
173 bool iNeedAccurateClockData;
175 BitArrayLow* iFrameNext;
176 BitArrayLow* iFrameCurrent;
177 BitArrayLow* iFramePrevious;
179 BitArrayLow* iFrameAlpha; //owned
180 BitArrayLow* iFrameBeta; //owned
181 BitArrayLow* iFrameGamma; //owned