IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Git Source Tree
Root/
| 1 | /* |
| 2 | * include/atusb/ep0.h - EP0 extension protocol |
| 3 | * |
| 4 | * Written 2008-2011, 2013 by Werner Almesberger |
| 5 | * Copyright 2008-2011, 2013 Werner Almesberger |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | */ |
| 12 | |
| 13 | |
| 14 | #ifndef EP0_H |
| 15 | #define EP0_H |
| 16 | |
| 17 | #include <atusb/atusb.h> |
| 18 | |
| 19 | |
| 20 | /* |
| 21 | * EP0 protocol: |
| 22 | * |
| 23 | * 0.0 initial release |
| 24 | * 0.1 addition of ATUSB_TEST |
| 25 | */ |
| 26 | |
| 27 | #define EP0ATUSB_MAJOR 0 /* EP0 protocol, major revision */ |
| 28 | #define EP0ATUSB_MINOR 1 /* EP0 protocol, minor revision */ |
| 29 | |
| 30 | #define HW_TYPE_100813 0 /* 2010-08-13 */ |
| 31 | #define HW_TYPE_101216 1 /* 2010-12-16 */ |
| 32 | #define HW_TYPE_110131 2 /* 2011-01-31, ATmega32U2-based */ |
| 33 | |
| 34 | |
| 35 | /* |
| 36 | * bmRequestType: |
| 37 | * |
| 38 | * D7 D6..5 D4...0 |
| 39 | * | | | |
| 40 | * direction (0 = host->dev) |
| 41 | * type (2 = vendor) |
| 42 | * recipient (0 = device) |
| 43 | */ |
| 44 | |
| 45 | #ifndef USB_TYPE_VENDOR |
| 46 | #define USB_TYPE_VENDOR 0x40 |
| 47 | #endif |
| 48 | |
| 49 | #ifndef USB_DIR_IN |
| 50 | #define USB_DIR_IN 0x80 |
| 51 | #endif |
| 52 | |
| 53 | #ifndef USB_DIR_OUT |
| 54 | #define USB_DIR_OUT 0x00 |
| 55 | #endif |
| 56 | |
| 57 | #define ATUSB_FROM_DEV(req) (ATUSB_REQ_FROM_DEV | (req) << 8) |
| 58 | #define ATUSB_TO_DEV(req) (ATUSB_REQ_TO_DEV | (req) << 8) |
| 59 | |
| 60 | |
| 61 | void ep0_init(void); |
| 62 | |
| 63 | #endif /* !EP0_H */ |
| 64 |
