3 Copyright (C) Dean Camera, 2009.
5 dean [at] fourwalledcubicle [dot] com
6 www.fourwalledcubicle.com
10 Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
12 Permission to use, copy, modify, and distribute this software
13 and its documentation for any purpose and without fee is hereby
14 granted, provided that the above copyright notice appear in all
15 copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
21 The author disclaim all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
34 /* Private Interface - For use in library only: */
35 #if !defined(__DOXYGEN__)
37 #if (defined(__AVR_AT90USB162__) || defined(__AVR_AT90USB82__) || \
38 defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega8U2__))
39 #define USB_SERIES_2_AVR
40 #elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))
41 #define USB_SERIES_4_AVR
42 #elif (defined(__AVR_ATmega32U6__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__))
43 #define USB_SERIES_6_AVR
44 #elif (defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1287__))
45 #define USB_SERIES_7_AVR
48 #if !defined(USB_SERIES_7_AVR)
49 #if defined(USB_HOST_ONLY)
50 #error USB_HOST_ONLY is not available for the currently selected USB AVR model.
53 #if !defined(USB_DEVICE_ONLY)
54 #define USB_DEVICE_ONLY
58 #if (!defined(USB_DEVICE_ONLY) && !defined(USB_HOST_ONLY))
59 #define USB_CAN_BE_BOTH
60 #define USB_CAN_BE_HOST
61 #define USB_CAN_BE_DEVICE
62 #elif defined(USB_HOST_ONLY)
63 #define USB_CAN_BE_HOST
64 #elif defined(USB_DEVICE_ONLY)
65 #define USB_CAN_BE_DEVICE
68 #if (defined(USB_HOST_ONLY) && defined(USB_DEVICE_ONLY))
69 #error USB_HOST_ONLY and USB_DEVICE_ONLY are mutually exclusive.