works!

Dependencies:   mbed

Committer:
mjoun
Date:
Fri Feb 21 20:40:56 2020 +0000
Revision:
1:6e512faaa17c
works

Who changed what in which revision?

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