A copy of the mbed USBDevice with USBSerial library

Dependents:   STM32L0_LoRa Smartage STM32L0_LoRa Turtle_RadioShuttle

Committer:
Helmut Tschemernjak
Date:
Thu Jan 31 20:56:55 2019 +0100
Revision:
7:8a5cc0d9bfa2
Parent:
0:a3ea811f80f2
fixed compiler warnings

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Helmut64 0:a3ea811f80f2 1 /*******************************************************************************
Helmut64 0:a3ea811f80f2 2 * Copyright (C) 2015 Maxim Integrated Products, Inc., All Rights Reserved.
Helmut64 0:a3ea811f80f2 3 *
Helmut64 0:a3ea811f80f2 4 * Permission is hereby granted, free of charge, to any person obtaining a
Helmut64 0:a3ea811f80f2 5 * copy of this software and associated documentation files (the "Software"),
Helmut64 0:a3ea811f80f2 6 * to deal in the Software without restriction, including without limitation
Helmut64 0:a3ea811f80f2 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
Helmut64 0:a3ea811f80f2 8 * and/or sell copies of the Software, and to permit persons to whom the
Helmut64 0:a3ea811f80f2 9 * Software is furnished to do so, subject to the following conditions:
Helmut64 0:a3ea811f80f2 10 *
Helmut64 0:a3ea811f80f2 11 * The above copyright notice and this permission notice shall be included
Helmut64 0:a3ea811f80f2 12 * in all copies or substantial portions of the Software.
Helmut64 0:a3ea811f80f2 13 *
Helmut64 0:a3ea811f80f2 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
Helmut64 0:a3ea811f80f2 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Helmut64 0:a3ea811f80f2 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Helmut64 0:a3ea811f80f2 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
Helmut64 0:a3ea811f80f2 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
Helmut64 0:a3ea811f80f2 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
Helmut64 0:a3ea811f80f2 20 * OTHER DEALINGS IN THE SOFTWARE.
Helmut64 0:a3ea811f80f2 21 *
Helmut64 0:a3ea811f80f2 22 * Except as contained in this notice, the name of Maxim Integrated
Helmut64 0:a3ea811f80f2 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
Helmut64 0:a3ea811f80f2 24 * Products, Inc. Branding Policy.
Helmut64 0:a3ea811f80f2 25 *
Helmut64 0:a3ea811f80f2 26 * The mere transfer of this software does not imply any licenses
Helmut64 0:a3ea811f80f2 27 * of trade secrets, proprietary technology, copyrights, patents,
Helmut64 0:a3ea811f80f2 28 * trademarks, maskwork rights, or any other form of intellectual
Helmut64 0:a3ea811f80f2 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
Helmut64 0:a3ea811f80f2 30 * ownership rights.
Helmut64 0:a3ea811f80f2 31 *******************************************************************************
Helmut64 0:a3ea811f80f2 32 */
Helmut64 0:a3ea811f80f2 33
Helmut64 0:a3ea811f80f2 34 #define NUMBER_OF_LOGICAL_ENDPOINTS (8)
Helmut64 0:a3ea811f80f2 35 #define NUMBER_OF_PHYSICAL_ENDPOINTS (NUMBER_OF_LOGICAL_ENDPOINTS * 2)
Helmut64 0:a3ea811f80f2 36
Helmut64 0:a3ea811f80f2 37 #define DIR_OUT 0x00
Helmut64 0:a3ea811f80f2 38 #define DIR_IN 0x01
Helmut64 0:a3ea811f80f2 39 #define EP_NUM(ep) (ep >> 1)
Helmut64 0:a3ea811f80f2 40 #define IN_EP(ep) (ep & DIR_IN)
Helmut64 0:a3ea811f80f2 41 #define OUT_EP(ep) (!(ep & DIR_IN))
Helmut64 0:a3ea811f80f2 42
Helmut64 0:a3ea811f80f2 43 /* Define physical endpoint numbers */
Helmut64 0:a3ea811f80f2 44
Helmut64 0:a3ea811f80f2 45 /* Endpoint No. */
Helmut64 0:a3ea811f80f2 46 /* ---------------- */
Helmut64 0:a3ea811f80f2 47 #define EP0OUT ((0 << 1) | DIR_OUT)
Helmut64 0:a3ea811f80f2 48 #define EP0IN ((0 << 1) | DIR_IN)
Helmut64 0:a3ea811f80f2 49 #define EP1OUT ((1 << 1) | DIR_OUT)
Helmut64 0:a3ea811f80f2 50 #define EP1IN ((1 << 1) | DIR_IN)
Helmut64 0:a3ea811f80f2 51 #define EP2OUT ((2 << 1) | DIR_OUT)
Helmut64 0:a3ea811f80f2 52 #define EP2IN ((2 << 1) | DIR_IN)
Helmut64 0:a3ea811f80f2 53 #define EP3OUT ((3 << 1) | DIR_OUT)
Helmut64 0:a3ea811f80f2 54 #define EP3IN ((3 << 1) | DIR_IN)
Helmut64 0:a3ea811f80f2 55 #define EP4OUT ((4 << 1) | DIR_OUT)
Helmut64 0:a3ea811f80f2 56 #define EP4IN ((4 << 1) | DIR_IN)
Helmut64 0:a3ea811f80f2 57 #define EP5OUT ((5 << 1) | DIR_OUT)
Helmut64 0:a3ea811f80f2 58 #define EP5IN ((5 << 1) | DIR_IN)
Helmut64 0:a3ea811f80f2 59 #define EP6OUT ((6 << 1) | DIR_OUT)
Helmut64 0:a3ea811f80f2 60 #define EP6IN ((6 << 1) | DIR_IN)
Helmut64 0:a3ea811f80f2 61 #define EP7OUT ((7 << 1) | DIR_OUT)
Helmut64 0:a3ea811f80f2 62 #define EP7IN ((7 << 1) | DIR_IN)
Helmut64 0:a3ea811f80f2 63
Helmut64 0:a3ea811f80f2 64 /* Maximum Packet sizes */
Helmut64 0:a3ea811f80f2 65
Helmut64 0:a3ea811f80f2 66 #define MAX_PACKET_SIZE_EP0 (64)
Helmut64 0:a3ea811f80f2 67 #define MAX_PACKET_SIZE_EP1 (64)
Helmut64 0:a3ea811f80f2 68 #define MAX_PACKET_SIZE_EP2 (64)
Helmut64 0:a3ea811f80f2 69 #define MAX_PACKET_SIZE_EP3 (64)
Helmut64 0:a3ea811f80f2 70 #define MAX_PACKET_SIZE_EP4 (64)
Helmut64 0:a3ea811f80f2 71 #define MAX_PACKET_SIZE_EP5 (64)
Helmut64 0:a3ea811f80f2 72 #define MAX_PACKET_SIZE_EP6 (64)
Helmut64 0:a3ea811f80f2 73 #define MAX_PACKET_SIZE_EP7 (64)
Helmut64 0:a3ea811f80f2 74
Helmut64 0:a3ea811f80f2 75 /* Generic endpoints - intended to be portable accross devices */
Helmut64 0:a3ea811f80f2 76 /* and be suitable for simple USB devices. */
Helmut64 0:a3ea811f80f2 77
Helmut64 0:a3ea811f80f2 78 /* Bulk endpoints */
Helmut64 0:a3ea811f80f2 79 #define EPBULK_OUT (EP1OUT)
Helmut64 0:a3ea811f80f2 80 #define EPBULK_IN (EP2IN)
Helmut64 0:a3ea811f80f2 81 #define EPBULK_OUT_callback EP1_OUT_callback
Helmut64 0:a3ea811f80f2 82 #define EPBULK_IN_callback EP2_IN_callback
Helmut64 0:a3ea811f80f2 83 /* Interrupt endpoints */
Helmut64 0:a3ea811f80f2 84 #define EPINT_OUT (EP3OUT)
Helmut64 0:a3ea811f80f2 85 #define EPINT_IN (EP4IN)
Helmut64 0:a3ea811f80f2 86 #define EPINT_OUT_callback EP3_OUT_callback
Helmut64 0:a3ea811f80f2 87 #define EPINT_IN_callback EP4_IN_callback
Helmut64 0:a3ea811f80f2 88 /* Isochronous endpoints */
Helmut64 0:a3ea811f80f2 89 /* NOT SUPPORTED - use invalid endpoint number to prevent built errors */
Helmut64 0:a3ea811f80f2 90 #define EPISO_OUT (EP0OUT)
Helmut64 0:a3ea811f80f2 91 #define EPISO_IN (EP0IN)
Helmut64 0:a3ea811f80f2 92
Helmut64 0:a3ea811f80f2 93 #define MAX_PACKET_SIZE_EPBULK (64)
Helmut64 0:a3ea811f80f2 94 #define MAX_PACKET_SIZE_EPINT (64)