ME11B Sample Code in Maxim Integrated Team

Dependencies:   BMI160 max32630hsp3 MemoryLCD USBDevice

Fork of Host_Software_MAX32664GWEB_HR_EXTENDED by Seyhmus Cacina

Committer:
seyhmus.cacina
Date:
Mon Mar 18 10:21:53 2019 +0300
Revision:
0:ac4dea3e2894
ME11B Sample Code First Commit

Who changed what in which revision?

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