Commit Graph

1685 Commits

Author SHA1 Message Date
Reinhard Panhuber bfddfbadc7 Implement unaligned word copy. 2021-03-25 14:28:59 +01:00
Reinhard Panhuber 1e4e87de51 Rework to copy wrapped word bytes by byte in copy_to_cont_dst etc. 2021-03-25 13:53:26 +01:00
Rafael Silva 2807644e7e add efm32 driver
Signed-off-by: Rafael Silva <silvagracarafael@gmail.com>
2021-03-23 20:45:56 +00:00
Rafael Silva 143582870c add efm32gg12 family
Signed-off-by: Rafael Silva <silvagracarafael@gmail.com>
2021-03-23 18:59:21 +00:00
Reinhard Panhuber a60bd0c8ac Fix bug in writing to constant src/dst address.
Copying has to be conduct in full words (at least for STM32). Renamed
copy function to tu_fifo_write_n_const_addr_full_words()
2021-03-23 19:33:04 +01:00
Ha Thach 7503b9f18c
Merge pull request #733 from hathach/fix-nrf-dcd-bulk-out-race
fix race condition that could cause drop packet of Bulk OUT transfer
2021-03-19 10:00:30 +07:00
hathach 64f41dea62 fix race condition that could cause drop packet of Bulk OUT transfer
NRF_USBD->SIZE.EPOUT[epnum] only need to write once to enable
Bulk/Interrupt transfer. We only need to do it in dcd_edpt_open() and
dcd_edpt_clear_stall()
2021-03-18 15:07:07 +07:00
Ha Thach 881321e763
Merge pull request #724 from xmos-jmccarthy/master
USB TMC Updates
2021-03-18 11:17:43 +07:00
Jeremiah McCarthy ec08dcf61a Implement requested changes for PR724 2021-03-17 09:25:01 -04:00
Michael Bruno 62d4652f86
Update usbtmc_device.c
Fix buffer alignment in TMC device class
2021-03-16 10:48:42 -04:00
hathach 82e24306e2 fix build with OPT_MCU_LPC177X_8X 2021-03-16 15:49:09 +07:00
Reinhard Panhuber cd491e296e Intermediate commit 2021-03-14 18:55:16 +01:00
hathach 4ee1216aaf fix fifo unlock typo, also clean up a bit 2021-03-13 00:22:04 +07:00
Ha Thach 3a27a9405f
Release 0.9.0 (#716)
* update change log for release
* move changelog into docs/
* more changelog
* increase macro version
2021-03-12 15:10:47 +07:00
hathach 31373fd55c use !tu_fifo_empty() instead of tu_fifo_count() 2021-03-12 12:55:18 +07:00
hathach 4310941daa Merge branch 'cdc_read' of https://github.com/HiFiPhile/tinyusb into HiFiPhile-cdc_read 2021-03-12 12:49:44 +07:00
HiFiPhile 5caad485f1 Add fifo empty check.
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2021-03-11 20:36:46 +01:00
Reinhard Panhuber 8cb3bd3cd3 Merge remote-tracking branch 'upstream/edpt_ISO_xfer' into edpt_ISO_xfer 2021-03-10 19:33:11 +01:00
Reinhard Panhuber d5a5a1cab6 Implement audio PCM type I enc./decoding acc. to 2.3.1.5 Audio Streams
Extending capabilities of support FIFOs
Removing copy from to FIFO
Adjusting audio examples
Remove peek/read into other FIFO
2021-03-10 19:32:13 +01:00
hathach a397353916 fix ci build with rp2040 2021-03-10 17:58:39 +07:00
hathach e864bda627 fix build with freertos 2021-03-10 17:21:59 +07:00
hathach 794083b647 Merge branch 'master' into edpt_ISO_xfer 2021-03-10 17:10:49 +07:00
HiFiPhile 7fc99a9e11 Call One time tu_fifo_write_n on cdcd_xfer_cb
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2021-03-10 10:19:45 +01:00
hathach eeea19c0ab usbd ack SET_INTERFACE if it is not implemented by class driver. 2021-03-10 11:33:03 +07:00
Reinhard Panhuber de1f36f2b0 Adapt mutexes in fifo.c 2021-03-04 19:52:48 +01:00
Reinhard Panhuber 2e28861cf8 Remove TODOs done. 2021-03-04 18:20:22 +01:00
Ha Thach 5285548c75
Merge pull request #700 from hathach/fix-rp2040-bus-reset
fix enum walkaround forever check for SE0 when pull up is disabled
2021-03-04 21:01:39 +07:00
Reinhard Panhuber 7e56f46957 Extend FIFO mutex to use separate write and read mutexes.
Adjust all USB drivers using FIFO and mutexes.
2021-03-04 13:52:14 +01:00
hathach 33a29c9e4c add midi comment 2021-03-04 19:30:08 +07:00
hathach 8cabbb28df fix enum walkaround forever check for SE0 when pull up is disabled 2021-03-04 18:36:18 +07:00
hathach a655a4169e add note for MIDI (audio v1.0) endpoint decriptor use 9 bytes instead of 7 2021-03-04 01:18:49 +07:00
Ha Thach 68db108b35
Merge pull request #688 from duddie/master
Fix Endpoint descriptor size for MIDI Device
2021-03-04 01:10:37 +07:00
Reinhard Panhuber 848e403e37 Fix unused parameter in _ff_push_copy_fct() and _ff_pull_copy_fct 2021-03-03 08:18:57 +01:00
Reinhard Panhuber a1b07ae14c Change copy modes for new read/write functions in tusb_fifo.c 2021-03-02 21:52:42 +01:00
Reinhard Panhuber 3cdb82c21c Change for copy modes in dcd_synopsis.c 2021-03-02 21:42:24 +01:00
Reinhard Panhuber bd2bab7aff Remove set_copy_modes(), implement:
tu_fifo_read_n_const_addr(), tu_fifo_write_n_const_addr()
2021-03-02 21:41:51 +01:00
Reinhard Panhuber 7b8a08d2e1 Rename dcd_edpt_iso_xfer() to dcd_edpt_xfer_fifo() 2021-03-02 20:00:39 +01:00
Reinhard Panhuber c8b6d9b990 Revert implementation of dcd_edpt_iso_xfer() 2021-03-02 19:28:35 +01:00
hathach a298045f6c clean up 2021-03-02 23:30:21 +07:00
Reinhard Panhuber fc35b3f72d Switch back OPT_MCU_DA1469X to use linear buffers 2021-03-02 17:24:58 +01:00
hathach 9d5e369170 rp2040 add disconnection detection
- also use dcd_event_bus_reset()
- Add TODO for suspend, resume later on (need to test with/without vbus
detection).
2021-03-02 23:24:36 +07:00
hathach 1676a836d1 fix rp2040 host build 2021-03-02 14:54:12 +07:00
Ha Thach 559ff80643
Merge pull request #684 from hathach/rp2040-host-example
add rp2040 to host example build
2021-03-02 13:03:52 +07:00
Reinhard Panhuber 8ec99694d2 audio_decive clean up and bootstrapping of linear (formerly evade) buff. 2021-03-01 09:09:15 +01:00
Duddie 72c1066ed1 Fix Endpoint descriptor for MIDI Device
Endpoint descriptor should be 9 bytes in length (not 7) and have two extra bytes at the end: bRefresh and bSynchAddress

According to MIDI USB specification 1.0 (6.2.1 Standard MS Bulk Data Endpoint Descriptor)
2021-02-28 22:18:35 +08:00
Ha Thach 5a753c1ab0
Merge pull request #675 from majbthrd/rp2040epaddr
rp2040: use TU endpoint conventions and remove redundant variables
2021-02-27 00:38:53 +07:00
Peter Lawrence eb44b6f7db rp2040: improve _hw_endpoint_init() 2021-02-26 11:07:34 -06:00
hathach f6b48c07fc
add rp2040 to host example build 2021-02-26 14:05:08 +07:00
Ha Thach c6eeee1b79
Merge pull request #683 from amitv87/handle_break_req
Handle CDC_REQUEST_SEND_BREAK
2021-02-26 12:54:50 +07:00
boggyb 55a46a5c3b
Update cdc_device.h
Minor api callback change as requested
2021-02-26 11:00:34 +05:30
Ha Thach 0c05a02e67
Merge pull request #682 from hathach/rp2040_fix_hcd_init
Update RP2040 hcd_init to have rhport argument.
2021-02-26 11:52:48 +07:00
amit verma 07a04255da initial break request handling 2021-02-25 23:13:21 +05:30
Liam Fraser e6e7c73f6e Update RP2040 hcd_init to have rhport argument. 2021-02-25 15:48:19 +00:00
majbthrd efea18a888
Merge branch 'master' into rp2040epaddr 2021-02-25 09:15:42 -06:00
majbthrd 0632ecf556
Merge branch 'master' into rp2040device 2021-02-25 08:57:09 -06:00
Peter Lawrence 999ef227d0 rp2040: requested code mode in rp2040_usb.h 2021-02-25 08:45:47 -06:00
Ha Thach 50a0bddd8b
Merge pull request #672 from majbthrd/rp2040trim
rp2040: correctly size variables to reduce RAM usage
2021-02-25 21:17:59 +07:00
Peter Lawrence 762f262be7 rp2040: requested change from TU_MIN to tu_min16 2021-02-25 07:58:54 -06:00
Reinhard Panhuber cc948288bd Revert tusb_fifo.h include form to original. 2021-02-25 11:18:37 +01:00
Reinhard Panhuber 5ebe53f02d Merge remote-tracking branch 'upstream/master' into edpt_ISO_xfer 2021-02-24 20:54:35 +01:00
Kamil Tomaszewski 448dcdc4cf spresense: fix setup processed flag 2021-02-24 17:39:16 +01:00
hathach a070626729 add itf argument to hid API to support multiple instances
following API signature is changed:
- tud_hid_descriptor_report_cb()
- tud_hid_get_report_cb()
- tud_hid_set_report_cb()
- tud_hid_boot_mode_cb()
- tud_hid_set_idle_cb()
2021-02-24 14:27:20 +07:00
Reinhard Panhuber a7f07a1a63 Fix pointer type 2021-02-23 21:53:17 +01:00
Reinhard Panhuber 697c9476b7 Fix pointer type 2021-02-23 21:42:38 +01:00
Reinhard Panhuber cb33840a9b Fix pointer type 2021-02-23 21:15:27 +01:00
Peter Lawrence e00178a1af rp2040: don't compile in host code when in device mode 2021-02-23 14:04:56 -06:00
Reinhard Panhuber 00248de15a Fix shadowing declartion in dcd_da146xx.c 2021-02-23 20:23:26 +01:00
Reinhard Panhuber 387bf1478e Fix missing , in tusb_fifo.h 2021-02-23 19:52:31 +01:00
Reinhard Panhuber c76e04f835 Add dcd_edpt_iso_xfer() to dcd_template.c 2021-02-23 19:50:54 +01:00
Reinhard Panhuber e223d46033 Merge remote-tracking branch 'upstream/master' into edpt_ISO_xfer
Conflicts:
	src/common/tusb_fifo.h
	src/osal/osal_none.h
2021-02-23 19:47:57 +01:00
Reinhard Panhuber 313dd1439d Implement dcd_edpt_iso_xfer() for dcd_da146xx.c BUT WITHOUT DMA SUPPORT 2021-02-23 19:41:21 +01:00
Peter Lawrence c5422a5c48 rp2040: use TU endpoint conventions and remove redundant variables 2021-02-23 12:06:41 -06:00
Ha Thach 656673fb58
Merge pull request #674 from hathach/host-msc
Enhance Host MSC
2021-02-24 00:19:38 +07:00
hathach 451650fa32 move ehci and ohci to portable folder 2021-02-23 23:09:48 +07:00
Peter Lawrence 5a8ae31316 rp2040: leverage existing macro for capping endpoints in pico-sdk 2021-02-23 10:08:38 -06:00
hathach 0de6a05d73 fix ohci hcd_init() signature change 2021-02-23 19:45:53 +07:00
hathach 5108d76136 host msc: call read_capacity as part of enumeration
- add tuh_msc_get_block_count(), tuh_msc_get_block_size()
- rename tuh_msc_mounted_cb/tuh_msc_unmounted_cb to
tuh_msc_mount_cb/tuh_msc_unmount_cb to match device stack naming
- change tuh_msc_is_busy() to tuh_msc_ready()
- add CFG_TUH_MSC_MAXLUN (default to 4) to hold lun capacities
- add host msc configured to for state check.
2021-02-23 19:41:11 +07:00
hathach 386a386345 clean up host msc 2021-02-23 12:20:30 +07:00
Ha Thach cea31c346d
Merge pull request #575 from nwlab/yaa/msc_read
Added MSC read10 and write10 function
2021-02-23 11:51:48 +07:00
hathach ade4bf74ea update function comment 2021-02-23 11:38:15 +07:00
hathach f2ed2ae09a rename tuh_msc_scsi_inquiry() to tuh_msc_inquiry() 2021-02-23 11:14:19 +07:00
Peter Lawrence 592d047936 rp2040: correctly size variables to reduce RAM usage 2021-02-22 20:53:16 -06:00
hathach de95585258 nxp tdi: hcd_init() reset and set host mode 2021-02-23 01:27:52 +07:00
hathach c5b8980398 separate hcd_init from ehci 2021-02-22 22:40:51 +07:00
hathach 1e07fc024c add rhport to hcd_init() 2021-02-22 22:32:56 +07:00
hathach 8a2e4c79fd make hcd tdi more generic 2021-02-22 18:02:52 +07:00
Kamil Tomaszewski b591a66b3d Pass the correct speed on Spresense 2021-02-22 11:24:16 +01:00
hathach 00b4b74e82 rename hcd_lpc18_43 to hcd_transdimension 2021-02-22 17:15:06 +07:00
hathach 43ca626774 merge iso and cbi transaction size to max ep size 2021-02-22 12:27:02 +07:00
hathach 44916bcacf Merge branch 'RP2040_enable_isochronous_buffer_size' of https://github.com/ndinsmore/tinyusb into ndinsmore-RP2040_enable_isochronous_buffer_size 2021-02-22 12:21:52 +07:00
ndinsmore cb5b9eb2f6
Remove stray. commented out line 2021-02-19 08:33:06 -05:00
hathach 2a04ee68b8 add TU_FIFO_INIT() to help with tu_fifo declaration
tu_fifo_clear() also reset max_pointer_idx and non_used_index_space
2021-02-19 11:57:56 +07:00
Ha Thach be9f86ca9e
Merge pull request #660 from hathach/fix-typo-midi-write24
Fix typo midi write24
2021-02-19 11:22:21 +07:00
Ha Thach 044d29c927
Merge pull request #654 from xmos-jmccarthy/master
Add alternate bitfield padding option
2021-02-19 11:03:53 +07:00
hathach aa85099171 fix tud_midi_write24 typo
rename jack_id to cable_num in function argument
2021-02-19 10:51:47 +07:00
Reinhard Panhuber fff6283bf7 Update .non_used_index_space = UINT16_MAX - (2*_depth-1) in osal_none.h 2021-02-18 21:22:11 +01:00
Reinhard Panhuber 8904874f76 Exclude #include "osal/osal.h" for OPT_OS_NONE 2021-02-18 20:52:57 +01:00
Reinhard Panhuber 31bf73517e Add #include "osal/osal.h" in tu_fifo.h 2021-02-18 20:16:57 +01:00
Jeremiah McCarthy 21f1cd4ec7 Implement requested PR changes
Removes CFG_TUSB_ALT_BIT_PACKING_ALIGNMENT, and makes the manual padding
behavior standard.  Replaced unused variable name with TU_RESERVED.
2021-02-18 13:26:03 -05:00
Reinhard Panhuber c098da9803 Implement left and right justifications for 24 to 32 bit PCM encoding 2021-02-18 19:25:08 +01:00
ndinsmore ac87a4547d
Change to using tu_min32
This was a github edit, not tested
2021-02-18 08:25:04 -05:00
Reinhard Panhuber 681cfd0bf2 Correct for wrong pointer type in audio_device.c 2021-02-18 11:12:16 +01:00
Nicholas R Dinsmore 27f4b6f5a4 Included size check for ISO buffers 2021-02-17 18:22:24 -05:00
Reinhard Panhuber 6cb9a6ebb1 Add (void *) for pointer cast. 2021-02-17 23:04:19 +01:00
Reinhard Panhuber d8481ac7e4 Fix wrong pointer call in dcd_samg.c 2021-02-17 22:52:59 +01:00
Reinhard Panhuber 666e0fad35 Fix wrong tu_fifo_read_n() call in dcd_stm32_fsdev.c 2021-02-17 22:50:49 +01:00
Reinhard Panhuber 402005c9e0 Fix missing pointer operator in dcd_nuc505.c 2021-02-17 22:49:10 +01:00
Reinhard Panhuber 94bf4f54da Fix missing FIFO definitions 2021-02-17 22:29:51 +01:00
Reinhard Panhuber 53a796a92e Fix wrong pointer type. 2021-02-17 22:29:40 +01:00
Reinhard Panhuber ae20d11124 Merge remote-tracking branch 'upstream/master' into edpt_ISO_xfer
Conflicts:
	src/common/tusb_fifo.h
2021-02-17 22:08:21 +01:00
Reinhard Panhuber eee47493a3 Fix bug in evasion buffer list 2021-02-17 21:59:32 +01:00
Reinhard Panhuber e407ce463d Add SAMD MCUs to buffer evasion list 2021-02-17 21:47:01 +01:00
Reinhard Panhuber 189b357b54 Implement an evasion linear buffer for MCUs not capable for EP FIFO
Also MCUs using DMAs are within this list, however, these can use an EP
FIFO. There is just no time for implementation
2021-02-17 21:42:44 +01:00
Reinhard Panhuber 2d7b61972c Implement dcd_edpt_iso_xfer() for dcd_stm32_fsdev
Implemented a special copy strategy to copy directly from the FIFO. This
function, however, is untested and should be regarded as unreliable
until somebody was able to test it
2021-02-17 20:46:31 +01:00
Reinhard Panhuber c87357c025 Improve tu_fifo capabilites
Added tu_fifo_get_linear_write_info(), tu_fifo_backward_write_pointer(),
and tu_fifo_backward_read_pointer()
2021-02-17 20:44:26 +01:00
Nicholas R Dinsmore 79b360f0a6 Enable iso buffers per rp2040 spec 2021-02-17 13:22:34 -05:00
Nicholas R Dinsmore b7ec66e33a This fixes the overflow mathmatic in the fifo 2021-02-16 23:08:08 -05:00
Jeremiah McCarthy f8fbc0930b Add alternate bitfield padding option
Adds configuration option CFG_TUSB_ALT_BIT_PACKING_ALIGNMENT, which
substitutes bitfield variable " : 0" padding syntax with an unused
variable of size equal to the remaining number of bits.

This change resolves aligned access issues for some platforms.

Default behavior is original if the option is not explicitly enabled.
2021-02-16 10:43:52 -05:00
Reinhard Panhuber a5d7b6266d Implement dcd_edpt_iso_xfer() for msp430 2021-02-14 14:05:15 +01:00
Reinhard Panhuber 893f997dcb Change FIFO use indication to ff == NULL to avoid future errors.
This way people don't need to pay attention for the buffer pointer
2021-02-14 09:25:34 +01:00
Reinhard Panhuber b634b5958b Implement dcd_edpt_iso_xfer() for INTERRUPT driven dcd_nuc505 2021-02-13 21:00:55 +01:00
Reinhard Panhuber 0c3dc8f99b Implement dcd_edpt_iso_xfer() for dcd_nuc121.c 2021-02-13 17:44:59 +01:00
Reinhard Panhuber 126e46e38a Fix not increment xfer->buffer if xfer->buffer == NULL in dcd_samg.c 2021-02-13 17:37:13 +01:00
Reinhard Panhuber e681678402 Implement dcd_edpt_iso_xfer() for dcd_nuc120.c 2021-02-13 17:06:27 +01:00
Reinhard Panhuber 7ab389db21 Implement dcd_edpt_iso_xfer() for dcd_samg.c. NOTE: ISO EP not supported 2021-02-13 16:36:32 +01:00
Reinhard Panhuber 59d6ed9ea4 Implement dcd_edpt_iso_xfer() for dcd_esp32s2.c 2021-02-13 12:13:10 +01:00
Reinhard Panhuber 9e2a1d2e6a Fix CFG_TUD_AUDIO_EP_IN/OUT_SW_BUFFER_SIZE to be defined anyway 2021-02-12 18:31:54 +01:00
Reinhard Panhuber cdf600048f Merge remote-tracking branch 'upstream/master' into edpt_ISO_xfer 2021-02-12 18:05:20 +01:00
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