Commit Graph

606 Commits

Author SHA1 Message Date
hathach 4b6c6929cb fix the duplicated plug connection status change with lpc17xx by using immediate reset on isr. However Khanh's G5 mouse is not enumerated !!
remove TUSB_CFG_CONFIGURATION_MAX from config file
fix some warning
2014-02-20 16:06:31 +07:00
hathach 533c8d2eed use hcd_pipe_is_busy instead of hcd_pipe_is_idle
remove hcd_pipe_is_idle
2014-02-20 10:41:31 +07:00
hathach d86523b16c re-enable blocking waiting in ehci controller reset (otherwise it wont works) 2014-02-19 15:50:39 +07:00
hathach bbe26facb3 some code clean up
NOTE: host on ea4357 does not work anymore
2014-02-19 15:29:29 +07:00
hathach 03ad1afef9 clean up warnings 2014-01-24 22:04:59 +07:00
hathach a982a52ab3 refractor __n2be_16 2014-01-24 21:51:24 +07:00
hathach 275e834bbe add device_os_none keil project for all boards 2013-12-27 13:40:59 +07:00
hathach d020c2f609 remove immediately reset when device plug.
check to make sure device is still plug after initial delay (200ms) before reset
remove blocking waiting when reset in ehci.c
2013-12-19 13:55:22 +07:00
hathach cfcef0558a fix plug & unplug issue by reseting port immediately instead of waiting for usbh enumeration task to do so 2013-12-19 12:43:22 +07:00
hathach 2715650751 refractor ohci.c 2013-12-19 12:11:13 +07:00
hathach cc736fd45e able to run ohci hid mouse demo
- an old mouse cause double plug event
- an old mouse failed to response the first get 8 byte device descriptor
2013-12-19 11:59:19 +07:00
hathach b828aabbe4 implement hcd_pipe_close, able to plug & unplug device from ohci lpc17xx 2013-12-18 16:23:09 +07:00
hathach eaacbd4a36 able to run MSC host demo on lpc17xx
implement walk around for halted ED in OHCI
2013-12-18 14:57:34 +07:00
hathach 915296013e add in hcd_pipe_open & hcd_pipe_xfer 2013-12-17 11:26:39 +07:00
hathach 75ffc0bfec implement ohci
- hcd_port_reset
- hcd_port_connect_status
- hcd_port_speed_get
- hcd_pipe_control_open
- hcd_pipe_control_xfer
- done_queue_isr for control xfer

