Skip to content

Commit 756291a

Browse files
committed
update tinyusb
1 parent a18a1f5 commit 756291a

File tree

12 files changed

+222
-481
lines changed

12 files changed

+222
-481
lines changed

cores/nRF5/usb/tinyusb/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ TinyUSB is an open-source cross-platform USB Host/Device stack for embedded syst
2424
Support multiple device configurations by dynamically changing usb descriptors. Low power functions such as suspend, resume and remote wakeup. Following device classes are supported:
2525

2626
- Communication Class (CDC)
27-
- Human Interface Device (HID): Keyboard, Mouse, Generic
27+
- Human Interface Device (HID): Keyboard, Mouse, Gamepad etc ...
2828
- Mass Storage Class (MSC)
2929
- Musical Instrument Digital Interface (MIDI)
3030

cores/nRF5/usb/tinyusb/src/class/cdc/cdc_device.h

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ ATTR_WEAK void tud_cdc_rx_wanted_cb(uint8_t itf, char wanted_char);
9494
ATTR_WEAK void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts);
9595
ATTR_WEAK void tud_cdc_line_coding_cb(uint8_t itf, cdc_line_coding_t const* p_line_coding);
9696

97+
/** @} */
98+
/** @} */
99+
97100
//--------------------------------------------------------------------+
98101
// INTERNAL USBD-CLASS DRIVER API
99102
//--------------------------------------------------------------------+
@@ -104,43 +107,8 @@ bool cdcd_control_request_complete (uint8_t rhport, tusb_control_request_t const
104107
bool cdcd_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes);
105108
void cdcd_reset (uint8_t rhport);
106109

107-
108-
//--------------------------------------------------------------------+
109-
// Interface Descriptor Template
110-
//--------------------------------------------------------------------+
111-
112-
// Length of template descriptor: 66 bytes
113-
#define TUD_CDC_DESC_LEN (8+9+5+5+4+5+7+9+7+7)
114-
115-
// CDC Descriptor Template
116-
// interface number, string index, EP notification address and size, EP data address (out,in) and size.
117-
#define TUD_CDC_DESCRIPTOR(_itfnum, _stridx, _ep_notif, _ep_notif_size, _epout, _epin, _epsize) \
118-
/* Interface Associate */\
119-
0x08, TUSB_DESC_INTERFACE_ASSOCIATION, _itfnum, 0x02, TUSB_CLASS_CDC, CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL, CDC_COMM_PROTOCOL_ATCOMMAND, 0x00,\
120-
/* CDC Control Interface */\
121-
0x09, TUSB_DESC_INTERFACE, _itfnum, 0x00, 0x01, TUSB_CLASS_CDC, CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL, CDC_COMM_PROTOCOL_ATCOMMAND, _stridx,\
122-
/* CDC Header */\
123-
0x05, TUSB_DESC_CLASS_SPECIFIC, CDC_FUNC_DESC_HEADER, U16_TO_U8S_LE(0x0120),\
124-
/* CDC Call */\
125-
0x05, TUSB_DESC_CLASS_SPECIFIC, CDC_FUNC_DESC_CALL_MANAGEMENT, 0x00, (_itfnum) + 1,\
126-
/* CDC ACM: support line request */\
127-
0x04, TUSB_DESC_CLASS_SPECIFIC, CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT, 0x02,\
128-
/* CDC Union */\
129-
0x05, TUSB_DESC_CLASS_SPECIFIC, CDC_FUNC_DESC_UNION, _itfnum, (_itfnum) + 1,\
130-
/* Endpoint Notification */\
131-
0x07, TUSB_DESC_ENDPOINT, _ep_notif, TUSB_XFER_INTERRUPT, U16_TO_U8S_LE(_ep_notif_size), 0x10,\
132-
/* CDC Data Interface */\
133-
0x09, TUSB_DESC_INTERFACE, (_itfnum)+1, 0x00, 0x02, TUSB_CLASS_CDC_DATA, 0x00, 0x00, 0x00,\
134-
/* Endpoint Out */\
135-
0x07, TUSB_DESC_ENDPOINT, _epout, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0x00,\
136-
/* Endpoint In */\
137-
0x07, TUSB_DESC_ENDPOINT, _epin, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0x00
138-
139110
#ifdef __cplusplus
140111
}
141112
#endif
142113

143114
#endif /* _TUSB_CDC_DEVICE_H_ */
144-
145-
/** @} */
146-
/** @} */

cores/nRF5/usb/tinyusb/src/class/hid/hid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ typedef enum
179179
/// Standard HID Boot Protocol Keyboard Report.
180180
typedef struct ATTR_PACKED
181181
{
182-
uint8_t modifier; /**< Keyboard modifier byte, indicating pressed modifier keys (a combination of HID_KEYBOARD_MODIFER_* masks). */
182+
uint8_t modifier; /**< Keyboard modifier (KEYBOARD_MODIFER_* masks). */
183183
uint8_t reserved; /**< Reserved for OEM use, always set to 0. */
184184
uint8_t keycode[6]; /**< Key codes of the currently pressed keys. */
185185
} hid_keyboard_report_t;

0 commit comments

Comments
 (0)