Commit Graph

339 Commits

Author SHA1 Message Date
Nathan Conrad eea71a8b3b usbtmc updates.... 2019-09-18 19:24:54 -04:00
Nathan Conrad 91cd247c97 changes 2 2019-09-17 13:29:39 -04:00
Nathan Conrad 45871001e6 Changes1... 2019-09-17 13:29:38 -04:00
Nathan Conrad e234998c6c More proper handling of clear. 2019-09-17 13:29:38 -04:00
Nathan Conrad c755aee7d0 Clear 2019-09-17 13:29:38 -04:00
Nathan Conrad 915f52730d Implement HID desc request. 2019-09-17 11:28:29 -04:00
Nathan Conrad e53e9bd4f0 Simulate query delay; getting to a point where implementing clear/aborts makes
sense. Probably adding too many concurance issues; need to figure out
semaphores.
2019-09-14 21:26:43 -04:00
Nathan Conrad 64bfec79b2 Change requset type parameter back to uint8_t (fix type cast), support USB indicator pulse 2019-09-14 18:11:07 -04:00
Nathan Conrad 6e00886ffb Handle USBTMC TermChar. 2019-09-14 17:15:34 -04:00
Nathan Conrad e74c6b0874 Combined status response enum (std with 488), support trigger. 2019-09-14 16:51:02 -04:00
Nathan Conrad 1cae96951f Add usbtmc class driver. 2019-09-14 13:35:08 -04:00
Nathan Conrad 8cca287683 Add verification that there is enough buffer space for HID OUT control transfer. 2019-09-12 16:07:12 -04:00
hathach 6c6a597465 fix #132 2019-09-11 10:47:07 +07:00
hathach 80cde5b0b5 fix potential bug with mis-align issue 2019-09-01 17:20:10 +07:00
hathach aeea6754af rename lpc_usbd to lpc_ip3511 2019-09-01 16:44:40 +07:00
hathach b7dbc98ab1 close #105 add tud_vendor_write_available() 2019-08-31 16:31:07 +07:00
Scott Shawcroft 00c440cb26
Merge pull request #99 from jepler/issue98-midi-program-change
midi_device: Send message classes C and D as 2 bytes
2019-08-15 23:34:42 -07:00
jepler 96d96a94b8 midi_device: Send message classes C and D as 2 bytes
.. sending these as two 1-byte messages with CIN of 0xF is
misinterpreted by OSes including Windows 10 and (reportedly)
Mac.

Testing performed: Ran the reproducer script, which sends Program
Change (0xCx) messages.  I did not check with Change Pressure (0xDx)
messages, but expect the same thing.

