Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: F401RE-USBHostMIDI_RecieveExample
Fork of F401RE-USBHost by
Diff: USBHost.h
- Revision:
- 1:c072d9e580b0
- Parent:
- 0:5160ee0c522d
- Child:
- 2:0cdac6bcc534
diff -r 5160ee0c522d -r c072d9e580b0 USBHost.h
--- a/USBHost.h Sat Jan 18 13:30:22 2014 +0000
+++ b/USBHost.h Tue Jan 21 08:59:28 2014 +0000
@@ -15,6 +15,15 @@
#define GET_CONFIGURATION 8
#define SET_CONFIGURATION 9
+// TOK_PID[5:2]
+#define DATA0 0x03
+#define DATA1 0x0b
+#define ACK 0x02
+#define STALL 0x0e
+#define NAK 0x0a
+#define Bus_Timeout 0x00
+#define Data_Error 0x0f
+
enum ODD_EVEN {
ODD = 0,
EVEN = 1,
@@ -28,27 +37,33 @@
int ControlWrite(SETUP_PACKET* setup, uint8_t* data = NULL, int size = 0);
int BulkRead(uint8_t* data, int size);
int BulkWrite(const uint8_t* data, int size);
+ uint8_t LastStatus;
protected:
USBHost();
void init();
void wait_attach();
- void enumeration();
+ bool enumeration();
uint8_t ep_int_in;
uint8_t ep_bulk_in;
uint8_t ep_bulk_out;
int MaxPacketSize0;
+ bool lowSpeed;
+ int dev_addr;
private:
static void _usbisr(void);
int token_setup(SETUP_PACKET* setup, uint16_t wLength = 0);
int token_in(uint8_t ep, uint8_t* data = NULL, int size = 0);
int token_out(uint8_t ep, const uint8_t* data = NULL, int size = 0);
+ void token_ready();
void UsbIrqhandler();
__IO bool attach_done;
__IO bool token_done;
ODD_EVEN tx_ptr;
ODD_EVEN rx_ptr;
+ uint8_t tx_data01[16];
+ uint8_t rx_data01[16];
static USBHost* inst;
};
