Reinhard Panhuber
185414721f
Formating
2021-02-12 18:04:45 +01:00
Reinhard Panhuber
a9fd0a454a
Complete redesign of audio driver.
2021-02-12 16:28:41 +01:00
ndinsmore
09868434cd
Fixes RP2040 buffer reallocation overrun problem ( #642 )
...
Fix running out of memory on a device that repeatedly closes and opens an endpoint. This is a workaround at the moment. A better solution would be to implement reclaiming usb buffer memory when closing an endpoint (i.e. implement dcd_edpt_close).
2021-02-12 08:16:46 +00:00
Ha Thach
04ab6b4082
Merge pull request #648 from hathach/rename-dfu-rt-to-runtime
...
Rename dfu rt to runtime
2021-02-11 15:29:55 +07:00
Ha Thach
d4281291e5
Merge pull request #647 from hathach/correct-fs-bulk-epsize
...
more epsize checking per type
2021-02-11 12:36:19 +07:00
hathach
e12c25ec2c
rename dfu_rt to dfu_runtime for easy reading
...
also rename tud_dfu_rt_reboot_to_dfu to tud_dfu_runtime_reboot_to_dfu_cb
2021-02-11 12:05:22 +07:00
hathach
9812cfc6c6
clean up
2021-02-11 11:48:34 +07:00
hathach
919bb9ce38
more epsize checking per type
2021-02-11 11:45:24 +07:00
hathach
49bc97b0ca
remove the requirement of std SET/CLEAR_FEATURE must not return zlp status
2021-02-11 11:22:02 +07:00
hathach
d2b8e591f6
tud_hid_report_complete_cb() API
...
update hid composite to make use of tud_hid_report_complete_cb() for
sending reports when possible.
2021-02-09 15:57:29 +07:00
Ha Thach
ecd16cf24b
Merge pull request #637 from tfx2001/master
...
add basic support for rt-thread
2021-02-08 20:10:07 +07:00
tfx2001
1b678eccf5
add basic support for rt-thread
2021-02-08 20:46:49 +08:00
hathach
72bcc0685c
add tud_hid_n_gamepad_report() helper for gamepad report
...
- Add gamepad to hid_composite example. Though it needs a bit of extra
work but it will come later as separated PR.
2021-02-08 19:08:16 +07:00
hathach
b2019e4d71
enhance gampepad report with dpad/hat support
...
add hid_gamepad_report_t along with GAMEPAD_BUTTON_ and GAMEPAD_HAT_
enum
2021-02-08 16:10:13 +07:00
Ha Thach
be1bd74b4b
Merge pull request #618 from homeodor/master
...
A CDC-like blocking behaviour for MIDI, incl. SysEx
2021-02-06 12:30:28 +07:00
hathach
465ea7a66e
increase TUSB_VERSION_ to 0.8.0
2021-02-05 22:37:22 +07:00
hathach
bb2f93d427
prepare for release
2021-02-05 20:41:41 +07:00
Ha Thach
78f50518a4
Merge pull request #610 from hathach/rp2040-followup2
...
Rp2040 followup2
2021-02-01 12:44:53 +07:00
Ha Thach
a044578a33
Merge pull request #601 from majbthrd/start_pi2tu
...
start the assimilation of Pi Pico into TU
2021-02-01 12:43:59 +07:00
Reinhard Panhuber
84406f1654
Rework audio driver
2021-01-31 19:08:23 +01:00
Alexander Golovanov
2a34be2eb0
A CDC-like blocking behaviour
2021-01-30 04:11:08 +03:00
Michael Himing
c4f7ea09f1
Fix midi sysex sending bug
2021-01-28 20:31:11 +11:00
hathach
1abf9eeb80
clean up rp2040 assigned_address, remove panic from remote_wakeup
2021-01-27 13:18:03 +07:00
hathach
c3c4f65fea
wrap rp2040_usb around opt mcu
2021-01-27 13:04:38 +07:00
Ha Thach
045674745a
Merge pull request #604 from kamtom480/spresense-sdk-2.0.2
...
Update Spresense SDK and fix dcd issues
2021-01-25 22:55:46 +07:00
Kamil Tomaszewski
5f999fa6a0
Fix dcd issues on cxd56
...
Pass the next setup package when USB stack is ready to receive it.
When the transfer is 0 on EP0 send complete to the USB stack
Pass the data received after the setup package to the USB stack.
2021-01-25 11:13:56 +01:00
hathach
ec458292fe
fix host build
2021-01-25 13:25:47 +07:00
Peter Lawrence
edc2224118
rp2040: start to adopt TU coding conventions
2021-01-23 20:21:58 -06:00
Peter Lawrence
587d1b334b
rp2040_hcd: check pointer before using
2021-01-23 20:19:10 -06:00
hathach
67a9cdc35b
fix compiler warning
2021-01-22 11:33:25 +07:00
Ha Thach
1e134cbb31
Merge branch 'master' into pico
2021-01-21 16:35:13 +07:00
Reinhard Panhuber
f1551d7a5f
Add __restrict keyword and memore alignment to src/dst pointer of
...
_tu_fifo_read_from_const_src_ptr()
_tu_fifo_write_to_const_dst_ptr()
2021-01-20 20:14:23 +01:00
graham sanderson
e0aa405d19
RP2040 support
2021-01-19 19:52:07 -06:00
Reinhard Panhuber
93ec6f3735
Adjust #include "dcd.h" to "device/dcd.h", the same for usbd.h in usbd.c
2021-01-19 17:10:08 +01:00
Reinhard Panhuber
56edc2b261
Change names from edpt_ISO_xfer to edpt_iso_xfer
2021-01-19 10:50:19 +01:00
Reinhard Panhuber
99e6bc3720
Explicitly add cast to uint32_t before shifting uint8 to left
2021-01-18 17:54:08 +01:00
Reinhard Panhuber
595a88b34c
Correct include path to #include "common/tusb_fifo.h"
2021-01-18 17:38:32 +01:00
Reinhard Panhuber
dff588d772
Implement dcd_edpt_ISO_xfer() and adapt transmission scheme
2021-01-18 17:15:23 +01:00
Reinhard Panhuber
2284db1fb5
Add usbd_edpt_ISO_xfer()
2021-01-18 17:14:17 +01:00
Reinhard Panhuber
51c80630f5
Clean up
2021-01-18 17:13:06 +01:00
Reinhard Panhuber
8450bc3225
Add FIFO copy modes: tu_fifo_copy_mode_t
...
Allows to copy from/to constant pointers required for STM32 hardware
FIFO copies.
2021-01-18 17:12:39 +01:00
Reinhard Panhuber
84c383061f
Add tusb_fifo.h header file to dcd.h
2021-01-18 17:08:59 +01:00
Reinhard Panhuber
3a3ada0c57
Implement the usage of usbd_edpt_ISO_xfer()
2021-01-18 17:07:15 +01:00
Reinhard Panhuber
bdbcb8df39
Add tu_fifo_read_n_into_other_fifo() to copy into from FIFO into another
...
Fix overflow in tu_fifo_write_n()
2021-01-17 11:55:33 +01:00
Reinhard Panhuber
485d8fa77e
Merge remote-tracking branch 'upstream/master' into edpt_ISO_xfer
2021-01-09 12:10:08 +01:00
hathach
d33b22d127
fix ci
2021-01-08 22:48:52 +07:00
hathach
6e6e6265e4
use dcd_event_bus_reset() with speed to replace bus_signal
2021-01-08 22:34:36 +07:00
hathach
cca27fc383
another rename
2021-01-08 16:54:50 +07:00
hathach
201ea7ca6d
remove inline for update_grxfsiz
2021-01-08 16:38:41 +07:00
hathach
9998e8a665
more minor work
2021-01-08 16:34:36 +07:00
hathach
86c34a9a33
minor clean up following pr581
2021-01-08 16:25:30 +07:00
Ha Thach
1f00a182c4
Merge pull request #581 from hathach/dcd_synopsis_mem_allocation
...
Dcd synopsis mem allocation
2021-01-08 12:45:46 +07:00
hathach
3e1d85eed2
comment clean up
2021-01-08 11:43:26 +07:00
hathach
cc5dfd03cd
update comment and correct the size to 8+2
2021-01-08 11:21:26 +07:00
hathach
60620dca42
walkround for samd21 setup_packet overflow
...
increase setup packet size from 8 to 12, since USB DMA controller is
suspected to overflow the buffer with 2 extra bytes
2021-01-08 01:21:03 +07:00
hathach
29f84b1602
change default CFG_TUD_HID_EP_BUFSIZE from 16 to 64
2021-01-07 11:58:05 +07:00
Reinhard Panhuber
f2b4567a2b
Correct function declaration
2021-01-04 17:15:42 +01:00
Reinhard Panhuber
2fa500af18
Minor corrections for PR
...
- externerlize code into functions
- correct comments
2021-01-04 17:00:23 +01:00
Reinhard Panhuber
37bb14678a
Remove too verbose comment
2021-01-04 12:06:16 +01:00
Reinhard Panhuber
09d8ead4b8
Start changes - not yet finished
2021-01-04 12:02:08 +01:00
Reinhard Panhuber
13b499f910
Clean up
2021-01-03 17:59:50 +01:00
Reinhard Panhuber
56c47188d8
Rework USB FIFO allocation scheme and allow RX FIFO size reduction
2021-01-03 16:11:56 +01:00
Ha Thach
1491bc9162
Merge pull request #569 from kkitayam/add_support_for_frdm_kl25z
...
add support for frdm_kl25z
2020-12-25 23:03:23 +07:00
Ha Thach
08f8f488a0
Merge pull request #571 from HiFiPhile/iar_fifo
...
Fix IAR error on memcpy and warnings.
2020-12-24 12:03:57 +07:00
HiFIPhile
baa5417f3e
Fix IAR error on memcpy and warnings.
...
Signed-off-by: MasterPhi <admin@hifiphile.com>
2020-12-23 16:54:55 +01:00
kkitayam
2737166d2b
fixed wrong direction to enable EP in dcd_edpt_open.
...
fixed incorrect handling of STALL other than EP0
convert tabs to spaces
removed unused symbols
2020-12-23 20:32:29 +09:00
Yakovenko Andrey
bdee6397eb
Added MSC read10 and write10 function
2020-12-23 12:52:51 +02:00
Ha Thach
b580a0b7f3
Merge pull request #573 from HiFiPhile/scsi_mode_sense6_t
...
IAR build error fixes
2020-12-22 17:17:36 +07:00
HiFiPhile
c8dc7f807f
Fix more warnings.
...
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2020-12-22 10:13:10 +01:00
HiFiPhile
b3c0d417ef
Fix error if "Required Prototype" is selected.
...
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2020-12-20 23:10:34 +01:00
HiFiPhile
13e6afd589
Fix scsi_mode_sense6_t padding, which cause IAR compiler internal error.
...
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2020-12-20 22:56:39 +01:00
kkitayam
2bbfc56bd8
added support for frdm_kl25z
2020-12-18 00:07:50 +09:00
hathach
8b34f2fca8
fix ci
2020-11-27 16:07:13 +07:00
hathach
94527951a0
add bus suspend & resume support for esp32s2
2020-11-27 15:54:55 +07:00
hathach
f5e13d5898
msc only invoke scsi complete callback after status transaction is complete
2020-11-24 23:42:30 +07:00
hathach
148eea1417
add tud_connected()
...
which return true as long as we receive the very first SETUP packet from
host.
2020-11-24 21:49:12 +07:00
hathach
4b4f880785
add tud_ready() check in tud_cdc_n_write_flush()
...
other clean up
2020-11-23 23:40:13 +07:00
Ha Thach
308028e17c
Merge branch 'master' into cdc_without_dtr
2020-11-23 23:25:55 +07:00
hathach
14138f105e
have tusb_init() return true instead of TUSB_ERROR_NONE
2020-11-23 13:12:51 +07:00
hathach
e4144d8b47
remove control_complete
2020-11-20 17:21:01 +07:00
hathach
cebb375eac
migrate audio device to new control xfer cb
2020-11-20 17:20:05 +07:00
hathach
c4bc8b2561
migrate net device to new control xfer cb
2020-11-20 16:59:33 +07:00
hathach
d6461abe78
clean up
2020-11-20 16:30:03 +07:00
hathach
9f853685ae
migrate bth device to new control xfer cb
2020-11-20 16:13:58 +07:00
hathach
61ad7bef71
migrate vendor device to new control xfer cb
2020-11-20 15:50:11 +07:00
hathach
3cc1979adb
migrate dfu runtime device to new control xfer cb
2020-11-20 15:42:32 +07:00
hathach
7df979673d
migrate usbtmc device to new control xfer cb
2020-11-20 15:38:56 +07:00
hathach
8813f9d3b8
clean up
2020-11-20 15:33:05 +07:00
hathach
e2abb089f4
migrate midi device to new control xfer cb
2020-11-20 15:30:36 +07:00
hathach
dc9a309839
migrate hid device to new control xfer cb
2020-11-19 22:00:49 +07:00
hathach
dd07fecc5f
migrate cdc_device to new control_xfer_cb
2020-11-19 21:26:06 +07:00
hathach
3c31d08051
merge class driver control_request & control_complete to control_xfer_cb()
...
migrated msc_device
2020-11-19 21:01:33 +07:00
Jan Dümpelmann
339b1a7723
Remove dcd_edpt_xfer_abort from DCD header
2020-11-18 11:12:06 +01:00
Jan Dümpelmann
54e29e9ff4
Implementation of the discussed changes
...
- remove usbd_edpt_xfer_abort
- rename tu_fifo_change_mode to tu_fifo_set_mode
- remove CFG_TUD_CDC_CLEAR_AT_CONNECTION definition
- remove auto fifo clear at connection event
- add tud_cdc_n_write_clear function
2020-11-18 09:42:50 +01:00
hathach
496c7c701a
fix ci
2020-11-09 01:23:19 +07:00
hathach
23b6b66f4d
release 0.7.0 with changelog and doc update
2020-11-07 23:43:39 +07:00
Ha Thach
a708ab6254
Merge pull request #553 from hathach/host-async-control
...
Host async control
2020-11-07 10:52:14 +07:00
hathach
2907b1e438
clean up
2020-11-07 10:37:33 +07:00
Jan Dümpelmann
af9f0f1cd6
Merge remote-tracking branch 'hathach/master' into cdc_without_dtr
2020-11-04 17:11:01 +01:00
Ha Thach
075334af80
Merge pull request #547 from hathach/cdc-auto-write-flush
...
enable cdc auto flush on write()
2020-11-03 11:42:17 +07:00
Ha Thach
720909e7f8
Merge pull request #545 from j4cbo/master
...
Rename CDC_COMM_SUBCLASS_ETHERNET_NETWORKING_CONTROL_MODEL
2020-11-02 22:07:05 +07:00
hathach
6fcd540cb6
enable cdc auto flush on write()
...
if there is enough data in the fifo
2020-11-02 16:50:46 +07:00
hathach
14461beffa
remove legacy blocking usbh_control_xfer()
...
reworking cdc host driver
2020-11-02 09:19:34 +07:00
hathach
2efdc2fb64
get hub work more reliably
2020-11-02 08:46:24 +07:00
hathach
6eafdfab93
update usbh with hub to use async control transfer
...
work ok with msc + hub, but definitely need more testing.
2020-11-02 00:54:04 +07:00
hathach
e029d6d726
added host set_config driver
...
to resolve control conflict with SET_CONFIGURE for class driver
- open will be called to open endpoint only
- set_config called later to initialized class driver
2020-11-01 17:46:46 +07:00
hathach
67ac40b98d
house keeping: make tu_print_mem format easier to compare with hex2dump
2020-11-01 13:37:56 +07:00
Jacob Potter
3ea8138750
Rename CDC_COMM_SUBCLASS_ETHERNET_NETWORKING_CONTROL_MODEL
...
This was a confusing name; "Ethernet control model" (CDC ECM)
and "network control model" (CDC NCM) are two separate USB subclasses.
2020-10-31 10:57:53 -06:00
Ha Thach
065991e011
Merge pull request #543 from majbthrd/net_tweaks
...
net_device: re-factor code so as to not be specific to lwIP
2020-10-26 23:43:24 +07:00
Peter Lawrence
a097b7e51a
net_device: re-factor code so as to not be specific to lwIP
2020-10-24 20:27:57 -05:00
Jacob Potter
229be75a98
Move into if statement
2020-10-24 17:16:05 -06:00
Jacob Potter
01996457c8
CR feedback: compare CFG_TUSB_RHPORT1_MODE instead of using new macro
2020-10-24 17:11:32 -06:00
Peter Lawrence
f5b72f5796
net_device: tweak 'pbuf chain' implementation
2020-10-24 17:29:47 -05:00
Jacob Potter
c87ed8eff1
Allow use of internal FS PHY on OTG_HS interface
...
Some ST parts (like STM32F74xxx / STM32F75xxx) allow the USB_OTG_HS core to be used with
either an external high-speed ULPI PHY or an internal full-speed-only (12mbps) PHY. Currently
the code assumes than an ULPI PHY is used unless the chip has an internal high-speed PHY
(`#if defined(USB_HS_PHYC)`), with no provision to use the internal FS PHY.
2020-10-18 17:01:17 -06:00
Jerzy Kasenberg
8669fd7383
audio: Add two channel feature unit descriptor
...
Feature unit descriptor size depends on number of channels.
So far only single channel feature unit was present.
This change adds feature unit descriptor for two channels.
2020-10-15 15:37:40 +02:00
Jerzy Kasenberg
db70a35044
osal_none: Fix queue definition
...
OSAL_QUEUE_DEF was not updated while FIFO was changed
to use unmasked pointers.
Two fields that are crucial to new functionality were left
uninitialized resulting in FIFO slowing down in time.
2020-10-13 16:34:44 +02:00
hathach
3623f578a4
more clean up
2020-10-13 14:11:17 +07:00
hathach
d92d1a03ca
clean up
2020-10-13 13:45:22 +07:00
hathach
437ccac696
implement tuh_msc_scsi_inquiry() / tuh_msc_read_capacity() / tuh_msc_get_maxlun()
2020-10-13 13:23:33 +07:00
hathach
9c07a2a4e2
rework msc host
...
- msc host enum is now async
- implement async tuh_msc_scsi_command() / tuh_msc_request_sense() /
tuh_msc_test_unit_ready()
2020-10-13 00:07:51 +07:00
hathach
87b989e8b4
add usbh_edpt_claim/release
...
implement USBH_EVENT_FUNC_CALL
2020-10-12 00:35:45 +07:00
hathach
b5d4c8185d
Merge branch 'master' into host-async-control
2020-10-11 16:22:12 +07:00
Ha Thach
6ce5395947
Merge pull request #525 from kasjer/kasjer/da1469x-iso
...
da1469x iso support
2020-10-11 16:12:20 +07:00
Ha Thach
80c509a0f3
Merge pull request #520 from salkinium/feature/misc_enhancements
...
STM32F3 IRQ remap option and some minor improvements
2020-10-11 14:55:06 +07:00
Ha Thach
762b390433
Merge pull request #521 from PanRe/uac2
...
Uac2
2020-10-10 14:33:42 +07:00
Niklas Hauser
f914e48d25
Dynamically check STM32F3 IRQ remap option
2020-10-10 05:02:37 +02:00
Reinhard Panhuber
032e84c9be
Revert dcd_alloc_mem_for_conf() but keep changes from @kasjer for ISO EP
...
Add tud_audio_set_itf_close_EP_cb()
2020-10-09 19:50:05 +02:00
hathach
8ba0c362cc
update tud_hid_boot_mode_cb/tud_hid_set_idle_cb support mul interfaces
...
also clean up code
2020-10-09 20:51:20 +07:00
hathach
13abcb953f
rename multiple hid callback
2020-10-09 20:24:10 +07:00
Ha Thach
c2a0612885
Merge pull request #524 from zlittell/f_MultipleHIDInterfaces
...
Feature multiple hid interfaces
2020-10-09 00:28:13 +07:00
Zachery Littell
a4ba1f0827
Fix tu_verify args
2020-10-08 12:08:13 -05:00
Zachery Littell
298aa1b669
Cleanup per review on PR
2020-10-08 11:59:12 -05:00
Jerzy Kasenberg
d36bfddc30
DA146xx: Allow transmitting of packets larger then 64 bytes
...
FIFO is limited to 64 bytes yet MCU is capable of transmitting
larger packets provided that FIFO will be filled on the fly
and USB_USB_TXCx_REG_USB_LAST_Msk bit is set after FIFO is
filled with all the data that should be transmitted.
This change allows to use FIFO level warning interrupt to fill
FIFO. When DMA is available it will be used instead of interrupts.
Some function names were changed to better reflect what each function
does.
2020-10-08 13:20:58 +02:00
Jerzy Kasenberg
33a5081bd1
DA146xx: Add support for ISO endpoints
...
Few changes were needed to have working ISO endpoints.
2020-10-08 13:20:58 +02:00
Jerzy Kasenberg
6615dd9062
DA146xx: Add dcd_edpt_close
...
Closing endpoints can be important when there are alternate
instances. This adds functionality of closing endpoints
similar to what exists in other drivers.
2020-10-08 13:20:58 +02:00
Jerzy Kasenberg
9edf4334c4
DA146xx: Allow receiving of packets larger then 64 bytes
...
Internal FIFO for each endpoint is limited to 64 bytes.
It is possible to have longer packets if respective FIFO
is read during actual packet transmission.
This change updates receive data path to allow packets (and
endpoint size) larger then 64 bytes.
If DMA is not used yet DMA is setup for reception of big packets.
If DMA is already assigned to some transfer, code enables FIFO level
warning interrupts and tries to read data before FIFO is filled up.
2020-10-08 13:20:58 +02:00
Zachery Littell
db3fe97f62
fix variable names. add itf n callbacks to multihid
2020-10-07 20:36:00 -05:00
Reinhard Panhuber
f700c08aed
Remove CFG_TUD_AUDIO_TX_DMA_RINGBUFFER_SIZE which is not needed any more
2020-10-07 10:57:12 +02:00
Ha Thach
440e23c491
Merge pull request #529 from gh2o/stm32-race
...
stm32 fsdev: fix ISTR and CTR_RX/TX race conditions
2020-10-07 15:16:55 +07:00
hathach
74a1404bea
tab -> spaces
2020-10-07 13:36:27 +07:00
hathach
3f54c27afa
fix audio_test build
2020-10-07 13:36:03 +07:00
Gavin Li
020ad47bb0
stm32: fix ISTR and CTR_RX/TX race conditions
2020-10-06 14:43:10 -07:00
hathach
d41248900b
Merge branch 'uac2' of https://github.com/PanRe/tinyusb into PanRe-uac2
2020-10-06 22:32:22 +07:00
Ha Thach
0686bd9369
Merge pull request #516 from PanRe/tusb_fifo_unmaksed_pointers
...
Tusb fifo unmaksed pointers
2020-10-06 00:01:51 +07:00
Niklas Hauser
788dcc200d
Change CFG_TUSB_CONFIG_FILE mechanism to improve header file scanning
2020-10-03 20:17:53 +02:00
Niklas Hauser
e41d9202b8
Allow overwriting TU_ASSERT etc macros
2020-10-03 20:17:53 +02:00
Niklas Hauser
51fb659533
Use tu_printf instead of printf
2020-10-03 20:17:53 +02:00
Niklas Hauser
78477077b4
Use C++11 static_assert when available
2020-10-03 20:17:36 +02:00
Reinhard Panhuber
2050dc0dc7
Revert #define CFG_TUSB_DEBUG 2 to #define CFG_TUSB_DEBUG 0
...
Change 1 << 31 to 0x100000000 in audio.h
2020-10-03 09:46:22 +02:00
Zachery Littell
081af79009
fix simple pull request comments. Implement descriptor index hack.
2020-10-02 16:02:00 -05:00
Ha Thach
9c4aceaaa8
Merge pull request #518 from kasjer/kasjer/nrf5x-iso-support
...
nrf5x iso support
2020-10-02 21:17:24 +07:00
Zachery Littell
b7208d6f7e
add index to report descriptor callback. this is breaking and needs to be reviewed
2020-10-01 12:51:48 -05:00
Zachery Littell
849681724a
create N functions and inlines for multi hid interfaces
2020-10-01 11:51:33 -05:00
Reinhard Panhuber
603ce17696
Change AUDIO_CS_INTERFACE_HEADER to AUDIO_CS_AC_INTERFACE_HEADER
2020-10-01 17:49:30 +02:00
Jerzy Kasenberg
96da1ca4b8
nrf5x: Add support for ISO endpoints
...
ISO endpoints were not covered so far by the driver code.
This adds support for ISO IN and OUT endpoint handling.
Registers for ISO IN(OUT) endpoints are placed just after normal IN(OUT)
so in some cases common code could be used for handling all type of
transfers.
Generally code synchronizes ISO endpoint handling to SOF interrupt.
This code does not change the way of how non-ISO endpoints are treated.
Code uses strategy outlined in nRF52840 Produce Specification v1.0
sections 6.35.11.1 and 6.35.11.2.
2020-10-01 09:22:55 +02:00
Jerzy Kasenberg
6f5ee09511
nrf5x: Increase size of mps to 16 bits
...
msp stores max packet size.
For ISO endpoints 8 bits is not enough so it's changed to 16 bits.
2020-10-01 09:22:55 +02:00
Jerzy Kasenberg
fceb8853c7
nrf5x: Add dcd_edpt_close
...
Closing endpoints can be important when there are alternate
instances. This adds functionality of closing endpoints
similar to what exists in other drivers.
2020-10-01 09:22:55 +02:00
Jerzy Kasenberg
b2ce7a39b0
device: Make number of endpoints configurable
...
Currently number of endpoints was hard coded to 8.
NRF52 has 9 IN and 9 OUT endpoints.
ISO endpoints are 0x08 and 0x88 and without this change those
two ISO endpoint could not be used.
2020-10-01 09:22:49 +02:00
Reinhard Panhuber
13a9cbde79
Change AUDIO_FUNC_PROTOCOL_CODE_UNDEF for midi in usbd.h
2020-09-29 23:30:35 +02:00
Reinhard Panhuber
da1c3c226b
Change AUDIO_PROTOCOL_V1 to AUDIO_FUNC_PROTOCOL_CODE_UNDEF in midi.c.
...
The USB specification does not define any AUDIO_PROTOCOL_V1!
2020-09-28 22:44:09 +02:00
Reinhard Panhuber
9c837300f1
Fix minor issue.
...
- Change set_EP0_max_pkt_size() to set_EP0_max_pkt_size(void).
2020-09-28 19:23:38 +02:00
Reinhard Panhuber
529622710c
Cleanup for PR.
2020-09-28 18:10:57 +02:00
Reinhard Panhuber
142871654e
Merge remote-tracking branch 'upstream/master' into uac2
2020-09-28 18:08:39 +02:00
Jerzy Kasenberg
f55437d889
audio: Add descriptor for mono speaker
...
This provides descriptor for mono speaker with
explicit feedback.
2020-09-28 08:41:17 +02:00
Jerzy Kasenberg
642a8b00c8
synopsys: Fix odd/even frame handling for ISO
...
Current implementation always sets odd/even bit for ISO transactions.
This is a good strategy only if interval is 1.
For ISO endpoint interval in (micro)frames is computed as
2^(interval-1), which means that odd/frame number should stay
same for interval values > 1.
With this change only when interval is 1 odd/even bit is modified.
2020-09-28 08:41:17 +02:00
Jerzy Kasenberg
2ace98e943
audio_device: Update explicit feedback support
...
Feedback can be specified by the user code and will be
sent at feedback endpoint specified interval.
2020-09-28 08:41:17 +02:00
Jerzy Kasenberg
6b52330969
synopsys: Remove compilation warning in dcd_edpt_close
...
dcd_edpt_close() no longer modifies FIFO distribution.
Code that that was commented out is removed along with
variables that are no longer used.
FIFO distribution among endpoints is handled upfront
and does not need to be modified in open and close endpoint
functions.
2020-09-28 08:41:17 +02:00
Jerzy Kasenberg
759d530506
audio_device: Allow one FIFO for N channels
...
This allow to build with single FIFO for devices with multiple channels.
Having just one FIFO greatly reduces time needed to feed endpoint.
This change also allows to have one FIFO with 24 bit samples that
is not rounded up to 32 bit elements.
CFG_TUD_AUDIO_RX_ITEMSIZE and CFG_TUD_AUDIO_TX_ITEMSIZE can be manually
defined. This allows to use FIFO more efficiently when 24 bits samples
are already using 3 bytes, in this case there is no need to put them
into FIFO one by one.
For 8, 16, 32 bits samples size efficient FIFO access is always used
when single FIFO is selected.
This also changes FIFO element size to 1, FIFO usage was confusing
in some place it treated content as byte base in other it looked like
ITEM size is to be used. Also bufsize that in most (maybe all) cases
was really meaning item count.
bufsize now mean buffer size in bytes so there is no confusion.
2020-09-28 08:41:17 +02:00
Jerzy Kasenberg
28cf63c7db
audio_device: Fix tud_audio_n_read_flush TU_VERIFY usage
...
void function used TU_VERIFY in a way that returned bool value.
It would not compile.
2020-09-28 08:41:17 +02:00
Jerzy Kasenberg
ca4a42156c
audio_device: Fix audio_rx_done_type_I_pcm_ff_cb bufor size check
...
Function was not checking buffer size correctly due missing parenthesis.
2020-09-28 08:41:17 +02:00
Jerzy Kasenberg
66b091282f
audio_device: Fix audio_rx_done_type_I_pcm_ff_cb prototype
...
Function prototype did not have return type specified by mistake.
2020-09-28 08:41:17 +02:00
Jerzy Kasenberg
e67fc808aa
audio_device: Store rhport in interface data
...
Some API uses interface number as argument, some wants to have
rhport.
To accommodate need of rhport for functions that don't have it
rhport can be extracted from interface data.
2020-09-28 08:41:17 +02:00
Jerzy Kasenberg
f4a44ee063
audio: Update ISO endpoint attributes
...
Explicit feedback attribute was missing.
No synchronization now also has definition.
2020-09-28 08:41:17 +02:00
Jerzy Kasenberg
5ad2f8efc6
audio_device: Fix inline function specifiers
...
Having just inline keyword for function specified in header
may not be enough to generate code for function.
Adding static solves this problem.
static inline is used in all other inline functions in TinyUSB.
2020-09-28 08:41:17 +02:00
Jerzy Kasenberg
6f3d0af1e6
synopsys: Fix fifo allocation schema
...
Recommended FIFO allocation schema includes 2 maximum endpoint sizes.
Comment suggested that this is the case while it would work according
to this description only in checked endpoints were ascending sizes.
Also two same size endpoints would be counted as one.
That is fixed by way sz is filled.
Calculation used too much modulo operation while single division was enough
to account for odd FIFO sizes.
Extra space that is evenly distributed between Bulk and control endpoints
was incorrectly calculated it could prevent allocation of ISO endpoint FIFO
when bulk endpoints existed with smaller endpoint numbers.
Minimum endpoint FIFO size is 16 32bit words, FIFO space requirement is
now observed.
2020-09-28 08:41:17 +02:00
Reinhard Panhuber
8dcb104933
Change modulo substitute to while ( idx >= depth) idx -= depth;
2020-09-26 11:00:31 +02:00
Reinhard Panhuber
9ddcfc09d7
Fix wrong comments, rename pos to offset, rename overflow().
2020-09-25 15:58:28 +02:00
Reinhard Panhuber
52c9a467b4
Fix bug in modulo substitute.
2020-09-23 21:36:30 +02:00
Reinhard Panhuber
9bdeafb295
Change maximum depth to 2^15 which allows for a fast modulo substitute.
...
Thus, however, overflows are detectable only for one time FIFO depth.
2020-09-23 20:48:03 +02:00
Ha Thach
8b2c822557
Merge pull request #512 from mzero/fix-midi-sysex
...
Fix a bug in writing SysEx messages.
2020-09-23 11:23:53 +07:00
Reinhard Panhuber
21299f90fa
Final cleanup.
2020-09-19 11:46:43 +02:00
Reinhard Panhuber
9dfb78e9d8
Tested, working.
2020-09-15 20:40:41 +02:00
Jerzy Kasenberg
62a76c0e04
nrf52: Fix edpt_dma_start() wrong condition check
...
Operator < used in while condition was obviously incorrect.
Loop starts with checking if unsigned variable is less then 0.
This condition is always false.
This reverses condition to follow intention of of the code.
2020-09-15 16:08:23 +02:00
Ha Thach
745c15d5b5
Merge pull request #508 from hathach/fix-edpt-race
...
Fix edpt xfer race condition
2020-09-14 23:56:21 +07:00
Reinhard Panhuber
349c0f640e
Implementation done, yet to be tested.
2020-09-14 18:24:08 +02:00
hathach
9c0d15fc43
more const
2020-09-14 22:23:59 +07:00
hathach
23e6ee2ea2
cdc device: claim endpoint before checking fifo availability
...
- add pre-check to reduce mutex lock in usbd_edpt_claim
2020-09-14 22:14:31 +07:00
Mark Lentczner
3b0216d3bf
Update midi_device.c
...
Fix a bug in writing SysEx messages.
At the start of a new USB packet (4 bytes), while in the middle of a SysEx, the code mistakenly
set the buffer length to 4, not the target length. As a consequence, the 3rd and 4th bytes from
the last packet were included, after every byte of the SysEx after the first packet of three.
The fix is simple, as it was just a typo, as can bee seen from the other branches in the same
section of if/else statements: At the start of a new packet, the code should set up the target
length... the buffer length should be left at 2 (as set on line 180).
2020-09-13 15:05:18 -07:00
hathach
5931d19666
correct the TUD_HID_REPORT_DESC_GAMEPAD
2020-09-13 15:01:20 +07:00
hathach
1804dba615
typo
2020-09-12 08:48:49 +07:00
hathach
ce4a9b9c3a
clean up
2020-09-11 00:14:07 +07:00
hathach
801f8b5b38
update claim edpt for hid and midi
2020-09-10 23:32:08 +07:00
Jan Dümpelmann
b15c209805
Set new define because of build failure
2020-09-10 13:36:07 +02:00
hathach
ed6d48b81e
typo
2020-09-09 16:45:54 +07:00
hathach
fe1b5dfa23
clean up
2020-09-09 16:29:45 +07:00
hathach
33f0a18523
update cdc edpt read
2020-09-09 16:25:31 +07:00
hathach
8b9893cada
introduce optional usbd_edpt_claim, usbd_edpt_release which can be used to gain exclusive access to usbd_edpt_xfer
2020-09-09 15:48:11 +07:00
hathach
2b54dcb9f6
move functions around
2020-09-07 15:39:46 +07:00
hathach
7a3b24827e
clean up
2020-09-07 15:25:03 +07:00
hathach
66a10ec9c8
rework usbh control transfer
...
use series of complete callback instead of blocking semaphore, which is
more noOS friendly. still working with hid host
2020-09-07 15:19:20 +07:00
Reinhard Panhuber
4e789b240d
Start of sampling works.
2020-09-06 11:37:59 +02:00
hathach
b3e81673c0
change xfer_cb return type from void to bool
2020-09-06 12:11:07 +07:00
hathach
15ad585e67
replacing hcd_pipe_xfer by usbh_edpt_xfer
2020-09-06 11:49:00 +07:00
hathach
9a6d7c648e
clean up enum task
2020-09-05 21:12:43 +07:00
hathach
828f720207
refactor hub class
...
- separate connect/disconnect handling
- hub work with full speed, but doesn't seem to work with Low speed
device (with mcb1800)
- need to update msc host after migrating from isr to xfer_cb (blocked
at inquiry)
2020-09-05 20:20:45 +07:00
hathach
7ffb6acc16
more clean up
2020-09-05 17:16:46 +07:00
hathach
b8b95e8494
add in_isr to all hcd event functions
2020-09-05 15:46:50 +07:00
hathach
90c8c14652
clean up
2020-09-05 15:19:01 +07:00
hathach
bc09b6065f
refactor extract parse_configuration_descriptor()
2020-09-05 15:16:45 +07:00
hathach
d87f2a9691
remove usbh control mutex
2020-09-05 15:05:25 +07:00
hathach
9531e47d10
update example to test with mouse
2020-09-05 14:59:07 +07:00
hathach
f7cf8cdf27
defer xfer_isr to xfer_cb
2020-09-05 14:41:31 +07:00
hathach
4d57b4ea33
clean up
2020-09-05 13:57:07 +07:00
Reinhard Panhuber
12562fc966
Merge remote-tracking branch 'upstream/master' into uac2
2020-09-04 16:23:39 +02:00
Jan Dümpelmann
9cc22b635c
Add functionality to abort an ongoing transfer
2020-09-04 15:40:23 +02:00
hathach
a8e538efe7
clean up
2020-09-04 01:35:32 +07:00
hathach
35aee4a6af
more hid host work
2020-09-03 23:57:51 +07:00
Reinhard Panhuber
338e96fa82
Remove tud_audio_n_write_ep_in_buffer() as long as ISO EPs are not RBs.
2020-09-03 18:09:46 +02:00
Jan Dümpelmann
4071e490e2
New function to modify fifo overwritability
2020-09-03 17:21:32 +02:00
Jan Dümpelmann
fd6cf9010b
Turn transmit fifo overwritable in no DTR mode
2020-09-03 17:03:13 +02:00
Jan Dümpelmann
d9eaa54e14
Remove connected check for write flushing
2020-09-03 16:40:53 +02:00
hathach
ef651e0734
fix #449 remove obsolete pipehandle from hid host
2020-09-03 17:07:29 +07:00
hathach
1d83ad0ebb
rename tuh_isr/hcd_isr to tuh_int_handler/hcd_int_handler
2020-09-03 13:12:25 +07:00
hathach
c492aef4c7
revert to use float-abi
...
define __USE_CMSIS instead of __USE_LPCOPEN will have startup enable FPU
on startup properly. Although it is only relevant to lpx43/40 series,
change all to __USE_CMSIS for consistency
2020-09-02 00:46:08 +07:00
hathach
84425c50b3
add more logging to host stack
...
tested host with lpc4357, don't use fpu with lpc m4 since it seems to
cause hardfault (stack does not make use of fpu anyway).
2020-09-01 19:16:50 +07:00
Reinhard Panhuber
8f0693346c
Allow epin_buf to be written directly into in case no TX FIFOs are used.
...
This is helpful if you have already encoded audio data and want an
efficient way to send it. However, this approach is NOT THREADSAFE so
far and works realiably ONLY IF tud_audio_n_write_ep_in_buffer() is NOT
called form an interrupt!
2020-09-01 11:26:16 +02:00
hathach
be708bb8a4
Merge branch 'master' into update-host
2020-09-01 12:02:25 +07:00
Reinhard Panhuber
83bd214203
Fix comment.
2020-08-29 13:26:41 +02:00
Reinhard Panhuber
43c4b53635
Fix CFG_TUD_AUDIO_RX_FIFO_SIZE defines.
2020-08-29 13:24:10 +02:00
Reinhard Panhuber
b9c9cfdbac
Change min to tu_min16.
2020-08-29 13:22:21 +02:00
Jerzy Kasenberg
b1f0d6f57e
audio_device: Change CFG_TUD_AUDIO_TX_BUFSIZE to CFG_TUD_AUDIO_TX_FIFO_SIZE
...
CFG_TUD_AUDIO_TX_BUFSIZE seems to be used only in 3 preprocessor
condition while in other places CFG_TUD_AUDIO_TX_FIFO_SIZE is used.
2020-08-25 14:45:40 +02:00
Jerzy Kasenberg
a3eff0c51a
audio_device: Fix NULL pointer access in audiod_xfer_cb
...
b_bytes_copied was pointer with NULL value instead of
plain variable.
NULL pointer was passed to audio_tx_done_cb() and dereference
as well.
Now variable is not a pointer.
2020-08-25 14:35:05 +02:00
Jerzy Kasenberg
a4c096be37
audio_device: Fix FIFO element size discrepancies
...
Buffer for TX and RX FIFO was not taking into account
size of element leading to out of bound access.
audio_tx_done_type_I_pcm_ff_cb() reported copied bytes was not returning
correct value number if channels was omitted in computation.
Transfer size calculation uses simpler arithmetic.
2020-08-25 14:35:05 +02:00
hathach
2d8787cdeb
fix typo
2020-08-24 15:29:34 +07:00
hathach
a1b7e767af
improve midi
...
- fix #436 tud_midi_rx_cb() not invoked
- fix xfer_cb() not handle ep in
- add ZLP if needed
2020-08-24 14:31:46 +07:00
Jerzy Kasenberg
c61e9fb96d
audio_device: Fix descriptor limit calculation
...
In several place p_desc_end calculation was not taking into account
that starting pointer (_audiod_itf[idxDriver].p_desc) was pointing
past interface association descriptor.
It would result in accessing random memory.
2020-08-24 09:04:42 +02:00
Ha Thach
19f08a02f6
Merge pull request #486 from kasjer/kasjer/add-endpoint-close-to-synopsys
...
Add dcd_edpt_close() to synopsys
2020-08-24 13:10:46 +07:00
hathach
9d3a9cf546
add OPT_MCU_SAMD11
...
skip ci build for example that need more ROM/RAM could fit into SAMD11
2020-08-22 18:46:19 +07:00
Ha Thach
e5d622b749
Merge pull request #434 from gh2o/master
...
Add TX callback to CDC device
2020-08-21 11:14:06 +07:00
Reinhard Panhuber
37be0ca732
Fix formatting, get rid of all tabs.
2020-08-20 20:09:44 +02:00
Gavin Li
72183c7bb4
Slight optimization for cdc tx refill
2020-08-20 09:59:23 -07:00
Gavin Li
15b063beb2
Smarter CDC TX refill logic
2020-08-20 02:20:01 -07:00
Reinhard Panhuber
c14f68e2c1
Commit before sharing.
...
Setup a test example - UNTESTED!
Missing: Start transmitting audio data in set_interface.
2020-08-19 21:07:43 +02:00
Reinhard Panhuber
6309364722
Merge remote-tracking branch 'upstream/master' into uac2
...
Conflicts:
src/device/usbd.c
src/device/usbd.h
src/portable/st/synopsys/dcd_synopsys.c
2020-08-16 14:08:24 +02:00
Reinhard Panhuber
444e4d2821
Add EP close. Fix bug in set_interface within audio.
2020-08-16 13:48:25 +02:00
Jerzy Kasenberg
e8d50a3c57
Add dcd_edpt_close() to synopsys
...
Endpoint close was implemented only in one driver so far.
This function is needed for interfaces with several alternate settings.
The way FIFO is allocated in dcd_edpt_open() allows to correctly close
only one IN endpoint (the one that was opened last).
2020-08-14 14:29:35 +02:00
Jerzy Kasenberg
88c5e2a37f
Fix synopsys fifo flush during stall
...
Wrong FIFO was flushed in dcd_edpt_stall().
(epnum - 1) should only be used when accessing DIEPTXF registers.
For DIEPCTL and GRSTCTL epnum is correct index.
2020-08-12 10:26:36 +02:00
hathach
61e96e97cb
use usbd_edpt_open in bth driver
2020-08-11 22:09:16 +07:00
hathach
a9d362185b
update note for app driver list mustbe accesible at all time.
2020-08-07 15:06:19 +07:00
hathach
01b9b77d3b
allow application driver to overwrite built-in one
...
- position application driver before built-in
- remove dcd.h from public include.
2020-08-07 14:47:32 +07:00
hathach
9df8057702
Merge branch 'master' into add-app-driver
2020-08-07 12:13:13 +07:00
Ha Thach
6f3378f71d
Merge pull request #476 from kasjer/kasjer/fix-synopsys-fix-iso-frame-bit
...
Fix synopsys odd/even frame bit for IN ISO endpoints
2020-08-05 22:36:05 +07:00
Jerzy Kasenberg
e9aa36a6e8
Fix synopsys odd/even frame bit for IN ISO endpoints
...
For ISO endpoint driver has to specify when data
is to be transmitted (odd or even frame).
Currently code was not updating this bit resulting in
data being sent every other frame.
If interval was 1ms full data packed was sent every 2ms, and
ZLP was sent in between.
2020-08-04 09:32:41 +02:00
hathach
7d9efd0697
manually submit unplugged event for nrf dcd_disconnect()
2020-08-04 14:18:12 +07:00
Ha Thach
026a1e7ac8
Merge pull request #478 from hathach/move-dcdconnect-to-dcdinit
...
Move pull-up enabling to dcd_init() instead of usbd
2020-08-04 14:11:32 +07:00
Reinhard Panhuber
c557bf7b2e
Implement dynamic FIFO RAM allocation according to configuration desc.
2020-08-03 19:48:05 +02:00
Ha Thach
72464faca4
Merge pull request #472 from hathach/fix-msp430-warning
...
fix msp430 gcc 9.2.0 warning
2020-08-02 12:53:03 +07:00
hathach
acde49ccc9
enable pull-up in dcd_init() instead of usbd
2020-08-01 20:14:58 +07:00
Ha Thach
310797a580
Merge pull request #477 from hathach/fix-nrf-unplugg-isr-event
...
correct isr context for nrf DCD_EVENT_UNPLUGGED
2020-08-01 12:31:48 +07:00
hathach
9bf2b33366
correct isr context for nrf DCD_EVENT_UNPLUGGED
...
also rename debug lookup to prevent conflict
2020-08-01 12:02:59 +07:00
Jerzy Kasenberg
c3b0389f10
Fix synopsys size check for ISO endpoint
...
Constraint was incorrect for ISO endpoint as stated in TODO.
2020-07-31 15:52:21 +02:00
hathach
10a8ef7614
fix nested extern declaration of 'SystemCoreClock' [-Werror=nested-externs]
2020-07-29 17:04:47 +07:00
hathach
5af08e2ffc
fix strict prototype
2020-07-29 16:59:07 +07:00
Ha Thach
78f1576e93
Merge pull request #412 from hathach/fix-net-cast-align
...
suppress cast-align warnings for net device driver
2020-07-29 11:23:11 +07:00
Ha Thach
8dda0a0dd1
Merge pull request #454 from me-no-dev/esp32-s2-fifos
...
ESP32-S2: Handle the fact that available EP IN FIFOs are less than the number of available EP INs
2020-07-28 15:16:15 +07:00
me-no-dev
a1a390a788
Update dcd_esp32s2.c
2020-07-28 10:54:23 +03:00
hathach
6976e64217
fix msp430 gcc 9.2.0 warning in #465
2020-07-28 14:36:15 +07:00
Reinhard Panhuber
01903a4a6d
Implement dynamic reallocation of RX and TX fifos for EP0.
...
Tested with EP0 size 8/16/32/64.
2020-07-27 21:03:20 +02:00
Reinhard Panhuber
5e3f90cd6e
add 'set_EP0_max_pkt_size(...)' and fix EP0 size to 64 bytes after reset
2020-07-26 19:21:30 +02:00
Reinhard Panhuber
1269bb440a
Fix structure definition audio_control_range_X_n_t
2020-07-25 14:31:25 +02:00
Reinhard Panhuber
e047fbe8fb
Merge remote-tracking branch 'upstream/master' into uac2
2020-07-25 14:26:24 +02:00
Reinhard Panhuber
d91843bcd2
Get and set requests work
2020-07-25 11:18:50 +02:00
hathach
503c15217e
example to call tud_init() after freeRTOS kernel is started
...
add note for usb init when using with RTOS
2020-07-23 09:20:45 +07:00
hathach
0407cfe16c
fix samd21 race condition with setup packet
...
reproduced with Adafruit_TinyUSB_ArduinoCore port commit 11d669b4d2a40eb2fc5e51b2a9707a6de9d42363 and SAMD BSP 1.6.1
2020-07-23 01:39:15 +07:00
Ha Thach
7d2fc12445
Merge pull request #469 from hathach/followup-pr466-pr468
...
Followup pr466 pr468
2020-07-21 21:56:57 +07:00
hathach
dfca92d29b
follow up to pr468
2020-07-21 21:06:10 +07:00
Ha Thach
be744e1e01
Merge pull request #466 from chang196700/feature/string_desc_msos
...
Remove 0xEE index string if statement & change TU_ASSERT to TU_VERIFY
2020-07-21 20:25:08 +07:00
Reinhard Panhuber
141db1278a
Make definition of CFG_TUD_AUDIO_CTRL_BUF_SIZE mandatory
2020-07-20 20:24:05 +02:00
Reinhard Panhuber
fdb156a3bb
Implement control EP0 buffer and get rid of CFG_TUD_AUDIO_USE_TX_FIFO
2020-07-20 20:18:45 +02:00
me-no-dev
3822a6a385
FreeRTOS: Yield from ISR to notify the USB task
...
If we do not yeld in ISR when we write to queue/give semaphore, the scheduler will not know of the change and will not check the queue untill the next OS tick. This change causes the task to be called immediately and makes communication many times faster.
2020-07-20 00:46:16 +03:00
Chang Feng
5cd654838b
Remove 0xEE index string if statement & change TU_ASSERT to TU_VERIFY
...
Signed-off-by: Chang Feng <chang_196700@hotmail.com>
2020-07-19 19:13:17 +08:00
Reinhard Panhuber
077e881c92
Implement all missing A.17 control selectors
2020-07-19 11:53:35 +02:00
Reinhard Panhuber
47bcedc0b4
Add A.17.4 - Terminal Control Selectors
2020-07-18 19:27:00 +02:00
hathach
881025afdc
add new name warning to cdc and midi (skip msc, hid warning for now)
2020-07-17 23:01:39 +07:00
hathach
7baeea7a00
update actual link speed for spresense
2020-07-17 18:28:19 +07:00
Reinhard Panhuber
d0f3d03933
Intermediate commit.
2020-07-17 08:40:10 +02:00
hathach
dc00f0cae1
update link speed detection for nuc505
2020-07-16 20:44:06 +07:00
hathach
0517f4a2f1
dcd tdi report link speed on reset
2020-07-16 16:12:21 +07:00
hathach
5ca748a68e
rename CFG_TUD_MSC_BUFSIZE to CFG_TUD_MSC_EP_BUFSIZE
...
rename CFG_TUD_HID_BUFSIZE to CFG_TUD_HID_EP_BUFSIZE
2020-07-16 15:34:16 +07:00
hathach
fea6fb73a1
add fs & hs config for cdc_msc_freertos, midi_test, msc_dual_lun
2020-07-16 13:04:10 +07:00
hathach
706413f751
add tud_speed_get()
...
- define both fs and hs configuration descriptor
- rename CFG_TUD_CDC_EPSIZE to CFG_TUD_CDC_EP_BUFSIZE with default size of 64 for FS, and 512 for HS
2020-07-16 00:44:09 +07:00
Craig Hutchinson
323ae5a84f
Improve comment on CDC tud_cdc_write_available()
...
Fixes #460
2020-07-10 12:24:09 +01:00
Ha Thach
81392da1ea
Merge pull request #456 from me-no-dev/esp32-s2-epin-to
...
ESP32-S2: Detect EP IN Xfer Timeout
2020-07-10 12:29:06 +07:00
Ha Thach
dbced9911d
Merge pull request #447 from hathach/add-stm-hs
...
Add support for STM32 OTG HS core
2020-07-08 19:47:24 +07:00
hathach
0fd074afd8
change REDUCE_SPEED=0/1 to explicitly SPEED=high/full
...
update readme, boards.md to add link to new stm boards
2020-07-08 16:29:48 +07:00
Ha Thach
a192d99bf0
Merge pull request #457 from UweBonnes/add-stm-hs
...
Add stm hs
2020-07-05 14:07:08 +07:00
Uwe Bonnes
fd38178189
STM32/OTG_HS: Allow OTG_HS port to run at FS speed.
...
Add "REDUCE_SPEED=1" to the compile options.
2020-07-03 10:52:57 +02:00
hathach
ad5ae8c31d
update per review
2020-07-03 14:50:39 +07:00
hathach
a09a86d299
fix NVIC disable typo
2020-07-03 01:19:02 +07:00
me-no-dev
d493724a7b
ESP32-S2: Detect EP IN Xfer Timeout
...
In some rare ocasions (bad cable, noise, etc.) data transfer might timeout and hang the endpoint, unless the interrupt flag is cleared.
This pull request targets to solve that case.
2020-07-02 13:05:17 +03:00
hathach
4cec866994
correct HSE_VALUE in hal_conf
...
- although it is define in CFLAGS, it is worth to correct to be
consistent with other build
- extract set_speed()
2020-07-02 14:57:00 +07:00
hathach
9a290febcd
change default port some stm bsp
...
- f769disco default port is highspeed port1
- remove PORT0 on stlink since the board only populated HS connector
2020-07-02 11:58:40 +07:00
hathach
4966fb2e13
clean up
2020-07-02 01:25:21 +07:00
hathach
c2289777f7
Merge branch 'add-stm-hs' of github.com:hathach/tinyusb into add-stm-hs
2020-07-01 23:53:33 +07:00
Uwe Bonnes
196bdbc702
st/synopsys/dcd_synopsys.c: Remove USBC PHY PLL stabilization delay for now
...
While the ST code has a 2 ms stabilization delay for the USBC PHY PLL,
running without this delay showed no problem for at leat 10 USB un/replug
cycles. Observe for problems!
2020-07-01 14:45:07 +02:00
hathach
d2450abaaf
only set turnaround in reset complete
2020-07-01 18:51:04 +07:00
hathach
e3974d6869
correctly set turn around according to cpu clock
...
help to run with low speed mcu
2020-07-01 18:44:52 +07:00
hathach
a512a31c9d
Merge branch 'master' into add-stm-hs
2020-07-01 17:58:02 +07:00
hathach
ed1b670c55
clean up code
2020-07-01 17:57:37 +07:00
me-no-dev
6178f8de2f
ESP32-S2: Handle the fact that available EP IN FIFOs are less than the number of available EP INs
...
ESP32-S2 has only 5 available endpoint-in FIFOs (including EP0) but 7 available EP IN numbers. This change decouples the fifo number from the endpoint number, providing FIFO numbers until they reach the limit, at which point it will return false and assert an error that too many endpoints were allocated.
2020-07-01 13:38:59 +03:00
Ha Thach
0c9932440b
Merge pull request #452 from hathach/fix-dfu-rt
...
Fix dfu rt
2020-07-01 15:24:39 +07:00
hathach
12a145b27d
fix dfu-rt to response to SET_INTERFACE and DFU_GETSTATUS
...
fix #450
2020-07-01 01:33:02 +07:00
Jan Dümpelmann
378e6aab8c
Clear ep0_pending if rx short packet
2020-06-30 17:56:25 +02:00
Jan Dümpelmann
9e35ef73f7
Fix receiving of short packet data (ep out)
2020-06-30 12:55:39 +02:00
Uwe Bonnes
30a18e2605
stm32f723disco: USB HS enumerates.
2020-06-30 11:07:53 +02:00
Uwe Bonnes
05bfd9ac4a
dcd_synopsys: Handle HS and FS IP in one device
...
FIXME: Allow run-time selection to allow to handle both HS and FS with
one file
F746 HS port enumerates with error
config 1 interface 2 altsetting 0 bulk endpoint 0x3 has invalid maxpacket 64
2020-06-30 11:02:41 +02:00
hathach
ab75998316
Merge branch 'master' into add-stm-hs
2020-06-30 01:55:57 +07:00
Ha Thach
05996aee64
Merge pull request #427 from kasjer/kasjer/add-da1469x-support
...
Support for DA1469x MCU from Dialog Semiconductor
2020-06-30 01:20:56 +07:00
Ha Thach
268ab9eaa8
Merge pull request #399 from duempel/redesign_synopsys_receive
...
Improvements to Synopsys EP OUT
2020-06-29 16:02:40 +07:00
Jan Dümpelmann
99df7789a7
Add author name to dcd_synopsys.c
2020-06-29 10:55:03 +02:00
Jan Dümpelmann
4f69bcea7e
Remove EP0 remaining bytes manipulation
...
Renaming edpt_xact to edpt_schedule_packets
2020-06-26 17:18:25 +02:00
Jeff Epler
b2ef8cdd42
dcd_samd: Provide implementation for OPT_MCU_SAME5X
2020-06-25 18:51:04 -05:00
hathach
d4d6e06c1d
added OPT_MCU_SAME5X option
2020-06-24 00:53:17 +07:00
Gavin Li
7ae47a9397
Call tud_cdc_tx_cb right after flush to keep tx fifo full
2020-06-20 22:12:10 -07:00
Reinhard Panhuber
28505cf03e
Merge branch 'master' into uac2
...
Conflicts:
src/device/usbd.c
2020-06-20 11:10:35 +02:00
Reinhard Panhuber
ada82b840f
Get update from tinyusb.
2020-06-20 10:51:21 +02:00
Jan Dümpelmann
067287ef91
Add transaction (edpt_xact) as sub transfer
...
A transfer can have one or multiple transactions.
Usually only EP0 splits one xfer into multiple xact.
2020-06-18 17:18:28 +02:00
Mengsk
9ffb9b69a4
Disable SOF in dcd_stm32_fsdev
...
Signed-off-by: Mengsk <admin@hifiphile.com>
2020-06-18 14:18:00 +02:00
Gavin Li
8fe887198b
Add tx callback to cdc device
...
Useful for continuous transmission of data, which is difficult currently
because there is no notification of tx completion.
2020-06-18 01:13:44 -07:00
Mengsk
57b553e023
Fix IAR warnings.
...
Pa039 : use of address of unaligned structure member.
Pe188: enumerated type mixed with another type.
2020-06-17 10:08:33 +02:00
hathach
2b1c7730b7
fix hs port1 build with net endpoint
2020-06-16 00:53:06 +07:00
hathach
667eaa6dd6
fix stm32h743 priority with freeRTOS
2020-06-16 00:03:52 +07:00
hathach
2dd1be13e5
Enhance EP FIFO allocation for both Fullspeed and Highspeed
...
- Update shared RX FIFO calculation with FS/HS
- IN FIFO EP
- Interrupt -> use EPSize
- Bulk/ISO -> use max(EPSize, remaining-fifo / non-opened-EPIN)
2020-06-15 23:17:49 +07:00
Reinhard Panhuber
bc7e24b659
Fix wrong comment for IAD checks.
2020-06-14 14:22:10 +02:00
Jan Dümpelmann
4399dd1b06
cherry pick PR399 commit : Interrupt time improvements
2020-06-14 19:13:31 +07:00
hathach
f438aedccb
overwrite setup packet
2020-06-14 18:29:38 +07:00
hathach
95966c2201
improve usbd log for control transfer
2020-06-14 18:29:02 +07:00
hathach
a347de6e50
revert CFG_TUSB_RHPORT0_MODE to previous way
2020-06-14 18:28:45 +07:00
Reinhard Panhuber
b25bbf4776
Fix alignment.
2020-06-14 12:58:16 +02:00
Reinhard Panhuber
3012175351
Fix alignment.
2020-06-14 12:57:00 +02:00
Reinhard Panhuber
862d1667f0
Fix alignment.
2020-06-14 12:55:52 +02:00
Reinhard Panhuber
930817221d
Merge branch 'fix-too-strict-iad-checks' into uac2
...
Conflicts:
src/device/usbd.c
2020-06-14 12:36:59 +02:00
Reinhard Panhuber
48b2e6cf78
Fix too strict checks on subclass and interface of iad descriptor.
2020-06-13 13:51:50 +02:00
Reinhard Panhuber
4362665fb3
Fix mic audio descriptor, fix too strict check on IAD desc. in usbd.c
2020-06-13 12:36:05 +02:00
Reinhard Panhuber
d2f1bb58b3
Merge branch 'master' into uac2
2020-06-11 14:35:44 +02:00
Jerzy Kasenberg
0635bafe0a
Add DCD for Dialog DA1469x MCU
...
Dialog Semiconductor's BLE MCU DA1469x comes with full speed USB.
It's base on National Semiconductor discrete USB controller USBN9603/4.
This adds support for:
- control/interrupt/bulk endpoints (up to 64 bytes)
- ISO endpoint were not tested and may not work correctly
- reset/sleep/wakeup are handled
- code for VBUS changes is provided
2020-06-09 15:55:46 +02:00
hathach
e92118635c
adding speed detect on bus reset
2020-06-01 13:40:18 +07:00
hathach
710c54f8cb
allow hs ep open with 512 bytes
2020-06-01 01:36:09 +07:00
hathach
f771afe6af
fixed EP0 size to 64 since LS is not supported in device mode
...
- set turn-around and report actual speed in Enum Done
- add dcd_event_bus_reset() helper to report speed
2020-05-31 23:43:29 +07:00
hathach
5ffba8536d
able to detect as hs
2020-05-31 19:41:22 +07:00
Ha Thach
5efeaf2ac1
Merge pull request #413 from kasjer/kasjer/ble-over-usb
...
Bluetooth HCI transport over USB
2020-05-31 15:07:56 +07:00
hathach
d6d29897f3
add get device qualifier descriptor
2020-05-28 23:16:16 +07:00
Jerzy Kasenberg
56d46483e4
Add bt hci device class
...
Code implements USB transport for bluetooth HCI.
2020-05-28 10:58:49 +02:00
Jerzy Kasenberg
077437b3dc
Add non standard request handling in class
...
For some reason bluetooth stack implementations send class requests
to device instead of interface.
To implement HCI interface over USB non device addressed requests
for class need to be handled.
2020-05-28 10:11:37 +02:00
hathach
53b749fd72
check max_len for vendor and hid
2020-05-28 14:44:26 +07:00
hathach
fb214f7cf7
rename to drv_len to be consistent
2020-05-28 13:57:49 +07:00
hathach
10cd3f24bf
initial transfer failed in open() shouldn't cause the driver open to fail.
2020-05-28 13:48:02 +07:00
hathach
c1db36a15c
update vendor open()
2020-05-28 12:19:06 +07:00
hathach
bec5b5f9da
update usbtmc open()
2020-05-28 12:13:48 +07:00
hathach
13860e9f94
update net open()
2020-05-28 11:51:25 +07:00
hathach
8f560bf275
update midi open()
2020-05-28 11:41:37 +07:00
hathach
89a3d1f6d1
update hid open()
2020-05-28 11:19:12 +07:00
hathach
7a15d2e0d2
improve msc
2020-05-28 00:56:33 +07:00
hathach
2eeeda1bcf
change signature for dfu runtime
2020-05-28 00:46:32 +07:00
hathach
e340404968
changing usbd driver open() return type, add max_len
...
only done with cdc and msc, push this interim for feedback first
2020-05-27 19:01:59 +07:00
hathach
d4bf777c94
try to get synopsys work with OTG HS + external PHY
2020-05-27 11:01:33 +07:00
hathach
b4804d1592
random clean up for tdi
2020-05-26 22:15:38 +07:00
hathach
0482f0d686
update h743eval with rhport=1 highspeed
2020-05-26 22:15:00 +07:00
hathach
947c3eb10d
multiple port support for global otg base
2020-05-26 16:07:48 +07:00
hathach
b7ab60aa44
suporting multiple port (OTG FS + HS) for stm32
2020-05-26 15:52:02 +07:00
hathach
fad088719e
merge CFG_TUSB_RHPORT1_MODE into CFG_TUSB_RHPORT0_MODE
...
each port is 1 byte for easy maintenance
2020-05-26 15:21:23 +07:00
hathach
d108ea4326
implement hcd_uframe_number for ohci
...
able to get 8 byte descriptors using LPC1769 + base, but failed to reset
and set address.
2020-05-22 21:45:34 +07:00
Reinhard Panhuber
9be2f1bf3d
Add basic UAC2 structure - untested
2020-05-22 12:09:34 +02:00
hathach
f308990ab5
Merge branch 'master' into update-host
2020-05-22 15:28:22 +07:00
hathach
ff9994116e
fix nrf hanged (blocking wait) when called within critical section
2020-05-21 21:22:12 +07:00
hathach
8b66098335
fix freeRTOS logic
2020-05-20 15:21:11 +07:00
hathach
a0fe3a80e7
remove queue lock/unlock per review
2020-05-20 15:09:46 +07:00
hathach
d8a15aca77
remove osal_queue_t const qhdl from osal API
...
since it doesn't make any differences.
2020-05-20 14:38:34 +07:00
hathach
88a455a9b9
added tud_task_event_ready()
...
to check if there is pending events in the tud task without executing
it. Useful to check before entering low power mode with WFI/WFE
2020-05-20 14:31:45 +07:00
hathach
4e8d414bc6
added osal_queue_empty() API
...
ported for osal none/freertos/mynewt
2020-05-20 13:38:41 +07:00
hathach
58cedf4c06
usb0 host on mcb1800 work with fullspeed mode.
...
use usbh_edpt_open() to correctly map ep2drv[]
2020-05-19 00:55:43 +07:00
hathach
81b1f97ef7
suppress cast-align warnings for net device driver
2020-05-18 13:23:40 +07:00
hathach
550746097b
fix cast-align warning for nuc505
2020-05-18 13:03:41 +07:00
hathach
1a8ce043ed
enable -Wcast-align
...
suppress vendor sdk driver at board.mk
2020-05-17 14:24:15 +07:00
Jan Dümpelmann
42edbc0006
Allow EP0 to use xfer sizes larger than one packet
2020-05-15 22:26:14 +02:00
Jan Dümpelmann
28696de390
Interrupt time improvements
2020-05-15 18:21:44 +02:00
hathach
b0d49e55de
refactor copy to and from fifo
2020-05-14 14:24:55 +07:00
Mengsk
46875a3912
Optimize FIFO for byte transfer.
...
Signed-off-by: Mengsk <admin@hifiphile.com>
2020-05-13 23:54:23 +02:00
Ha Thach
4e6aa0d81d
Merge pull request #390 from hathach/detect-nrf-softdevice
...
detect if SD is actually present on the flash using SD magic
2020-05-12 14:35:45 +07:00
Jan Dümpelmann
3401e0f6ff
Synopsys OUT EP improvements:
...
- Use register based XFRSIZ to determine transfer complete
(xfer->queued_len and xfer->short_packet were deleted)
- Pop out as many RxFIFO data entries as available within a IRQ call
- less application interruption due to XFRC calls
2020-05-08 18:10:48 +02:00
Mengsk
f02ad1d0dc
Add IAR compiler attribute and endian support.
2020-05-08 13:29:33 +02:00
hathach
eeb076454b
add CFG_TUSB_DEBUG_PRINTF() for log retargeting
2020-05-08 12:56:32 +07:00
Ha Thach
f9f0873b72
Merge pull request #393 from xobs/fix-debug-warning
...
device: fix build warning when CFG_TUSB_DEBUG >= 2
2020-05-08 12:38:50 +07:00
Sean Cross
63bd8d2e44
device: fix build warning when CFG_TUSB_DEBUG >= 2
...
The function is defined inside of a function body which generates a
warning. Circuit Python treats these warnings as errors, and so
refuses to build with debugging enabled:
../../lib/tinyusb/src/device/usbd_control.c: In function 'usbd_control_xfer_cb':
../../lib/tinyusb/src/device/usbd_control.c:195:19: error: nested extern declaration of 'usbd_driver_print_control_complete_name' [-Werror=nested-externs]
195 | extern void usbd_driver_print_control_complete_name(bool (*control_complete) (uint8_t, tusb_control_request_t const *));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [../../py/mkrules.mk:55:
build-simmel/lib/tinyusb/src/device/usbd_control.o] Error 1
Move the declaration to the top of the function to silence this warning.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-07 19:03:40 +08:00
hathach
58b99e59d4
detect if SD is actually present on the flash using SD magic
...
even with SOFTDEVICE_PRESENT defined, SD may not be present on actual
flash.
2020-05-05 23:07:56 +07:00
Ha Thach
101f234a16
Merge pull request #387 from duempel/redesign_transmit_synopsys
...
Redesign of Synopsys device transmission
2020-05-04 14:41:20 +07:00
hathach
905a80d1b2
temporarily remove osal_task_delay() from osal
...
- add hcd_uframe_number() API, update EHCI to return uframe number
- get host running on ea4357
2020-05-04 14:11:58 +07:00
Jan Dümpelmann
fd69cc3dcc
clean up
...
renaming function and variables
changing indent size
2020-05-04 07:59:13 +02:00
hathach
4a3a448340
clean up things, add makefile for host example
2020-05-04 00:29:52 +07:00
hathach
0e30afa691
abstract all UDP_CSR
2020-05-02 18:24:23 +07:00