Commit Graph

281 Commits

Author SHA1 Message Date
hathach 8a2e4c79fd make hcd tdi more generic 2021-02-22 18:02:52 +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
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
hathach ec458292fe fix host build 2021-01-25 13:25:47 +07:00
hathach 67a9cdc35b fix compiler warning 2021-01-22 11:33:25 +07:00
graham sanderson e0aa405d19 RP2040 support 2021-01-19 19:52:07 -06:00
hathach 2907b1e438 clean up 2020-11-07 10:37:33 +07:00
hathach 14461beffa remove legacy blocking usbh_control_xfer()
reworking cdc host driver
2020-11-02 09:19:34 +07:00
hathach 2efdc2fb64 get hub work more reliably 2020-11-02 08:46:24 +07:00
hathach 6eafdfab93 update usbh with hub to use async control transfer
work ok with msc + hub, but definitely need more testing.
2020-11-02 00:54:04 +07:00
hathach e029d6d726 added host set_config driver
to resolve control conflict with SET_CONFIGURE for class driver
- open will be called to open endpoint only
- set_config called later to initialized class driver
2020-11-01 17:46:46 +07:00
hathach 3623f578a4 more clean up 2020-10-13 14:11:17 +07:00
hathach 9c07a2a4e2 rework msc host
- msc host enum is now async
- implement async tuh_msc_scsi_command() / tuh_msc_request_sense() /
tuh_msc_test_unit_ready()
2020-10-13 00:07:51 +07:00
hathach 87b989e8b4 add usbh_edpt_claim/release
implement USBH_EVENT_FUNC_CALL
2020-10-12 00:35:45 +07:00
hathach 2b54dcb9f6 move functions around 2020-09-07 15:39:46 +07:00
hathach 7a3b24827e clean up 2020-09-07 15:25:03 +07:00
hathach 66a10ec9c8 rework usbh control transfer
use series of complete callback instead of blocking semaphore, which is
more noOS friendly. still working with hid host
2020-09-07 15:19:20 +07:00
hathach b3e81673c0 change xfer_cb return type from void to bool 2020-09-06 12:11:07 +07:00
hathach 15ad585e67 replacing hcd_pipe_xfer by usbh_edpt_xfer 2020-09-06 11:49:00 +07:00
hathach 9a6d7c648e clean up enum task 2020-09-05 21:12:43 +07:00
hathach 828f720207 refactor hub class
- separate connect/disconnect handling
- hub work with full speed, but doesn't seem to work with Low speed
device (with mcb1800)
- need to update msc host after migrating from isr to xfer_cb (blocked
at inquiry)
2020-09-05 20:20:45 +07:00
hathach 7ffb6acc16 more clean up 2020-09-05 17:16:46 +07:00
hathach b8b95e8494 add in_isr to all hcd event functions 2020-09-05 15:46:50 +07:00
hathach 90c8c14652 clean up 2020-09-05 15:19:01 +07:00
hathach bc09b6065f refactor extract parse_configuration_descriptor() 2020-09-05 15:16:45 +07:00
hathach d87f2a9691 remove usbh control mutex 2020-09-05 15:05:25 +07:00
hathach f7cf8cdf27 defer xfer_isr to xfer_cb 2020-09-05 14:41:31 +07:00
hathach 4d57b4ea33 clean up 2020-09-05 13:57:07 +07:00
hathach 35aee4a6af more hid host work 2020-09-03 23:57:51 +07:00
hathach 1d83ad0ebb rename tuh_isr/hcd_isr to tuh_int_handler/hcd_int_handler 2020-09-03 13:12:25 +07:00
hathach c492aef4c7 revert to use float-abi
define __USE_CMSIS instead of __USE_LPCOPEN will have startup enable FPU
on startup properly. Although it is only relevant to lpx43/40 series,
change all to __USE_CMSIS for consistency
2020-09-02 00:46:08 +07:00
hathach 84425c50b3 add more logging to host stack
tested host with lpc4357, don't use fpu with lpc m4 since it seems to
cause hardfault (stack does not make use of fpu anyway).
2020-09-01 19:16:50 +07:00
hathach be708bb8a4 Merge branch 'master' into update-host 2020-09-01 12:02:25 +07: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
hathach d108ea4326 implement hcd_uframe_number for ohci
able to get 8 byte descriptors using LPC1769 + base, but failed to reset
and set address.
2020-05-22 21:45:34 +07:00
hathach 58cedf4c06 usb0 host on mcb1800 work with fullspeed mode.
use usbh_edpt_open() to correctly map ep2drv[]
2020-05-19 00:55:43 +07:00
hathach 905a80d1b2 temporarily remove osal_task_delay() from osal
- add hcd_uframe_number() API, update EHCI to return uframe number
- get host running on ea4357
2020-05-04 14:11:58 +07:00
hathach 4a3a448340 clean up things, add makefile for host example 2020-05-04 00:29:52 +07:00
Nathan Conrad 25c1bea782 Normalize line endings 2020-01-15 14:47:43 -05:00
hathach 03deeea465 fix segger host example 2019-11-22 00:33:10 +07:00
hathach bbec47b647 adding tud_isr/tuh_isr with lpc18/43 2019-11-21 22:20:30 +07:00
hathach 043697ab95 rename lpc 17/18 irq to dcd_isr/hcd_isr 2019-11-21 16:08:08 +07:00
hathach 6a076d8aae rename CFG_TUSB_HOST_CUSTOM_CLASS to CFG_TUH_VENDOR 2019-07-19 16:31:51 +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 f4762ff012 host fix address alloc when it reach max devices 2019-05-23 10:59:43 +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 6135019230
clean up 2019-05-14 11:46:22 +07:00
hathach 801f3c9d8d
more clean up 2019-03-27 21:00:15 +07:00
hathach da452d4ba6
cleanup, remove the use of _TINY_USB_SOURCE_FILE_ 2019-03-27 17:48:42 +07:00
hathach c211ee19dd migrate license from BSD 3 clause to MIT 2019-03-20 16:11:42 +07:00
hathach e4e8413acc
add tusb_inited() API, check for inited() before running device/host task 2019-01-29 19:05:07 +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 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 af1ffe4675 remove task void* param 2018-12-13 13:53:43 +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 a76d3a8726
clean up 2018-12-12 14:53:11 +07:00
hathach 5fd60e5761
clean up 2018-12-12 12:36:40 +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 e3514b8054
rename hcd_device_remove to hcd_device_close 2018-12-12 11:34:09 +07:00
hathach c88e16bd11
clean up 2018-12-12 00:48:53 +07:00
hathach aaf65831d8
update ohci for hcd_device_remove 2018-12-12 00:48:41 +07:00
hathach def20ce35b
clean up ehci warnings 2018-12-12 00:13:48 +07:00
hathach 67d6d753d6
replace all hcd pipe close by hcd_device_remove 2018-12-12 00:00:33 +07:00
hathach c94df51503
more clean up 2018-12-11 19:35:08 +07:00
hathach 364666c206
ehci clean up 2018-12-11 17:05:56 +07:00
hathach d05021009b
more ohci clean up 2018-12-11 16:29:43 +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 7deac61d5f
clean up 2018-12-11 13:09:40 +07:00
hathach b8c63ff624
ehci struct rename 2018-12-11 13:01:07 +07:00
hathach b0717275c8
ehci periodic 2018-12-11 10:50:05 +07:00
hathach 73e6bb6f5d
clean up 2018-12-11 01:06:10 +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 5886ccdb03
ehci clean up 2018-12-10 20:16:26 +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 57233cead7
rename usbh_xfer_isr to hcd_event_xfer_complete 2018-12-10 05:47:33 +07:00
hathach a31f83dbb0
removing pipe handle 2018-12-10 05:44:08 +07:00
hathach 75baedf27d
removing pipe handle, remove xfer type 2018-12-10 05:33:25 +07:00
hathach 8ef93ef85d
usbh remove class code in xfer isr callback 2018-12-10 05:19:08 +07:00
hathach ac67e0ea3f
clean up 2018-12-10 05:15:49 +07:00
hathach 6a6e7d0ecb
refactor usbh class driver 2018-12-10 05:07:22 +07:00
hathach 05913a7350
change usbh class driver open signature 2018-12-09 12:34:05 +07:00
hathach 637285e9ae
clean up ehci 2018-12-09 00:10:49 +07:00
hathach f6f0910778
hub clean up 2018-12-08 20:56:56 +07:00
hathach d3ac4c14a3
refactor hcd api 2018-12-08 20:51:48 +07:00
hathach 607658d047
rename MODE_HOST_SUPPORTED to TUSB_OPT_HOST_ENABLED 2018-12-07 23:38:52 +07:00
hathach e019916263
clean up ehci, support only 1 controller 2018-12-07 23:35:42 +07:00
hathach 98dd0c4d4d
clean up 2018-12-07 23:28:51 +07:00
hathach e4fd9fbaf4
seperate control xfer to 3 tds for ohci
- ohci only work with 1st transfer with specific timing. TODO fix it
later
2018-12-07 23:16:06 +07:00
hathach 6c49848d59
ohci got device not response condition in control transfer 2018-12-07 22:01:26 +07:00
hathach 2aa21a14e6
lpc17 ohci failed to execute control transfer !! 2018-12-07 18:49:26 +07:00
hathach 13d08cd636
adding new hcd api, tested working with control xfer.
- hcd_edpt_open
- hcd_edpt_xfer
- hcd_edpt_xfer
2018-12-07 17:31:35 +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 9478c647e3 change usbh_control_xfer name and signature 2018-12-07 12:23:37 +07:00
hathach c93fb23693 usbh rename vars 2018-12-07 00:47:16 +07:00
hathach 2fe9abe71f change usbh queue to generic event queue 2018-12-06 23:45:24 +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 5b09774ae0 clean up usbh, rename doxygen folder to docs 2018-12-06 21:46:34 +07:00
hathach 5a7493ed42
fix more host build error 2018-12-05 21:12:10 +07:00
hathach 2fa32bd949
able to build host lpc18xx 2018-12-05 20:39:52 +07:00
hathach 4537ba66e5
fixing build error with host stack 2018-12-05 20:26:55 +07:00
hathach d887829b4c
change usbd_init() return to bool for simplicity 2018-12-05 17:30:04 +07:00
hathach a619ff88a3
rename xfer complete enum 2018-11-23 15:17:43 +07:00
hathach cb8782e5f2
rename tusb_event_t to xfer_result_t 2018-11-23 15:14:47 +07:00
hathach 60d8cde695
rename CFG_TUSB_MEM_SECTION to CFG_TUSB_MEM_SECTION 2018-11-22 17:21:07 +07:00
hathach 10bf41f718 change osal_queue_receive() signature
- fix build issue with freertos
2018-11-14 16:31:28 +07:00
hathach bfa10016ae rename verify_breakpoint to TU_BREAKPOINT 2018-10-24 12:37:43 +07:00
hathach c7340f4b0e clean up helper func 2018-10-23 12:19:32 +07:00
hathach c5d2f661e7 rename common func to avoid conflict 2018-08-23 20:09:28 +07:00
hathach e07b1acbed rename VERIFY to TU_VERIFY to avoid conflict with application 2018-08-13 18:10:23 +07:00
hathach 5f6cd49031 clean up include 2018-07-23 23:41:14 +07:00
hathach 51903a60c5 rename timeout_ API to tu_timeout API 2018-07-23 22:36:29 +07:00
hathach 361928f429 rename timeout_timer.h to tusb_timeout.h 2018-07-23 22:32:21 +07:00
hathach 1efb552bfd add ep2drv, rename descriptor offset 2018-07-13 17:48:26 +07:00
hathach f8e7695fe9 clean up 2018-06-18 14:31:15 +07:00
hathach 424735d440 rename subfolder source to src 2018-06-18 14:05:24 +07:00