diff options
author | Martino Facchin <m.facchin@arduino.cc> | 2015-08-13 09:39:21 +0200 |
---|---|---|
committer | Martino Facchin <m.facchin@arduino.cc> | 2015-08-13 09:39:21 +0200 |
commit | b3197c6ef83253d712f4b7b30a0763f18f6d3ddc (patch) | |
tree | c1c11380a35613e3ab8e9264bfb84251a91d5db8 /cores/arduino/USBAPI.h | |
parent | 98f7ab15884119b1c9f1f58f96a8302200c1e2a3 (diff) | |
parent | 98301ba23a1f7c60b4590330da2ee1c260da7aa6 (diff) |
Merge pull request #3640 from NicoHood/USB-Core-Fixes
Usb core fixes
Diffstat (limited to 'cores/arduino/USBAPI.h')
-rw-r--r-- | cores/arduino/USBAPI.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/cores/arduino/USBAPI.h b/cores/arduino/USBAPI.h index 4abd961..7f468a6 100644 --- a/cores/arduino/USBAPI.h +++ b/cores/arduino/USBAPI.h @@ -32,6 +32,12 @@ typedef unsigned long u32; #include "Arduino.h" +// This definitions is usefull if you want to reduce the EP_SIZE to 16 +// at the moment only 64 and 16 as EP_SIZE for all EPs are supported except the control endpoint +#ifndef USB_EP_SIZE +#define USB_EP_SIZE 64 +#endif + #if defined(USBCON) #include "USBDesc.h" @@ -41,13 +47,13 @@ typedef unsigned long u32; //================================================================================ // USB -#define EP_TYPE_CONTROL 0x00 -#define EP_TYPE_BULK_IN 0x81 -#define EP_TYPE_BULK_OUT 0x80 -#define EP_TYPE_INTERRUPT_IN 0xC1 -#define EP_TYPE_INTERRUPT_OUT 0xC0 -#define EP_TYPE_ISOCHRONOUS_IN 0x41 -#define EP_TYPE_ISOCHRONOUS_OUT 0x40 +#define EP_TYPE_CONTROL (0x00) +#define EP_TYPE_BULK_IN ((1<<EPTYPE1) | (1<<EPDIR)) +#define EP_TYPE_BULK_OUT (1<<EPTYPE1) +#define EP_TYPE_INTERRUPT_IN ((1<<EPTYPE1) | (1<<EPTYPE0) | (1<<EPDIR)) +#define EP_TYPE_INTERRUPT_OUT ((1<<EPTYPE1) | (1<<EPTYPE0)) +#define EP_TYPE_ISOCHRONOUS_IN ((1<<EPTYPE0) | (1<<EPDIR)) +#define EP_TYPE_ISOCHRONOUS_OUT (1<<EPTYPE0) class USBDevice_ { |