00001 /******************** (C) COPYRIGHT 2010 STMicroelectronics ******************** 00002 * File Name : usb_conf.h 00003 * Author : MCD Application Team 00004 * Version : V3.1.1 00005 * Date : 04/07/2010 00006 * Description : Virtual COM Port Demo configuration header 00007 ******************************************************************************** 00008 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 00009 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 00010 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 00011 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 00012 * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 00013 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 00014 *******************************************************************************/ 00015 00016 /* Define to prevent recursive inclusion -------------------------------------*/ 00017 #ifndef __USB_CONF_H 00018 #define __USB_CONF_H 00019 00020 /* Includes ------------------------------------------------------------------*/ 00021 /* Exported types ------------------------------------------------------------*/ 00022 /* Exported constants --------------------------------------------------------*/ 00023 /* Exported macro ------------------------------------------------------------*/ 00024 /* Exported functions ------------------------------------------------------- */ 00025 /* External variables --------------------------------------------------------*/ 00026 00027 /*-------------------------------------------------------------*/ 00028 /* EP_NUM */ 00029 /* defines how many endpoints are used by the device */ 00030 /*-------------------------------------------------------------*/ 00031 00032 #define EP_NUM (4) 00033 00034 00035 /******************************************************************************* 00036 * FIFO Size Configuration 00037 * 00038 * (i) Dedicated data FIFO SPRAM of 1.25 Kbytes = 1280 bytes = 320 32-bits words 00039 * available for the endpoints IN and OUT. 00040 * Device mode features: 00041 * -1 bidirectional CTRL EP 0 00042 * -3 IN EPs to support any kind of Bulk, Interrupt or Isochronous transfer 00043 * -3 OUT EPs to support any kind of Bulk, Interrupt or Isochronous transfer 00044 * 00045 * ii) Receive data FIFO size = RAM for setup packets + 00046 * OUT endpoint control information + 00047 * data OUT packets + miscellaneous 00048 * Space = ONE 32-bits words 00049 * --> RAM for setup packets = 4 * n + 6 space 00050 * (n is the nbr of CTRL EPs the device core supports) 00051 * --> OUT EP CTRL info = 1 space 00052 * (one space for status information written to the FIFO along with each 00053 * received packet) 00054 * --> data OUT packets = (Largest Packet Size / 4) + 1 spaces 00055 * (MINIMUM to receive packets) 00056 * --> OR data OUT packets = at least 2*(Largest Packet Size / 4) + 1 spaces 00057 * (if high-bandwidth EP is enabled or multiple isochronous EPs) 00058 * --> miscellaneous = 1 space per OUT EP 00059 * (one space for transfer complete status information also pushed to the 00060 * FIFO with each endpoint's last packet) 00061 * 00062 * (iii)MINIMUM RAM space required for each IN EP Tx FIFO = MAX packet size for 00063 * that particular IN EP. More space allocated in the IN EP Tx FIFO results 00064 * in a better performance on the USB and can hide latencies on the AHB. 00065 * 00066 * (iv) TXn min size = 16 words. (n : Transmit FIFO index) 00067 * (v) When a TxFIFO is not used, the Configuration should be as follows: 00068 * case 1 : n > m and Txn is not used (n,m : Transmit FIFO indexes) 00069 * --> Txm can use the space allocated for Txn. 00070 * case2 : n < m and Txn is not used (n,m : Transmit FIFO indexes) 00071 * --> Txn should be configured with the minimum space of 16 words 00072 * (vi) The FIFO is used optimally when used TxFIFOs are allocated in the top 00073 * of the FIFO.Ex: use EP1 and EP2 as IN instead of EP1 and EP3 as IN ones. 00074 *******************************************************************************/ 00075 00076 #define RX_FIFO_SIZE 128 00077 #define TX0_FIFO_SIZE 64 00078 #define TX1_FIFO_SIZE 64 00079 #define TX2_FIFO_SIZE 16 00080 #define TX3_FIFO_SIZE 16 00081 00082 /* OTGD-FS-DEVICE IP interrupts Enable definitions */ 00083 /* Uncomment the define to enable the selected interrupt */ 00084 //#define INTR_MODEMISMATCH 00085 //#define INTR_SOFINTR 00086 #define INTR_RXSTSQLVL /* Mandatory */ 00087 //#define INTR_NPTXFEMPTY 00088 //#define INTR_GINNAKEFF 00089 //#define INTR_GOUTNAKEFF 00090 //#define INTR_ERLYSUSPEND 00091 #define INTR_USBSUSPEND /* Mandatory */ 00092 #define INTR_USBRESET /* Mandatory */ 00093 #define INTR_ENUMDONE /* Mandatory */ 00094 //#define INTR_ISOOUTDROP 00095 //#define INTR_EOPFRAME 00096 //#define INTR_EPMISMATCH 00097 #define INTR_INEPINTR /* Mandatory */ 00098 #define INTR_OUTEPINTR /* Mandatory */ 00099 //#define INTR_INCOMPLISOIN 00100 //#define INTR_INCOMPLISOOUT 00101 #define INTR_WKUPINTR /* Mandatory */ 00102 00103 /* OTGD-FS-DEVICE IP interrupts subroutines */ 00104 /* Comment the define to enable the selected interrupt subroutine and replace it 00105 by user code */ 00106 #define INTR_MODEMISMATCH_Callback NOP_Process 00107 #define INTR_SOFINTR_Callback NOP_Process 00108 #define INTR_RXSTSQLVL_Callback NOP_Process 00109 #define INTR_NPTXFEMPTY_Callback NOP_Process 00110 #define INTR_NPTXFEMPTY_Callback NOP_Process 00111 #define INTR_GINNAKEFF_Callback NOP_Process 00112 #define INTR_GOUTNAKEFF_Callback NOP_Process 00113 #define INTR_ERLYSUSPEND_Callback NOP_Process 00114 #define INTR_USBSUSPEND_Callback NOP_Process 00115 #define INTR_USBRESET_Callback NOP_Process 00116 #define INTR_ENUMDONE_Callback NOP_Process 00117 #define INTR_ISOOUTDROP_Callback NOP_Process 00118 #define INTR_EOPFRAME_Callback NOP_Process 00119 #define INTR_EPMISMATCH_Callback NOP_Process 00120 #define INTR_INEPINTR_Callback NOP_Process 00121 #define INTR_OUTEPINTR_Callback NOP_Process 00122 #define INTR_INCOMPLISOIN_Callback NOP_Process 00123 #define INTR_INCOMPLISOOUT_Callback NOP_Process 00124 #define INTR_WKUPINTR_Callback NOP_Process 00125 00126 /* Isochronous data update */ 00127 #define INTR_RXSTSQLVL_ISODU_Callback NOP_Process 00128 00129 /* Isochronous transfer parameters */ 00130 /* Size of a single Isochronous buffer (size of a single transfer) */ 00131 #define ISOC_BUFFER_SZE 1 00132 /* Number of sub-buffers (number of single buffers/transfers), should be even */ 00133 #define NUM_SUB_BUFFERS 2 00134 00135 00136 00137 /* CTR service routines */ 00138 /* associated to defined endpoints */ 00139 /*#define EP1_IN_Callback NOP_Process*/ 00140 #define EP2_IN_Callback NOP_Process 00141 #define EP3_IN_Callback NOP_Process 00142 #define EP4_IN_Callback NOP_Process 00143 #define EP5_IN_Callback NOP_Process 00144 #define EP6_IN_Callback NOP_Process 00145 #define EP7_IN_Callback NOP_Process 00146 00147 #define EP1_OUT_Callback NOP_Process 00148 #define EP2_OUT_Callback NOP_Process 00149 /*#define EP3_OUT_Callback NOP_Process*/ 00150 #define EP4_OUT_Callback NOP_Process 00151 #define EP5_OUT_Callback NOP_Process 00152 #define EP6_OUT_Callback NOP_Process 00153 #define EP7_OUT_Callback NOP_Process 00154 00155 #endif /* __USB_CONF_H */ 00156 00157 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/