Commit Graph

653 Commits

Author SHA1 Message Date
Reinhard Panhuber 8f72c97f7b Change read infos to pointer type 2021-04-30 12:59:12 +02:00
Jeremiah McCarthy f830800d00 Fix typo and clean up reset 2021-04-29 16:04:18 -04:00
hathach c9177246d2 temporarily fix include recusrive loop 2021-04-28 12:31:24 +07:00
hathach c26875e70d add TUP_MCU_STRICT_ALIGN macro that manually pick bytes for lpc55 port1 that is m4 but cannot unaligned acces on usb ram 2021-04-26 17:42:49 +07:00
Reinhard Panhuber 7072f0155e Change tu_fifo_get_linear_write/read_info() to return a struct
Compilers always complain that variables set by function via pointer
might be uninitialized so to avoid that return values are now delivered
via struct.
2021-04-23 11:48:54 +02:00
Reinhard Panhuber a98d0217a0 Init len_wrap = 0 to fix compiler complains. 2021-04-23 10:47:22 +02:00
Reinhard Panhuber 4dd1f1f3b5 Fix include path in audio_device.h 2021-04-23 10:32:22 +02:00
Reinhard Panhuber 03f974c9b9 Implement functions to allow for DMA usage in audio driver.
- Add tud_audio_n_get_ep_out_ff(), tud_audio_n_get_ep_in_ff(),
tud_audio_n_get_rx_support_ff(), and tud_audio_n_get_tx_support_ff()
- Change get_linear_read/write_info() to return linear and wrapped part
at once
- Adjusted affected code in audio_device.c and tested with
audio_4_channel.
2021-04-23 10:27:48 +02:00
Jeremiah McCarthy b8e5885c2b Removes polltimeout behaviour and restructures
Moves dfu_req_dnload_reply to ACK stage of a DNREQUEST.

Removes unneeded variables due to other simplifications.
2021-04-22 17:45:33 -04:00
Jeremiah McCarthy 8c80ddeb54 Fix statte check on DATA stage 2021-04-22 17:00:57 -04:00
Jeremiah McCarthy cc440ade81 Remove custom status description table 2021-04-22 16:47:05 -04:00
Jeremiah McCarthy e54d9d10af Add const 2021-04-22 16:39:43 -04:00
Jeremiah McCarthy 289af581bb Remove uunused code 2021-04-22 16:06:06 -04:00
Jeremiah McCarthy 18e9d253e9 Remove usb reset callback 2021-04-22 16:04:09 -04:00
Jeremiah McCarthy 0936a76dc9 Remove nonstd behaviour 2021-04-22 15:59:49 -04:00
Jeremiah McCarthy 88dea7a0a8 Move debug from .h to .c 2021-04-22 15:02:50 -04:00
Jeremiah McCarthy 01661b3f28 Replace dfu_mode with dfu 2021-04-22 14:56:52 -04:00
Reinhard Panhuber 29bcc83d0f Remove unnecessary volatile and short audio function index to func_id 2021-04-21 17:01:38 +02:00
Reinhard Panhuber c7c11b181c Clean up old depracted and misleading variable names 2021-04-20 20:15:02 +02:00
Reinhard Panhuber fef0d54559 Refactor static function for better performance 2021-04-20 19:56:40 +02:00
Reinhard Panhuber 4408ffce88 Fix pointer alt_setting to be cleared when driver gets initialized 2021-04-20 18:44:56 +02:00
Reinhard Panhuber 8d9f60ca5e Improve user feedback in case of wrong configuration of audio driver 2021-04-14 21:52:54 +02:00
Jeremiah McCarthy 7b45b38fe4 Remove DFU mode and rt 2021-04-12 11:17:01 -04:00
Reinhard Panhuber 2134c1a875 Fix defines in audio_device.c 2021-04-08 21:48:36 +02:00
Reinhard Panhuber 4bebb9ca49 Remove depracted defines in audio_device.c 2021-04-08 20:11:51 +02:00
Jeremiah McCarthy ae851bba31 Resolve gcc warnings for no parameter functions 2021-04-07 17:15:26 -04:00
Jeremiah McCarthy 2e2dc7bdc5 Revise per initial comments
Returns the RT driver to the function state of previous iteration, which
did not support the will_detach.  Behavior should be fine without this
feature.  This removes much of the added bloat to track state, and
handle requests in the APP_DETACH state which is no longer required.

Removes the optional bloat added to the RT driver, such as responding to
GETSTATE requests.

Fixes the DFU Mode to extract the attr bits from the functional
descriptor when opened.

Fixes some incorrect bitwise if checks.

Also, updates some naming of functions to be consistent with the rest of
the library.
2021-04-07 17:05:04 -04:00
Reinhard Panhuber 8eacdffebd Optimize encode/decode - refactor unnecessary repetitive division 2021-04-07 20:07:28 +02:00
hathach 58bab86d79 minor clean up 2021-04-06 21:09:23 +07:00
hathach 8b79040c38 code format 2021-04-06 15:34:50 +07:00
Jeremiah McCarthy c39b7b8177 Add DFU runtime and mode "class"
With the runtime and mode portions in separate classes, a single
application should only be building with one or the other enabled.  In
some applications both might be desired at build time.

