Sensor reporting over USB CDC
Dependencies: MAG3110 MMA8451Q SLCD- TSI USBDevice mbed
USBDevice/USBDevice/USBEndpoints_STM32F4.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 | #define NUMBER_OF_LOGICAL_ENDPOINTS (4) |
wue | 0:7b58cdacf811 | 20 | #define NUMBER_OF_PHYSICAL_ENDPOINTS (NUMBER_OF_LOGICAL_ENDPOINTS * 2) |
wue | 0:7b58cdacf811 | 21 | |
wue | 0:7b58cdacf811 | 22 | /* Define physical endpoint numbers */ |
wue | 0:7b58cdacf811 | 23 | |
wue | 0:7b58cdacf811 | 24 | /* Endpoint No. Type(s) MaxPacket DoubleBuffer */ |
wue | 0:7b58cdacf811 | 25 | /* ---------------- ------------ ---------- --- */ |
wue | 0:7b58cdacf811 | 26 | #define EP0OUT (0) /* Control 64 No */ |
wue | 0:7b58cdacf811 | 27 | #define EP0IN (1) /* Control 64 No */ |
wue | 0:7b58cdacf811 | 28 | #define EP1OUT (2) /* Int/Bulk/Iso 64/64/1023 Yes */ |
wue | 0:7b58cdacf811 | 29 | #define EP1IN (3) /* Int/Bulk/Iso 64/64/1023 Yes */ |
wue | 0:7b58cdacf811 | 30 | #define EP2OUT (4) /* Int/Bulk/Iso 64/64/1023 Yes */ |
wue | 0:7b58cdacf811 | 31 | #define EP2IN (5) /* Int/Bulk/Iso 64/64/1023 Yes */ |
wue | 0:7b58cdacf811 | 32 | #define EP3OUT (6) /* Int/Bulk/Iso 64/64/1023 Yes */ |
wue | 0:7b58cdacf811 | 33 | #define EP3IN (7) /* Int/Bulk/Iso 64/64/1023 Yes */ |
wue | 0:7b58cdacf811 | 34 | |
wue | 0:7b58cdacf811 | 35 | /* Maximum Packet sizes */ |
wue | 0:7b58cdacf811 | 36 | |
wue | 0:7b58cdacf811 | 37 | #define MAX_PACKET_SIZE_EP0 (64) |
wue | 0:7b58cdacf811 | 38 | #define MAX_PACKET_SIZE_EP1 (64) /* Int/Bulk */ |
wue | 0:7b58cdacf811 | 39 | #define MAX_PACKET_SIZE_EP2 (64) /* Int/Bulk */ |
wue | 0:7b58cdacf811 | 40 | #define MAX_PACKET_SIZE_EP3 (64) /* Int/Bulk */ |
wue | 0:7b58cdacf811 | 41 | |
wue | 0:7b58cdacf811 | 42 | #define MAX_PACKET_SIZE_EP1_ISO (1023) /* Isochronous */ |
wue | 0:7b58cdacf811 | 43 | #define MAX_PACKET_SIZE_EP2_ISO (1023) /* Isochronous */ |
wue | 0:7b58cdacf811 | 44 | #define MAX_PACKET_SIZE_EP3_ISO (1023) /* Isochronous */ |
wue | 0:7b58cdacf811 | 45 | |
wue | 0:7b58cdacf811 | 46 | /* Generic endpoints - intended to be portable accross devices */ |
wue | 0:7b58cdacf811 | 47 | /* and be suitable for simple USB devices. */ |
wue | 0:7b58cdacf811 | 48 | |
wue | 0:7b58cdacf811 | 49 | /* Bulk endpoint */ |
wue | 0:7b58cdacf811 | 50 | #define EPBULK_OUT (EP2OUT) |
wue | 0:7b58cdacf811 | 51 | #define EPBULK_IN (EP2IN) |
wue | 0:7b58cdacf811 | 52 | /* Interrupt endpoint */ |
wue | 0:7b58cdacf811 | 53 | #define EPINT_OUT (EP1OUT) |
wue | 0:7b58cdacf811 | 54 | #define EPINT_IN (EP1IN) |
wue | 0:7b58cdacf811 | 55 | /* Isochronous endpoint */ |
wue | 0:7b58cdacf811 | 56 | #define EPISO_OUT (EP3OUT) |
wue | 0:7b58cdacf811 | 57 | #define EPISO_IN (EP3IN) |
wue | 0:7b58cdacf811 | 58 | |
wue | 0:7b58cdacf811 | 59 | #define MAX_PACKET_SIZE_EPBULK (MAX_PACKET_SIZE_EP2) |
wue | 0:7b58cdacf811 | 60 | #define MAX_PACKET_SIZE_EPINT (MAX_PACKET_SIZE_EP1) |
wue | 0:7b58cdacf811 | 61 | #define MAX_PACKET_SIZE_EPISO (MAX_PACKET_SIZE_EP3_ISO) |