JBBoardに接続したモーター2つをRCBControllerでコントロールするテストです。
Dependencies: FatFileSystem TB6612FNG2 mbed
Fork of JBB_BTLE_Test by
uvc/uvcctl.cpp@7:3ed1e36587d4, 2014-05-12 (annotated)
- Committer:
- jksoft
- Date:
- Mon May 12 14:24:35 2014 +0000
- Revision:
- 7:3ed1e36587d4
- Parent:
- 0:1ed23ab1345f
First edition
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
va009039 | 0:1ed23ab1345f | 1 | #include "mbed.h" |
va009039 | 0:1ed23ab1345f | 2 | #include "uvc.h" |
va009039 | 0:1ed23ab1345f | 3 | #define __DEBUG |
va009039 | 0:1ed23ab1345f | 4 | #include "mydbg.h" |
va009039 | 0:1ed23ab1345f | 5 | |
va009039 | 0:1ed23ab1345f | 6 | UsbErr uvc::Control(int req, int cs, int index, uint8_t* buf, int size) |
va009039 | 0:1ed23ab1345f | 7 | { |
va009039 | 0:1ed23ab1345f | 8 | UsbErr rc; |
va009039 | 0:1ed23ab1345f | 9 | if (req == SET_CUR) { |
va009039 | 0:1ed23ab1345f | 10 | rc = m_pDev->controlSend( |
va009039 | 0:1ed23ab1345f | 11 | USB_HOST_TO_DEVICE | USB_REQUEST_TYPE_CLASS | USB_RECIPIENT_INTERFACE, |
va009039 | 0:1ed23ab1345f | 12 | req, cs<<8, index, buf, size); |
va009039 | 0:1ed23ab1345f | 13 | return rc; |
va009039 | 0:1ed23ab1345f | 14 | } |
va009039 | 0:1ed23ab1345f | 15 | rc = m_pDev->controlReceive( |
va009039 | 0:1ed23ab1345f | 16 | USB_DEVICE_TO_HOST | USB_REQUEST_TYPE_CLASS | USB_RECIPIENT_INTERFACE, |
va009039 | 0:1ed23ab1345f | 17 | req, cs<<8, index, buf, size); |
va009039 | 0:1ed23ab1345f | 18 | return rc; |
va009039 | 0:1ed23ab1345f | 19 | } |