Commit Graph

578 Commits

Author SHA1 Message Date
hathach 8813f9d3b8 clean up 2020-11-20 15:33:05 +07:00
hathach e2abb089f4 migrate midi device to new control xfer cb 2020-11-20 15:30:36 +07:00
hathach dc9a309839 migrate hid device to new control xfer cb 2020-11-19 22:00:49 +07:00
hathach dd07fecc5f migrate cdc_device to new control_xfer_cb 2020-11-19 21:26:06 +07:00
hathach 3c31d08051 merge class driver control_request & control_complete to control_xfer_cb()
migrated msc_device
2020-11-19 21:01:33 +07:00
Ha Thach a708ab6254
Merge pull request #553 from hathach/host-async-control
Host async control
2020-11-07 10:52:14 +07:00
Jacob Potter 226efdcec0 Reduce excessive poll rate on interrupt endpoint 2020-11-05 18:14:56 -07:00
Jacob Potter bb0df2740e Add CDC NCM driver 2020-11-04 20:51:57 -07:00
Jacob Potter 3ea8138750 Rename CDC_COMM_SUBCLASS_ETHERNET_NETWORKING_CONTROL_MODEL
This was a confusing name; "Ethernet control model" (CDC ECM)
and "network control model" (CDC NCM) are two separate USB subclasses.
2020-10-31 10:57:53 -06:00
Jerzy Kasenberg 8669fd7383 audio: Add two channel feature unit descriptor
Feature unit descriptor size depends on number of channels.
So far only single channel feature unit was present.
This change adds feature unit descriptor for two channels.
2020-10-15 15:37:40 +02:00
hathach 87b989e8b4 add usbh_edpt_claim/release
implement USBH_EVENT_FUNC_CALL
2020-10-12 00:35:45 +07:00
hathach b5d4c8185d Merge branch 'master' into host-async-control 2020-10-11 16:22:12 +07:00
Reinhard Panhuber 032e84c9be Revert dcd_alloc_mem_for_conf() but keep changes from @kasjer for ISO EP
Add tud_audio_set_itf_close_EP_cb()
2020-10-09 19:50:05 +02:00
hathach 74a1404bea tab -> spaces 2020-10-07 13:36:27 +07:00
hathach d41248900b Merge branch 'uac2' of https://github.com/PanRe/tinyusb into PanRe-uac2 2020-10-06 22:32:22 +07:00
Reinhard Panhuber 603ce17696 Change AUDIO_CS_INTERFACE_HEADER to AUDIO_CS_AC_INTERFACE_HEADER 2020-10-01 17:49:30 +02:00
Jerzy Kasenberg b2ce7a39b0 device: Make number of endpoints configurable
Currently number of endpoints was hard coded to 8.
NRF52 has 9 IN and 9 OUT endpoints.
ISO endpoints are 0x08 and 0x88 and without this change those
two ISO endpoint could not be used.
2020-10-01 09:22:49 +02:00
Reinhard Panhuber 13a9cbde79 Change AUDIO_FUNC_PROTOCOL_CODE_UNDEF for midi in usbd.h 2020-09-29 23:30:35 +02:00
Reinhard Panhuber 142871654e Merge remote-tracking branch 'upstream/master' into uac2 2020-09-28 18:08:39 +02:00
Jerzy Kasenberg f55437d889 audio: Add descriptor for mono speaker
This provides descriptor for mono speaker with
explicit feedback.
2020-09-28 08:41:17 +02:00
Jerzy Kasenberg 2ace98e943 audio_device: Update explicit feedback support
Feedback can be specified by the user code and will be
sent at feedback endpoint specified interval.
2020-09-28 08:41:17 +02:00
hathach 9c0d15fc43 more const 2020-09-14 22:23:59 +07:00
hathach 23e6ee2ea2 cdc device: claim endpoint before checking fifo availability
- add pre-check to reduce mutex lock in usbd_edpt_claim
2020-09-14 22:14:31 +07:00
hathach ce4a9b9c3a clean up 2020-09-11 00:14:07 +07:00
hathach 801f8b5b38 update claim edpt for hid and midi 2020-09-10 23:32:08 +07:00
hathach 33f0a18523 update cdc edpt read 2020-09-09 16:25:31 +07:00
hathach 8b9893cada introduce optional usbd_edpt_claim, usbd_edpt_release which can be used to gain exclusive access to usbd_edpt_xfer 2020-09-09 15:48:11 +07:00
hathach b8b95e8494 add in_isr to all hcd event functions 2020-09-05 15:46:50 +07:00
hathach 4d57b4ea33 clean up 2020-09-05 13:57:07 +07:00
Reinhard Panhuber 12562fc966 Merge remote-tracking branch 'upstream/master' into uac2 2020-09-04 16:23:39 +02:00
hathach 1d83ad0ebb rename tuh_isr/hcd_isr to tuh_int_handler/hcd_int_handler 2020-09-03 13:12:25 +07:00
Reinhard Panhuber 6309364722 Merge remote-tracking branch 'upstream/master' into uac2
Conflicts:
	src/device/usbd.c
	src/device/usbd.h
	src/portable/st/synopsys/dcd_synopsys.c
