class library to access fischertechnik interfaces via USB
Dependencies: FatFileSystem mbed myBlueUSB neigbourhood rfcomm sdp
ftlib/ftlibclass.h@1:4676e8b9b357, 2013-03-11 (annotated)
- Committer:
- networker
- Date:
- Mon Mar 11 08:04:37 2013 +0000
- Revision:
- 1:4676e8b9b357
- Parent:
- 0:7da612835693
first publication of this experimental class, just for sharing wip
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
networker |
0:7da612835693 | 1 | #ifndef FTLIBCLASS_H |
networker |
0:7da612835693 | 2 | #define FTLIBCLASS_H |
networker |
0:7da612835693 | 3 | |
networker |
0:7da612835693 | 4 | #include "mbed.h" |
networker |
0:7da612835693 | 5 | |
networker |
0:7da612835693 | 6 | #define LIBFT_VERSION_MAJOR 1 |
networker |
0:7da612835693 | 7 | #define LIBFT_VERSION_MINOR 0 |
networker |
0:7da612835693 | 8 | #define LIBFT_VERSION_PATCH 0 |
networker |
0:7da612835693 | 9 | |
networker |
0:7da612835693 | 10 | #define INTERFACE_QUERY_TIME 10000 // �s == 5ms |
networker |
0:7da612835693 | 11 | |
networker |
0:7da612835693 | 12 | |
networker |
0:7da612835693 | 13 | class ftusbdev; |
networker |
0:7da612835693 | 14 | class ftcommdev; |
networker |
0:7da612835693 | 15 | |
networker |
0:7da612835693 | 16 | class ftlib { |
networker |
0:7da612835693 | 17 | friend ftusbdev; |
networker |
0:7da612835693 | 18 | friend ftcommdev; |
networker |
0:7da612835693 | 19 | static ftlib* lib; |
networker |
0:7da612835693 | 20 | Ticker tick;//the ticker indicates the moments that transfers should be conducted |
networker |
0:7da612835693 | 21 | void onTick(); |
networker |
0:7da612835693 | 22 | ftlib() { |
networker |
0:7da612835693 | 23 | tick.attach_us(this, &ftlib::onTick, INTERFACE_QUERY_TIME); |
networker |
0:7da612835693 | 24 | } |
networker |
0:7da612835693 | 25 | ~ftlib() { |
networker |
0:7da612835693 | 26 | tick.detach(); |
networker |
0:7da612835693 | 27 | } |
networker |
0:7da612835693 | 28 | static int FtproductIDToInterfaceID(int iProductID); |
networker |
0:7da612835693 | 29 | public: |
networker |
0:7da612835693 | 30 | static void poll(); |
networker |
0:7da612835693 | 31 | //public API: These functions match those of the original ftlib |
networker |
0:7da612835693 | 32 | static unsigned GetLibVersion(); |
networker |
0:7da612835693 | 33 | static unsigned InitFtLib(); |
networker |
0:7da612835693 | 34 | static unsigned CloseFtLib(); |
networker |
0:7da612835693 | 35 | static unsigned IsFtLibInit(); |
networker |
0:7da612835693 | 36 | static char* GetFtLibErrorString(unsigned dwErrorCode, unsigned dwTyp); |
networker |
0:7da612835693 | 37 | static unsigned CloseAllFtDevices() ; |
networker |
0:7da612835693 | 38 | }; |
networker |
0:7da612835693 | 39 | |
networker |
0:7da612835693 | 40 | #endif |