Commit Graph

1198 Commits

Author SHA1 Message Date
hathach 77495cf119
improve logging, allow easier to turn off usbd, driver logging
can be useful when focusing on let's say usbh
2023-07-20 17:12:00 +07:00
Lars Pötter 0693462eba made line ends consistent. 2023-07-02 09:02:24 +02:00
Devin Auclair 98fb10a724
Fix minor spelling 2023-06-28 14:03:18 -04:00
Ha Thach fe77b6713b
Merge pull request #2085 from georgeboc/msc-ready-bug-fix
Fixes bug in tuh_msc_ready
2023-06-27 17:57:35 +07:00
Ha Thach 50e61e0e16
Merge pull request #2101 from eustas/patch-1
Fix typos
2023-06-21 15:51:03 +07:00
hathach 8af8869d3b
renam OPT_MCU_MIMXRT to OPT_MCU_MIMXRT1XXX
fix build util with makefile
2023-06-16 11:26:38 +07:00
Ha Thach 433ffe2152
Merge pull request #1985 from kkitayam/uvc_bulk
Add the capability for video class to handle a bulk endpoint in the streaming interface.
2023-06-15 16:28:33 +07:00
Eugene Kliuchnikov 0833806980 Fix typos 2023-06-08 15:38:30 +02:00
gitlab acfaa4494f Fixes bug in tuh_msc_ready 2023-05-28 15:40:01 +01:00
hathach 26d05d7fc9
fix issue with ftdi host driver with status bytes
add workflow_dispatch to all ci workflow
2023-05-25 16:53:32 +07:00
hathach 1c4f22a54c
EHCI: fix xfer failed with disconnected device as stalled
- change CFG_TUH_ENDPOINT_MAX to 16 (max endpoint pair per device) if
not defined
- change QHD_MAX for EHCI, should be user configurable and more
optimized in the future
2023-05-16 11:09:22 +07:00
hathach 206d63e038
correct EHCI reporting failed xfer (instead of stalled) when device is unplugged 2023-05-16 11:09:21 +07:00
hathach 1763eede48
more update to host serial API 2023-04-28 22:14:14 +07:00
hathach fb5fe3360f
allow call tuh cdc with blocking (callback = NULL)
- tuh_cdc_set_control_line_state()
- tuh_cdc_set_baudrate()
- tuh_cdc_set_line_coding()
2023-04-28 21:50:54 +07:00
hathach 0a43a7b418
improve host serial drivers
- tuh_control_xfer() update xfer result to user_data if complete
callback = NULL (sync/blocking)
- refactor host serial driver for acm/ftdi/cp210x
2023-04-28 19:13:25 +07:00
hathach 190acc1fb0 add aligned(4) for cdc_line_coding_t 2023-04-28 11:12:03 +07:00
Jean-Baptiste Theou 8f47976639 cdc: fix line_coding aligment
While calling tud_cdc_n_get_line_coding, the structure is copied into
the destination.

Dump of assembler code for function tud_cdc_n_get_line_coding:
   0x000193f4 <+0>:	mov.w	r2, #2112	@ 0x840
0x000193f8 <+4>:	ldr	r3, [pc, #20]	@ (0x19410
<tud_cdc_n_get_line_coding+28>)
   0x000193fa <+6>:	mla	r0, r2, r0, r3