2020-08-16 14:08:24 +02:00
hathach a9d362185b update note for app driver list mustbe accesible at all time. 2020-08-07 15:06:19 +07:00
hathach 01b9b77d3b allow application driver to overwrite built-in one
- position application driver before built-in
- remove dcd.h from public include.
2020-08-07 14:47:32 +07:00
hathach 9df8057702 Merge branch 'master' into add-app-driver 2020-08-07 12:13:13 +07:00
hathach acde49ccc9
enable pull-up in dcd_init() instead of usbd 2020-08-01 20:14:58 +07:00
Reinhard Panhuber 01903a4a6d Implement dynamic reallocation of RX and TX fifos for EP0.
Tested with EP0 size 8/16/32/64.
2020-07-27 21:03:20 +02:00
Reinhard Panhuber e047fbe8fb Merge remote-tracking branch 'upstream/master' into uac2 2020-07-25 14:26:24 +02:00
hathach 503c15217e
example to call tud_init() after freeRTOS kernel is started
add note for usb init when using with RTOS
2020-07-23 09:20:45 +07:00
Ha Thach be744e1e01
Merge pull request #466 from chang196700/feature/string_desc_msos
Remove 0xEE index string if statement & change TU_ASSERT to TU_VERIFY
2020-07-21 20:25:08 +07:00
Chang Feng 5cd654838b
Remove 0xEE index string if statement & change TU_ASSERT to TU_VERIFY
Signed-off-by: Chang Feng <chang_196700@hotmail.com>
2020-07-19 19:13:17 +08:00
Reinhard Panhuber d0f3d03933 Intermediate commit. 2020-07-17 08:40:10 +02:00
hathach 706413f751 add tud_speed_get()
- define both fs and hs configuration descriptor
- rename CFG_TUD_CDC_EPSIZE to CFG_TUD_CDC_EP_BUFSIZE with default size of 64 for FS, and 512 for HS
2020-07-16 00:44:09 +07:00
hathach ab75998316 Merge branch 'master' into add-stm-hs 2020-06-30 01:55:57 +07:00
Reinhard Panhuber 28505cf03e Merge branch 'master' into uac2
Conflicts:
	src/device/usbd.c
2020-06-20 11:10:35 +02:00
Reinhard Panhuber ada82b840f Get update from tinyusb. 2020-06-20 10:51:21 +02:00
Mengsk 57b553e023 Fix IAR warnings.
Pa039 : use of address of unaligned structure member.
Pe188: enumerated type mixed with another type.
2020-06-17 10:08:33 +02:00
Reinhard Panhuber bc7e24b659 Fix wrong comment for IAD checks. 2020-06-14 14:22:10 +02:00
hathach 95966c2201 improve usbd log for control transfer 2020-06-14 18:29:02 +07:00
Reinhard Panhuber b25bbf4776 Fix alignment. 2020-06-14 12:58:16 +02:00
Reinhard Panhuber 3012175351 Fix alignment. 2020-06-14 12:57:00 +02:00
Reinhard Panhuber 862d1667f0 Fix alignment. 2020-06-14 12:55:52 +02:00
Reinhard Panhuber 930817221d Merge branch 'fix-too-strict-iad-checks' into uac2
Conflicts:
	src/device/usbd.c