able to go through enumeration with MSC device
2013-12-16 12:35:05 +07:00
hathach 736cbdc276 using PINSEL_ConfigPin for setting pinsel 2013-12-13 12:41:29 +07:00
hathach 30c8f68930 able to get connect status change interrupt occured 2013-12-13 12:26:37 +07:00
hathach 51b6c6ff41 implement inline bit manipulation function 2013-12-12 12:21:38 +07:00
hathach 4d14e2ac50 add structure & define for ohci 2013-12-11 14:31:27 +07:00
hathach 8bd6440547 fix error in dcd_lpc175x_6x (still has problem with control transfer)
fix build error for host
start to add keil support for device
opt out pca9532.c when ea4357 is not the selected board
2013-12-11 11:31:09 +07:00
hathach b35acbdcb2 add some doxygen 2013-12-10 10:57:59 +07:00
hathach a40d20387d complete dcd 17xx control xfer with soft DMA
keyboard LED set report run ok with lpc17xx
there is problem with cdc set line encoding
2013-12-09 16:11:10 +07:00
hathach b08ecda657 house keeping, lpc43xx works okie 2013-12-09 11:57:09 +07:00
hathach 2af9ecbed5 refractor dcd lpc43xx control xfer (with int on complete) 2013-12-09 11:49:34 +07:00
hathach 055285c559 minor refractor 2013-12-09 11:28:11 +07:00
hathach e320659f8a add keyboard led mask
make usbd control request to subtask
add get/set report via control pipe to hidd
enforce soft DMA to control pipe for lpc11u (lpc17xx not yet)
temp add led_blinking_set_interval to change led blinking interval
refractor dcd_pipe_control_xfer to have interrupt on complete option
add get/set report support of moused_app and keyboardd_app, keyboard LED will make LED blink faster
2013-12-09 11:15:13 +07:00
hathach 1ad78f104e refractor hid device driver 2013-12-02 14:17:51 +07:00
hathach 2c8b8ea529 add board lpclink2, able to run device stack without any problems 2013-12-02 00:40:10 +07:00
hathach 4b78578266 fix potential wrong endpoint handle for stalling unsupported scsi command 2013-12-01 22:34:59 +07:00
hathach 24e92f79e7 adjust packet per TD for lpc13u is 1023, 11u is 64 2013-12-01 16:11:41 +07:00
hathach a9a5146108 correct stall & clear stall behavior for non-control pipe
fix data_residue when read10, write10 return 0 (no need for BE conversion)
2013-12-01 15:48:49 +07:00
hathach edb4226f23 change class_ixr to class_cb
use IAD whenever enable CDC to make sure windows driver can detect
change keyboard, mouse send report to int_on_complete = true
2013-12-01 13:53:36 +07:00
hathach d2f91af6b3 add some document for msc_device API 2013-12-01 12:18:26 +07:00
hathach e0db04e6b4 tested with lpc13u 2013-12-01 00:34:18 +07:00
hathach 864935fbe8 code clean up 2013-11-30 22:38:15 +07:00
hathach 6e30a068d2 completely change the dcd for lpc11u & lpc13u to overcome the fact that lpc11u dma cannot transfer more than 64 bytes
each buffer. This implement an soft DMA for lpc11u & lpc13u (previously 1023 max) queued transfer
2013-11-30 22:29:37 +07:00
hathach af87e231c5 house keeping 2013-11-26 14:17:58 +07:00
hathach 47d8af7111 complete msc demo with lpc13uxx with readonly flash 2013-11-26 13:58:13 +07:00
hathach 8f70a6a886 change endian conversion to native to be & be to native
completely deferred xfer isr event to usbd task
complete read10, write10 sequence for large data transfer
2013-11-26 13:15:40 +07:00
hathach 51def3f7ed refractor usbd task
move control request data into task event
adding tusbd_msc_read10_cb, tusbd_msc_write10_cb (not fully supported)
2013-11-25 16:42:04 +07:00
hathach a5ba283557 change MCU to TUSB_CFG_MCU 2013-11-25 12:48:27 +07:00
hathach 41ffcaf4a5 temp fix for dcd 43xx suspend detection (disconnection does not generate interrupt) 2013-11-22 16:10:05 +07:00
hathach 83f1d660ce clean up
add some doxygen work
finalize device disconnection & suspend
- suspend & resume & remote wake up is not supported yet
2013-11-22 15:16:24 +07:00
hathach d1ef89a154 fixed lpc11u/13u VBUS (P0_3) with pulldown resistor for USB_VBUS_DEBOUNCED is correct
added disconnect callback for lpc11u/13u
2013-11-21 15:24:02 +07:00
hathach c303154b7a add class mounted callback for hid mouse/keyboard & refractor mouse/keyboard app 2013-11-21 13:54:29 +07:00
hathach c461c72ac2 clean up 2013-11-21 13:20:46 +07:00
hathach 6887e5e642 refractor usbd-dcd callback, add bus event isr 2013-11-21 12:47:55 +07:00
hathach d94efa60d6 fixed dcd lpc17xx queue transfer & IOC handling
able to run MSC demo
2013-11-20 15:34:49 +07:00
hathach 850fcf03f0 refractor descriptor 2013-11-20 12:52:07 +07:00
hathach dbfad50d43 house keeping 2013-11-20 12:21:29 +07:00
hathach d284ecaccb add sw int_on_complete support for dcd lpc17xx 2013-11-20 12:03:04 +07:00
hathach 2dafeee585 complete dcd for lpc175x_6x
cdc device demo can work but there is hardfault with dma descriptor with fast typing
2013-11-19 16:41:30 +07:00
hathach 94854f805a get lpc17xx running through enumeration (with control data < 64) 2013-11-18 17:29:12 +07:00
hathach b104d21e71 fix dcd_pipe_control_xfer for dcd43xx
refractor tusb_descriptors.h
2013-11-16 22:16:03 +07:00
hathach 672057de5a IAD support 2013-11-15 17:20:40 +07:00
hathach 6e463caec0 add semaphore for control xfer for > 64 support for some mcu such as lpc11u/lpc17xx 2013-11-15 16:47:26 +07:00
hathach d4a260c090 refractor usbd's get descriptor 2013-11-15 15:05:23 +07:00
hathach 699edf9485 separate data & status from dcd_pipe_control_xfer 2013-11-15 14:15:05 +07:00
hathach 05c439e45a refractor usbd, first step to make get configuration as sub task 2013-11-15 13:26:12 +07:00
hathach fc68439b74 add usbd_task to handle event task eg setup received 2013-11-15 12:30:22 +07:00
hathach ba49d26e19 fix build error with device 43xx
refractor mscd ramdisk demo
2013-11-15 00:01:07 +07:00
hathach 6e8440afe5 complete double buffering for queueing xfer for lpc11u/13u requried by msc device 2013-11-14 14:12:07 +07:00
hathach 7d84139bd4 fix potential issue with stall endpoints
NOTE: cannot able to STALL control OUT endpoints --> unsupported with data out request may got to an issue.
clean up configure, add max string descriptor configure as windows sometimes ask for string @ index 238 !!!
2013-11-13 14:00:39 +07:00
hathach 92d9c36dbc able to build and run cdc device demo on lpc11uxx 2013-11-13 12:40:11 +07:00
hathach d8f32a79fc technically, mouse + keyboard device demo also work on lpc13uxx 2013-11-11 14:02:55 +07:00
hathach 9a81cbcd59 remove xfer_type in endpoint_handle_t
cdc device demo runs on lpc13uxx
2013-11-11 13:52:31 +07:00
hathach f00a4b448d adding support for lpc13uxx 2013-11-11 12:48:21 +07:00
hathach 7ff0dbb64c add tusbd_cdc_is_busy
enhance cdc serial device demo
refractor fifo.c
2013-11-08 14:46:48 +07:00
hathach 15d3a418bd add windows driver for cdc
add simple echo cdc serial demo
add cdc device send/receive API
refractor descriptor
refractor cdc.h
add usbd driver function
- init
- bus_reset
2013-11-08 12:03:32 +07:00
hathach 8c9def8618 clean up tusb_descriptors 2013-11-07 11:51:39 +07:00
hathach 9171d106bc added hid device hidd_isr callback
refractor keyboard dev demo app
2013-11-06 19:55:48 +07:00
hathach 60d444b452 fix a bug with USB1, but still cannot get interrupt occurred on USB1 2013-11-06 14:53:18 +07:00
hathach 58b41a05db refractor for device able to work on usb1 of lpc43xx. But could not get it work on EA4357 2013-11-06 14:20:45 +07:00
hathach b2b53e61fb refractor dcd_controller_reset & hcd_controller_reset to hal_controller_reset 2013-11-06 12:15:11 +07:00
hathach 83d9ececfb msc add support
- SCSI_CMD_MODE_SELECT_6
- SCSI_CMD_MODE_SENSE_6
- SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL

