Commit Graph

4313 Commits

Author SHA1 Message Date
hathach
adf6cbfe03 cdch clean up and refactor, add explicit sync() API 2025-06-20 12:52:34 +07:00
hathach
5c974cee23 usbh make TU_API_SYNC() public, to implement sync() API, change return of sync API from uint8_t to tusb_xfer_result_t 2025-06-20 12:51:29 +07:00
hathach
221b5288e4 union ftdi/pl2303/acm data to save memory. 2025-06-19 18:14:24 +07:00
hathach
ce9140a150 rename tuh_cdc_get_local_line_coding to tuh_cdc_get_line_coding_local
add tuh_cdc_get_control_line_state_local()
implement tuh_cdc_get/set_dtr/rts() as inline
2025-06-19 17:57:21 +07:00
hathach
fa3ec44533 revert CFG_TUH_CDC_DTR/RTS_CONTROL_ON_ENUM 2025-06-19 17:22:26 +07:00
hathach
ec1a26251d clean up pl2303 type data 2025-06-19 17:05:21 +07:00
hathach
2adb305ea7 house keeping 2025-06-19 15:30:02 +07:00
hathach
9503883ba7 usbh: add new API tuh_descriptor_get_device_local()
cdc host: remove the local desc_dev and the get_device descriptor call for ftdi and pl2303
2025-06-18 23:44:03 +07:00
hathach
506edc6267 add get_itf_by_xfer() to better determine cdc interface from xfer complete callback 2025-06-18 18:55:31 +07:00
hathach
d4abf43f22 add common cdch_process_set_config() to safely complete set_config() when it failed.
driver_process_set_config() also pass drv index with user_data
2025-06-17 22:16:13 +07:00
hathach
4a44dd5c47 Merge branch 'master' into fork/IngHK/cdch_upgrade
# Conflicts:
#	README.rst
#	docs/reference/index.rst
#	src/class/cdc/cdc_device.c
#	src/class/cdc/cdc_host.c
2025-06-16 11:08:01 +07:00
HiFiPhile
1a36a1c1af audio: remove FIFO mutex, as audio streaming is always single producer single consumer
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-06-14 22:46:51 +02:00
HiFiPhile
eed294fbb5 audio: move ISO transfers into xfer_isr
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-06-14 22:46:51 +02:00
HiFiPhile
76a6834659 USBD: introduce xfer_isr. 2025-06-14 22:45:40 +02:00
HiFiPhile
ea02e929b4 audio: buffer macro update
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-06-13 22:49:06 +02:00
HiFiPhile
e19ff3ecae Add cache line size alignment to buffer macro
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-06-13 22:49:06 +02:00
HiFiPhile
e84efd2771 Add STM32 DWC2 cache support
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-06-13 15:21:04 +02:00
Ha Thach
e95973d346 Merge pull request #3137 from HiFiPhile/uac_simplify
uac2: remove support fifo
2025-06-12 22:18:17 +07:00
hathach
7d66a3e775 merge n6 and h7rs (same config) 2025-06-12 21:20:49 +07:00
hathach
386f33807a Merge branch 'master' into fork/james-advatek/stm32n657nucleo 2025-06-12 11:02:54 +07:00
hathach
14124c1735 add h7rs to ci matrix 2025-06-11 19:35:20 +07:00
hathach
d3d505e8f7 Merge branch 'master' into fork/HiFiPhile/h7rs 2025-06-11 16:23:54 +07:00
Cédric Berger
d533650105 Fix TUH_EPSIZE_BULK_MPS macro
TUH_EPSIZE_BULK_MPS should be set based on TUH_OPT_HIGH_SPEED, not TUD_OPT_HIGH_SPEED
2025-06-09 16:56:02 +02:00
HiFiPhile
d61077cbad Merge pull request #3135 from andrewleech/ncm-link-state-control
Add USB NCM link state control support
2025-06-09 14:25:25 +02:00
HiFiPhile
69f6b57772 Code reformat
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-06-08 14:31:11 +02:00
HiFiPhile
1ccb10e3f1 Fix ECM compile
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-06-08 13:53:23 +02:00
James Sandison
5c4b2c75d2 docs: update dwc2_info.md 2025-06-04 13:21:34 +10:00
James Sandison
56c9521abd chore: squash previous commits from other branches 2025-06-04 11:21:27 +10:00
HiFiPhile
dc0038f614 uac2: remove support fifo
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-05-29 13:56:46 +02:00
Andrew Leech
9021efcacb Add link state control support for ECM mode
Extends the link state control feature to CDC-ECM mode.
RNDIS mode prints state changes but doesn't send notifications
to the host yet (would require RNDIS_INDICATE_STATUS_MSG).

