Axeda Ready Demo for Freescale FRDM-KL46Z as accident alert system
Dependencies: FRDM_MMA8451Q KL46Z-USBHost MAG3110 SocketModem TSI mbed FATFileSystem
Fork of AxedaGo-Freescal_FRDM-KL46Z revert by
KL46Z_USBHostC270/BaseUvc.h@0:65004368569c, 2014-07-01 (annotated)
- Committer:
- AxedaCorp
- Date:
- Tue Jul 01 21:31:54 2014 +0000
- Revision:
- 0:65004368569c
Made initial
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AxedaCorp | 0:65004368569c | 1 | // BaseUvc.h |
AxedaCorp | 0:65004368569c | 2 | //#include "USBIsochronous.h" |
AxedaCorp | 0:65004368569c | 3 | #pragma once |
AxedaCorp | 0:65004368569c | 4 | |
AxedaCorp | 0:65004368569c | 5 | // --- UVC -------------------------------------------------- |
AxedaCorp | 0:65004368569c | 6 | #define _30FPS 333333 |
AxedaCorp | 0:65004368569c | 7 | #define _25FPS 400000 |
AxedaCorp | 0:65004368569c | 8 | #define _20FPS 500000 |
AxedaCorp | 0:65004368569c | 9 | #define _15FPS 666666 |
AxedaCorp | 0:65004368569c | 10 | #define _10FPS 1000000 |
AxedaCorp | 0:65004368569c | 11 | #define _5FPS 2000000 |
AxedaCorp | 0:65004368569c | 12 | #define _1FPS 10000000 |
AxedaCorp | 0:65004368569c | 13 | |
AxedaCorp | 0:65004368569c | 14 | #define SET_CUR 0x01 |
AxedaCorp | 0:65004368569c | 15 | #define GET_CUR 0x81 |
AxedaCorp | 0:65004368569c | 16 | #define GET_MIN 0x82 |
AxedaCorp | 0:65004368569c | 17 | #define GET_MAX 0x83 |
AxedaCorp | 0:65004368569c | 18 | #define GET_RES 0x84 |
AxedaCorp | 0:65004368569c | 19 | #define GET_LEN 0x85 |
AxedaCorp | 0:65004368569c | 20 | #define GET_INFO 0x86 |
AxedaCorp | 0:65004368569c | 21 | #define GET_DEF 0x87 |
AxedaCorp | 0:65004368569c | 22 | |
AxedaCorp | 0:65004368569c | 23 | #define VS_PROBE_CONTROL 0x01 |
AxedaCorp | 0:65004368569c | 24 | #define VS_COMMIT_CONTROL 0x02 |
AxedaCorp | 0:65004368569c | 25 | |
AxedaCorp | 0:65004368569c | 26 | class BaseUvc { |
AxedaCorp | 0:65004368569c | 27 | public: |
AxedaCorp | 0:65004368569c | 28 | void poll(); |
AxedaCorp | 0:65004368569c | 29 | USB_TYPE Control(int req, int cs, int index, uint8_t* buf, int size); |
AxedaCorp | 0:65004368569c | 30 | USB_TYPE setInterfaceAlternate(uint8_t intf, uint8_t alt); |
AxedaCorp | 0:65004368569c | 31 | //IsochronousEp* m_isoEp; |
AxedaCorp | 0:65004368569c | 32 | // callback |
AxedaCorp | 0:65004368569c | 33 | void onResult(uint16_t frame, uint8_t* buf, int len); |
AxedaCorp | 0:65004368569c | 34 | void setOnResult( void (*pMethod)(uint16_t, uint8_t*, int) ); |
AxedaCorp | 0:65004368569c | 35 | class CDummy; |
AxedaCorp | 0:65004368569c | 36 | template<class T> |
AxedaCorp | 0:65004368569c | 37 | void setOnResult( T* pItem, void (T::*pMethod)(uint16_t, uint8_t*, int) ) |
AxedaCorp | 0:65004368569c | 38 | { |
AxedaCorp | 0:65004368569c | 39 | m_pCb = NULL; |
AxedaCorp | 0:65004368569c | 40 | m_pCbItem = (CDummy*) pItem; |
AxedaCorp | 0:65004368569c | 41 | m_pCbMeth = (void (CDummy::*)(uint16_t, uint8_t*, int)) pMethod; |
AxedaCorp | 0:65004368569c | 42 | } |
AxedaCorp | 0:65004368569c | 43 | void clearOnResult(); |
AxedaCorp | 0:65004368569c | 44 | CDummy* m_pCbItem; |
AxedaCorp | 0:65004368569c | 45 | void (CDummy::*m_pCbMeth)(uint16_t, uint8_t*, int); |
AxedaCorp | 0:65004368569c | 46 | void (*m_pCb)(uint16_t, uint8_t*, int); |
AxedaCorp | 0:65004368569c | 47 | protected: |
AxedaCorp | 0:65004368569c | 48 | USBHost * host; |
AxedaCorp | 0:65004368569c | 49 | USBDeviceConnected * dev; |
AxedaCorp | 0:65004368569c | 50 | USBEndpoint* ep_iso_in; |
AxedaCorp | 0:65004368569c | 51 | }; |