summaryrefslogtreecommitdiff
path: root/src/device/usbd.c
AgeCommit message (Collapse)Author
2026-07-09usbd: forward vendor EP0 requests; clear ep state on iso activatehathach
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HeF2gZ1M7GWkz6Av4BpKPg
2026-07-05Fix usbd empty builtin driver warning v2HiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-07-05Fix usbd empty builtin driver warningaineoae86-sys
Generated-by: OpenAI Codex Signed-off-by: aineoae86-sys <[email protected]>
2026-07-02license: use SPDX identifiers for src/ headers (#3749)Ha Thach
* license: use SPDX identifiers for src/ headers Replace the full ~20-line MIT license boilerplate on every src/ file with a two-line SPDX tag (SPDX-FileCopyrightText + SPDX-License-Identifier), following the REUSE convention used by CircuitPython and the Linux kernel. Removes ~3500 lines of duplicated boilerplate.
2026-06-22Merge remote-tracking branch 'tinyusb/master' into pr-osal-spin-deinitHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-06-22usbd: add osal_spin_deinit() to tud_deinit()HiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-06-16device: clamp EP0 OUT data copy to the control transfer buffer (#3705)Ha Thach
* device: clamp EP0 OUT data copy to the control transfer buffer usbd_control_xfer_cb() copied xferred_bytes from the EP0 bounce buffer into the requester's buffer with no bound. A non-compliant host that sends an OUT data packet larger than the control transfer's data_len (= min(len, wLength), the buffer capacity) would overflow that buffer and over-count total_xferred. Clamp xferred_bytes to the remaining buffer space before the memcpy and accounting.
2026-05-12feat: add MIDI 2.0 Device class driver (USB-MIDI 2.0)Saulo Veríssimo
Add native USB-MIDI 2.0 Device class driver to TinyUSB. Implements the USB-MIDI 2.0 specification with both Alt Setting 0 (MIDI 1.0 fallback) and Alt Setting 1 (UMP native) descriptor support. Driver features: - UMP (Universal MIDI Packet) read/write with atomic message framing - Protocol negotiation: Endpoint Discovery, Config Request/Notify, Function Block Discovery (embedded in driver) - Group Terminal Block descriptor via GET_DESCRIPTOR - Alt Setting switch handler with endpoint re-arm - Static allocation, no dynamic memory, ISR-safe Build system: - Register midi2d_* in usbd.c driver table - Add TUD_MIDI2_DESCRIPTOR macros to usbd.h - Add config defaults (CFG_TUD_MIDI2_*) to tusb_option.h - Add midi2_ump_word_count() to midi.h (shared by Device and Host) - Add midi2_device.c/h to family.cmake and CMakeLists.txt - Add midi2_device.h include to tusb.h All changes guarded by #if CFG_TUD_MIDI2 (default 0). Zero impact on existing drivers and examples. Tested: Raspberry Pi Pico (RP2040), Linux ALSA, Windows MIDI Services
2026-05-04fix usbd control to support wLength hackhathach
2026-05-04refactor: replace `tu_edpt_state_t` struct with `uint8_t` and update all ↵hathach
endpoint state handling methods and accesses
2026-05-04refactor `usbd.c`: extract `process_std_device_request` for clarityhathach
2026-05-04refactor `usbd.c`: centralize control transfer state management into ↵hathach
`_usbd_dev` structure and remove `usbd_control_reset`
2026-04-29deprecated `usbd_control.c` and merge its functionality into `usbd.c`hathach
2026-04-17remove duplicated tu_le16toh since we have converted the endian when setup.Fan DANG
2026-03-22Simplify tud_task() like in tuh_task()Cédric Berger
2026-03-06replace printer_to_hid example with printer_to_cdc examplehathach
fix printer GET_DEVICE_ID request weird wIndex (interface high, alt low)
2026-03-06Merge branch 'refs/heads/master' into fork/remiberthoz/device-class-printerhathach
2026-02-27Merge remote-tracking branch 'tinyusb/master' into dwc2_deinitHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-02-01Actually exit the loop in addition to logging. ENOTENOUGHCOFFEECédric Berger
2026-02-01Limit events processed by tud_task_ext() / tuh_task_ext()Cédric Berger
2026-01-06catch deinit errorHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-01-04Implement Printer Device ClassRémi Berthoz
2025-12-15Merge pull request #3364 from hathach/hcd_fsdevHa Thach
hcd: add stm32_fsdev driver
2025-12-15minor clean uphathach
2025-12-13Merge pull request #3358 from hathach/dwc2_cfgHa Thach
Add dcd_configure for dwc2 FIFO config
2025-12-13Merge branch 'refs/heads/master' into hcd_fsdevhathach
2025-12-12remove bitfield in usbd_device_t state to reduce code sizehathach
2025-12-11move host hacked bulk mps out of tu_edpt_validate()hathach
2025-12-11refactor binding ep and interface to driverhathach
2025-12-10move hwid into edpt stream for consistent APIhathach
2025-12-10minor formathathach
2025-12-10revert the usbd_edpt_xfer_fifo guardhathach
2025-12-08usbd: remove dcd_edpt_xfer_fifo ifdef guardZixun LI
Signed-off-by: Zixun LI <[email protected]>
2025-12-02Merge remote-tracking branch 'tinyusb/master' into dwc2_cfgZixun LI
2025-11-27Merge remote-tracking branch 'tinyusb/master' into hcd_fsdevZixun LI
Signed-off-by: Zixun LI <[email protected]>
2025-11-27usbd: clear state and call callback on deinitZixun LI
Signed-off-by: Zixun LI <[email protected]>
2025-11-21dcd: add tud_configure()HiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2025-11-21edpt stream support xfer_fifo for device CFG_TUD_EDPT_DEDICATED_HWFIFOhathach
cdc device omit ep buffer when hwfifo is supported
2025-11-20refactor tu_fifo, add tu_fifo_write/read/peek_n_access()hathach
2025-11-11Merge remote-tracking branch 'tinyusb/master' into ↵HiFiPhile
copilot/fix-dcd-edpt-xfer-issue Signed-off-by: HiFiPhile <[email protected]>
2025-11-07fix more alerts found by pvs-studiohathach
2025-11-04Fixed more alert found by PVS-Studiohathach
2025-10-31Merge remote-tracking branch 'tinyusb/master' into ↵HiFiPhile
copilot/fix-dcd-edpt-xfer-issue Signed-off-by: HiFiPhile <[email protected]>
2025-10-22Add is_isr parameter to usbd_edpt_xfer and usbd_edpt_xfer_fifocopilot-swe-agent[bot]
- Added bool is_isr parameter to usbd_edpt_xfer() and usbd_edpt_xfer_fifo() wrapper functions - These are called by class drivers to queue USB transfers - Updated all callers to pass false by default (non-ISR context) - Updated audiod_rx_xfer_isr() and audiod_tx_xfer_isr() to pass true (ISR context) - All 21 unit tests pass Co-authored-by: HiFiPhile <[email protected]>
2025-10-22Add is_isr parameter to dcd_edpt_xfer and dcd_edpt_xfer_fifocopilot-swe-agent[bot]
Co-authored-by: HiFiPhile <[email protected]>
2025-10-03Merge remote-tracking branch 'tinyusb/master' into uac1Mengsk
2025-10-01Minor fixesHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2025-09-30support UAC1 without IADMengsk
Signed-off-by: Mengsk <[email protected]>
2025-09-29Merge branch 'master' into fork/ennebi/mtphathach
2025-09-18Add usbd_edpt_xfer_fifo stubHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>