Trying to sort out our interop nicely.
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/>.
25 #include "MiniDisplay.h"
29 #define MIN(a,b) (((a)<(b))?(a):(b))
33 #define MAX(a,b) (((a)>(b))?(a):(b))
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;
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;
53 //typedef struct hid_device_info HidDeviceInfo;
56 Define a Futaba HID report.
58 class FutabaVfdReport: public HidReport<KFutabaMaxHidReportSize>
67 Define a generic Futaba VFD command.
69 class FutabaVfdCommand
75 //void Create(int aMaxSize);
78 //inline unsigned char& operator[](int aIndex){return iBuffer[aIndex];}
83 //unsigned char* iBuffer;
84 FutabaVfdReport iReports[KFutabaMaxCommandOutputReport];
91 class FutabaGraphicDisplay : public GraphicDisplay