Il y avait des problèmes dans la libraire...
Fork of USBDEVICE by
USBDevice/TARGET_Silicon_Labs/inc/usbconfig.h@5:3329e56e51d7, 2017-09-03 (annotated)
- Committer:
- qroche
- Date:
- Sun Sep 03 23:19:21 2017 +0000
- Branch:
- master
- Revision:
- 5:3329e56e51d7
- Parent:
- 1:2a3ae13b45ef
fin;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 1 | /***************************************************************************//** |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 2 | * @file usbconfig.h |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 3 | * @brief USB protocol stack library, application supplied configuration options. |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 4 | * @version 3.20.12 |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 5 | ******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 6 | * @section License |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 7 | * <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b> |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 8 | ******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 9 | * |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 10 | * Licensed under the Apache License, Version 2.0 (the "License"); |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 11 | * you may not use this file except in compliance with the License. |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 12 | * You may obtain a copy of the License at |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 13 | * |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 14 | * http://www.apache.org/licenses/LICENSE-2.0 |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 15 | * |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 16 | * Unless required by applicable law or agreed to in writing, software |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 17 | * distributed under the License is distributed on an "AS IS" BASIS, |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 19 | * See the License for the specific language governing permissions and |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 20 | * limitations under the License. |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 21 | * |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 22 | ******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 23 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 24 | #ifndef __USBCONFIG_H |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 25 | #define __USBCONFIG_H |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 26 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 27 | #ifdef __cplusplus |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 28 | extern "C" { |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 29 | #endif |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 30 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 31 | /* Compile stack for device mode. */ |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 32 | #define USB_DEVICE |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 33 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 34 | /* Maximum number of endpoint used, EP0 excluded. If you change this, you must |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 35 | also change USBEndpoints_EFM32.h to match. */ |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 36 | #define NUM_EP_USED 6 |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 37 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 38 | /* Power management modes. The following can be or'd toghether. See comments in |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 39 | em_usbd.c under "Energy-saving modes" for more details. |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 40 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 41 | USB_PWRSAVE_MODE_ONSUSPEND Set USB peripheral in low power mode on suspend |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 42 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 43 | USB_PWRSAVE_MODE_ONVBUSOFF Set USB peripheral in low power mode when not |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 44 | attached to a host. While this mode assumes that the internal voltage regulator |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 45 | is used and that the VREGI pin of the chip is connected to VBUS it should |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 46 | be safe to use given that VREGOSEN is always enabled. If you disable VREGOSEN |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 47 | you must turn this off. |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 48 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 49 | USB_PWRSAVE_MODE_ENTEREM2 Enter EM2 when USB peripheral is in low power mode. |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 50 | On Mbed this allows the sleep() and deepsleep() calls to enter EM2, but |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 51 | does not automatically enter any sleep states. Entering EM1 is always allowed. |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 52 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 53 | Note for Happy Gecko, errata USB_E111: Entering EM2 when both the system clock |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 54 | (HFCLK) and the USB core clock (USBCCLK) is running on USHFRCO will result in |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 55 | a lock-up. |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 56 | */ |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 57 | #define USB_PWRSAVE_MODE (USB_PWRSAVE_MODE_ONSUSPEND|USB_PWRSAVE_MODE_ONVBUSOFF|USB_PWRSAVE_MODE_ENTEREM2) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 58 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 59 | /* Use dynamic memory to allocate rx/tx buffers in the HAL. Saves memory |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 60 | as buffers are only allocated for used endpoints. The system malloc |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 61 | must return memory that is aligned by 4. |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 62 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 63 | Note: if you disable this, using isochronous endpoints with packet |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 64 | sizes that are larger than the maximum for other EP types (64) will |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 65 | not work. */ |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 66 | #define USB_USE_DYNAMIC_MEMORY |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 67 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 68 | /* When the USB peripheral is set in low power mode, it must be clocked by a 32kHz |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 69 | clock. Both LFXO and LFRCO can be used, but only LFXO guarantee USB specification |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 70 | compliance. */ |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 71 | #define USB_USBC_32kHz_CLK USB_USBC_32kHz_CLK_LFXO |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 72 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 73 | /* Uncomment to get some debugging information. Default value for USER_PUTCHAR |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 74 | should work for SiLabs Gecko boards. Printf requires a working retarget |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 75 | implementation for write(). */ |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 76 | //#define DEBUG_USB_API |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 77 | //#define USB_USE_PRINTF |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 78 | //#define USER_PUTCHAR ITM_SendChar |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 79 | //#define DEBUG_USB_INT_HI |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 80 | //#define DEBUG_USB_INT_LO |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 81 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 82 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 83 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 84 | #ifdef __cplusplus |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 85 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 86 | #endif |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 87 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 88 | #endif /* __USBCONFIG_H */ |