ON Semiconductor / mbed-os

Dependents:   mbed-TFT-example-NCS36510 mbed-Accelerometer-example-NCS36510 mbed-Accelerometer-example-NCS36510

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers USBEndpoints_M453.h Source File

USBEndpoints_M453.h

00001 /* mbed Microcontroller Library
00002  * Copyright (c) 2015-2016 Nuvoton
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 #define NU_MAX_EPX_BUFSIZE      4096
00017 #define NU_EP2EPL(ep)           ((ep) >> 1)
00018 #define NU_EP2EPH(ep)           (((ep) >> 1) + 1)
00019 #define NU_EPL2EPH(ep)          ((ep) + 1)
00020 #define NU_EPH2EPL(ep)          ((ep) - 1)
00021 #define NU_EP_DIR_Pos           0
00022 #define NU_EP_DIR_Msk           (1 << NU_EP_DIR_Pos)
00023 #define NU_EP_DIR_OUT           0
00024 #define NU_EP_DIR_IN            1
00025 
00026 #define NU_EP_TYPE(ep)          (((ep) & NU_EP_TYPE_Msk) >> NU_EP_TYPE_Pos)
00027 #define NU_EP_NUM(ep)           (((ep) & NU_EP_NUM_Msk) >> NU_EP_NUM_Pos)
00028 #define NU_EP_DIR(ep)           (((ep) & NU_EP_DIR_Msk) >> NU_EP_DIR_Pos)
00029 #define NU_EP_NUM_DIR(ep)       ((NU_EP_NUM(ep) << 1) | NU_EP_DIR(ep))
00030 
00031 #define NUMBER_OF_PHYSICAL_ENDPOINTS    8
00032 #define EP0OUT      (0)
00033 #define EP0IN       (1)
00034 #define EP1OUT      (2)
00035 #define EP1IN       (3)
00036 #define EP2OUT      (4)
00037 #define EP2IN       (5)
00038 #define EP3OUT      (6)
00039 #define EP3IN       (7)
00040 #define EP4OUT      (8)
00041 #define EP4IN       (9)
00042 #define EP5OUT     (10)
00043 #define EP5IN      (11)
00044 #define EP6OUT     (12)
00045 #define EP6IN      (13)
00046 
00047 /* Maximum Packet sizes */
00048 #define MAX_PACKET_SIZE_EP0     64
00049 #define MAX_PACKET_SIZE_EP1     64
00050 #define MAX_PACKET_SIZE_EP2     64
00051 #define MAX_PACKET_SIZE_EP3     0x60
00052 #define MAX_PACKET_SIZE_EP4     64
00053 #define MAX_PACKET_SIZE_EP5     64
00054 #define MAX_PACKET_SIZE_EP6     64
00055 #define MAX_PACKET_SIZE_EP7     64
00056 
00057 /* Generic endpoints - intended to be portable accross devices */
00058 /* and be suitable for simple USB devices. */
00059 
00060 /* Bulk endpoints */
00061 #define EPBULK_OUT            EP5OUT
00062 #define EPBULK_IN             EP6IN
00063 #define EPBULK_OUT_callback   EP5_OUT_callback
00064 #define EPBULK_IN_callback    EP6_IN_callback
00065 /* Interrupt endpoints */
00066 #define EPINT_OUT             EP1OUT
00067 #define EPINT_IN              EP2IN
00068 #define EPINT_OUT_callback    EP1_OUT_callback
00069 #define EPINT_IN_callback     EP2_IN_callback
00070 /* Isochronous endpoints */
00071 #define EPISO_OUT             EP3OUT
00072 #define EPISO_IN              EP4IN
00073 #define EPISO_OUT_callback    EP3_OUT_callback
00074 #define EPISO_IN_callback     EP4_IN_callback
00075 
00076 #define MAX_PACKET_SIZE_EPBULK  64
00077 #define MAX_PACKET_SIZE_EPINT   64
00078 #define MAX_PACKET_SIZE_EPISO   1023
00079