Commit Graph

48 Commits

Author SHA1 Message Date
hathach 44e09cc397 enhance some tests
add test for usbh_isr error invoke
fix bug if device unplugged before is set to new address
- clean up & close control addr0 in usbh_device_unplugged_isr
2013-03-23 17:31:51 +07:00
hathach 4adfc6a6d8 change signature usbh_isr to add tusb_bus_event_t parameter
change singature of call_isr as well
2013-03-23 15:00:56 +07:00
hathach e6b8166a58 house keeping 2013-03-23 14:27:32 +07:00
hathach e14864759d refractor
- rename TUSB_DEVICE_STATE_READY to TUSB_DEVICE_STATE_CONFIGURED
- move device_state to core/tusb_types.h
- remove usbh_device_hcd_data_cleaned_up_cb, hcd now set the state directly
2013-03-23 12:13:02 +07:00
hathach d7ba86c85e refractor
- rename usbh_device_info_t.status to state
- rename enum TUSB_DEVICE_STATUS_* to TUSB_DEVICE_STATE_*
2013-03-23 11:34:51 +07:00
hathach 0c6d406ddf - house keeping
- add controller id for hal_interrupt_enable/disable
2013-03-23 10:56:41 +07:00
hathach f6acca6664 add callback for hcd when it cleaned up all cache data for a device (previously mark as removing). 2013-03-22 18:55:45 +07:00
hathach dbaf6c0d30 - fix bug when unplugged unmounted-already device (mostly plugged when power on)
- add hal_debugger_is_attached & hal_debugger_breakpoint
- assert will suspend (place breakpoint) if the condition is failed and debugger is attached. Otherwise, a message to uart is printed
- fix get control qhd function when dev_addr is not zero (shifted 1)
- fix wrong logic for unsupported class
2013-03-22 17:08:51 +07:00
hathach 9bc30f7694 add some test for usbh_hcd integration
- add tests for pipe_close  (while TDs are active)
- add tests for device unplugged
add tesst & implement the async_advance_isr to clean up "REMOVING" queue head
- add helper find previous qhd
- add remove qhd from async list
- add is_removing field for async advance isr to clean up
add pipe close for control pipe & bulk pipe (with tests)
add helper get qhd from pipe_handle
2013-03-13 21:42:19 +07:00
hathach 97c436a16e add usbh_pipe_control_close (in conjunction with usbh pipe control open)
close control pipe when unplugged
2013-03-13 11:20:02 +07:00
hathach 97c9001d40 add hard fault handler to bsp.c
rename class_install_subtask to class_open_subtask
add class_close for unmount
adding code for usbh_device_unplugged_isr & invoke it in hcd_isr
2013-03-13 10:57:30 +07:00
hathach 79e277d323 go through all the enumeration (up to get full configuration)
- fix init_qhd for address 0 (clear queue head --> ehci controller halted)
- fix bug in usbh_init missing address0 for semaphore create

TUSB_CFG_DEBUG == 3: --> ATTR_ALWAYS_INLINE is null --> allow gcc to export "normal inline" function
2013-03-13 00:02:45 +07:00
hathach d2bd80109e add semaphore post in usbh_isr for control pipe
add osal_queue_send in usbh_device_plugged
add macro for placing breakpoint macros
fix ehci init:
- regs->cmd or (add run_stop)
- enable port power in portsc
add tusb_task_runner in main loop
2013-03-12 20:04:29 +07:00
hathach 80facf6f2e add isr api for usbh_hcd
- void usbh_device_plugged_isr(uint8_t hostid, tusb_speed_t speed);
- void usbh_device_unplugged_isr(uint8_t hostid);

