|
| 1 | +/* |
| 2 | + * The MIT License (MIT) |
| 3 | + * |
| 4 | + * Copyright (c) 2018, hathach for Adafruit |
| 5 | + * |
| 6 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | + * of this software and associated documentation files (the "Software"), to deal |
| 8 | + * in the Software without restriction, including without limitation the rights |
| 9 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | + * copies of the Software, and to permit persons to whom the Software is |
| 11 | + * furnished to do so, subject to the following conditions: |
| 12 | + * |
| 13 | + * The above copyright notice and this permission notice shall be included in |
| 14 | + * all copies or substantial portions of the Software. |
| 15 | + * |
| 16 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 22 | + * THE SOFTWARE. |
| 23 | + */ |
| 24 | + |
| 25 | +#ifndef _TUSB_CONFIG_H_ |
| 26 | +#define _TUSB_CONFIG_H_ |
| 27 | + |
| 28 | +#ifdef __cplusplus |
| 29 | + extern "C" { |
| 30 | +#endif |
| 31 | + |
| 32 | +//-------------------------------------------------------------------- |
| 33 | +// COMMON CONFIGURATION |
| 34 | +//-------------------------------------------------------------------- |
| 35 | +#ifdef USE_TINYUSB |
| 36 | + #define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE |
| 37 | +#else |
| 38 | + #define CFG_TUSB_RHPORT0_MODE OPT_MODE_NONE |
| 39 | +#endif |
| 40 | + |
| 41 | +// #define CFG_TUSB_MCU OPT_MCU_RP2040 |
| 42 | +#define CFG_TUSB_OS OPT_OS_PICO |
| 43 | + |
| 44 | +#define CFG_TUSB_DEBUG 0 |
| 45 | +#if CFG_TUSB_DEBUG |
| 46 | + #define tu_printf serial1_printf |
| 47 | + extern int serial1_printf(const char *__restrict __format, ...); |
| 48 | +#endif |
| 49 | + |
| 50 | +#define CFG_TUSB_MEM_SECTION |
| 51 | +#define CFG_TUSB_MEM_ALIGN TU_ATTR_ALIGNED(4) |
| 52 | + |
| 53 | +//-------------------------------------------------------------------- |
| 54 | +// DEVICE CONFIGURATION |
| 55 | +//-------------------------------------------------------------------- |
| 56 | + |
| 57 | +#define CFG_TUD_ENDOINT0_SIZE 64 |
| 58 | + |
| 59 | +//------------- CLASS -------------// |
| 60 | +#define CFG_TUD_CDC 1 |
| 61 | +#define CFG_TUD_MSC 1 |
| 62 | +#define CFG_TUD_HID 1 |
| 63 | +#define CFG_TUD_MIDI 1 |
| 64 | +#define CFG_TUD_VENDOR 1 |
| 65 | + |
| 66 | +// CDC FIFO size of TX and RX |
| 67 | +#define CFG_TUD_CDC_RX_BUFSIZE 256 |
| 68 | +#define CFG_TUD_CDC_TX_BUFSIZE 256 |
| 69 | + |
| 70 | +// MSC Buffer size of Device Mass storage |
| 71 | +#define CFG_TUD_MSC_BUFSIZE 512 |
| 72 | + |
| 73 | +// HID buffer size Should be sufficient to hold ID (if any) + Data |
| 74 | +#define CFG_TUD_HID_BUFSIZE 64 |
| 75 | + |
| 76 | +// MIDI FIFO size of TX and RX |
| 77 | +#define CFG_TUD_MIDI_RX_BUFSIZE 128 |
| 78 | +#define CFG_TUD_MIDI_TX_BUFSIZE 128 |
| 79 | + |
| 80 | +// Vendor FIFO size of TX and RX |
| 81 | +#define CFG_TUD_VENDOR_RX_BUFSIZE 64 |
| 82 | +#define CFG_TUD_VENDOR_TX_BUFSIZE 64 |
| 83 | + |
| 84 | +#ifdef __cplusplus |
| 85 | + } |
| 86 | +#endif |
| 87 | + |
| 88 | +#endif /* _TUSB_CONFIG_H_ */ |
0 commit comments