fix msc device bug with no data unsupported command
complete msc device demo with ram disk of 8KB
2013-11-05 13:02:15 +07:00
hathach d02ef07337 added support for
- sense data scsi_sense_fixed_data_t
- read format capacity scsi_read_format_capacity_data_t

change msc device callback to support actual response
fix dcd_pipe_clear_stall also reset toggle
2013-11-01 22:00:39 +07:00
hathach f2ae5b541f add dcd pipe clear stall
- tusb_error_t dcd_pipe_clear_stall(uint8_t coreid, uint8_t edpt_addr) but does not take endpoint_handle_t as input
complete msc device driver
add usbd clear stall endpoint
2013-11-01 14:44:14 +07:00
hathach 3a54ad4c0d implement msc device class
usbd auto stall control for not supported return from class control request
usbd implement xfer isr callback mechanism
DCD
- implement dcd multiple qtd support
- dcd dcd_pipe_stall
- implement dcd_pipe_queue_xfer
- xfer_complete_isr
- flush control endpoint if received new setup while previous transfer is not complete
change msc_cmd_block_wrapper_t flags field to dir
force full speed for easy testing

NOTEs: somehow unable to get endpoint IN interrupt with ioc
2013-11-01 12:11:26 +07:00
hathach c760c69d51 clean up 2013-10-30 14:16:45 +07:00
hathach 3a37dd66cc refractor hid device
add check dcd_pipe_open if endpoint is already used
refractor usbd : parse and auto open class driver
2013-10-30 14:13:06 +07:00
hathach b8a7ea6d46 add dcd control pipe stall protocol 2013-10-30 12:52:25 +07:00
hathach d67a7b7959 fix dcd_data declared with TUSB_CFG_ATTR_USBRAM
fix lpc43xx UM: non-control unused endpoint type should be set to different than control in ENDPTCTRL
add hid mouse device
fix mouse descriptor with vertical wheel support
2013-10-30 12:20:00 +07:00
hathach d9ce879df8 able to enumerate mouse + keyboard (missing timing at set configured though) 2013-10-29 17:16:41 +07:00
hathach cb0a02f8c9 change device driver init to open (when configured)
fix HID_REQUEST_CONTROL_SET_REPORT handle
2013-10-29 16:29:48 +07:00
hathach 5ab195a73d temporarily implementation of dcd_pipe_is_busy 2013-10-29 15:09:16 +07:00
hathach db986b3107 able to fully enumerated with keyboard 2013-10-29 14:19:56 +07:00
hathach 357813f171 implementing sw device stack 2013-10-29 11:27:25 +07:00
hathach d925026089 make device keyboard buildable & runnable with ea4357 2013-10-27 21:33:06 +07:00
hathach 064d0cf5a9 document cdc 2013-10-27 19:59:06 +07:00
hathach 318a058d3c static assert to check OSAL_QUEUE_DEF's queue_depth parameter < 256
enable HOST_HCD_XFER_INTERRUPT by default (previously only enabled with HID), as it is widely used
implement tusbh_cdc_is_busy
add compilation switch in usbh enumeration for hub
rewrite CDC serial application to address usb-serial race condition
2013-10-27 19:34:36 +07:00
hathach 0d9e1163df fix osal_none timeout, instant return with OSAL_TIMEOUT_NOTIMEOUT 2013-10-27 16:48:09 +07:00
hathach eb39d88360 rndis document 2013-10-27 15:42:31 +07:00
hathach f941f88549 rndis document 2013-10-27 15:15:28 +07:00
hathach 76e993c45c rndis document 2013-10-26 20:25:14 +07:00
hathach df8d56f485 more document 2013-10-26 20:14:12 +07:00
hathach dae4fdc04f cdc document 2013-10-26 20:12:39 +07:00
hathach acd69a7692 document msc 2013-10-26 19:14:06 +07:00
hathach 621cdc7013 doxygen document for msc 2013-10-26 14:12:45 +07:00
hathach d1d2bbdf5d update doxygen 2013-10-26 12:42:27 +07:00
hathach 0d00742cf0 more doxygen work
rename tusb_mouse_report_t (keyboard) to hid_mouse_report_t (keyboard)
2013-10-25 17:28:31 +07:00
hathach 7bf5cbc3fc move descriptor to common folder 2013-10-25 13:46:38 +07:00
hathach 5f23653c69 more doxygen work 2013-10-25 13:45:57 +07:00
hathach 6c629a18fc partially document CDC & RNDIS 2013-10-24 17:26:06 +07:00
hathach b1142ff065 document hub 2013-10-24 17:00:04 +07:00
hathach 5f584384eb document msc host 2013-10-24 16:47:18 +07:00
hathach d8d00ca768 refractor HID document 2013-10-24 15:48:57 +07:00
hathach b71ffe3d5a change TUSB_CFG_CONTROLLER0/1_MODE to TUSB_CFG_CONTROLLER_0/1_MODE for clearance
adding configuration docs for tinyusb_config.h
document HID mouse & keyboard API
2013-10-24 15:32:54 +07:00
hathach 15c80a9580 clean up 2013-10-16 12:35:55 +07:00
hathach de7e21dc66 refractor hub api
fix all test build errors
2013-10-16 11:05:33 +07:00
hathach 6f9172c15f clean up warnings here and there 2013-10-02 14:20:05 +07:00
hathach 1263dbb122 enhacne msc demo, update IAR project file 2013-10-02 13:32:39 +07:00
hathach 5c8389b9ae update freertos project
temp hack to fix problem with no TD on status endpoint of hub in case of error
2013-10-02 11:01:28 +07:00
hathach 640b0ec546 - move disconnection handle to enum task --> move tusbh_xxx_unmount is invoked in non-isr context 2013-10-01 13:53:54 +07:00
hathach 7f4a3fc829 ignore multiple level of hub 2013-10-01 13:23:31 +07:00
hathach 71b2859fe5 handle unplug the hub itself 2013-10-01 13:09:52 +07:00
hathach 4da3b03430 refractor hub 2013-10-01 12:12:35 +07:00
hathach 14ebd6c4d9 refractor hub 2013-10-01 11:29:25 +07:00
hathach 93821c55ce hack ehci advance async to handle disconnect via hub 2013-09-30 18:40:20 +07:00
hathach 5eebec61f1 refractor hub 2013-09-30 17:14:44 +07:00
hathach 0f05d27ac9 refractor hub 2013-09-30 16:59:41 +07:00
hathach 9ecaec67b3 refractor hub 2013-09-30 16:40:02 +07:00
hathach 5fb22e3f34 refractor hub 2013-09-30 16:13:08 +07:00
hathach 821f85cb20 refractor hub 2013-09-30 15:34:22 +07:00
hathach 3cc169f2fd able to mount one device on the hub 2013-09-30 15:16:23 +07:00
hathach cb600ed988 clean up hid host (temp let test failed) 2013-09-28 01:01:44 +07:00
hathach bfa96ae9da fix an "extra" semaphore wait in msc host 2013-09-27 23:23:45 +07:00
hathach eb1a101667 house keeping 2013-09-27 22:38:23 +07:00
hathach 9d60db0f9f add scsi write10 & test unit ready
done copy command
implement get_fattime using __DATE__ and number of calls
2013-09-26 14:37:40 +07:00
hathach f827750120 add cat command to cli 2013-09-26 01:14:27 +07:00
hathach 09724c5d11 refractor msch 2013-09-26 00:17:45 +07:00
hathach 1fee50b9fe add tusbh_msc_status
reanme PRINTF_TARGET_DEBUG_CONSOLE to PRINTF_TARGET_SEMIHOST
add read10 implementation
able to read fat root sector
2013-09-25 16:20:38 +07:00
hathach bbfa85aa08 allow a limited model to deal with stalled pipe/transaction
added stall clear & able to mount the stupid toshiba thumb drive