implement port_connect_status_isr
2013-03-12 16:42:19 +07:00
hathach 453ea39865 add project file for keil
fix binary.h compiler specific
add hal_init code to reset & set usbmode --> able to get USB ISR
remove const qualifier from return function of
- get_operational_register
- get_period_frame_list
- get_async_head
- get_period_head
- get_control_qhd
add stub for
- hcd_port_connect_status
- hcd_port_speed
2013-03-12 12:06:40 +07:00
hathach 38ff7123b4 add semaphore reset & queue flush API for osal
add semaphore reset when opening control pipe
2013-03-12 00:10:52 +07:00
hathach 8eaad2326b add semphore reset & queue flush API
modify test to check control pipe semaphore created with usbh_init
2013-03-11 12:00:25 +07:00
hathach c1ceec067f add isr empty function for hidh and msch and usbh 2013-03-10 19:42:50 +07:00
hathach 8457585464 add class code to hcd_pipe_open to facilitate usb_complete callback 2013-03-09 21:37:49 +07:00
hathach 2364b09f80 add int_on_complete parameter to hcd_pipe_xfer for TD chain class request
fix control transfer request: remove get_control_request_ptr()
2013-03-09 14:19:40 +07:00
hathach b1db85dedf - addd p_qtd_list_tail to qhd structure for easy queue TD
- move control_request from ehci_data to usbh_device_info_pool
- add test for bulk transfer double (2 consecutive xfers)
- use table (array) structure for class driver, currently included
- refractor extract to function insert_qtd_to_qhd
+ init function
+ install_subtask
--> all class driver function must be declared with WEAK
2013-03-09 13:11:02 +07:00
hathach ef08654e73 add prototype for hcd_pipe(control)_close
- update test code for enum task respectively
2013-03-06 22:41:14 +07:00
hathach 3ed29f5f3c add test & code for hcd_pipe_control_open 2013-03-05 14:26:36 +07:00
hathach e1033b9b3c replace TUSB_CFG_HOST by MODE_HOST_SUPPORTED
move stuffs around
2013-03-04 17:07:14 +07:00
hathach 74e6b545e1 house keeping 2013-03-03 15:36:53 +07:00
hathach 795fe7468d start to add code for hcd_init test
change hcd_init signature (omit hostid)
2013-02-28 17:00:51 +07:00
hathach 82bd4719ce continue to strengthen include policy 2013-02-28 15:58:18 +07:00
hathach 0c397c6b8d house keeping
- correct initialization call sequence
- move hcd_init to ehci.c
2013-02-27 18:49:28 +07:00
hathach a6fac7180c add coded to test ehci alignment and structure layout (included bitfield) 2013-02-27 16:19:40 +07:00
hathach b1d33c7ffc rename tusbh_device_mount_succeed_cb
add set configure and tusbh_device_mount_succeed_cb invocation
refractor get_configure_number_for_device
2013-02-27 12:42:32 +07:00
hathach 5eca6d69c3 correct error using local p_interface_desc with subtask invoke (require static) 2013-02-27 02:14:01 +07:00
hathach 4023d07df0 add parsing configuration desc & invoke driver install subtask 2013-02-27 01:57:40 +07:00
hathach 49da210860 add osal subtask support
add usbh_control_xfer_subtask as xfer and wait
fix potential error when update device info & open control pipe for new address
fix build error with hal_****.c
add STATIC_ASSSERT to perform compile time checking with sizeof later
update osal_queue_receive and osal_semaphore_wait for osal_none to support subtask
2013-02-26 17:28:05 +07:00
hathach ac744b0401 refractor use Compound Literal Reference for sending control request in enum task 2013-02-22 17:14:34 +07:00
hathach 5bacdc6c0f updating usbh init with class init 2013-02-08 12:52:46 +07:00
hathach 489b98cb93 add TUSB_CFG_HOST_CONTROLLER_START_INDEX
update usbh_init and test code for TUSB_CFG_HOST_CONTROLLER_START_INDEX
clean up some
2013-02-08 12:12:10 +07:00
hathach ef0e105da6 rename addr variable to avoid conflict with static variable 2013-02-07 19:42:41 +07:00
hathach 89f74d22a7 flatten enum task --> there is quite of code duplication 2013-02-06 18:56:49 +07:00
hathach e6ed1729b2 update enumeration up to get full configuration descriptor 2013-02-06 18:12:26 +07:00
hathach 060c4b3b30 refractor move device_addr0 into usbh_device_pool
enum_entry contains speed and enum task will not carry out disconnection clean up
2013-02-06 16:52:18 +07:00
hathach 7961f04e17 remove hcd_addr0_close_Ignore
add code to check error handling from enum task
2013-02-06 13:50:17 +07:00
hathach e20025b54d refractor move test enum to its own file
add assert with handler
add task assert with error catcher
2013-02-06 12:03:01 +07:00
hathach aa040c4c98 rename device_info_pool to usbh_device_info_pool
update enum task to post set address
2013-02-04 21:52:50 +07:00
hathach 93269b0343 fix osal_semaphore_wait & osal_queue_receive of osal_none's bug
- not assign error to TUSB_ERROR_NON if succeed

add code up to set device address for enumeration
2013-02-04 20:54:52 +07:00
hathach d71e244dff add TUSB_CFG_HOST_ENUM_BUFFER_SIZE
add enum buffer
getting serious with osal_freeRTOS
2013-02-04 16:07:42 +07:00
hathach 0a13e37ba2 resolve conflict between usbh & hcd 2013-02-04 14:48:35 +07:00
hathach 94486f55ec add usbh_hcd to hold common structure/typedef for usbh and hcd 2013-02-04 13:51:20 +07:00
hathach 5ec56120e6 rename usbd_host to usbh 2013-02-04 12:29:50 +07:00