=> 0x000193fe <+10>:	ldr.w	r3, [r0, #6]
   0x00019402 <+14>:	str	r3, [r1, #0]

On some platform (tested on LPC55S28), the address needs to be 4-bytes
aligned. Without this, the address is

(gdb) p &_cdcd_itf.line_coding
$3 = (cdc_line_coding_t *) 0x40100006 <_cdcd_itf+6>

which leads to a HardFault. With this fix

(gdb) p &_cdcd_itf.line_coding
$5 = (cdc_line_coding_t *) 0x40100008 <_cdcd_itf+8>

and the function can be called properly

Signed-off-by: Jean-Baptiste Theou <jb@thing.com>
2023-04-27 15:48:15 -10:00
hathach 732686cc10 add tuh_cdc_set_baudrate() 2023-04-27 23:22:10 +07:00
hathach ee58278ed2 add code to calculate divisor from baudrate for ftdi 2023-04-27 23:08:25 +07:00
hathach 8214f0f497 clean up 2023-04-27 17:40:08 +07:00
hathach c10f52b237 forgot to add cp210x header 2023-04-27 17:39:02 +07:00
hathach 438387be8c more refactor 2023-04-27 17:32:56 +07:00
hathach 86f6fd17ed cp210x seems to work well 2023-04-27 17:09:21 +07:00
hathach a32ef1cde1 more host serial refactor 2023-04-27 16:32:42 +07:00
hathach 9698a088db refactor acm function 2023-04-27 15:29:44 +07:00
hathach 85d9925d24 refactor ftdi driver 2023-04-27 15:20:04 +07:00
hathach 293a6222f8 rename ftdi_host to ftdi_sio 2023-04-27 11:08:42 +07:00
hathach 45169d833d hacky, but ftdi work with hard code baudrate = 9600 2023-04-26 22:36:17 +07:00
Ha Thach c3a60ed355
Merge pull request #1920 from mikee47/fix/midi-definition
MIDI_CIN_NOTE_ON definition transposed with MIDI_CIN_NOTE_OFF
2023-04-18 10:43:52 +07:00
hathach 6db24e0dba implement tuh_hid_receive_ready() and tuh_hid_send_ready() 2023-04-06 11:16:28 +07:00
hathach 106084289d add define for vendor_flush() to write_flush() for backward compatible 2023-04-06 11:15:57 +07:00
epatstarkey 1372d4e4d5 Remove trailing whitespace 2023-03-31 12:58:51 -05:00
tobozo 805ebb3924 remove trailing space (satisfy pre-commit flow) 2023-03-30 22:01:36 +02:00
tobozo a77aaf7f9e Added helpers for abs_mouse_report 2023-03-30 21:57:06 +02:00
tobozo 290f18a1fe
Merge branch 'hathach:master' into master 2023-03-30 19:30:24 +00:00
epatstarkey 1fb2a2f1bd
Update vendor_device.c 2023-03-28 14:01:33 -05:00
epatstarkey 876f49f6ad
Update vendor_device.c 2023-03-28 14:00:23 -05:00
epatstarkey faaed198b4
Update vendor_device.h 2023-03-28 13:59:59 -05:00
kkitayam 993b8d6686 Add state variable 2023-03-26 21:18:00 +09:00
kkitayam e508831561 Update handle streaming interface 2023-03-25 21:25:13 +09:00
kkitayam 78732d6733 Fix streaming interface handling 2023-03-25 21:25:12 +09:00
kkitayam 97f9321e1d Add handling for bulk EPs 2023-03-25 21:25:12 +09:00
Ha Thach 5add4c97fa
Merge pull request #1979 from hathach/fix-cdc-host-unsupported-line-request
fix cdc host enumeration issue when device does not support line request
2023-03-24 17:58:34 +07:00
hathach df5f60b6d6 fix shadow warning 2023-03-24 17:36:29 +07:00
hathach b054229780 fix cdc host enumeration issue when device does not support line request 2023-03-24 17:26:30 +07:00
Ha Thach 59cbfbbdbe
Merge pull request #1971 from MattMills/class_net_net_device_mac_address_shouldnt_be_consts
Update net_device.h to make MAC addresses not const.
2023-03-24 16:48:33 +07:00
Ha Thach f640163ee9
Merge pull request #1969 from hathach/fix-tmc488-bit-order-1658
Fix tmc488 bit order 1658
2023-03-24 14:41:57 +07:00
hathach 71fb6469d4 separate CFG_TUSB_MEM_SECTION and CFG_TUSB_MEM_ALIGN to
- CFG_TUD_MEM_SECTION and CFG_TUD_MEM_ALIGN
- CFG_TUH_MEM_SECTION and CFG_TUH_MEM_ALIGN
- fix missing mem section and align for host
2023-03-24 14:05:21 +07:00
Matt Mills 4274cab395
Update net_device.h 2023-03-22 07:18:27 -06:00
hathach 096da11e88
more update 2023-03-22 17:01:04 +07:00
hathach c85f46c4ab
fix bitorder in usbtmc_response_capabilities_488_t 2023-03-22 16:59:57 +07:00
Ha Thach 07976ad26d
Merge pull request #1968 from hathach/refactor-hid-host
Refactor hid host
2023-03-22 10:37:06 +07:00
hathach f27486e19a add tuh_hid_itf_get_info() and change tuh_cdc_itf_get_info() to use new tuh_itf_info_t 2023-03-22 10:00:42 +07:00
hathach d22fc550c7 change meaning of CFG_TUH_HID to total number of HID interfaces supported.
- previously CFG_TUH_HID is max number of interfaces per device which is
rather limited and consume more resources than needed.
- change hid host instance in API to index
2023-03-21 21:04:06 +07:00
hathach 878f2b54fe relax hid host enumeration, allow set protocol to be stalled 2023-03-21 18:12:55 +07:00
Ha Thach ec9c666107
Merge pull request #1965 from HiFiPhile/align
UAC2: fix feedback EP buffer alignment.
2023-03-21 15:46:00 +07:00
Mengsk 42decd94e5 UAC2: fix feedback EP buffer alignment. 2023-03-21 07:58:39 +01:00
hathach e44e461ce3 add tuh_set_interface 2023-03-21 12:55:52 +07:00
hathach 9f54cc1eb7
more clean up 2023-03-18 11:43:47 +07:00
hathach d919f107c7
minor clean up 2023-03-18 11:22:44 +07:00
hathach bdfcd50b1b
Merge branch 'master' into portability 2023-03-17 23:53:38 +07:00
hathach 3623ba1884
fix trailing space and new line
temporarily disable codespell
2023-03-17 16:12:49 +07:00
hathach 317177c83d
update host example, add pio-pico-usb for rp2040 2023-03-17 14:06:25 +07:00
James Smith 296ce528fc Updated host hid_controller example to demo tuh_hid_send_report 2023-03-13 16:31:25 +07:00
James Smith f6774d5611 Implemented tuh_hid_send_report 2023-03-13 16:31:25 +07:00
Nathaniel Brough 95cfa37bf5 fix: Fix wrong destsz used with tu_memcpy_s
Bug: #1935
2023-03-05 18:47:48 -08:00
hathach 5d3084a714 add TUP_USBIP_FSDEV and TUP_USBIP_FSDEV_STM32, clean up ifdef with stm32 2023-03-01 11:22:04 +07:00
Ha Thach 3c38c7dc25
Merge pull request #1828 from HiFiPhile/stm32_fsdev
stm32_fsdev & ISO EP buffer allocation improvements
2023-02-28 23:45:02 +07:00
hathach ffdc100cb9 rename ep_num to ep_idx, minor clean up 2023-02-28 17:11:59 +07:00
Ha Thach 65ac519715
Merge pull request #1852 from silvergasp/mem_s
fix: Replace device calls to memcpy with tu_memcpy_s
2023-02-27 10:22:53 +07:00
hathach e34aeb5cf6 minor clean up 2023-02-27 09:11:35 +07:00
mikee47 302b9562dc MIDI_CIN_NOTE_ON definition transposed with MIDI_CIN_NOTE_OFF 2023-02-22 09:58:30 +00:00
hathach 498989ee00
use tu_static instead of static _fuzz_thread 2023-02-22 16:23:40 +07:00
Ha Thach 557bf82336
Merge pull request #1867 from silvergasp/thread_local_globals
fix: Change all static variables to thread when fuzzing
2023-02-22 12:54:32 +07:00
hathach 03ec49450d
rename maros from FUZZ to _FUZZ, change TU_STATIC to static _fuzz_thread 2023-02-22 11:47:09 +07:00
rppicomidi fde7577117 Fix issue 1909 2023-02-15 20:02:12 -08:00
Jeff Trull 7e2c5fcc8a Correct bitfields for cdc_desc_func_telephone_call_state_reporting_capabilities_t 2023-02-12 20:52:17 -08:00
Jeff Trull f48ae4aad7 Adjust reserved bitfields to make SDCC happy
- keep each field at or under 16b
- For optimal packing, segment fields to 8b boundaries
2023-02-10 15:54:04 -08:00
hathach 3422e05684
change length in tud_hid_report_complete_cb() from uint8 to uint16 2023-02-04 11:43:23 +07:00
Nathaniel Brough 18c3095346 fix: Change all static variables to thread when fuzzing 2023-01-20 15:45:31 -08:00
hathach daec3c24d8 fix warnings with arithmetic on void* pointer 2023-01-20 15:30:45 +07:00
Nathaniel Brough 2e47210c1a fix: Replace device calls to memcpy with tu_memcpy_s
Introduces a new function tu_memcpy_s, which is effectively
a backport of memcpy_s. The change also refactors calls
to memcpy over to the more secure tu_memcpy_s.
2023-01-13 15:20:32 -08:00
Ha Thach 83cc71feaf
Merge pull request #1820 from Staacks/master
Fix UVC probe and commit on MacOS
2023-01-07 23:30:30 +07:00
Ha Thach 6e23c596cc
Merge pull request #1837 from pete-pjb/master
Fix typo in audio.h. Specifiy _ctrl_xfer struct in CFG_TUSB_MEM_SECTION in usbh.c
2023-01-06 10:24:55 +07:00
Mengsk 8c591e2c45 More warning fixes 2023-01-04 12:40:01 +01:00
pete-pjb f5cffeedec Fix typo in audio.h. Specifiy _ctrl_xfer struct in CFG_TUSB_MEM_SECTION
Add NULL check to loop in list_remove_qhd_by_addr() function in ehci.c
2023-01-03 10:33:36 +00:00
Mengsk 82f105e32b Fix IAR warning: Warning[Pe381]: extra ";" ignored 2023-01-02 21:18:10 +01:00
Mengsk 51bb27a131 Optimize descriptor looping. 2022-12-31 13:37:22 +01:00
Mengsk 21bdafcfef Add ISO buffer allocation. 2022-12-30 01:08:04 +01:00
Mengsk e4f07206f8 UAC : Enable fifo based transfer on stm32_fsdev 2022-12-29 19:34:12 +01:00
Staacks 95ba158a10 Fix UVC probe and commit on MacOS 2022-12-27 23:02:33 +01:00
hathach d0ca6ca8f7
fix ncm warning 2022-12-27 18:21:56 +07:00
hathach 48d4a67ec5
add tuh_cdc_peek() 2022-12-24 01:11:13 +07:00
hathach 15a02d04df
fix incorrect rx buf in cdc 2022-12-22 21:35:55 +07:00
hathach 396716cc2c
clean up 2022-12-22 20:26:32 +07:00
hathach f33883c308
add tuh_cdc_get_local_line_coding() 2022-12-22 19:41:39 +07:00
hathach 14d45b580e
correct host cdc enum 2022-12-22 19:17:09 +07:00
hathach 05c119ce97
cdc host, add set line coding API 2022-12-22 18:28:06 +07:00
hathach 11233e4d3e
minor clean up 2022-12-22 11:43:57 +07:00
hathach 2d536123c8
finish moving edpt stream to tusb.c 2022-12-22 11:31:37 +07:00
hathach e3c9d94500
fix stream read count computation 2022-12-22 11:16:39 +07:00
hathach 8323e4b79a
moving edpt_stream API into common tusb.c 2022-12-22 08:52:01 +07:00
hathach 9e8ea44925 add tuh_cdc_write_clear, rename read_flush() to read_clear() 2022-12-21 17:49:50 +07:00
hathach cd9008e5a9 add tuh_cdc_tx_complete_cb() callback 2022-12-21 13:05:45 +07:00
hathach 84a483f5ea add more host cdc API
tuh_cdc_write_available(), tuh_cdc_read_flush(), tuh_cdc_rx_cb()
callback
2022-12-21 12:47:00 +07:00
hathach badb30a6c3 correct cdc host app 2022-12-21 12:25:13 +07:00
hathach 22b62f8712 add tu_edpt_stream_write_zlp_if_needed() 2022-12-21 12:07:12 +07:00
hathach 76021c7359 rename tud_edpt_stream_write_xfer 2022-12-21 11:49:28 +07:00
hathach cb2af4c0bc minor debug log 2022-12-21 11:46:58 +07:00
hathach 37529c41da fix ci 2022-12-21 10:46:47 +07:00
hathach 854e5222ae finalizing cdc host, has a working read/write
TODO: first character seems not to get echoed. set control line state
seems to failed with LOG < 2
2022-12-21 00:26:46 +07:00
hathach 7004914d8c fix hid host incorrect edpt release if failed to transmit
add CDC_CONTROL_LINE_STATE_DTR/RTS, TUSB_INDEX_INVALID enum
2022-12-20 12:06:59 +07:00
hathach fc9321ce26 correct cdc usbh_driver_set_config_complete() 2022-12-16 23:54:21 +07:00
hathach 4811b3463f stub 2022-12-16 17:08:37 +07:00
hathach bd1f7f86ce add common EPSIZE for bulk/iso in full and highspeed
adding cdc host fifo tx/rx
2022-12-16 17:08:37 +07:00
hathach f62f973956 minor rename 2022-12-16 17:08:37 +07:00
hathach f0c51eae44 cdc check for bNumEndpoints before checking for endpoint descriptor 2022-12-16 17:08:37 +07:00
hathach 4f03695084 adding tuh_cdc_mount_cb/tuh_cdc_umount_cb
start adding cdc_app.c to example
2022-12-16 17:08:37 +07:00
hathach 96d2be905b fix build with usbtmc 2022-12-15 18:47:54 +07:00
hathach 88e6da7273 use OSAL_MUTEX_REQUIRED to replace CFG_FIFO_MUTEX/TUSB_OPT_MUTEX
add macro to swallow mutex API in order to simplify code with mutex
2022-12-15 18:03:01 +07:00
scoudreau 007ed1f0fe
Added missing typecast to pass build checks 2022-12-08 14:50:34 +01:00
Sebastien COUDREAU 15ab35d9b8 usbtmc: correct packet size bug
Code was only reading the first 64 bytes of a 512 bytes packet.
2022-12-08 11:35:32 +01:00
hathach 19400c8556 fix typo, add -Wno-error=unreachable-code for fuzz due to latest cdc changes 2022-12-08 10:30:22 +07:00
Tomas Rezucha 603effbb77 cdc: Fix autoflush for FIFO < MPS 2022-12-06 07:49:26 +01:00
Ha Thach f03c28ec31
Merge pull request #1776 from hathach/hid-fido
Hid fido
2022-12-05 14:32:49 +07:00
hathach d58120647a rename to match fido sample uf2_hid..h 2022-12-05 13:18:05 +07:00
hathach 43b255f413 more typos 2022-12-04 19:44:01 +07:00
Bastien Nocera 6a2cf67289 Fix typos 2022-12-04 19:43:23 +07:00
hathach 7298923927 rework tuh_msc_complete_cb_t signature to use new tuh_msc_complete_data_t
add user arg to all scsi command API that support complete callback
2022-11-23 16:01:48 +07:00
hathach 64ecf43663
whitespace 2022-11-21 11:53:15 +07:00
Mark K Cowan 9673d20901 PanRe refactor applied: s{_int_ctr_}{_int_}g; s{_INT_CTR_}{_INT_}g; 2022-10-26 21:43:27 +03:00
Mark K Cowan 15ed45e1a3 clean up descriptor search for interrupt endpoint 2022-10-26 21:40:30 +03:00
Ha Thach 28f49c088b
Merge pull request #1698 from battlesnake/fix-attrs-on-struct-member
do not apply storage attributes to member of struct
2022-10-25 15:23:09 +07:00
Mark K Cowan 025d3477e8 fixed spec reference 2022-10-24 20:41:09 +03:00
Mark K Cowan 815c2cc995 keep alignment spec 2022-10-24 20:36:45 +03:00
Mark K Cowan f931983469 UAC2 supports interrupt-endpoint for providing control-change notifications to the host 2022-10-23 13:38:24 +03:00
Mark K Cowan 4ec1643bdb do not apply storage attributes to member of struct 2022-10-20 22:46:21 +03:00
Ha Thach e79325adec
Merge pull request #1668 from kkitayam/add_support_for_mjpeg
Add support for MJPEG on UVC
2022-10-19 23:10:11 +07:00
gaoyichuan 3846d5f38c hid: add configurable report size for fido 2022-10-15 19:22:21 +08:00
gaoyichuan 2a520fb921 hid: add fido hid descriptor templates 2022-10-15 19:07:07 +08:00
kkitayam 53dc9d55b5 Fix pointer type to calculate streaming parameter 2022-10-12 20:41:03 +09:00
kkitayam 4be7ffd63f Fix max payload size to clip at 1023 2022-10-07 21:30:03 +09:00
kkitayam ee832e4e37 Fix descriptor searching 2022-10-03 21:41:58 +09:00
Mark K Cowan 6c3c2df823 audio_device: prototype added for function referenced before use 2022-09-17 21:27:04 +03:00
Ben Avison 62d90c8500 Move variable into its own curly-brace scope
IAR generates warning Pe546 'transfer of control bypasses initialization of
variable "invInvTag"'.
2022-09-13 18:00:51 +01:00
Ben Avison caff3b5c54 Remove unused static data
This affects struct rspMsg in usbtmc_app.c (unconditionally) and uint8_t
termChar in usbtmc_device.c (when NDEBUG is defined). IAR generates warning
Pe550 'variable was set but never used'.
2022-09-13 18:00:51 +01:00
Ben Avison 6a2d01bae4 Don't assume different enum types can be combined
IAR generates warning Pa089 'enumerated type mixed with another enumerated
type'.
2022-09-13 18:00:51 +01:00
Ben Avison 53f0d5538b Don't assume ints automatically convert to enums
IAR generates warning Pe188 'enumerated type mixed with another type'.
2022-09-13 18:00:50 +01:00
Ben Avison 65ba15c37d Remove unreachable code
IAR generates warning Pe111 'statement is unreachable'. In a couple of
cases, replace return statements with TU_ATTR_FALLTHROUGH; because some
compilers apparently can't figure out that the return statements are
unreachable but do whinge about an imagined fall-through without them!
2022-09-13 18:00:50 +01:00
Ben Avison 16518dcbbb Refactor pointer arithmetic on void*
This is a GCC extension, illegal in ISO C. IAR generates errors Pa152
'these operand types cannot be used here' and Pe852 'expression must be a
pointer to a complete object type'.

Replace with uint8_t*.
2022-09-13 18:00:49 +01:00