For ECM:
- Tracks link state and sends proper CDC notifications
- Handles notification endpoint busy conditions
- Only sends connection notification when link is actually up

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-29 09:36:38 +10:00
Andrew Leech
5de4a23abe Add USB NCM link state control support
This adds the ability to dynamically control the network link state
for NCM devices. The host OS will see the network interface as
connected/disconnected based on the link state.

New API:
- tud_network_link_state(rhport, is_up): Set link up/down state

Example updates:
- Added button control to toggle link state
- Fixed LWIP integration to properly handle link state changes
- Added printf to show correct protocol (NCM vs RNDIS/ECM)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-29 09:36:38 +10:00
hathach
132c55aca0 add OPT_MCU_MAX32665 2025-05-28 08:38:26 +07:00
Ha Thach
8f077f9295 Merge pull request #3111 from hathach/ci_vbus 2025-05-23 21:50:00 +07:00
HiFiPhile
1a13bd8eba Add comment about CFG_TUD_CI_HS_VBUS_CHARGE
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-05-23 13:27:27 +02:00
hathach
e41a63c60d add usbh_spin_lock/unlock() use spinlock instead of atomic flag for hcd max3421 2025-05-21 15:27:18 +07:00
hathach
58dfc126ac remove unused dwc2_critical.h 2025-05-21 14:36:53 +07:00
hathach
5551a3e430 add usbd_spin_lock/unlock for driver usage 2025-05-21 11:41:06 +07:00
hathach
c1d23a0a92 osal_spin skipping lock/unlock when executed in isr 2025-05-21 11:19:07 +07:00
hathach
a4875fefea rename osal_critcal to osal_spinlock
add spinlock implementation for most rtos
2025-05-20 17:01:31 +07:00
hathach
bb1d348eb3 implement osal critical for none/freertos/pico-sdk 2025-05-19 22:51:40 +07:00
hathach
9aea7751f2 dwc2 only enter critical in isr with multiple core CPUs 2025-05-19 20:04:20 +07:00
hathach
72ee742761 add osal_critical API() for use with dwc2 2025-05-19 20:04:19 +07:00
Tomas Rezucha
c8baba10f9 fix(dcd): Fixed race condition on device disconnect
TinyUSB does not provide any locking means to protect the DCD variables.
This can lead to race conditions when the user is trying to submit
a transfer while the device is being disconnected. This can cause
the device to be in an inconsistent state, leading to a crash or
undefined behavior.

This commit adds a spin-lock to protect the DCD variables during
device disconnect.

Closes https://github.com/espressif/esp-idf/issues/9691
Also reported in https://github.com/espressif/esp-usb/pull/131
2025-05-19 20:04:16 +07:00
hathach
67389f37f2 follow up to pr3118, interface also end with IAD. Add more checks 2025-05-16 16:39:53 +07:00
HiFiPhile
531fb69531 Merge pull request #3118 from ZakDanger/vendor_device_fix
vendor device open fix for descriptor parsing
2025-05-16 10:25:28 +02:00
HiFiPhile
6346fbec16 Merge branch 'master' into h7rs 2025-05-15 21:40:36 +02:00
hathach
fe4446090e fix dual example for rp2350 conflict printf and cdc_printf 2025-05-13 16:27:26 +07:00
hathach
baf67539fc fix warnings, minor clean up 2025-05-13 12:16:22 +07:00
HiFiPhile
a2117d5d0f simplify vendord_open parsing loop
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-05-09 16:43:19 +02:00
ZakDanger
6b30a61bdb revert 'end fix' 2025-05-09 20:44:11 +10:00