The CFG_TUD_DFU_RUNTIME_AND_MODE option creates a DFU class, which asks
the application which mode to initialize to.  This allows a runtime
change between RT and DFU mode, by just reinitializing tusb.
2021-04-05 17:52:33 -04:00
Jeremiah McCarthy bc2cb99780 Remove unreachable callback 2021-04-05 17:06:27 -04:00
Jeremiah McCarthy fdc91f8d2c Fix bug during initialization of DFU Mode 2021-04-05 16:48:09 -04:00
Jeremiah McCarthy c5b8ef1529 Separate DFU RT and Mode. Untested 2021-04-05 16:32:58 -04:00
hathach 68687ed0f4 fix build 2021-04-06 01:16:51 +07:00
hathach 7ab8da949e audio driver only use USE_LINEAR_BUFFER = 0 for stm32 synopsys driver 2021-04-06 01:07:32 +07:00
Jeremiah McCarthy 164d3e82e3 Fix incorrect DNLOAD request len passed to app
Fixes bug where the app callback was getting the length of the status
request transfer rather than the length of the data stage payload.

TODO: Right now this returns the expected length, when it really should
be returning the transfer length.
2021-04-05 11:13:42 -04:00
Reinhard Panhuber 1ac9e7e3a7 Fix wrong read mutexes in audio_device.c 2021-04-03 18:22:19 +02:00
Reinhard Panhuber f6ba58e370 Fix wrong pointer type in audio_device.c 2021-04-03 17:50:30 +02:00
Reinhard Panhuber 4af5189492 Fix potential bug in support FIFO sizes 2021-04-03 16:53:29 +02:00
Reinhard Panhuber 475badd087 Add missing #defines in uac2_headset example 2021-04-03 16:10:46 +02:00
Reinhard Panhuber fc65f39ff2 Fix error in #defines in uac2_headset 2021-04-03 15:58:41 +02:00
Reinhard Panhuber ec6b240de2 Fix #define error in audio_device.h 2021-04-03 15:44:44 +02:00
Reinhard Panhuber 6236effb14 Fix #define error in audio_device.h 2021-04-03 15:29:39 +02:00
Reinhard Panhuber 8b90c08b35 Fix #define errors in audio_device.h 2021-04-03 15:24:38 +02:00
Reinhard Panhuber a1efd41649 Merge remote-tracking branch 'upstream/master' into edpt_ISO_xfer 2021-04-03 09:50:08 +02: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
Ha Thach eb92986b88
Merge pull request #766 from hathach/enhance-midi
Enhance midi
2021-04-02 15:47:40 +07:00
hathach 48bb96f507 correct midi stream read behavior to read until user buffer is full or no more data from usb fifo 2021-04-02 15:08:36 +07:00
hathach 350eb11277 refactor midi read buffer to stream 2021-04-02 14:52:44 +07:00
hathach da59c4ad44 rename midi write()/read() to stream_write() stream_read()
also add deprecated for warning and rename hint
2021-04-02 14:43:38 +07:00
hathach 99b78e62f2 removed tud_midi_write24() 2021-04-02 14:34:13 +07:00
hathach 08fe16840f refactor midi write into stream 2021-04-02 14:26:55 +07:00
hathach 6b04efd443 refactor midi stream read 2021-04-02 13:55:51 +07:00
hathach 080b14b292 fix midi tx fifo overflow cause data corruption
rename
2021-04-02 13:26:55 +07:00
hathach 949ff791e0 code format 2021-03-31 00:34:09 +07:00
hathach b05084e406 remove tud_midi_read_flush() 2021-03-30 23:56:55 +07:00
hathach c5aa661c89 rename tud_midi_receive/send to tud_midi_packet_read/write 2021-03-30 23:54:17 +07:00
hathach 89a911ee43 correct hid key enter = 0x28, return = 0x9E 2021-03-30 21:26:35 +07:00
hathach d135825e9c add hid keys from 0x6B to 0xA4 2021-03-30 21:12:56 +07:00
Jeremiah McCarthy fb7b47cf07 Minor cleanup 2021-03-26 17:32:03 -04:00
Jeremiah McCarthy 1138f8cc70 Add DFU Class per Version 1.1 Spec 2021-03-26 15:30:43 -04: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
Reinhard Panhuber cd491e296e Intermediate commit 2021-03-14 18:55:16 +01: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 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
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
Reinhard Panhuber 7b8a08d2e1 Rename dcd_edpt_iso_xfer() to dcd_edpt_xfer_fifo() 2021-03-02 20:00:39 +01:00
Reinhard Panhuber fc35b3f72d Switch back OPT_MCU_DA1469X to use linear buffers 2021-03-02 17:24:58 +01:00
Reinhard Panhuber 8ec99694d2 audio_decive clean up and bootstrapping of linear (formerly evade) buff. 2021-03-01 09:09:15 +01:00
boggyb 55a46a5c3b
Update cdc_device.h
Minor api callback change as requested
2021-02-26 11:00:34 +05:30
amit verma 07a04255da initial break request handling 2021-02-25 23:13:21 +05:30
Reinhard Panhuber 5ebe53f02d Merge remote-tracking branch 'upstream/master' into edpt_ISO_xfer 2021-02-24 20:54:35 +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 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
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
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
hathach aa85099171 fix tud_midi_write24 typo
rename jack_id to cable_num in function argument
2021-02-19 10:51:47 +07: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
Reinhard Panhuber 681cfd0bf2 Correct for wrong pointer type in audio_device.c 2021-02-18 11:12:16 +01:00
Reinhard Panhuber 53a796a92e Fix wrong pointer type. 2021-02-17 22:29:40 +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
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 9e2a1d2e6a Fix CFG_TUD_AUDIO_EP_IN/OUT_SW_BUFFER_SIZE to be defined anyway 2021-02-12 18:31:54 +01:00