Closes: #98
2019-08-14 19:15:29 -05:00
hathach bd08d0edc9 add vendor peek, change cdc peek signature, change cdc read_char() return from signed char to int32_t 2019-08-01 10:46:27 +07:00
hathach 00a9e492cd clean up 2019-07-30 00:48:31 +07:00
hathach d2b60b6755 webusb work great with linux 2019-07-26 11:36:30 +07:00
hathach caf2b6d463 move tud_vendor_control_* to usbd.h 2019-07-24 23:12:31 +07:00
hathach 2a543c0e79 update vendor device similar to cdc read/write
maybe refactor later
2019-07-24 23:07:30 +07:00
hathach 56b656c768 Merge branch 'master' into develop 2019-07-24 17:08:19 +07:00
hathach 1ee9ef4f2b change tud_msc_start_stop_cb() to return void -> bool 2019-07-24 16:19:12 +07:00
hathach 8ba78ee012 adding vendor 2019-07-24 16:08:43 +07:00
hathach c63f2b30cb rename tud_control_vendor_request_cb/complete_cb to tud_vendor_control_request_cb/complete_cb 2019-07-24 09:45:32 +07:00
hathach 33de35504a more house keeping 2019-07-19 20:20:13 +07:00
hathach a3cb2dda9e rename custom/custom-_* to vendor/vendor_* 2019-07-19 16:37:28 +07:00
hathach 6a076d8aae rename CFG_TUSB_HOST_CUSTOM_CLASS to CFG_TUH_VENDOR 2019-07-19 16:31:51 +07:00
hathach b0678e1050 rename CFG_TUD_CUSTOM_CLASS to CFG_TUD_VENDOR 2019-07-19 16:23:56 +07:00
hathach 036e858543 add tud_control_vendor_request_cb()/tud_control_vendor_complete_cb(), expose usbd control transfer
rename usbd_control_transfer/status to tud_control_transfer/status
2019-07-16 18:14:47 +07:00
hathach cb4e6837e9 clean up, rename internal driver control_request_complete to simply control_complete 2019-07-12 22:03:40 +07:00
hathach 216ccc6e93 midi only use audio 1.0 without IAD 2019-07-05 16:46:11 +07:00
hathach 1b242cb3c6 clean up 2019-07-04 01:31:56 +07:00
hathach b0e5a1a9ec remove tud_midi_write_flush() send asap. rename tud_midi_connected() to tud_midi_mounted() 2019-07-04 01:27:51 +07:00
hathach 50f4c61d7c fix midi_write prototype 2019-07-03 01:22:41 +07:00
hathach 1a0e02fa1b tested midi example 2019-07-03 00:52:25 +07:00
hathach 62d3b91691 clean up 2019-07-02 18:23:42 +07:00
hathach 3f3ef6f4e6 clean up 2019-07-02 16:42:12 +07:00
hathach e702328093 fix compiling 2019-07-01 23:11:16 +07:00
hathach 6991b28532 improving midi support, adding midi exmaple
rename TUSB_DESC_CLASS_SPECIFIC to TUSB_DESC_CS_INTERFACE
2019-07-01 22:38:06 +07:00
hathach 7156bfb54d
fix build error with midi, use usbd_edpt_xfer/busy for midi to replace dcd_* 2019-06-10 18:46:00 +07:00
hathach dcfaec9efc
add HID_ASCII_TO_KEYCODE 2019-06-06 18:06:24 +07:00
hathach 13e01c7dca
add TU_ prefix to compiler ATTR to prevent name conflict with application 2019-06-06 10:39:37 +07: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 5f34c63660 should fix and work with #58
- add hid_test_js
2019-05-24 12:33:56 +07:00
hathach 3846645a28 fix tud_cdc_read_char()/tud_cdc_peek() to return signed char
- depending on compiler option "char" can be intepreted as unsigned char
2019-05-22 00:54:21 +07:00
hathach 454496316f
more endian convert 2019-05-14 13:06:38 +07:00
hathach 3e6d911ce9
more clean up use inline bit funciton instead of macros 2019-05-14 12:54:29 +07:00
hathach 81fc7b7e2b
clean up endian convert function 2019-05-14 12:14:51 +07:00
hathach 61ec407752
update license year to 2019 2019-05-14 11:48:05 +07:00
hathach 6135019230
clean up 2019-05-14 11:46:22 +07:00
hathach 1174949308
change tud_descriptor_string_cb() to be consistent with other descriptor callback 2019-05-12 15:38:15 +07:00
hathach ba2136486c
add tud_hid_descriptor_report_cb()
- remove tud_desc_set.hid_report
- remove tud_desc_set_t
2019-05-12 14:09:35 +07:00
hathach 7063a0dd03 msc device will stall READ_CAPACITY & READ_FORMAT_CAPACITY if tud_msc_capacity_cb() get zero size 2019-05-09 23:33:55 +07:00
hathach 81cb1c9510 clean up 2019-05-07 00:03:42 +07:00
hathach 6e4dc2f23d adding msc Start Stop to buitin command, but not complate yet
add tud_msc_start_stop_cb() as optional callback
2019-05-06 16:48:50 +07:00
hathach efefbd3a4e add Test Unit Ready to builtin command, add tud_msc_test_unit_ready_cb()
- rename tud_msc_maxlun_cb to tud_msc_get_maxlun_cb
2019-05-06 15:01:38 +07:00
hathach fae9aba68f add tud_msc_inquiry_cb() remove CFG_TUD_MSC_VENDOR/PRODUCT/PRODUCT_REV 2019-05-03 23:46:01 +07:00
hathach f9d9eebfe1 support hid generic inout #58
- add report descriptor template TUD_HID_REPORT_DESC_GENERIC_INOUT
- add TUD_HID_INOUT_DESCRIPTOR & TUD_HID_INOUT_DESC_LEN
- add hid_generic_inout example
2019-05-02 14:30:49 +07:00
hathach 3387b9fca5 use tud_hid_set_report_cb for hid epout 2019-05-02 13:27:32 +07:00
hathach 353d415d3f clean up 2019-05-02 13:27:00 +07:00
hathach 1c0ec61aa1 add tud_hid_out_report_cb() for hid epout 2019-05-02 00:08:39 +07:00
hathach a25ca701cd text clean up 2019-05-01 23:26:52 +07:00
hathach c8b9293d68 rename hid report_buf to epin_buf
add epout_buf and use it for SET_REPORT request buffer
2019-05-01 20:45:05 +07:00
hathach 2050778763 clean up 2019-05-01 20:41:26 +07:00
hathach c006f3dbce adding optional ep out for hid
refactor usbd_open_edpt_pair
2019-05-01 19:29:56 +07:00
hathach 90fdae94f8 clean up 2019-05-01 18:21:08 +07:00
hathach 9fa5c8025f clean up 2019-05-01 17:07:33 +07:00
hathach 84f81f6b21 simplify hid keyboard & mouse report to one API each 2019-05-01 17:06:18 +07:00
hathach 0b6999a28e add tud_hid_set_idle_cb
- rename tud_hid_mode_changed_cb to tud_hid_mode_changed_cb
- add mouse ac pan descriptor template support
2019-05-01 16:53:35 +07:00
hathach 89ace295ba add TUD_ to HID_REPORT_DESC_* template 2019-04-28 00:43:36 +07:00
hathach b74eca4f12
add msc multiple lun support
- remove CFG_TUD_MSC_MAXLUN
- add tud_msc_maxlun_cb()
- add msc_dual_lun exmaple
2019-04-26 15:54:42 +07:00
hathach 67aa45f75f
remove CFG_TUD_HID_ASCII_TO_KEYCODE_LOOKUP 2019-04-25 21:41:21 +07:00
hathach ff8fe28c98
move interface descriptor template to usbd.h, update exmaple 2019-04-19 13:16:06 +07:00
hathach 23bcf1cc7a
remove auto descriptor and its option CFG_TUD_DESC_AUTO 2019-04-18 23:59:21 +07:00
hathach 307ba23046
wrap up hid device refactor 2019-04-18 22:31:35 +07:00
hathach a30461b078
update tud_hid_keyboard/mouse helper 2019-04-18 13:27:06 +07:00
hathach 8d2db4dd70
add tud_hid_mode_changed_cb() 2019-04-18 12:32:19 +07:00
hathach 1ffcadd373
hid update 2019-04-18 11:52:23 +07:00
hathach cc2fce31e5
refactor hid, rename hid_generic to simply hid_ 2019-04-18 00:36:17 +07:00
hathach 516964b3d3
add interface descriptor template 2019-04-17 13:43:07 +07:00
hathach 6102183193
clean up 2019-04-11 00:22:18 +07:00
hathach 4af16efea7
add tud_ready() to hid_ready() 2019-04-02 02:14:39 +07:00
hathach eabfc53f38
added tud_suspended() and tud_ready() 2019-03-30 23:01:23 +07:00
hathach 1c2beba85c working on suspend and resume
change dcd_init signature
2019-03-29 16:23:00 +07:00
hathach 0bdd4bd550
added Suspend and Resume event for nrf5x port
also rename DCD_EVENT_SUSPENDED to DCD_EVENT_SUSPEND
2019-03-29 01:34:53 +07:00
hathach 8fb9fbb0b1
add tud_mounted() check in tud_cdc_connected()
mark device as disconnected immed with DCD_EVENT_UNPLUGGED
2019-03-27 23:58:24 +07:00
hathach c09d754654
remove tud_msc_ready() 2019-03-27 23:47:59 +07:00
hathach da452d4ba6
cleanup, remove the use of _TINY_USB_SOURCE_FILE_ 2019-03-27 17:48:42 +07:00
hathach 1e9848d917
replace dcd_edpt_(clear)stall by usbd_edpt_(clear)stall
- remove dcd_edpt_stalled() from dcd porting
2019-03-27 16:09:49 +07:00
hathach 852abba918 Merge branch 'master' into develop 2019-03-27 00:46:32 +07:00
hathach 89b9ee2f52 revert to use pending_read_from_host (temp) since 2019-03-27 00:39:14 +07:00
hathach aaf5714268 follow up to pr #46 2019-03-25 11:38:16 +07:00
hathach fad8720215
Merge pull request #46 from tannewt/fix_cdc_out
Fix slow CDC OUT by NAKing
2019-03-24 03:27:58 -07:00
hathach d866999bf0
remove idle rate enforcement, should be done in application level 2019-03-23 21:46:51 +07:00
Scott Shawcroft 909891325a
Fix slow CDC OUT by NAKing
This NAKs CDC OUT packets when the ring buffer doesn't have
enough space for it. This makes CDC OUT reliable rather than
allowing overwriting into the ring buffer.
2019-03-21 14:52:56 -07:00
hathach c211ee19dd migrate license from BSD 3 clause to MIT 2019-03-20 16:11:42 +07:00
hathach a19455d1ff follow up to PR #39 2019-03-04 11:51:36 +07:00
Gregory P. Smith fa8141f31f Fixes #33: Remove invalid use of strncpy().
This was causing a stringop-truncation compiler warning in gcc 8 when
the #defined values being copied from were string literals.
 `error: 'strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Werror=stringop-truncation]`

