Axeda Corp / Mbed 2 deprecated AxedaGo-Freescal_FRDM-KL46Z

Dependencies:   FRDM_MMA8451Q KL46Z-USBHost MAG3110 SocketModem TSI mbed FATFileSystem

Fork of AxedaGo-Freescal_FRDM-KL46Z by Axeda Corp

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers BaseUvc.h Source File

BaseUvc.h

00001 // BaseUvc.h
00002 //#include "USBIsochronous.h"
00003 #pragma once
00004 
00005 // --- UVC --------------------------------------------------
00006 #define _30FPS  333333
00007 #define _25FPS  400000
00008 #define _20FPS  500000
00009 #define _15FPS  666666
00010 #define _10FPS 1000000
00011 #define _5FPS  2000000
00012 #define _1FPS 10000000
00013 
00014 #define SET_CUR  0x01
00015 #define GET_CUR  0x81
00016 #define GET_MIN  0x82
00017 #define GET_MAX  0x83
00018 #define GET_RES  0x84
00019 #define GET_LEN  0x85
00020 #define GET_INFO 0x86
00021 #define GET_DEF  0x87
00022 
00023 #define VS_PROBE_CONTROL  0x01
00024 #define VS_COMMIT_CONTROL 0x02
00025 
00026 class BaseUvc {
00027 public:
00028     void poll();
00029     USB_TYPE Control(int req, int cs, int index, uint8_t* buf, int size);
00030     USB_TYPE setInterfaceAlternate(uint8_t intf, uint8_t alt);
00031     //IsochronousEp* m_isoEp;
00032     // callback
00033     void onResult(uint16_t frame, uint8_t* buf, int len);
00034     void setOnResult( void (*pMethod)(uint16_t, uint8_t*, int) );
00035     class CDummy;
00036     template<class T> 
00037     void setOnResult( T* pItem, void (T::*pMethod)(uint16_t, uint8_t*, int) )
00038     {
00039         m_pCb = NULL;
00040         m_pCbItem = (CDummy*) pItem;
00041         m_pCbMeth = (void (CDummy::*)(uint16_t, uint8_t*, int)) pMethod;
00042     }
00043     void clearOnResult();
00044     CDummy* m_pCbItem;
00045     void (CDummy::*m_pCbMeth)(uint16_t, uint8_t*, int);
00046     void (*m_pCb)(uint16_t, uint8_t*, int);
00047 protected:
00048     USBHost * host;
00049     USBDeviceConnected * dev;
00050     USBEndpoint* ep_iso_in;
00051 };