Sensor reporting over USB CDC
Dependencies: MAG3110 MMA8451Q SLCD- TSI USBDevice mbed
USBDevice/USBDevice/USBEndpoints.h@0:7b58cdacf811, 2014-04-16 (annotated)
- Committer:
- wue
- Date:
- Wed Apr 16 12:20:12 2014 +0000
- Revision:
- 0:7b58cdacf811
Sensor reporting over USB CDC
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wue | 0:7b58cdacf811 | 1 | /* Copyright (c) 2010-2011 mbed.org, MIT License |
wue | 0:7b58cdacf811 | 2 | * |
wue | 0:7b58cdacf811 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
wue | 0:7b58cdacf811 | 4 | * and associated documentation files (the "Software"), to deal in the Software without |
wue | 0:7b58cdacf811 | 5 | * restriction, including without limitation the rights to use, copy, modify, merge, publish, |
wue | 0:7b58cdacf811 | 6 | * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the |
wue | 0:7b58cdacf811 | 7 | * Software is furnished to do so, subject to the following conditions: |
wue | 0:7b58cdacf811 | 8 | * |
wue | 0:7b58cdacf811 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
wue | 0:7b58cdacf811 | 10 | * substantial portions of the Software. |
wue | 0:7b58cdacf811 | 11 | * |
wue | 0:7b58cdacf811 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
wue | 0:7b58cdacf811 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
wue | 0:7b58cdacf811 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
wue | 0:7b58cdacf811 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
wue | 0:7b58cdacf811 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
wue | 0:7b58cdacf811 | 17 | */ |
wue | 0:7b58cdacf811 | 18 | |
wue | 0:7b58cdacf811 | 19 | #ifndef USBENDPOINTS_H |
wue | 0:7b58cdacf811 | 20 | #define USBENDPOINTS_H |
wue | 0:7b58cdacf811 | 21 | |
wue | 0:7b58cdacf811 | 22 | /* SETUP packet size */ |
wue | 0:7b58cdacf811 | 23 | #define SETUP_PACKET_SIZE (8) |
wue | 0:7b58cdacf811 | 24 | |
wue | 0:7b58cdacf811 | 25 | /* Options flags for configuring endpoints */ |
wue | 0:7b58cdacf811 | 26 | #define DEFAULT_OPTIONS (0) |
wue | 0:7b58cdacf811 | 27 | #define SINGLE_BUFFERED (1U << 0) |
wue | 0:7b58cdacf811 | 28 | #define ISOCHRONOUS (1U << 1) |
wue | 0:7b58cdacf811 | 29 | #define RATE_FEEDBACK_MODE (1U << 2) /* Interrupt endpoints only */ |
wue | 0:7b58cdacf811 | 30 | |
wue | 0:7b58cdacf811 | 31 | /* Endpoint transfer status, for endpoints > 0 */ |
wue | 0:7b58cdacf811 | 32 | typedef enum { |
wue | 0:7b58cdacf811 | 33 | EP_COMPLETED, /* Transfer completed */ |
wue | 0:7b58cdacf811 | 34 | EP_PENDING, /* Transfer in progress */ |
wue | 0:7b58cdacf811 | 35 | EP_INVALID, /* Invalid parameter */ |
wue | 0:7b58cdacf811 | 36 | EP_STALLED, /* Endpoint stalled */ |
wue | 0:7b58cdacf811 | 37 | } EP_STATUS; |
wue | 0:7b58cdacf811 | 38 | |
wue | 0:7b58cdacf811 | 39 | /* Include configuration for specific target */ |
wue | 0:7b58cdacf811 | 40 | #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088) |
wue | 0:7b58cdacf811 | 41 | #include "USBEndpoints_LPC17_LPC23.h" |
wue | 0:7b58cdacf811 | 42 | #elif defined(TARGET_LPC11UXX) || defined(TARGET_LPC1347) |
wue | 0:7b58cdacf811 | 43 | #include "USBEndpoints_LPC11U.h" |
wue | 0:7b58cdacf811 | 44 | #elif defined(TARGET_KL25Z) | defined(TARGET_KL46Z) | defined(TARGET_K20D5M) |
wue | 0:7b58cdacf811 | 45 | #include "USBEndpoints_KL25Z.h" |
wue | 0:7b58cdacf811 | 46 | #elif defined (TARGET_STM32F4XX) |
wue | 0:7b58cdacf811 | 47 | #include "USBEndpoints_STM32F4.h" |
wue | 0:7b58cdacf811 | 48 | #else |
wue | 0:7b58cdacf811 | 49 | #error "Unknown target type" |
wue | 0:7b58cdacf811 | 50 | #endif |
wue | 0:7b58cdacf811 | 51 | |
wue | 0:7b58cdacf811 | 52 | #endif |