These fields aren't NUL terminated C strings, they are a fixed width buffer
that is supposed to be space (0x20) padded.
2019-03-03 19:41:41 -08:00
hathach f2d76a39eb mscd: send scsi status before invoke read10/write10/scsi complete callback 2019-02-22 01:31:13 +07:00
Scott Shawcroft c870efffc0
Fix write protected MSC. The bits were flipped. 2019-02-20 15:12:36 -08:00
hathach 59c1b4b427
zero init internal class/device data 2019-01-29 19:39:34 +07:00
Scott Shawcroft 52abbec7c5
Remove txbuf in favor of fifo.
Fifo incurs a second copy into a USB buffer but this ensures the
correct USB buffer alignment. Some LPC chips require 64 byte
alignment that txbuf couldn't do.
2019-01-08 14:10:40 -08:00
Scott Shawcroft 048fc9694c
Split out txbuf and add unit test. 2019-01-04 18:27:00 -08:00
Scott Shawcroft a3173b8de4
Add USB Midi support.
It also introduces a txbuffer which copies data into it but passes
the buffer straight to the USB rather than another copy.
2019-01-04 12:16:27 -08:00
hathach 257d60fe1a white spaces 2018-12-21 12:58:53 +07:00
hathach 902697ca07 add dcd_get_microframe() 2018-12-17 12:14:11 +07:00
hathach 2a60427bdc rename bit_* helper to tu_bit_*, BIT_* to TU_BIT_* for consistency 2018-12-14 15:30:54 +07:00
hathach a3713f801d clean up compiler attribute 2018-12-14 13:08:21 +07:00
hathach a6b9432600 clean up error enum 2018-12-13 14:57:21 +07:00
hathach 1c49c479ca seperate tusb_task() to tud_task() and tuh_task()
tusb_task() still exists for backward compatible
2018-12-13 14:51:37 +07:00
hathach bb544a0951
minor update 2018-12-12 14:43:45 +07:00
hathach c1c501e0c2
change usbd xfer_cb return type to bool 2018-12-12 13:12:06 +07:00
hathach b6cb4757d2
change class driver open return type to bool 2018-12-12 13:00:59 +07:00
hathach 6c0b0917e1
rename descriptor_* helper to tu_desc_* 2018-12-12 12:01:15 +07:00
hathach 6d86db3977
rename edpt_dir/number/addr to tu_edpt_* 2018-12-12 11:51:31 +07:00
hathach 67d6d753d6
replace all hcd pipe close by hcd_device_remove 2018-12-12 00:00:33 +07:00
hathach 600fac1845
fix build error with ohci 2018-12-11 16:18:56 +07:00
hathach dbc560658a
more hcd_pipe to hcd_edpt rename 2018-12-11 13:15:05 +07:00
hathach 0d04e6eb96
rename to hcd_edpt_open() 2018-12-11 13:12:21 +07:00
hathach 7c2056defb
remove pipe handle in host msc 2018-12-11 01:03:15 +07:00
hathach 7a626dbc8b
completely remove pipe handle for cdc/hub/ehci 2018-12-11 00:56:21 +07:00
hathach e863c99a6f
fix msc host 2018-12-10 23:15:53 +07:00
hathach 212deaf2f8
usbh name change 2018-12-10 22:19:01 +07:00
hathach 9c3c782b64
host msc built but got hardfault with inquiry command 2018-12-10 22:11:02 +07:00
hathach dffe9b335e
clean up host pipe api 2018-12-10 20:26:47 +07:00
hathach 4e7596ca9c
add tuh_mount_cb/tuh_umount_cb 2018-12-10 19:25:57 +07:00
hathach 9c4c797502
add ep addr to host cdc 2018-12-10 19:01:28 +07:00
hathach 0ae8a1aa89
remove pipe handle.dev_addr 2018-12-10 16:58:17 +07:00
hathach a486da33ee
usbh clean up 2018-12-10 05:55:02 +07:00
hathach a31f83dbb0
removing pipe handle 2018-12-10 05:44:08 +07:00
hathach 05913a7350
change usbh class driver open signature 2018-12-09 12:34:05 +07:00
hathach 607658d047
rename MODE_HOST_SUPPORTED to TUSB_OPT_HOST_ENABLED 2018-12-07 23:38:52 +07:00
hathach e6e3679136
simple cdc host demo work 2018-12-07 17:37:54 +07:00
hathach 9b74f0e98f
add connect to cdc for testing 2018-12-07 15:07:00 +07:00
hathach 366ab79776
able to build host hid 2018-12-07 14:57:58 +07:00
hathach 89820a36a1 able to build with host msc 2018-12-07 12:56:42 +07:00
hathach ac829c0a87 minor clean up 2018-12-06 22:56:58 +07:00
hathach 07c3fd5e1e clean up hub 2018-12-06 22:47:49 +07:00
hathach 7d3ff7aff6 rename CFG_TUSB_HOST_CDC/MSC to CFG_TUH_CDC/MSC 2018-12-06 22:24:31 +07:00
hathach 5f7d7a34f5 able to complete enumeration with os none blocking 2018-12-06 00:38:00 +07:00
hathach d96347a0f5
rename OPT_MCU_LPC13UXX to OPT_MCU_LPC13XX 2018-11-30 12:48:06 +07:00
hathach 8b03b6d3b4 add Auto descriptor endpoint num config to support lpc17xx
CFG_TUD_DESC_*_EPNUM
2018-11-28 16:10:31 +07:00
hathach 80ecf1fd54
add OPT_MODE_HIGH_SPEED 2018-11-26 14:56:07 +07:00
hathach 064eec5dd8
clean up warnings 2018-11-26 12:29:55 +07:00
Scott Shawcroft 47fabe42ed
One tweak to make -Wdiscarded-qualifiers happy. 2018-11-23 12:48:55 -08:00
hathach 394a22ecf7
remove pragma GCC diagnostic 2018-11-23 15:25:25 +07:00
hathach f196b24dce
rename DCD_XFER_SUCCESS to XFER_RESULT_SUCCESS 2018-11-23 15:22:46 +07:00