2020-06-14 12:36:59 +02:00
Reinhard Panhuber 48b2e6cf78 Fix too strict checks on subclass and interface of iad descriptor. 2020-06-13 13:51:50 +02:00
Reinhard Panhuber 4362665fb3 Fix mic audio descriptor, fix too strict check on IAD desc. in usbd.c 2020-06-13 12:36:05 +02:00
Reinhard Panhuber d2f1bb58b3 Merge branch 'master' into uac2 2020-06-11 14:35:44 +02:00
hathach e92118635c adding speed detect on bus reset 2020-06-01 13:40:18 +07:00
hathach f771afe6af fixed EP0 size to 64 since LS is not supported in device mode
- set turn-around and report actual speed in Enum Done
- add dcd_event_bus_reset() helper to report speed
2020-05-31 23:43:29 +07:00
Ha Thach 5efeaf2ac1
Merge pull request #413 from kasjer/kasjer/ble-over-usb
Bluetooth HCI transport over USB
2020-05-31 15:07:56 +07:00
hathach d6d29897f3 add get device qualifier descriptor 2020-05-28 23:16:16 +07:00
Jerzy Kasenberg 56d46483e4 Add bt hci device class
Code implements USB transport for bluetooth HCI.
2020-05-28 10:58:49 +02:00
Jerzy Kasenberg 077437b3dc Add non standard request handling in class
For some reason bluetooth stack implementations send class requests
to device instead of interface.
To implement HCI interface over USB non device addressed requests
for class need to be handled.
2020-05-28 10:11:37 +02:00
hathach e340404968
changing usbd driver open() return type, add max_len
only done with cdc and msc, push this interim for feedback first
2020-05-27 19:01:59 +07:00
hathach d4bf777c94 try to get synopsys work with OTG HS + external PHY 2020-05-27 11:01:33 +07:00
Reinhard Panhuber 9be2f1bf3d Add basic UAC2 structure - untested 2020-05-22 12:09:34 +02:00
hathach 88a455a9b9 added tud_task_event_ready()
to check if there is pending events in the tud task without executing
it. Useful to check before entering low power mode with WFI/WFE
2020-05-20 14:31:45 +07:00
Sean Cross 63bd8d2e44 device: fix build warning when CFG_TUSB_DEBUG >= 2
The function is defined inside of a function body which generates a
warning.  Circuit Python treats these warnings as errors, and so
refuses to build with debugging enabled:

    ../../lib/tinyusb/src/device/usbd_control.c: In function 'usbd_control_xfer_cb':
    ../../lib/tinyusb/src/device/usbd_control.c:195:19: error: nested extern declaration of 'usbd_driver_print_control_complete_name' [-Werror=nested-externs]
      195 |       extern void usbd_driver_print_control_complete_name(bool (*control_complete) (uint8_t, tusb_control_request_t const *));
          |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    make: *** [../../py/mkrules.mk:55:
    build-simmel/lib/tinyusb/src/device/usbd_control.o] Error 1

Move the declaration to the top of the function to silence this warning.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-07 19:03:40 +08:00
hathach 6f4b6a1d03 remove the use of TU_VERIFY_HDLR 2020-04-29 11:31:27 +07:00
hathach c14c0cfc9f support class drivers implemented by application 2020-04-29 10:49:58 +07:00
Ha Thach d4511186a2
Merge pull request #383 from kasjer/kasjer/fox-busy-flag-race-condition
Fix endpoint busy flag race condition
2020-04-29 10:12:31 +07:00
hathach fcdb22b2f9 fix typo 2020-04-28 10:53:43 +07:00
Jerzy Kasenberg 63cefb7615 Fix endpoint busy flag race condition
Busy flag was set to true after call to dcd_edpt_xfer().
In some cased it was possible that transfer finished before function
ended.
In this case busy flag could be set to false before it was set to
true.
Then setting it to true after dcd_edpt_xfer() made edpoint busy forever.

