Simple USBHost library for STM32F746NG Discovery board. Only either the Fastspeed or the Highspeed port can be used( not both together)
Dependents: DISCO-F746NG_USB_Host
Fork of KL46Z-USBHost by
Diff: USBHost/USBDeviceConnected.h
- Revision:
- 10:40c7f6788902
- Parent:
- 9:7f9f64cf5ded
--- a/USBHost/USBDeviceConnected.h Mon Feb 03 13:00:16 2014 +0000 +++ b/USBHost/USBDeviceConnected.h Wed Feb 05 13:34:37 2014 +0000 @@ -17,24 +17,21 @@ #include "USBEndpoint.h" #include "USBHostConf.h" -#include "myqueue.h" +#include "myvector.h" #include "mymap.h" class USBEndpoint; struct INTERFACE { - INTERFACE() { - in_use = false; - intf_class = 0; - intf_subclass = 0; - intf_protocol = 0; - ep.clear(); + INTERFACE(uint8_t _class, uint8_t _subclass, uint8_t _protocol) { + intf_class = _class; + intf_subclass = _subclass; + intf_protocol = _protocol; } - bool in_use; uint8_t intf_class; uint8_t intf_subclass; uint8_t intf_protocol; - myqueue<USBEndpoint*>ep; + myvector<USBEndpoint*>ep; }; /** @@ -93,7 +90,7 @@ */ void disconnect(); - void init(uint8_t hub, uint8_t _port, bool _lowSpeed); + void init(USBDeviceConnected* parent, uint8_t _port, bool _lowSpeed); void setAddress(uint8_t addr_) { addr = addr_; }; void setVid(uint16_t vid_) { vid = vid_; }; void setPid(uint16_t pid_) { pid = pid_; }; @@ -110,7 +107,6 @@ static int addr = 1; return addr++; } - uint8_t getHub() { return hub_nb; }; uint8_t getAddress() { return addr; }; uint16_t getVid() { return vid; }; uint16_t getPid() { return pid; }; @@ -120,8 +116,8 @@ USBEndpoint* getEpCtl() { return ep_ctl; } private: + USBDeviceConnected* hub_parent; mymap<int,INTERFACE*>intf; - uint8_t hub_nb; uint8_t port; uint16_t vid; uint16_t pid;