# HG changeset patch # User sl # Date 1408650815 -7200 # Node ID 6b08e3e81cf3ddf5cc09da2a2bfcec44ffa93a68 # Parent 5a9dbbc40c6b3681a8996b4d922a27cdfa8c16d1 Still working on our architecture to support GP1212A02 diff -r 5a9dbbc40c6b -r 6b08e3e81cf3 Display.h --- a/Display.h Thu Aug 21 21:30:38 2014 +0200 +++ b/Display.h Thu Aug 21 21:53:35 2014 +0200 @@ -5,14 +5,15 @@ #ifndef DISPLAY_H #define DISPLAY_H -#include "HidDevice.h" - /** Define an interface to some basic display functionality */ -class DisplayBase : public HidDevice +class DisplayBase { public: + virtual int Open()=0; + virtual void Close()=0; + // virtual int MinBrightness() const=0; virtual int MaxBrightness() const=0; virtual void SetBrightness(int aBrightness)=0; diff -r 5a9dbbc40c6b -r 6b08e3e81cf3 FutabaGP1212.h --- a/FutabaGP1212.h Thu Aug 21 21:30:38 2014 +0200 +++ b/FutabaGP1212.h Thu Aug 21 21:53:35 2014 +0200 @@ -5,18 +5,27 @@ #ifndef FUTABA_GP1212_H #define FUTABA_GP1212_H -#include "Display.h" +#include "FutabaVfd.h" + +const int KGP12xWidthInPixels = 256; +const int KGP12xHeightInPixels = 64; +const int KGP12xPixelsPerByte = 8; +const int KGP12xFrameBufferSizeInBytes = KGP12xWidthInPixels*KGP12xHeightInPixels/KGP12xPixelsPerByte; //256*64/8=2048 +const int KGP12xFrameBufferPixelCount = KGP12xWidthInPixels*KGP12xHeightInPixels; /** Common functionality between GP1212A01A and GP1212A02A */ -class GP1212XXXX : public GraphicDisplay +class GP1212XXXX : public FutabaGraphicDisplay { public: //From FutabaVfd virtual int MinBrightness() const {return 0;} virtual int MaxBrightness() const {return 5;} + virtual int WidthInPixels() const {return KGP12xWidthInPixels;} + virtual int HeightInPixels() const {return KGP12xHeightInPixels;} + }; diff -r 5a9dbbc40c6b -r 6b08e3e81cf3 FutabaGP1212A01.h --- a/FutabaGP1212A01.h Thu Aug 21 21:30:38 2014 +0200 +++ b/FutabaGP1212A01.h Thu Aug 21 21:53:35 2014 +0200 @@ -22,11 +22,9 @@ GP1212A01A(); ~GP1212A01A(); - // + //From DisplayBase int Open(); //From FutabaGraphicVfd - virtual int WidthInPixels() const {return KGP12xWidthInPixels;} - virtual int HeightInPixels() const {return KGP12xHeightInPixels;} virtual void SetPixel(unsigned char aX, unsigned char aY, bool aOn); virtual void SetAllPixels(unsigned char aPattern); virtual int FrameBufferSizeInBytes() const {return KGP12xFrameBufferSizeInBytes;} diff -r 5a9dbbc40c6b -r 6b08e3e81cf3 FutabaVfd.cpp --- a/FutabaVfd.cpp Thu Aug 21 21:30:38 2014 +0200 +++ b/FutabaVfd.cpp Thu Aug 21 21:53:35 2014 +0200 @@ -65,7 +65,14 @@ */ +// +// class FutabaDisplay +// +void FutabaGraphicDisplay::Close() + { + HidDevice::Close(); + } diff -r 5a9dbbc40c6b -r 6b08e3e81cf3 FutabaVfd.h --- a/FutabaVfd.h Thu Aug 21 21:30:38 2014 +0200 +++ b/FutabaVfd.h Thu Aug 21 21:53:35 2014 +0200 @@ -9,6 +9,7 @@ #include "HidDevice.h" #include "BitArray.h" #include "MiniDisplay.h" +#include "Display.h" #ifndef MIN #define MIN(a,b) (((a)<(b))?(a):(b)) @@ -31,11 +32,6 @@ const unsigned short KFutabaVendorId = 0x1008; const unsigned short KFutabaProductIdGP1212A01A = 0x100C; const unsigned short KFutabaProductIdGP1212A02A = 0x1013; //Or is it 0x1015 -const int KGP12xWidthInPixels = 256; -const int KGP12xHeightInPixels = 64; -const int KGP12xPixelsPerByte = 8; -const int KGP12xFrameBufferSizeInBytes = KGP12xWidthInPixels*KGP12xHeightInPixels/KGP12xPixelsPerByte; //256*64/8=2048 -const int KGP12xFrameBufferPixelCount = KGP12xWidthInPixels*KGP12xHeightInPixels; //typedef struct hid_device_info HidDeviceInfo; @@ -73,5 +69,15 @@ int iMaxSize; }; +/** +*/ +class FutabaGraphicDisplay : public GraphicDisplay, public HidDevice + { +public: + //From DisplayBase + virtual void Close(); + + }; + #endif