fork/GramFirmware
git clone https://git.julia.blue/fork/GramFirmware
f319e86
v0.1.0
1/* 2The MIT License (MIT) 3 4Copyright (c) 2018, hathach for Adafruit 5 6Permission is hereby granted, free of charge, to any person obtaining a copy 7of this software and associated documentation files (the "Software"), to 8deal in the Software without restriction, including without limitation the 9rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10sell copies of the Software, and to permit persons to whom the Software is 11furnished to do so, subject to the following conditions: 12 13The above copyright notice and this permission notice shall be included in 14all copies or substantial portions of the Software. 15 16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22IN THE SOFTWARE. 23*/ 24 25#ifndef _TUSB_CONFIG_RP2040_H_ 26#define _TUSB_CONFIG_RP2040_H_ 27 28#ifdef __cplusplus 29extern "C" { 30#endif 31 32//-------------------------------------------------------------------- 33// COMMON CONFIGURATION 34//-------------------------------------------------------------------- 35#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE 36 37// Enable device stack 38#define CFG_TUD_ENABLED 1 39 40// Enable host stack with pio-usb if Pico-PIO-USB library is available 41#if __has_include ("pio_usb.h" ) 42#define CFG_TUH_ENABLED 1 43#define CFG_TUH_RPI_PIO_USB 1 44#endif 45 46#ifndef CFG_TUSB_MCU 47#define CFG_TUSB_MCU OPT_MCU_RP2040 48#endif 49#define CFG_TUSB_OS OPT_OS_PICO 50 51#ifndef CFG_TUSB_DEBUG 52#define CFG_TUSB_DEBUG 0 53#endif 54 55#if CFG_TUSB_DEBUG 56#define CFG_TUSB_DEBUG_PRINTF serial1_printf 57extern int serial1_printf (const char * __restrict__format , ...); 58#endif 59 60#define CFG_TUSB_MEM_SECTION 61#define CFG_TUSB_MEM_ALIGN TU_ATTR_ALIGNED(4) 62 63//-------------------------------------------------------------------- 64// Device Configuration 65//-------------------------------------------------------------------- 66 67#define CFG_TUD_ENDOINT0_SIZE 64 68 69#define CFG_TUD_CDC 1 70#define CFG_TUD_MSC 1 71#define CFG_TUD_HID 1 72#define CFG_TUD_MIDI 1 73#define CFG_TUD_VENDOR 0 74 75// CDC FIFO size of TX and RX 76#define CFG_TUD_CDC_RX_BUFSIZE 256 77#define CFG_TUD_CDC_TX_BUFSIZE 256 78 79// MSC Buffer size of Device Mass storage 80#define CFG_TUD_MSC_EP_BUFSIZE 512 81 82// HID buffer size Should be sufficient to hold ID (if any) + Data 83#define CFG_TUD_HID_EP_BUFSIZE 64 84 85// MIDI FIFO size of TX and RX 86#define CFG_TUD_MIDI_RX_BUFSIZE 128 87#define CFG_TUD_MIDI_TX_BUFSIZE 128 88 89// Vendor FIFO size of TX and RX 90#define CFG_TUD_VENDOR_RX_BUFSIZE 64 91#define CFG_TUD_VENDOR_TX_BUFSIZE 64 92 93//-------------------------------------------------------------------- 94// Host Configuration 95//-------------------------------------------------------------------- 96 97// Size of buffer to hold descriptors and other data used for enumeration 98#define CFG_TUH_ENUMERATION_BUFSIZE 256 99 100#define CFG_TUH_HUB 1 101// max device support (excluding hub device) 102#define CFG_TUH_DEVICE_MAX (CFG_TUH_HUB ? 4 : 1) // hub typically has 4 ports 103 104// Enable tuh_edpt_xfer() API 105//#define CFG_TUH_API_EDPT_XFER 1 106 107#define CFG_TUH_HID 4 108 109#ifdef __cplusplus 110} 111#endif 112 113#endif /* _TUSB_CONFIG_RP2040_H_ */