max4146x_comp

Dependencies:   MAX14690

Committer:
sdivarci
Date:
Sun Oct 25 20:10:02 2020 +0000
Revision:
0:0061165683ee
sdivarci

Who changed what in which revision?

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