Commit Graph

50 Commits

Author SHA1 Message Date
hathach a3c06aa7bc more clean up for _ff_pull_const_addr_in_full_words() 2021-04-06 23:39:39 +07:00
hathach d82ee2f8c0 refactor _ff_pull_n() with const addr 2021-04-06 23:12:04 +07:00
Reinhard Panhuber 9b2ddd9cc6 Generalize audio driver for 3 audio functions plus a lot more.
- Audio format and parameters are parsed from descriptors thus user no
longer needs to give them explicitely

- Tested for 4 channel software type I PCM encoding with 16 bit with 1
channel per FIFO and 2 channels per FIFO (this is I2S specific)
2021-04-03 09:49:27 +02:00
Reinhard Panhuber 994dddc231 Fix shadowing parameter in fifo.c 2021-03-25 14:38:55 +01:00
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
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
hathach 4ee1216aaf fix fifo unlock typo, also clean up a bit 2021-03-13 00:22:04 +07: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
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
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
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 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 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
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
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 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 b7ec66e33a This fixes the overflow mathmatic in the fifo 2021-02-16 23:08:08 -05: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
Reinhard Panhuber 99e6bc3720 Explicitly add cast to uint32_t before shifting uint8 to left 2021-01-18 17:54:08 +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 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
HiFIPhile baa5417f3e Fix IAR error on memcpy and warnings.
Signed-off-by: MasterPhi <admin@hifiphile.com>
2020-12-23 16:54:55 +01:00
hathach 4b4f880785 add tud_ready() check in tud_cdc_n_write_flush()
other clean up
2020-11-23 23:40:13 +07: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
Jan Dümpelmann af9f0f1cd6 Merge remote-tracking branch 'hathach/master' into cdc_without_dtr 2020-11-04 17:11:01 +01: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
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
Reinhard Panhuber 349c0f640e Implementation done, yet to be tested. 2020-09-14 18:24:08 +02:00
Jan Dümpelmann 4071e490e2 New function to modify fifo overwritability 2020-09-03 17:21:32 +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
Nathan Conrad 25c1bea782 Normalize line endings 2020-01-15 14:47:43 -05:00
hathach a0307bafda added usbd_edpt_xfer/usbd_edpt_busy to replace dcd_edpt_transfer/dcd_edpt_busy()
- improve fifo write/read_n with only one lock
- use usbd_edpt_xfer/usbd_edpt_busy for hid/cdc/msc class driver
- replace cdc read's pending_read_from_host by usbd_edpt_busy()
2019-05-29 16:55:15 +07:00
hathach 61ec407752
update license year to 2019 2019-05-14 11:48:05 +07:00
hathach c211ee19dd migrate license from BSD 3 clause to MIT 2019-03-20 16:11:42 +07:00
hathach bc46dc6edf osal clean up
remove OSAL_TASK_DEF, osal_task_create. Applicaton should create a task
and call tinyusb_task(). This make API consistent with NO OS.
2018-12-13 13:49:09 +07:00
hathach 3fe7cd1659 added tud_cdc_write_str, tu_fifo only use mutex for RTOS config 2018-11-13 15:45:22 +07:00
hathach f6076b0e06 add mutex support (optional) for tu_fifo 2018-11-02 17:28:07 +07:00
hathach c78540be0f add sys/queue.h to common 2018-09-26 01:39:59 +07:00
hathach c5d2f661e7 rename common func to avoid conflict 2018-08-23 20:09:28 +07:00
hathach 19b6bbfd14 add device cdc wanted char callback, cdc peek 2018-07-14 23:28:07 +07:00
hathach 3e66d2d31e rename fifo * to tu_fifo to avoid conflict with other module 2018-07-04 00:22:15 +07:00
hathach b9f8575e2d clean up device cdc
separate cdc tx & rx bufsize
2018-06-23 13:19:36 +07:00
hathach 424735d440 rename subfolder source to src 2018-06-18 14:05:24 +07:00