USB Host Driver with Socket Modem support. Works with revision 323 of mbed-src but broken with any later version.
Dependencies: FATFileSystem
Fork of F401RE-USBHost by
Diff: USBHostC270/USBHostCam.cpp
- Revision:
- 18:61554f238584
- Parent:
- 13:8774c07f12a5
--- a/USBHostC270/USBHostCam.cpp Mon Jun 23 20:48:53 2014 +0900 +++ b/USBHostC270/USBHostCam.cpp Tue Jul 01 18:33:31 2014 +0900 @@ -59,6 +59,7 @@ USB_INFO("New Cam: %s device: VID:%04x PID:%04x [dev: %p - intf: %d]", caminfo->name, dev->getVid(), dev->getPid(), dev, cam_intf); ep_iso_in = new USBEndpoint(dev); ep_iso_in->init(ISOCHRONOUS_ENDPOINT, IN, caminfo->mps, caminfo->en); + ep_iso_in->ohci_init(caminfo->frameCount, caminfo->queueLimit); uint8_t buf[26]; memset(buf, 0, sizeof(buf)); buf[2] = caminfo->formatIndex; @@ -81,44 +82,6 @@ return false; } -#if 0 -void USBHostCam::setup() { - caminfo = CamInfoList; - bool found = false; - while(caminfo->vid != 0) { - if (caminfo->vid == host->getDevice(0)->getVid() && - caminfo->pid == host->getDevice(0)->getPid() && - caminfo->size == _caminfo_size && caminfo->option == _caminfo_option) { - found = true; - break; - } - caminfo++; - } - if (!found) { - CAM_INFO("caminfo not found."); - exit(1); - } - CAM_INFO("Found: %s", caminfo->name); - - ep_iso_in.setAddress(caminfo->en); - ep_iso_in.setSize(caminfo->mps); - uint8_t buf[26]; - memset(buf, 0, sizeof(buf)); - buf[2] = caminfo->formatIndex; - buf[3] = caminfo->frameIndex; - *reinterpret_cast<uint32_t*>(buf+4) = caminfo->interval; - USB_TYPE res = Control(SET_CUR, VS_COMMIT_CONTROL, 1, buf, sizeof(buf)); - if (res != USB_TYPE_OK) { - USB_ERR("SET_CUR VS_COMMIT_CONTROL FAILED"); - } - res = setInterfaceAlternate(1, caminfo->if_alt); - if (res != USB_TYPE_OK) { - USB_ERR("SET_INTERFACE FAILED"); - } -} -#endif - - /*virtual*/ void USBHostCam::setVidPid(uint16_t vid, uint16_t pid) { CAM_DBG("vid:%04x,pid:%04x", vid, pid);