add HCD pipe API
- bool hcd_pipe_is_busy(pipe_handle_t pipe_hdl);
- bool hcd_pipe_is_stalled(pipe_handle_t pipe_hdl);
- uint8_t hcd_pipe_get_endpoint_addr(pipe_handle_t pipe_hdl);
- tusb_error_t hcd_pipe_clear_stall(pipe_handle_t pipe_hdl);

remove tusbh_device_mount_failed_cb (not neccessary for user)
2013-09-24 18:23:34 +07:00
hathach 63b776f7cf add some tests support for msc host
refractor msch buffer for getting inital scsi like inquiry, read capacity
adding support for resovling stall on control pipe
2013-09-24 15:21:16 +07:00
hathach c4fef827b1 refractor, add wheel for mouse demo 2013-09-23 01:12:59 +07:00
hathach 85f3ad9d3b refractor hcd API to allow queue xfer without actually transferring data 2013-09-23 00:24:51 +07:00
hathach a8a10e8650 added read capacity 10 with hacking code 2013-09-22 23:54:44 +07:00
hathach cc91a73cdc fix pingstate for highspeed bulk out transfer
temp implementation of msc host --> can issue inquiry command
2013-09-22 18:44:55 +07:00
hathach 5708863859 house keeping, clean up warnings 2013-09-21 14:38:40 +07:00
hathach d15ba08fdc house keeping 2013-09-21 13:17:43 +07:00
hathach 295612b48f remove ATTR_WEAK for all necessary driver callback
fix ceedling tests
2013-09-21 00:42:39 +07:00
hathach f8f398a681 start to add msc host, fix dangerous problem with unstable device when plugged --> 200 ms delay. 50ms delay after each port reset 2013-09-20 23:53:48 +07:00
hathach 52ae0afeb6 refine hid host driver 2013-09-20 16:20:28 +07:00
hathach 86681fe442 starting to add support for IAR workbench 2013-09-19 16:11:11 +07:00
hathach 61c591b9ac clean up warnings 2013-09-18 23:34:03 +07:00
hathach e32e901cd1 increase usb transaction time-out as host_cmsis_rtx easily timeouted 2013-09-14 00:00:05 +07:00
hathach 0d279facbb fix cmsis rtx tick configuration
everything should work
TODO: remove static for variable error in control xfer subtask
2013-09-13 23:32:07 +07:00
hathach 67453b89f0 fix task def with cmsis rtx 2013-09-13 23:01:43 +07:00
hathach ad0ef2e266 all project can run ok 2013-09-13 22:30:11 +07:00
hathach c71f5c6f1b integrate & able to run cmsis-rtx with current code base 2013-09-13 16:53:17 +07:00
hathach 09dd83c05b add set msg & get set cmplt for OID_GEN_CURRENT_PACKET_FILTER (default = 0 reject all) to
○ NDIS_PACKET_TYPE_DIRECTED
○ NDIS_PACKET_TYPE_MULTICAST
○ NDIS_PACKET_TYPE_BROADCAST
2013-09-11 15:03:37 +07:00