sl@0: // sl@0: // 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 "HidDevice.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 sl@0: const unsigned short KFutabaVendorId = 0x1008; sl@0: const unsigned short KFutabaProductIdGP1212A01A = 0x100C; sl@10: const unsigned short KFutabaProductIdGP1212A02A = 0x1015; 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@9: class FutabaGraphicDisplay : public GraphicDisplay, public HidDevice 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