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