Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
heiso committed Apr 14, 2024
1 parent 6a01a10 commit d1d0206
Show file tree
Hide file tree
Showing 19 changed files with 3,203 additions and 2,744 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
"editor.quickSuggestions": {
"strings": "on"
},
"tailwindCSS.classAttributes": ["class", "className", ".*Styles", ".*Class"]
"tailwindCSS.classAttributes": ["class", "className", ".*Styles", ".*Class"],
"files.associations": {
"main.h": "c"
}
}
4 changes: 2 additions & 2 deletions firmware/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1072420442826958151" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="922630805834284133" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand All @@ -16,7 +16,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1072420442826958151" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="922630805834284133" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
10 changes: 1 addition & 9 deletions firmware/Core/Inc/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ struct key {
struct actuation actuation;
};

struct hid_generic_inout_report_key {
struct serial_key {
uint8_t row;
uint8_t column;
uint16_t idle_value;
Expand All @@ -140,14 +140,6 @@ struct hid_generic_inout_report_key {
enum actuation_status status;
};

struct hid_generic_inout_report {
struct hid_generic_inout_report_key keys[6];
uint8_t duration;
uint8_t trigger_offset;
uint8_t reset_threshold;
uint8_t rapid_trigger_offset;
};

struct user_config {
uint8_t trigger_offset;
uint8_t reset_threshold;
Expand Down
2 changes: 1 addition & 1 deletion firmware/Core/Inc/stm32f4xx_hal_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
#define MAC_ADDR5 0U

/* Definition of the Ethernet driver buffers size and count */
#define ETH_RX_BUF_SIZE /* buffer size for receive */
#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
Expand Down
17 changes: 13 additions & 4 deletions firmware/Core/Inc/tusb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,23 @@ extern "C" {
#endif

//------------- CLASS -------------//
#define CFG_TUD_HID 2
#define CFG_TUD_CDC 0
#define CFG_TUD_HID 1
#define CFG_TUD_CDC 1
#define CFG_TUD_MSC 0
#define CFG_TUD_MIDI 0
#define CFG_TUD_VENDOR 0
#define CFG_TUD_VENDOR 1

// HID buffer size Should be sufficient to hold ID (if any) + Data
#define CFG_TUD_HID_EP_BUFSIZE 64
#define CFG_TUD_HID_EP_BUFSIZE 16

// CDC FIFO size of TX and RX
#define CFG_TUD_CDC_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
#define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)

// Vendor FIFO size of TX and RX
// If not configured vendor endpoints will not be buffered
#define CFG_TUD_VENDOR_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
#define CFG_TUD_VENDOR_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)

#ifdef __cplusplus
}
Expand Down
25 changes: 17 additions & 8 deletions firmware/Core/Inc/usb_descriptors.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,31 @@
#ifndef USB_DESCRIPTORS_H_
#define USB_DESCRIPTORS_H_

#define HID_GENERIC_INOUT_REPORT_BUFFSIZE 64

enum {
REPORT_ID_KEYBOARD = 1,
REPORT_ID_CONSUMER_CONTROL,
};

enum {
REPORT_ID_ANALOG = 1,
REPORT_ID_CONFIG,
VENDOR_REQUEST_WEBUSB = 1,
VENDOR_REQUEST_MICROSOFT = 2
};

enum {
ITF_0_NUM_KEYBOARD = 0,
ITF_0_NUM_TOTAL
};

enum {
ITF_NUM_KEYBOARD,
ITF_NUM_GENERIC_INOUT,
ITF_NUM_TOTAL
ITF_1_NUM_CDC = 0,
ITF_1_NUM_CDC_DATA,
ITF_1_NUM_VENDOR,
ITF_1_NUM_TOTAL
};

enum USB_MODE {
USB_MODE_SERIAL = 0,
USB_MODE_HID
};

#endif /* USB_DESCRIPTORS_H_ */
#endif /* USB_DESCRIPTORS_H_ */
Loading

0 comments on commit d1d0206

Please sign in to comment.