sl@0: // StephaneLenclud@35: // Copyright (C) 2014-2015 Stéphane Lenclud. sl@0: // StephaneLenclud@35: // This file is part of MiniDisplay. StephaneLenclud@35: // StephaneLenclud@35: // MiniDisplay is free software: you can redistribute it and/or modify StephaneLenclud@35: // it under the terms of the GNU General Public License as published by StephaneLenclud@35: // the Free Software Foundation, either version 3 of the License, or StephaneLenclud@35: // (at your option) any later version. StephaneLenclud@35: // StephaneLenclud@35: // MiniDisplay is distributed in the hope that it will be useful, StephaneLenclud@35: // but WITHOUT ANY WARRANTY; without even the implied warranty of StephaneLenclud@35: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the StephaneLenclud@35: // GNU General Public License for more details. StephaneLenclud@35: // StephaneLenclud@35: // You should have received a copy of the GNU General Public License StephaneLenclud@35: // along with MiniDisplay. If not, see . sl@0: // sl@0: sl@0: #ifndef FUTABA_VFD_H sl@0: #define FUTABA_VFD_H sl@0: sl@0: #include "hidapi.h" sl@0: #include "BitArray.h" sl@4: #include "MiniDisplay.h" sl@9: #include "Display.h" sl@0: sl@0: #ifndef MIN sl@0: #define MIN(a,b) (((a)<(b))?(a):(b)) sl@0: #endif sl@0: sl@0: #ifndef MAX sl@0: #define MAX(a,b) (((a)>(b))?(a):(b)) sl@0: #endif sl@0: sl@0: sl@0: //This was computed from our number of pixels as follow 256x64/8/64 = 32 + 1 = 33 sl@0: //+1 was added for our header sl@0: const int KFutabaMaxCommandOutputReport = 33; sl@0: //TODO: Get ride of that constant once we figure out a way to get it from hidapi sl@0: const int KFutabaMaxHidReportSize = 65; sl@0: sl@0: const int KHidReportIdIndex=0; sl@0: const int KFutabaHidReportSizeIndex=1; sl@0: //Define Futaba vendor ID to filter our list of device StephaneLenclud@25: const unsigned short KTargaVendorId = 0x19C2; sl@0: const unsigned short KFutabaVendorId = 0x1008; sl@0: const unsigned short KFutabaProductIdGP1212A01A = 0x100C; sl@10: const unsigned short KFutabaProductIdGP1212A02A = 0x1015; StephaneLenclud@25: const unsigned short KFutabaProductIdMDM166AA = 0x6A11; StephaneLenclud@25: sl@0: sl@0: //typedef struct hid_device_info HidDeviceInfo; sl@0: sl@0: /** sl@0: Define a Futaba HID report. sl@0: */ sl@0: class FutabaVfdReport: public HidReport sl@0: { sl@0: sl@0: private: sl@0: sl@0: }; sl@0: sl@0: sl@0: /** sl@0: Define a generic Futaba VFD command. sl@0: */ sl@0: class FutabaVfdCommand sl@0: { sl@0: public: sl@0: FutabaVfdCommand(); sl@0: ~FutabaVfdCommand(); sl@0: // sl@0: //void Create(int aMaxSize); sl@0: //void Delete(); sl@0: sl@0: //inline unsigned char& operator[](int aIndex){return iBuffer[aIndex];} sl@0: sl@0: void Reset(); sl@0: sl@0: private: sl@0: //unsigned char* iBuffer; sl@0: FutabaVfdReport iReports[KFutabaMaxCommandOutputReport]; sl@0: int iSize; sl@0: int iMaxSize; sl@0: }; sl@0: sl@9: /** sl@9: */ sl@15: class FutabaGraphicDisplay : public GraphicDisplay sl@9: { sl@9: public: sl@9: //From DisplayBase sl@9: virtual void Close(); sl@9: sl@9: }; sl@9: sl@0: sl@0: #endif