FutabaVfd.h
author StephaneLenclud
Sat, 26 Sep 2015 11:45:26 +0200
changeset 39 c32f4955c166
parent 25 3fa4007c0b19
permissions -rw-r--r--
More fixes to our NuGet package targets file.
     1 //
     2 // Copyright (C) 2014-2015 Stéphane Lenclud.
     3 //
     4 // This file is part of MiniDisplay.
     5 //
     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.
    10 //
    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.
    15 //
    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/>.
    18 //
    19 
    20 #ifndef FUTABA_VFD_H
    21 #define FUTABA_VFD_H
    22 
    23 #include "hidapi.h"
    24 #include "BitArray.h"
    25 #include "MiniDisplay.h"
    26 #include "Display.h"
    27 
    28 #ifndef MIN
    29 #define MIN(a,b) (((a)<(b))?(a):(b))
    30 #endif
    31 
    32 #ifndef MAX
    33 #define MAX(a,b) (((a)>(b))?(a):(b))
    34 #endif
    35 
    36 
    37 //This was computed from our number of pixels as follow 256x64/8/64 = 32 + 1 = 33
    38 //+1 was added for our header
    39 const int KFutabaMaxCommandOutputReport = 33;
    40 //TODO: Get ride of that constant once we figure out a way to get it from hidapi
    41 const int KFutabaMaxHidReportSize = 65;
    42 
    43 const int KHidReportIdIndex=0;
    44 const int KFutabaHidReportSizeIndex=1;
    45 //Define Futaba vendor ID to filter our list of device
    46 const unsigned short KTargaVendorId = 0x19C2;
    47 const unsigned short KFutabaVendorId = 0x1008;
    48 const unsigned short KFutabaProductIdGP1212A01A = 0x100C;
    49 const unsigned short KFutabaProductIdGP1212A02A = 0x1015;
    50 const unsigned short KFutabaProductIdMDM166AA = 0x6A11;
    51 
    52 
    53 //typedef struct hid_device_info HidDeviceInfo;
    54 
    55 /**
    56 Define a Futaba HID report.
    57 */
    58 class FutabaVfdReport: public HidReport<KFutabaMaxHidReportSize>
    59 	{
    60 
    61 private:
    62 
    63 	};
    64 
    65 
    66 /**
    67 Define a generic Futaba VFD command.
    68 */
    69 class FutabaVfdCommand
    70     {
    71 public:
    72     FutabaVfdCommand();
    73     ~FutabaVfdCommand();
    74     //
    75     //void Create(int aMaxSize);
    76     //void Delete();
    77 
    78     //inline unsigned char& operator[](int aIndex){return iBuffer[aIndex];}
    79 
    80     void Reset();
    81 
    82 private:
    83     //unsigned char* iBuffer;
    84     FutabaVfdReport iReports[KFutabaMaxCommandOutputReport];
    85     int iSize;
    86     int iMaxSize;
    87     };
    88 
    89 /**
    90 */
    91 class FutabaGraphicDisplay : public GraphicDisplay
    92 	{
    93 public:
    94 	//From DisplayBase
    95 	virtual void Close();
    96 
    97 	};
    98 
    99 
   100 #endif