FutabaVfd.h
author StephaneLenclud
Thu, 05 Feb 2015 15:09:48 +0100
changeset 30 7f649078cb52
parent 15 105f2c0d3cf1
child 35 638eb0763e20
permissions -rw-r--r--
MDM166AA: Clock is now synchronized at the second.
     1 //
     2 //
     3 //
     4 
     5 #ifndef FUTABA_VFD_H
     6 #define FUTABA_VFD_H
     7 
     8 #include "hidapi.h"
     9 #include "BitArray.h"
    10 #include "MiniDisplay.h"
    11 #include "Display.h"
    12 
    13 #ifndef MIN
    14 #define MIN(a,b) (((a)<(b))?(a):(b))
    15 #endif
    16 
    17 #ifndef MAX
    18 #define MAX(a,b) (((a)>(b))?(a):(b))
    19 #endif
    20 
    21 
    22 //This was computed from our number of pixels as follow 256x64/8/64 = 32 + 1 = 33
    23 //+1 was added for our header
    24 const int KFutabaMaxCommandOutputReport = 33;
    25 //TODO: Get ride of that constant once we figure out a way to get it from hidapi
    26 const int KFutabaMaxHidReportSize = 65;
    27 
    28 const int KHidReportIdIndex=0;
    29 const int KFutabaHidReportSizeIndex=1;
    30 //Define Futaba vendor ID to filter our list of device
    31 const unsigned short KTargaVendorId = 0x19C2;
    32 const unsigned short KFutabaVendorId = 0x1008;
    33 const unsigned short KFutabaProductIdGP1212A01A = 0x100C;
    34 const unsigned short KFutabaProductIdGP1212A02A = 0x1015;
    35 const unsigned short KFutabaProductIdMDM166AA = 0x6A11;
    36 
    37 
    38 //typedef struct hid_device_info HidDeviceInfo;
    39 
    40 /**
    41 Define a Futaba HID report.
    42 */
    43 class FutabaVfdReport: public HidReport<KFutabaMaxHidReportSize>
    44 	{
    45 
    46 private:
    47 
    48 	};
    49 
    50 
    51 /**
    52 Define a generic Futaba VFD command.
    53 */
    54 class FutabaVfdCommand
    55     {
    56 public:
    57     FutabaVfdCommand();
    58     ~FutabaVfdCommand();
    59     //
    60     //void Create(int aMaxSize);
    61     //void Delete();
    62 
    63     //inline unsigned char& operator[](int aIndex){return iBuffer[aIndex];}
    64 
    65     void Reset();
    66 
    67 private:
    68     //unsigned char* iBuffer;
    69     FutabaVfdReport iReports[KFutabaMaxCommandOutputReport];
    70     int iSize;
    71     int iMaxSize;
    72     };
    73 
    74 /**
    75 */
    76 class FutabaGraphicDisplay : public GraphicDisplay
    77 	{
    78 public:
    79 	//From DisplayBase
    80 	virtual void Close();
    81 
    82 	};
    83 
    84 
    85 #endif