This change marks endpoint as busy before transfer is started to
avoid race condition.
2020-04-27 16:42:35 +02:00
hathach a1c599f4b6 clean up log message 2020-04-26 22:02:49 +07:00
hathach 017c95037f add usbd edpt open
- RTT mode is blocking to prevent log lost
- Improve logging message
2020-04-26 14:51:44 +07:00
Ha Thach 379b8ac556
Merge pull request #365 from pigrew/desc_tu_verify
tu_verify for getting descriptors
2020-04-22 12:24:05 +07:00
Nathan Conrad 0ec69de77c sof is optional, revert other changes but remove unneeded check. 2020-04-21 10:06:17 -04:00
Nathan Conrad d1656c0b8d tu_verify for getting descriptors 2020-04-20 16:09:15 -04:00
hathach bbcf9241bd add back MIDI multiple jack 2020-04-20 23:46:17 +07:00
hathach 6f9c256ad0
complete remove dcd_set_config(), fix unit test 2020-04-17 13:52:34 +07:00
hathach 05476d9ad7 Merge branch 'master' into remove-dcd-set-config 2020-04-17 13:38:22 +07:00
hathach 50be9d7c3a
mass rename tud/dcd_irq_handler to tud/dcd_init_handler 2020-04-17 12:27:53 +07:00
Ha Thach 33610751d7
Merge pull request #336 from pigrew/edpt_close
> If you notice my chain of events above, the bulk transfer was started BEFORE the SET_INTERFACE call. The USB device hardware swaps the order of them being delivered. On STM32, it gives priority to the lower-numbered EP index.

