summaryrefslogtreecommitdiff
path: root/hid/pico/src/tusb_config.h
diff options
context:
space:
mode:
Diffstat (limited to 'hid/pico/src/tusb_config.h')
-rw-r--r--hid/pico/src/tusb_config.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/hid/pico/src/tusb_config.h b/hid/pico/src/tusb_config.h
new file mode 100644
index 00000000..c29b23ad
--- /dev/null
+++ b/hid/pico/src/tusb_config.h
@@ -0,0 +1,67 @@
+/* ========================================================================= #
+# #
+# KVMD - The main PiKVM daemon. #
+# #
+# Copyright (C) 2018-2023 Maxim Devaev <[email protected]> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
+# #
+# ========================================================================= */
+
+
+#pragma once
+
+
+//--------------------------------------------------------------------
+// Common config
+//--------------------------------------------------------------------
+
+//#define CFG_TUSB_DEBUG 100
+
+#define CFG_TUSB_OS OPT_OS_PICO
+
+// Enable device stack
+#define CFG_TUD_ENABLED 1
+
+// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
+//#define CFG_TUSB_DEBUG 100
+
+// USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
+// Tinyusb use follows macros to declare transferring memory so that they can be put
+// into those specific section.
+// - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
+// - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
+#ifndef CFG_TUSB_MEM_SECTION
+# define CFG_TUSB_MEM_SECTION
+#endif
+
+#ifndef CFG_TUSB_MEM_ALIGN
+# define CFG_TUSB_MEM_ALIGN __attribute__((aligned(4)))
+#endif
+
+
+//--------------------------------------------------------------------
+// Device config
+//--------------------------------------------------------------------
+
+#ifndef CFG_TUD_ENDPOINT0_SIZE
+# define CFG_TUD_ENDPOINT0_SIZE 64
+#endif
+
+#define CFG_TUD_HID 2
+
+// HID buffer size Should be sufficient to hold ID (if any) + Data
+#ifndef CFG_TUD_HID_EP_BUFSIZE
+# define CFG_TUD_HID_EP_BUFSIZE 16
+#endif