partly working USB Device lib for STM32F746NG Discovery both Interface are working

Dependents:   DISCO-F746NG-USB_Device McLighTT project_Keyboard_to_the_Keyboard MIDIInstrumentPADProject ... more

Committer:
DieterGraef
Date:
Sun Jul 31 17:47:35 2016 +0000
Revision:
0:0a2eaa300982
partly working USB Device library - serial and MIDI is working

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DieterGraef 0:0a2eaa300982 1 /* Copyright (c) 2010-2011 mbed.org, MIT License
DieterGraef 0:0a2eaa300982 2 *
DieterGraef 0:0a2eaa300982 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
DieterGraef 0:0a2eaa300982 4 * and associated documentation files (the "Software"), to deal in the Software without
DieterGraef 0:0a2eaa300982 5 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
DieterGraef 0:0a2eaa300982 6 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
DieterGraef 0:0a2eaa300982 7 * Software is furnished to do so, subject to the following conditions:
DieterGraef 0:0a2eaa300982 8 *
DieterGraef 0:0a2eaa300982 9 * The above copyright notice and this permission notice shall be included in all copies or
DieterGraef 0:0a2eaa300982 10 * substantial portions of the Software.
DieterGraef 0:0a2eaa300982 11 *
DieterGraef 0:0a2eaa300982 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
DieterGraef 0:0a2eaa300982 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
DieterGraef 0:0a2eaa300982 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DieterGraef 0:0a2eaa300982 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
DieterGraef 0:0a2eaa300982 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
DieterGraef 0:0a2eaa300982 17 */
DieterGraef 0:0a2eaa300982 18
DieterGraef 0:0a2eaa300982 19 #define NUMBER_OF_LOGICAL_ENDPOINTS (4)
DieterGraef 0:0a2eaa300982 20 #define NUMBER_OF_PHYSICAL_ENDPOINTS (NUMBER_OF_LOGICAL_ENDPOINTS * 2)
DieterGraef 0:0a2eaa300982 21
DieterGraef 0:0a2eaa300982 22 /* Define physical endpoint numbers */
DieterGraef 0:0a2eaa300982 23
DieterGraef 0:0a2eaa300982 24 /* Endpoint No. Type(s) MaxPacket DoubleBuffer */
DieterGraef 0:0a2eaa300982 25 /* ---------------- ------------ ---------- --- */
DieterGraef 0:0a2eaa300982 26 #define EP0OUT (0) /* Control 64 No */
DieterGraef 0:0a2eaa300982 27 #define EP0IN (1) /* Control 64 No */
DieterGraef 0:0a2eaa300982 28 #define EP1OUT (2) /* Int/Bulk/Iso 64/64/1023 Yes */
DieterGraef 0:0a2eaa300982 29 #define EP1IN (3) /* Int/Bulk/Iso 64/64/1023 Yes */
DieterGraef 0:0a2eaa300982 30 #define EP2OUT (4) /* Int/Bulk/Iso 64/64/1023 Yes */
DieterGraef 0:0a2eaa300982 31 #define EP2IN (5) /* Int/Bulk/Iso 64/64/1023 Yes */
DieterGraef 0:0a2eaa300982 32 #define EP3OUT (6) /* Int/Bulk/Iso 64/64/1023 Yes */
DieterGraef 0:0a2eaa300982 33 #define EP3IN (7) /* Int/Bulk/Iso 64/64/1023 Yes */
DieterGraef 0:0a2eaa300982 34
DieterGraef 0:0a2eaa300982 35 /* Maximum Packet sizes */
DieterGraef 0:0a2eaa300982 36
DieterGraef 0:0a2eaa300982 37 #define MAX_PACKET_SIZE_EP0 (64)
DieterGraef 0:0a2eaa300982 38 #define MAX_PACKET_SIZE_EP1 (64) /* Int/Bulk */
DieterGraef 0:0a2eaa300982 39 #define MAX_PACKET_SIZE_EP2 (64) /* Int/Bulk */
DieterGraef 0:0a2eaa300982 40 #define MAX_PACKET_SIZE_EP3 (64) /* Int/Bulk */
DieterGraef 0:0a2eaa300982 41
DieterGraef 0:0a2eaa300982 42 #define MAX_PACKET_SIZE_EP1_ISO (1023) /* Isochronous */
DieterGraef 0:0a2eaa300982 43 #define MAX_PACKET_SIZE_EP2_ISO (1023) /* Isochronous */
DieterGraef 0:0a2eaa300982 44 #define MAX_PACKET_SIZE_EP3_ISO (1023) /* Isochronous */
DieterGraef 0:0a2eaa300982 45
DieterGraef 0:0a2eaa300982 46 /* Generic endpoints - intended to be portable accross devices */
DieterGraef 0:0a2eaa300982 47 /* and be suitable for simple USB devices. */
DieterGraef 0:0a2eaa300982 48
DieterGraef 0:0a2eaa300982 49 /* Bulk endpoint */
DieterGraef 0:0a2eaa300982 50 #define EPBULK_OUT (EP2OUT)
DieterGraef 0:0a2eaa300982 51 #define EPBULK_IN (EP2IN)
DieterGraef 0:0a2eaa300982 52 #define EPBULK_OUT_callback EP2_OUT_callback
DieterGraef 0:0a2eaa300982 53 #define EPBULK_IN_callback EP2_IN_callback
DieterGraef 0:0a2eaa300982 54 /* Interrupt endpoint */
DieterGraef 0:0a2eaa300982 55 #define EPINT_OUT (EP1OUT)
DieterGraef 0:0a2eaa300982 56 #define EPINT_IN (EP1IN)
DieterGraef 0:0a2eaa300982 57 #define EPINT_OUT_callback EP1_OUT_callback
DieterGraef 0:0a2eaa300982 58 #define EPINT_IN_callback EP1_IN_callback
DieterGraef 0:0a2eaa300982 59 /* Isochronous endpoint */
DieterGraef 0:0a2eaa300982 60 #define EPISO_OUT (EP3OUT)
DieterGraef 0:0a2eaa300982 61 #define EPISO_IN (EP3IN)
DieterGraef 0:0a2eaa300982 62 #define EPISO_OUT_callback EP3_OUT_callback
DieterGraef 0:0a2eaa300982 63 #define EPISO_IN_callback EP3_IN_callback
DieterGraef 0:0a2eaa300982 64
DieterGraef 0:0a2eaa300982 65 #define MAX_PACKET_SIZE_EPBULK (MAX_PACKET_SIZE_EP2)
DieterGraef 0:0a2eaa300982 66 #define MAX_PACKET_SIZE_EPINT (MAX_PACKET_SIZE_EP1)
DieterGraef 0:0a2eaa300982 67 #define MAX_PACKET_SIZE_EPISO (MAX_PACKET_SIZE_EP3_ISO)