It shouldn't be a matter, control is 2+ stage, before sending the setup. Host should stop all communication to the endpoint that It wants to close.
2020-04-16 23:10:36 +07:00
Ha Thach bfec3b4479
Merge pull request #345 from hathach/add-alt-itf
Implement setInterface(alt) for usb net driver
2020-04-16 21:33:03 +07:00
Nathan Conrad 2994d100cd Remove transfer queue filtering. May need to be revisited later. 2020-04-16 09:59:40 -04:00
hathach 969121df4f
added dcd disconnect/connect to lpc17/40 2020-04-16 15:52:45 +07:00
hathach 2eed58d096
per review 2020-04-16 11:13:54 +07:00
hathach 0ddbda08cb
always response if GET_INTERFACE even if class driver does not support alt interface 2020-04-15 23:08:49 +07:00
hathach caa1dceed9
implement alternate setInterface() request
mostly forward these request (recipient = interface) to class driver.
2020-04-15 17:51:02 +07:00
hathach d315393fbb
use IAD to assign itf2drv mapping correctly
merge net_data back into net driver
2020-04-15 16:18:24 +07:00
hathach 0b39168dc2
add IAD for CDC ECM, remove EEM descriptor template 2020-04-15 15:40:53 +07:00
hathach b03b9eb939
change cdc template protocol to None 2020-04-15 15:14:26 +07:00
hathach 93ffe317b2
clean up 2020-04-15 13:53:50 +07:00
hathach 3bfb402d8c
clean up 2020-04-15 11:44:12 +07:00
hathach 1faa3b2768
tested usbnet, completely remove class code 2020-04-15 11:41:26 +07:00
hathach c74f7e708e
remove class_code/subclass/protocol from driver structure, add name for logging 2020-04-15 11:06:35 +07:00
hathach f1a6f92fab
Merge branch 'master' into class-driver-id 2020-04-15 10:47:49 +07:00
Peter Lawrence 7fa8d87291 usbnet: remove CDC-EEM 2020-04-14 21:10:43 -05:00
hathach 3ef6e33533
use class driver open() for interface support detection
tested with dfu_runtime
2020-04-15 01:00:37 +07:00
hathach ae60146274 use explicit all_subclass and all_protocol since 0xFF is stil valid 2020-04-14 22:35:34 +07:00
Nathan Conrad 16f65890eb Merge branch 'master' into edpt_close 2020-04-14 10:22:03 -04:00
hathach b90b00d43b
complete adding subclass and protocol to driver id 2020-04-14 18:35:50 +07:00
hathach 593fe154ec
adding subclass & protocol to class driver structure 2020-04-14 18:00:59 +07:00
Ha Thach 57ffa94a52
Merge pull request #334 from majbthrd/usbnet_osagnostic
usbnet: OS-agnostic (Windows/Linux/macOS) network driver
2020-04-14 17:39:50 +07:00
Nathan Conrad de208b31cf edpt_close: Remove item from queue instead of modifying it. 2020-04-13 11:05:34 -04:00
Nathan Conrad f8e7487355 edpt_close: Updated based on feedback. 2020-04-13 09:51:46 -04:00
hathach f4df829399 lpc17xx move set configdevice into set address
for removing dcd_set_config()
2020-04-13 17:04:18 +07:00
Nathan Conrad 0eeaccaf46 Skeleton, and initial stm32fsdev implementation (that leaks memory) 2020-04-12 21:27:27 -04:00
Peter Lawrence bb3bbcc00b usbnet: OS-agnostic (Windows/Linux/macOS) network driver 2020-04-12 15:41:18 -05:00
Ha Thach 04a06ec401
Merge branch 'master' into refactor-irqhandler 2020-04-11 15:49:34 +07:00
Ha Thach 07809d03a7
Merge pull request #332 from pigrew/stm32fsdev-dcdconnect
stm32fsdev: Implement dcd_connect.
2020-04-11 13:20:31 +07:00
Ha Thach 2ff3f765db
Merge pull request #319 from hathach/add-esp32s2
port ESP32 S2
2020-04-10 23:53:03 +07:00
Nathan Conrad 5bd9d14fc1 stm32fsdev: set dcd_connect API definitions to strong, Modify documentation. 2020-04-10 10:26:41 -04:00
hathach 1b3d1b52c9 fix uint32_t format with log 2020-04-10 13:54:50 +07:00
Nathan Conrad 715c4dbbf8 stm32fsdev: Implement dcd_connect. 2020-04-09 17:03:12 -04:00
hathach 11201f1a06 adding dcd_connect/disconnect 2020-04-09 11:42:42 +07:00
hathach 4179334aca call tud_irq_handler() for all nrf5x board 2020-04-06 17:35:11 +07:00
hathach fb05451a26 mass rename dcd_isr() to dcd_irq_handler() 2020-04-06 17:24:22 +07:00
hathach dc4bf02dcb mass rename tud_isr to tud_irq_handler 2020-04-06 17:04:49 +07:00
hathach c026236824 house keeping 2020-04-06 16:33:04 +07:00
hathach 2d6d298302 move irqhandler to application
tud_isr() must be called by application to forward the irqhandle to the
stack
2020-04-06 14:11:45 +07:00
Peter Lawrence 794212d44e revise argument order for TUD_CONFIG_DESCRIPTOR macro 2020-03-31 10:53:47 -05:00
Peter Lawrence 87f313da48 add provision for multiple configurations 2020-03-30 13:47:17 -05:00
Nathan Conrad 6606cf2896 USBD: Use tud_control_xfer only for data 2020-03-27 15:54:37 -04:00
hathach 4f871063fd Merge branch 'master' into cr1901-msp430f5529 2020-03-22 17:19:57 +07:00
Nathan Conrad 7f6316dbe1 Use CRLF on UART. 2020-03-14 14:26:14 -04:00
hathach c8247f0907 fix zlp for nrf52840 2020-03-08 14:20:28 +07:00
hathach 7aa5a53652 fix log printf 2020-03-08 13:26:36 +07:00
Ha Thach 5f5ee465a6
Merge pull request #291 from hathach/port-samg55
Port samg55
2020-03-07 16:38:59 +07:00
Peter Lawrence fee79d7466 add CDC-ECM/RNDIS/CDC-EEM network device class with example 2020-03-02 21:15:01 -06:00
Chang Feng b8ea0f0a6b
Add langid support to descriptor string callback.
Signed-off-by: Chang Feng <chang_196700@hotmail.com>
2020-02-26 13:07:15 +08:00
hathach b6b9fe42af more log for debugging 2020-02-07 16:43:44 +07:00
Nathan Conrad 25c1bea782 Normalize line endings 2020-01-15 14:47:43 -05:00
Ha Thach d6a8d42bd6
Merge pull request #254 from majbthrd/multi-setconfig
gracefully handle multiple SET_CONFIGURATION requests
2020-01-05 17:48:55 +07:00
Jeremy Herbert db24b2f372 Let device respond to endpoint requests on EP0 (#251)
Since endpoint 0 is used for control requests, it doesn't have a class driver attached to it. As such, the corresponding `_usbd_dev.ep2drv` entry points to driver `0xFF`, which is invalid and this makes the `TU_ASSERT(drvid < USBD_CLASS_DRIVER_COUNT);` line fail, and eventually causes an endpoint stall. So as-is the stack cannot respond to any endpoint requests on endpoint 0.

However, standard requests on endpoint 0 do not need a class driver to produce a valid response. This commit changes the order of execution so that the assert is only checked if the endpoint is not 0.
2019-12-30 10:58:06 +07:00
Peter Lawrence e7bf66b29e gracefully handle multiple SET_CONFIGURATION requests 2019-12-28 16:49:52 -06:00
hathach 2caa1ac078 Merge branch 'master' into develop 2019-12-24 21:13:05 +07:00
hathach bbada1d3e6 adding lookup table for debugging
add msc scsi command list
2019-12-23 18:54:06 +07:00
hathach 050fa2fd39
able to response to scsi inquiry, but failed to response to test unit ready 2019-12-21 19:33:41 +07:00
hathach a1e55e57a4
clean warnings 2019-12-20 17:09:42 +07:00
hathach d7558e8a0f use dcd_edpt0_status_complete() to set address without blocking for samd21/samd51/stm32_fsdev 2019-11-28 13:39:29 +07:00
hathach 5dc04887e2 get passed set address 2019-11-28 11:48:08 +07:00
hathach 6bc245cb36 add dcd_edpt0_status_complete() which is useful for several mcu port 2019-11-28 11:46:36 +07:00
hathach 40b454cf28 get passed first get device descriptor 2019-11-27 23:20:48 +07:00
hathach 8a1b6327ba extract code to invoke_class_control()
- also rename usbd_class_drivers to _usbd_driver
2019-11-27 12:12:52 +07:00
hathach f5d737aa7e moving irq to bsp for lpc17/40 2019-11-21 23:19:38 +07:00
hathach bbec47b647 adding tud_isr/tuh_isr with lpc18/43 2019-11-21 22:20:30 +07:00
hathach 1ab3a1035c Merge branch 'master' into cr1901-msp430f5529 2019-11-05 10:17:36 +07:00
hathach 3c49ff153e
Merge pull request #149 from pigrew/ZLP_Request2
Zlp request2
2019-11-05 00:05:21 +07:00
Nathan Conrad 8d0fa158d7 Change one more TU_ASSERT to TU_VERIFY in usbd. 2019-11-04 11:33:14 -05:00
hathach 2727983a2d fix #211 2019-11-04 22:52:29 +07:00
Nathan Conrad a94fe05ecb usbd: Change TU_ASSERT to TU_VERIFY as the assertion can be hit when bad data is sent from host. 2019-11-04 08:59:29 -05:00
hathach 44ad683bd6 fix tud_control_status() didn't update request 2019-11-04 11:21:57 +07:00
hathach 65e96e5d52 added optional dcd_control_status_complete() 2019-11-03 18:00:07 +07:00
hathach 62f8c14fae add a bit of log1 for debugging 2019-11-03 14:08:38 +07:00
hathach 7bf01e218d make control buf static 2019-11-03 11:43:07 +07:00
hathach 1b51b78eaf hack the request length for the first get device descriptor if EP0 size =8 or 16
to prevent usbd control send out ZLP
2019-11-03 00:17:17 +07:00
hathach a0cffdc843 Merge branch 'pigrew-ZLP_Request2' into cr1901-msp430f5529 2019-11-02 23:29:35 +07:00
hathach 164d0db825
Merge branch 'ZLP_Request2' into pigrew-ZLP_Request2 2019-11-01 10:16:59 +07:00
Nathan Conrad d35f86993f Merge remote-tracking branch 'origin/master' into ZLP_Request2 2019-10-31 12:23:54 -04:00
hathach cacbb80a90
zlp should work with control in, tested with Unity framework 2019-10-31 21:14:06 +07:00
hathach 6de9eb4b1a
add more tests, fix an issue with tud_descriptor_configuration_cb() return NULL 2019-10-31 13:06:57 +07:00
hathach d9ba4d90a8
move function around, more rename 2019-10-31 12:26:36 +07:00
hathach 0029b58417
rename 2019-10-31 12:18:41 +07:00
hathach e6857d8ee0
clean up 2019-10-31 11:25:41 +07:00
hathach 8a57997c0f Merge branch 'master' into pigrew-ZLP_Request2 2019-10-31 09:57:52 +07:00
hathach 4d329d46cc
Merge pull request #206 from hathach/develop
Added a couple of unit testing with Ceedling/Cmock/Unity
2019-10-31 08:29:11 +07:00
hathach a0002cc709
rename usbd_init() to tud_init() 2019-10-30 23:26:34 +07:00
hathach 16665672a4 initally adding test_usbd.c 2019-10-30 12:24:07 +07:00
hathach 880ac1e398 move dcd event helper to be dcd.h as inline function 2019-10-30 11:35:25 +07:00
hathach a29eb87c38 Merge branch 'ZLP_Request2' of https://github.com/pigrew/tinyusb into pigrew-ZLP_Request2 2019-10-29 18:19:10 +07:00
hathach f6a65720e5 should fix #184
only response up to EP0 size with get device descriptor if not
addressed.
2019-10-29 16:25:32 +07:00
hathach 78523301bb
Merge pull request #202 from smunaut/dfu-rt
Add support for DFU Runtime class for devices
2019-10-28 22:56:14 +07:00
Sylvain Munaut ec4ecfa817 Add support for DFU Runtime class for devices
This is really just a few descriptors and then answering to the
request from the host to reboot into DFU mode.

That latter part is delegated to the app since this is platform
specific.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2019-10-28 16:11:08 +01:00
hathach 4e8c57171c Merge branch 'master' into cr1901-msp430f5529 2019-10-25 21:20:05 +07:00
hathach 6ab0663c1a adding more log 2019-10-24 12:00:06 +07:00
hathach 661515a807 adding debug log function 2019-10-23 21:18:46 +07:00
William D. Jones a01b0a73c1 Remove accidentally-commited debug var. 2019-10-03 23:59:22 -04:00
William D. Jones 432e9dcd2e Merge remote-tracking branch 'pigrew/ZLP_Request2' into msp430f5529 2019-10-03 23:50:55 -04:00
hathach 7fd68efe7b couldn't get 32L4 running with crystal less mode 2019-10-03 13:37:10 +07:00
William D. Jones 5ee1070c16 Merge remote-tracking branch 'origin' into msp430f5529 2019-10-02 23:18:49 -04:00
William D. Jones b0b737b42a usbd_control.c: Decide whether a control transfer has a data stage
based on setup packet wLength.
2019-10-02 23:02:55 -04:00
Nathan Conrad cef388b7bd Merge branch 'master' into ZLP_Request2 2019-10-02 01:15:47 -04:00
hathach 204791b3e7 2nd attempt to fix #161 2019-10-01 22:19:04 +07:00
hathach 12609f818b fix #161 added volatile for ep_busy_map/ep_stall_map 2019-10-01 14:43:34 +07:00
Nathan Conrad 4ea2a4ed60 Github's web interface changed line endings without asking me. Oops. 2019-09-29 10:45:13 -04:00
Nathan Conrad 0078be9c24
Merge branch 'master' into ZLP_Request2 2019-09-29 09:52:53 -04:00
Nathan Conrad c4483d244b Fix typo of CFG_TUD_ENDOINT0_SIZE. 2019-09-27 21:22:19 -04:00
Nathan Conrad 4ccdc5522d Fix typo of CFG_TUD_ENDOINT0_SIZE. 2019-09-27 12:41:46 -04:00
Nathan Conrad 91fa24d99c Merge branch 'master' into ZLP_Request2 2019-09-27 00:37:21 -04:00
Nathan Conrad 2aa10daf26 Merge branch 'clear_feature_ordering' into usbtmc 2019-09-21 21:39:25 -04:00
Nathan Conrad 9498adef71 Changing the bitwise to a logical OR created a huge hard to find bug. It shortcutted the call to the class function,
so, lets use shortcutting anyway?
2019-09-21 19:29:57 -04:00
Nathan Conrad fbb8520acd logical or. 2019-09-21 14:34:29 -04:00
Nathan Conrad 37b52e354f Correct wording of comment on handling EP requests. 2019-09-21 12:17:17 -04:00
Nathan Conrad a187f0268c When unstalling, EP must be marked as not busy. Also, mark EP as busy when stalling as xfer requests should fail. 2019-09-21 12:05:57 -04:00
Nathan Conrad be28a05409 Make type casting explicit 2019-09-21 12:05:46 -04:00
Nathan Conrad 55abb3d717 Calling EP open with bad parameters should be considered a bug. 2019-09-21 12:02:52 -04:00
Nathan Conrad aebecf169a Reorder handling of EP control requests, 2019-09-21 12:02:06 -04:00
Nathan Conrad b6590490a8 USB Control: Pointer arithmetic on void* is forbiden 2019-09-21 12:00:52 -04:00
Nathan Conrad 2a7ca15e2c Rename functions to include tud_ and _cb 2019-09-19 20:43:49 -04:00
Nathan Conrad 7e0490bbf3 Move descriptors to usbd.h 2019-09-19 19:51:37 -04:00
Nathan Conrad ac2c9ff02f Merge branch 'master' into usbtmc 2019-09-17 13:31:53 -04:00
hathach 9c5ae0369b follow up to suggestion to pr 155 2019-09-16 11:13:17 +07:00
Nathan Conrad 1cae96951f Add usbtmc class driver. 2019-09-14 13:35:08 -04:00
hathach ac8c343fef fix #154 forward all endpoint recipeint request to class driver
fix typo
remove magic number 0xff of driver id
2019-09-13 22:16:24 +07:00
hathach 064adebbd0 fix #152, potential memory issue 2019-09-13 14:03:59 +07:00
hathach c3598f0301 fix #139, correct usbd request intepreting, Non-STD request to Interface must be forward to class driver 2019-09-13 13:03:11 +07:00
Nathan Conrad 340dcb81bf For control transfers, compare the transmitted length against the requested length to know if a ZLP needs to happen. (fixes #139) 2019-09-12 16:06:45 -04:00
Nathan Conrad 4517d504b8 Fix typo of ENDOINT 2019-09-09 13:34:30 -04:00
hathach 48c7b80c57 fix warnings of template descriptor 2019-08-23 13:33:40 +07:00
hathach 30de17a830 clean up
- remove TUD_WEBUSB_URL_DESCRIPTOR to avoid flexible array member (C++
forbid in strict mode)
- remove unused TUD_DESC_STRLEN/TUD_DESC_STR_HEADER/TUD_DESC_STR_HEADER
2019-08-01 13:20:00 +07: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 af3c301ea5 added BOS MS OS 2.0 descriptor to webusb example, it work with windows 2019-07-30 00:34:25 +07:00
hathach cdaf455461 fix stall response with SET_INTERFACE/GET_INTERFACE
webusb work with linux & macos
2019-07-26 20:14:56 +07:00
hathach d2b60b6755 webusb work great with linux 2019-07-26 11:36:30 +07:00
hathach 8ba71be6ee more webusb + vendor 2019-07-25 16:52:20 +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 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 ae5dc435cb house keeping 2019-07-19 16:49:04 +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 2b7acd554a updating webusb with cdc 2019-07-12 19:38:04 +07:00
hathach 164b26ee6b change TUD_HID_INOUT_DESCRIPTOR epout & epin order
clean up, adding template for BOS & BOS platform descriptor
2019-07-12 14:53:11 +07:00
hathach e74aa41552 added tud_descriptor_bos_cb(), add support for BOS get descriptor 2019-07-12 00:12:14 +07:00
hathach 64e9c11b41 fix incorrect midi descriptor template 2019-07-09 10:40:14 +07:00
hathach 216ccc6e93 midi only use audio 1.0 without IAD 2019-07-05 16:46:11 +07:00
hathach 57433135ce fix midi template 2019-07-01 23:19:14 +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 73d7ab201e
remove dcd_edpt_busy() 2019-06-10 22:29:18 +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 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 8ccecde18e
lpc1769 work with makefile 2019-05-15 12:57:31 +07:00
hathach 3e6d911ce9
more clean up use inline bit funciton instead of macros 2019-05-14 12:54:29 +07:00
hathach 61ec407752
update license year to 2019 2019-05-14 11:48:05 +07:00
hathach f3a5ea65a9
add index to tud_descriptor_configuration_cb() 2019-05-12 19:55:15 +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 de56a0ca89 add tud_descriptor_string_cb() for getting string descriptor from application
- remove tud_desc_set.string_arr/string_count
2019-05-11 16:31:52 +07:00
hathach 77bc421359 fix clear stall usage, fix reset data toggle with dcd_clear_stall for nrf52 2019-05-09 23:31:18 +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 c006f3dbce adding optional ep out for hid
refactor usbd_open_edpt_pair
2019-05-01 19:29:56 +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 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 72575534f8
remove auto device descriptor
Application should declare its own device descriptor
2019-04-11 00:51:28 +07:00