J&W / Mbed 2 deprecated Rejestrator

Dependencies:   mbed Rejestrator

Dependents:   Rejestrator

Committer:
Waldek
Date:
Sat Apr 18 17:01:57 2015 +0000
Revision:
0:fa31f8461c63
working version, stop

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Waldek 0:fa31f8461c63 1 // BaseUvc.h
Waldek 0:fa31f8461c63 2 //#include "USBIsochronous.h"
Waldek 0:fa31f8461c63 3 #pragma once
Waldek 0:fa31f8461c63 4
Waldek 0:fa31f8461c63 5 // --- UVC --------------------------------------------------
Waldek 0:fa31f8461c63 6 #define _30FPS 333333
Waldek 0:fa31f8461c63 7 #define _25FPS 400000
Waldek 0:fa31f8461c63 8 #define _20FPS 500000
Waldek 0:fa31f8461c63 9 #define _15FPS 666666
Waldek 0:fa31f8461c63 10 #define _10FPS 1000000
Waldek 0:fa31f8461c63 11 #define _5FPS 2000000
Waldek 0:fa31f8461c63 12 #define _1FPS 10000000
Waldek 0:fa31f8461c63 13
Waldek 0:fa31f8461c63 14 #define SET_CUR 0x01
Waldek 0:fa31f8461c63 15 #define GET_CUR 0x81
Waldek 0:fa31f8461c63 16 #define GET_MIN 0x82
Waldek 0:fa31f8461c63 17 #define GET_MAX 0x83
Waldek 0:fa31f8461c63 18 #define GET_RES 0x84
Waldek 0:fa31f8461c63 19 #define GET_LEN 0x85
Waldek 0:fa31f8461c63 20 #define GET_INFO 0x86
Waldek 0:fa31f8461c63 21 #define GET_DEF 0x87
Waldek 0:fa31f8461c63 22
Waldek 0:fa31f8461c63 23 #define VS_PROBE_CONTROL 0x01
Waldek 0:fa31f8461c63 24 #define VS_COMMIT_CONTROL 0x02
Waldek 0:fa31f8461c63 25
Waldek 0:fa31f8461c63 26 class BaseUvc {
Waldek 0:fa31f8461c63 27 public:
Waldek 0:fa31f8461c63 28 void poll();
Waldek 0:fa31f8461c63 29 USB_TYPE Control(int req, int cs, int index, uint8_t* buf, int size);
Waldek 0:fa31f8461c63 30 USB_TYPE setInterfaceAlternate(uint8_t intf, uint8_t alt);
Waldek 0:fa31f8461c63 31 //IsochronousEp* m_isoEp;
Waldek 0:fa31f8461c63 32 // callback
Waldek 0:fa31f8461c63 33 void onResult(uint16_t frame, uint8_t* buf, int len);
Waldek 0:fa31f8461c63 34 void setOnResult( void (*pMethod)(uint16_t, uint8_t*, int) );
Waldek 0:fa31f8461c63 35 class CDummy;
Waldek 0:fa31f8461c63 36 template<class T>
Waldek 0:fa31f8461c63 37 void setOnResult( T* pItem, void (T::*pMethod)(uint16_t, uint8_t*, int) )
Waldek 0:fa31f8461c63 38 {
Waldek 0:fa31f8461c63 39 m_pCb = NULL;
Waldek 0:fa31f8461c63 40 m_pCbItem = (CDummy*) pItem;
Waldek 0:fa31f8461c63 41 m_pCbMeth = (void (CDummy::*)(uint16_t, uint8_t*, int)) pMethod;
Waldek 0:fa31f8461c63 42 }
Waldek 0:fa31f8461c63 43 void clearOnResult();
Waldek 0:fa31f8461c63 44 CDummy* m_pCbItem;
Waldek 0:fa31f8461c63 45 void (CDummy::*m_pCbMeth)(uint16_t, uint8_t*, int);
Waldek 0:fa31f8461c63 46 void (*m_pCb)(uint16_t, uint8_t*, int);
Waldek 0:fa31f8461c63 47 protected:
Waldek 0:fa31f8461c63 48 USBHost * host;
Waldek 0:fa31f8461c63 49 USBDeviceConnected * dev;
Waldek 0:fa31f8461c63 50 USBEndpoint* ep_iso_in;
Waldek 0:fa31f8461c63 51 };