Commit Graph

606 Commits

Author SHA1 Message Date
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
hathach 14a8e26697 able to get blinky + greeting 2013-09-10 10:43:24 +07:00
hathach d3e83bc802 print out mac address 2013-07-19 12:08:04 +07:00
hathach a522263a9d add implementation for
- tusbh_cdc_rndis_is_mounted
- tusbh_cdc_rndis_get_mac_addr
2013-07-19 02:30:22 +07:00
hathach ce865721a5 add test & code to send rndis msg query for permanent address (MAC address) 2013-07-19 01:52:56 +07:00
hathach 3b12917fb0 extract send message & wait & get complete message to send_message_get_response_subtask 2013-07-14 08:33:39 +07:00
hathach 03873135a9 add some required NDIS OID define 2013-07-13 00:11:17 +07:00
hathach 0e14752c81 pass the initialize_cmplt 2013-07-06 19:06:30 +07:00
hathach 25304d142f refractor qhd_xfer_error_isr (omit xfer_type para)
add accumulated total xferred byte for an endpoint until transfer with IOC set
- control xfer will have length of data phase in usbh_xfer_isr callback
2013-07-06 14:52:02 +07:00
hathach 68da489c2e refractor ehci.c adding qhd_get_xfer_type 2013-07-06 13:41:48 +07:00
hathach e4ae45359d fix bug with RNDIS class open using non-static variable p_cdc
fix bug with SUBTASK_EXIT with single if (add do while wrapper)
add payloay message
able to send initialize & wait on notification pipe & get initialize cmpt
2013-07-05 20:21:24 +07:00
hathach 355fd7e648 adding subclass RNDIS-CDC driver API
- implement init
- close
- xfer_isr
- open

adding waiting for notification after send rndis_initalize_msg
2013-07-05 16:22:42 +07:00
hathach e4ff63c604 fix a minor bug 2013-07-05 13:41:34 +07:00
hathach 7345a4515d fix bug with rndis overshadow the normal cdc callback 2013-07-05 13:37:57 +07:00
hathach 374aea7a11 change usbh_control_xfer_subtask to use flat API instead of passing tusb_control_request_t struct 2013-07-05 13:23:42 +07:00
hathach c08c655fd1 implementing initializing for RNDIS 2013-07-05 11:46:12 +07:00
hathach aed07d83db host enum task use static control_request variable instead of literal of requests
increase enum task stack size from 128 to 150 as it comes dangerously close to overflow
2013-07-04 16:01:20 +07:00
hathach 0d37c4a319 refractor control request used in enumeration task to reduce task data
--> enum task now can work with 128 depth
2013-07-04 14:00:41 +07:00
hathach 97cbb39f6f port osal_mutex to freeRTOS, able to mount mouse & cdc device
tinyusb host stack overflow though
2013-07-04 13:24:54 +07:00
hathach 391e132d6b no big deal, only rename tusb_std_request_t to tusb_control_request_t 2013-07-04 12:25:39 +07:00
hathach d3aed01874 add some printf when a class is mounted
add initial tests for rndis
2013-07-04 10:47:31 +07:00
hathach c5afb9d50f change class (hid/cdc) _mounted_isr to _mounted_cb 2013-07-04 09:45:20 +07:00
hathach 51e9a1817b change some license text 2013-07-03 13:14:14 +07:00
hathach 4a8686e868 adding _mounted_isr & _umounted_isr callback for host keyboard & mouse
remove TUSB_EVENT_INTERFACE_OPEN & TUSB_EVENT_INTERFACE_CLOSE
2013-07-03 12:46:12 +07:00
hathach b0f45b3651 temporarily check cdc mounted by pipe_in & pipe_out
add tests for tusbh_cdc_xfer_isr
2013-07-03 12:06:07 +07:00
hathach 1667ef5041 replace tusbh_cdc_isr by tusbh_cdc_xfer_isr with extra parameter as
- pipe id
- xferred_bytes

host_class_driver_t add xferred_bytes parameter
void (* const isr) (pipe_handle_t, tusb_event_t); -->   void (* const isr) (pipe_handle_t, tusb_event_t, uint32_t);

update hid_host & its tests
2013-07-03 11:36:08 +07:00
hathach b3f98bc15a rename cdc descriptor type
add tusbh_cdc_mounted_isr & tusbh_cdc_unmounted_isr
2013-07-03 10:53:16 +07:00
hathach 539c7cdbe1 update usbh_xfer_isr to take actual byte transferred and correct tests 2013-07-02 17:37:55 +07:00
hathach e1ad7b62cf add way to calculate the actual byte transferred with ehci
add come callback for cdch
add code for cdc serial demo
2013-07-02 17:20:25 +07:00
hathach 6ce90e2bd8 add tusbh_cdc_send, t usbh_cdc_receive
add cdc_serial_app for virtual com demo
2013-07-02 16:41:13 +07:00
hathach 7e5c6ded2d add tusbh_cdc_serial_is_mounted API
test for cdch close driver
2013-07-02 15:32:41 +07:00
hathach b04b145965 add cdc_rndis enum & struct 2013-07-02 14:45:42 +07:00
hathach 12526b34a1 extract qhd_xfer_error_isr
add support for period list in xfer_error_isr
pass period TUSB_EVENT_XFER_ERROR & TUSB_EVENT_XFER_STALLED tests
2013-07-02 12:22:46 +07:00
hathach 9fea5291bf refractor extract list_next
add support for TUSB_EVENT_XFER_STALL
add test for error/stall in periodic list
2013-07-02 12:01:51 +07:00
hathach 958d390a85 refractor code 2013-07-01 20:28:16 +07:00
hathach 3f9f3f08d2 add cdc host driver close cdch_close
refractor
- add helper function in ehci qhd_next & qtd_next
- extract function qhd_create_pipe_handle
rename tusb_transfer_type_t to tusb_xfer_type_t
add some handling for stall
2013-07-01 18:53:25 +07:00
hathach d8bd749c75 change control xfer check in usbh_xfer_isr
rename
- async_list_process_isr to async_list_xfer_complete_isr
- period_list_process_isr to period_list_xfer_complete_isr

extract function void qhd_xfer_complete_isr(ehci_qhd_t * p_qhd, tusb_transfer_type_t xfer_type)
2013-07-01 16:14:46 +07:00
hathach 3f0d740776 rename usbh_isr to usbh_xfer_isr 2013-07-01 15:30:29 +07:00
hathach 35adca5ba3 house keeping 2013-07-01 11:37:53 +07:00
hathach e1883fcd26 add acm_capability saving to host data & its test 2013-07-01 11:29:23 +07:00
hathach e94ce81b04 fix compilation error 2013-07-01 10:43:55 +07:00
hathach a4f7dc1105 add & pass a first few test for cdc host
implement cdch_open_subtask
2013-07-01 10:35:37 +07:00
hathach a943cce991 test refractor 2013-06-29 21:00:33 +07:00
hathach 9e607f6dee add SUBTASK_EXIT in osal.h for TDD project 2013-06-29 16:20:24 +07:00
hathach 7e6e5cc356 [CDC]
- add configure option
- add include path
- add driver function table
2013-06-29 16:06:45 +07:00
hathach d4f31e149a adding descriptor, structure, enum support for cdc 2013-06-29 15:56:32 +07:00
hathach a07ff5a3ce use SUBTASK_EXIT to restart & exit task without "assert" 2013-06-27 16:32:54 +07:00
hathach 3bca56665c add mutex support for osal
add test for mutex in test_osal_none.c
implement usbh_control_xfer using mutex to get access to queue xfer on control pipe
(while semaphore is used to sync with hcd DMA)
failed to issue control xfer: set idle & get report descriptor in hidh_open_subtask (more to work on)
2013-06-27 16:19:22 +07:00
hathach c81c4bb817 add set idle request for hidh_open_subtask
add interface number to hidh_interface_info_t
refractor hidh_open_subtask to be a true subtask
cannot run with set idle code ON because of semaphore misuse
2013-06-27 03:20:14 +07:00
hathach ea2e63a332 remove app_os_prio.h in os_none configure
remove instance_num in hidh API
temporarily pause device stack developement
should fix travis-ci build error
2013-06-26 18:00:05 +07:00
hathach 2cc5df9b00 add custom bulk out test 2013-06-23 01:10:59 +07:00
hathach fe53297b17 fix bug with custom class that terminate xfer after the first QTD 2013-06-22 22:26:00 +07:00
hathach 54c065b1d5 fix license 2013-06-22 12:54:47 +07:00
hathach 07f36e8a61 fix a stupid bug 2013-06-21 14:52:18 +07:00
hathach 5c564df8c1 add api for hcd: hcd_pipe_is_idle
add api for usbh: tusbh_device_get_mounted_class_flag
implement api for custom class
- is mounted
- read
2013-06-21 14:20:08 +07:00
hathach 3924764dff [host lpc43xx] adding support for host custom class
refractor usbh class driver indexing
opt out periodic list code in EHCI (need to refractor/group later)
[device lpc176x] rename dcd_endpoint_configure to dcd_pipe_open
add usbd_pipe_open to manage pipe
2013-06-21 13:11:45 +07:00
hathach 743e5a7a93 house keeping 2013-06-16 15:39:09 +07:00
hathach 4d6121d44a refractor set endpoint max packet size 2013-06-16 15:32:08 +07:00
hathach 357e8d32ec clean up some & add code for managing control request targeting interface 2013-06-16 14:41:48 +07:00
hathach 77e0834f34 use dcd_pipe_control_read in endpoint_control_isr 2013-06-14 19:10:11 +07:00
hathach f219a9c77d add dcd_pipe_control_read 2013-06-14 19:06:33 +07:00
hathach 40b65b265c implement hidd_control_request including std & class specific to interface number.
refractor usbd_setup_received
2013-06-14 18:22:40 +07:00
hathach 4103cc374f add coreid to hidd_init
temporarily implement hidd_init using dcd from lpc17xx
add more test for dcd lp176x
implement dcd_endpoint_configure
2013-06-12 21:06:43 +07:00
hathach ee57a6f13f clean up 2013-06-12 14:06:41 +07:00
hathach 17a27f7398 [lpc176x][device] pass set configure control request 2013-06-11 17:53:33 +07:00
hathach 5ae9c72f84 [lpc176x][device] get pass get string descriptors 2013-06-11 17:35:53 +07:00
hathach cae19b8f56 fix bug with setup packet received (wrong increasement of pointer) 2013-06-11 17:12:44 +07:00
hathach 049a22f2cc refractor dcd_pipe_control_write_zero_length to use dcd_pipe_control_write 2013-06-11 16:30:06 +07:00
hathach d55f9ecef1 get pass set address 2013-06-11 16:13:50 +07:00
hathach 72b5b61597 able to xfer device descriptor on control endpoint of lpc176x 2013-06-11 16:01:30 +07:00
hathach 503d279af5 ADDING LPC176X device
implementing dcd_lpc175x_6x.c
add usbd_dcd.h
add usbd_isr with TUSB_EVENT_SETUP_RECEIVED & TUSB_EVENT_BUS_RESET event
parameterize TUSB_CFG_DEVICE_CONTROL_PACKET_SIZE (replace USB_MAX_PACKET0)

--> able to get interrupt and receive setup packet, but SET ADDRESS (expected get device descriptor).
uncomment write zero length will cause issue, no more interrupt ?
2013-06-08 02:50:10 +07:00
hathach e3bb5e9f2f change buffer_start_addr from uint8_t* to uint32_t due to travis linux 64bit 2013-06-05 11:56:55 +07:00
hathach f69fefefa9 added dcd_dma_descriptor_t typdef
reorganize test project, multiple test projects each is specifically for an MCU
2013-06-05 11:23:41 +07:00
hathach 3394b4beaa re-create ngx4330.h
remove some rom driver dependency on upper layer
introduce CAP_DEVICE_ROMDRIVER to overwrite TUSB_CFG_DEVICE_USE_ROM_DRIVER within the lib
add support for lpc175x_6x
- able to build and blink led on lpcxpresso1769 with device (without any class enabled)
2013-06-04 13:36:18 +07:00
hathach cdc830782f rename tusb_device_is_configured
remove dcd_lpc18xx_lpc43xx.h and dcd_lpc11uxx_lpc13xx move define to hal
2013-06-04 10:43:58 +07:00
hathach a3ed66344d fix compiler bug with ceedling tests 2013-06-03 16:40:02 +07:00
hathach 9f9adca03b add TUSB_CFG_PROUDCT_ID check
move USB_MAX_EP_NUM to device dependency
- lpc43 --> 6
- lpc11/13 --> 5
2013-06-03 15:56:14 +07:00
hathach 52f18f3784 refractor device mouse main.c & tusbd_hid_mouse_send_report 2013-06-03 14:37:41 +07:00
hathach b527e6ec4a refractor tusb_descriptors
usbd device_class_driver
added & tested HID mouse for device (work together with hid keyboard)
rename DEVICE_ROM_REG_BASE, DEVICE_ROM_DRIVER_ADDR
2013-06-03 14:31:17 +07:00
hathach 7d78fc1baf rename romdriver handle
forming API for USBD-CLASS driver (abstract away from rom driver)
separate buffer of hid class from buffer of core driver
2013-06-01 21:54:08 +07:00
hathach 9e49056721 refractor change tusbd_hid_keyboard_send_report API 2013-05-31 21:24:40 +07:00
hathach 03d85acfc7 refractor string descriptors, allow one-stop configure descriptor for
- manufacturer, product etc ... (only english now)
2013-05-31 18:21:31 +07:00
hathach ed64401e61 rename descriptor variables 2013-05-31 14:42:38 +07:00
hathach 3b9a616ca9 change at86rf to 1ghznode
rom device runs ok with lpc11uxx
2013-05-31 13:57:57 +07:00
hathach 04a641f067 ea4357 can be enumerated, but get setconfiugre value of 0 2013-05-29 16:56:15 +07:00
hathach d5836751d9 keyboard example works with lpc1347 xpresso 2013-05-29 15:23:07 +07:00
hathach dda0808ebb fix lpcxpresso1347 board_leds
temp change USBD_API to ROM_API
add lpc13xx device support
fix romdriver pointer
able to init rom driver
2013-05-29 14:39:14 +07:00
hathach 1e5bd82af2 rename NGX to ngx
add a bunch of stub header for dcd (175x_6x, 13xx, 18xx_43xx)
add dcd_nxp_romdriver for handling usb rom driver
add BIT_TEST_ in binary.h
remove mw_usbd_hid.h include due to lexical conflict
2013-05-28 15:24:27 +07:00
hathach ed217948b8 rename descriptor type, hid descriptor type 2013-05-25 17:19:18 +07:00
hathach ae02263d81 add stub function to able to build device with EA4357
- dcd_controller_reset
- dcd_controller_connect
2013-05-25 16:03:40 +07:00
hathach 132c3996ea move scu_pinmux(0x2, 5, MD_PLN | MD_EZI | MD_ZI, FUNC2) to hal/hal_lpc43xx.c
dual host run without problem with mcb4300
2013-05-23 14:56:11 +07:00
hathach 94fc55ba2c fix host build error (problem with conflict name in hid.h) 2013-05-23 13:29:46 +07:00
hathach 8cb7818bcc - move CMSIS & driver lib for lpc13u to codebase bsp/lpc13xx
- change descriptor.c/h able to build device example
2013-05-23 13:22:46 +07:00
hathach d7ae21203c fix issue with osal_none queue def 2013-05-21 17:57:21 +07:00
hathach 40503b913b abstract os priority for application tasks 2013-05-14 21:32:13 +07:00
hathach f8d1c3da3e rename tusbh_hid_keyboard/mouse_is_supported to tusbh_hid_keyboard/mouse_is_mounted 2013-05-14 03:03:54 +07:00
hathach cc49607434 test refractor 2013-05-12 19:32:32 +07:00
hathach 81780008e9 add cardinality_of function to return number of set bits
refractor tests in ehci
2013-05-11 00:40:21 +07:00
hathach 327519a5a6 refractor test
try to add travis-ci
2013-05-09 13:48:11 +07:00
hathach 63add70139 test clean up 2013-05-09 12:49:52 +07:00
hathach 861f02943d add log2_of and use this function in get_period_head 2013-05-06 20:51:34 +07:00
hathach 41fee0f488 house keeping 2013-05-06 20:25:38 +07:00
hathach fd49cff8e8 add stub for msc host & hub driver 2013-05-06 20:09:06 +07:00
hathach 120db28a17 change format of file header & license spacing 2013-05-06 12:50:19 +07:00
hathach fdd98e2fa9 clean up main 2013-04-28 00:00:48 +07:00
hathach 38172d3d3c fix bug with osal_queue for freeRTOS
implement process mouser report to clarify mouse app task
2013-04-27 16:40:18 +07:00
hathach 4db386525f reduce delay after reset to 20ms
correct freeRTOS configCPU_CLOCK_HZ to correct M4 mcu clock
2013-04-27 14:17:06 +07:00
hathach 8bd077fa5c fix bug (wrong logic) with osal_task_delay in non OS configure
complete keyboard app with key state & event TODO handle & check for non-printable(control) keycode
add unit test for osal_task_delay for non OS
2013-04-27 00:24:15 +07:00
hathach 33feba5cbc add hid_keycode_to_ascii_tbl for hid class
improve keyboard_app, should display all displayable characters
improve the de-bouncing keyboard (still got some issues)
2013-04-26 02:08:22 +07:00
hathach c0104b996e implement hcd_port_speed_get
move port reset & speed detection from isr context to usbh enumeration task
- decrease time in isr significantly from 50 ms to 580us
fix bug with osal_task_delay for freeRTOS buil
2013-04-25 17:48:55 +07:00
hathach 3763e22c9a change OSAL_TASK_DEF to decouple variable name with task name
implement osal_task_delay for freeRTOS & non_os
getting both no_os & freertos running with mouse + keyboard
2013-04-25 16:41:00 +07:00
hathach 1ae5484320 finally able to get freeRTOS run with current mouse + keyboard example
NOTES: print_greeting if is executed before the start of freeRTOS scheduler --> hardfault
- print_greeting->vsprintf->systick -> bunch of ISR --> hardfault.

printf using serial after the start of scheduler is ok though
2013-04-25 15:43:33 +07:00
hathach 92994c8192 add attribute warn unused result for osal_create_* function
taskify keyboard_app mouse_app & led_blinking
2013-04-25 11:55:24 +07:00
hathach e9dbce5f1b add TUSB_CFG_OS_TASK_PRIO to mandatory option for using an RTOS
using plain char for error enum character
increase freeRTOS configMAX_PRIORITIES to 16
house keeping & clean up compiler warning
2013-04-25 11:00:56 +07:00
hathach d4a2600ecc - change OSAL_TASK_FUNCTION to have void* parameter (to be consistent with most popular RTOS)
- add new error enum TUSB_ERROR_OSAL_TASK_CREATE_FAILED
- move usbh_enumeration_task prototype to usbh.h
- change OSAL_SUBTASK_INVOKED_AND_WAIT behavior, will not "return" in calling task when subtask got error status.
calling task need to do that after the call
- osal_queue_receive signature from uint32_t* to void*

- implement osal_freertos.h for FreeRTOS 7.3 --> able to compile & build host_freertos
+ OSAL_TASK_FUNCTION
+ turn on FPU for M4 in both host_os_none & host_freertos (freertos requires FPU to be on to compile)
+ osal_task_create
+ OSAL_SUBTASK_INVOKED_AND_WAIT
+ SUBTASK_ASSERT
+ osal_semaphore_reset
+ osal_queue_flush
+ adding heap_1.c for memory management
2013-04-24 17:53:43 +07:00
hathach 574710dde5 move main work in usbh_enumeration_task to its body subtask for task_assert style 2013-04-24 13:45:42 +07:00
hathach d312be7006 fix potential error with usbh_control_xfer_subtask in subtask_assert
change back to use task_assert style in usbh_enumeraion
change test to task->subtask->subtask style in test/test_osal_none.c
2013-04-24 12:20:56 +07:00
hathach 73d5f00a40 rename OSAL_TASK_DECLARE to OSAL_TASK_FUNCTION
removing TASK_ASSERT to avoid using goto/continue statement with rtos configure
2013-04-23 15:35:27 +07:00
hathach c20071c55c fix compiler error for USB1 to none in ehci.c
rename and moving bsp ea4357
2013-04-22 11:00:43 +07:00
hathach 3f9a73a34d change config to use USB0 only
fix some compiler warnings
2013-04-22 10:44:51 +07:00
hathach ee9d53477a complete the support for correct polling of 1ms 2ms 4ms 8ms 2013-04-21 16:24:42 +07:00
hathach a493fab753 separate fake ehci's run async & period list
refractor list_find_previous_item & list_remove_qhd to act on ehci_link_t* instead of ehci_qhd_t*
fully support 1ms, 2ms, 4ms, 8ms for period list (each list has a dummy queue head)
- change period list structure
limit the maximum polling interval to 256 ms
add max_loop static MAX number of iteration for list_find_previous_item
add test for close 256ms polling interrupt
2013-04-21 15:09:54 +07:00
hathach 357888a5e5 rename nxp_sof_received to nxp_int_sof
implementing freeRTOS integration
change get_period_frame_list from using lst_idx to hostid (fix bug)
adding polling interval supported for interrupt: 1ms, 2ms, 4ms, 8ms
- add interval_ms to get_period_head function
- add bInterval to qhd_init
- add support for sub-frame (less than 8 micro frames) interval
- add bunch of test for interrupt different intervals
2013-04-21 00:28:25 +07:00
hathach a9010c1786 getting build with freertos & host demo 2013-04-16 16:48:19 +08:00
hathach fffe8b547d - ehci: free error TD for recovery 2013-04-10 02:40:09 +07:00
hathach 2d7fbb5153 change keyboard_app.c & mouse_app.c from polling API to interrupt-based (callback isr)
and using OSAL for task-base demo
- fix ehci error with XFER_COMPLETE callback to usbh_isr, TD need to be freed & unlink before invoking
callback
- fix bug in usbh.c set device state to CONFIGURED right after SET_CONFIGURE control xfer
2013-04-10 02:34:40 +07:00
hathach e14aa4197d change osal_queue_send(osal_queue_handle_t const queue_hdl, uint32_t data) signature to osal_queue_send(osal_queue_handle_t const queue_hdl, const void * data)
- support any size queue message (instead of fixed uint32_t)
2013-04-10 01:18:32 +07:00
hathach e6a44b3fe9 add test & code for TUSB_EVENT_INTERFACE_OPEN for tusbh_hid_keyboard_isr tusbh_hid_mouse_isr 2013-04-09 13:28:07 +07:00
hathach a6cf4f228e add tusbh_hid_mouse_isr & tusbh_hid_keyboard_isr callback with xfer_complete & error event 2013-04-09 03:13:27 +07:00
hathach c036efff1d adding code to allow configure MIC2555 to pull down D+/D- (still need bit bangding I2C on PB_0 PB_1)
add back port reset after get 8 bytes of device descriptor
2013-04-09 02:13:18 +07:00
hathach 94e25880dc - add scu_pinmux(0x2, 5, MD_PLN | MD_EZI | MD_ZI, FUNC2); // USB1_VBUS monitor presence
- USB1 host run ok with NGX4330
2013-04-08 14:57:00 +07:00
hathach ef850984da move MCU define to tusb_option.h, fix the ATTR with USB RAM
hack: add delay before the very first xfer when enumerating (finalize later
after reading USB 2.0 specs)
2013-04-08 03:45:31 +07:00
hathach 4b63a2bc5c - fix HID_MOUSEBUTTON right & left
- add mouse app to mount mouse interface
2013-04-07 19:33:40 +07:00
hathach dfe2b94248 refractor extract hidh_interface_get_report from keyboard_get_report 2013-04-07 18:38:32 +07:00
hathach ff63a86a4d add complete isr for hidh mouse
refractor hid_host.c
- extract hidh_interface_open from hidh_keyboard_open
- extract hidh_interface_close from hidh_keyboard_close
-
2013-04-07 18:29:30 +07:00
hathach 058e2a9837 add test code & implement
- hidh_mouse_open
- tusbh_hid_mouse_status
- tusbh_hid_mouse_get_report
2013-04-07 18:10:01 +07:00
hathach 10c08ab404 add test for mouse_open
add hid descriptor for mouse & mouse interface to descriptor_test
refractor extract function hidh_interface_status
fix error with MACRO HID_REPORT_ITEM with zero data size --> redundant semicolon
2013-04-07 15:48:01 +07:00
hathach 3d8a4ef8c8 remove hcd_port_reset before set address in enumeration
add test & implement tusbh_hid_mouse_is_supported
2013-04-07 14:44:53 +07:00
hathach 27f860db9f rename hidh_keyboard_info_t to hidh_interface_info_t
rename tusb_bus_event_t to tusb_event_t
add test_mouse_init and more stuff for hidh mouse
move delay after port reset to only for speed detection
prioritize port change interrupt over xfer interrupt
- in case of unplugged, current connect change & xfer error both set
- xfer error only break to debugger if not because of unplugged

fix bug: set dev addr0 state to UNPLUG after close its control pipe in enumeration process
2013-04-07 05:09:18 +07:00
hathach 24ade0458e fix compiling error for tests project
start to add support for host hid mouse
2013-04-07 03:53:53 +07:00
hathach 1776bb53f6 add hal init for USB1 and trying to get USB1 working
add hack delay 100 ms after a port reset (huge) for correct speed detection
2013-04-07 03:40:24 +07:00
hathach 68dddefe7b add control xfer for ehci controller fake: ehci_controller_control_xfer_proceed
refractor test code
2013-04-05 14:00:37 +07:00
hathach fcb8e295ec clean up, update tests for hcd_port_reset after 8 byte descriptor & set configure before open class driver 2013-03-29 23:37:59 +07:00
hathach e658e67ebe fix the damn bug within 10 line of code in keyboard_app.c 2013-03-29 00:20:27 +07:00
hathach 7b5d9edc5a add test for pipe_interrupt_xfer
implement keyboard app code
- forcefully place keyboard_report in RAM section 3
change used bit in qtd from reserved in buffer[1] to alternate link
add code for fake ehci controller runs on period interrupt
change signature of tusbh_hid_keyboard_get_report
- tusb_keyboard_report_t* to uint8_t*
implement period (interrupt) complete isr processing
2013-03-27 11:51:44 +07:00
hathach b0ff7a7e23 add code & test for hidh_isr (set status for keyboard) 2013-03-26 17:04:55 +07:00
hathach ac905a8d09 rename pipe_status_t to tusb_interface_status_t
add tusbh_hid_keyboard_status & test code
2013-03-26 16:39:25 +07:00
hathach 0b08dc7724 fix bug with enum task skipping decriptor 2013-03-26 14:18:14 +07:00
hathach 205a21ff04 add code for hidh close
refractor the full configure descriptor parsing in enum task
2013-03-26 13:45:14 +07:00
hathach 3c767e9f44 add field to endpoint maxpacketsize (mult)
refractor hidh_open_subtask & hidh_keyboard_open
add ATTR_PACKED_STRUCT(x)
- TODO remove ugly pre_pack & post pack
2013-03-26 13:07:42 +07:00
hathach 03d045ecde - put ATTR_UNUSED to hardfault handler variables to discard compiler warning
- change host_class_driver_t: open_subtask signature to accept tusb_descriptor_interface_t const * instead of uint8_t*
2013-03-26 12:14:04 +07:00
hathach 54acee1fc8 start merge hidh_keyboard back to hidh 2013-03-26 11:41:41 +07:00
hathach a7e8a2ba9a pass all the current tests 2013-03-26 02:06:30 +07:00
hathach 086a8e4a2d add flag_supported_class to usbh_devices
remove all ATTR_WEAK in init,open,isr,close driver functions of USBH-CLASS API
- prefer testing
2013-03-26 02:02:54 +07:00
hathach ff03b452d9 remove multiple instances per device for hidh keyboard (no needed)
- API retain though
2013-03-25 22:06:00 +07:00
hathach a2031e6218 refractor hidh_keyboard_open 2013-03-25 20:57:27 +07:00
hathach f5e7644a1e fix const discard warning 2013-03-25 18:07:33 +07:00
hathach 2622cc487b add more test and complete keyboard open 2013-03-25 17:57:33 +07:00
hathach d0a73f4b0d add several helper function
add test & code for hidh_keyboard_open_subtask
- skip parsing HID descriptor for keyboard
2013-03-25 17:39:22 +07:00
hathach c026a9f2e0 remove obsolete TUSB_CFG_HOST_HID_KEYBOARD_ENDPOINT_SIZE
temporarily ignore test for hid_host.c due to ceedling linking issue with weak symbol
implement hidh_open_subtask driver to subclass open
rename hidh_keyboard_install to hidh_keyboard_open_subtask
2013-03-25 16:02:24 +07:00
hathach 45db7b4a53 able to build test hidh
hack include in hid_host_keyboard.h
2013-03-25 13:51:44 +07:00
hathach ddeec330fa separate hidh_keyboard from hid_host
move test hid related to its own folder
2013-03-25 13:08:40 +07:00
hathach 56cd8be75e change website from tinyusb.net to tinyusb.org 2013-03-25 11:46:30 +07:00
hathach 20a22d956d changing the hcd_pipe_close behavior
- bulk/int/iso pipe can only be closed as part of unmount/safe remove process
add test for interrupt_close
2013-03-25 11:04:37 +07:00
hathach b15694bc5f fix potential bug when insert new queue head to list 2013-03-24 22:24:27 +07:00
hathach 62f5ec8a0f period_frame_list0 is not existed if period list is not required 2013-03-24 21:53:41 +07:00
hathach c7c993d6cc refractor hidh keyboard
changing class hidh behavior
2013-03-24 21:40:49 +07:00
hathach a1b17be681 add class flags
change keyboard_info_pool to keyboard_data
2013-03-24 17:29:07 +07:00
hathach 92c137243d refractor
- rename usbh_device_info_pool to usbh_devices
- create a struct for control pipe in usbh_device_info_t
2013-03-24 16:44:59 +07:00
hathach ea04815bbc rename sem_hdl in usbh_device_info_t control_sem_hdl 2013-03-24 16:22:58 +07:00
hathach 55ce5cc4a2 add TUSB_DEVICE_STATE_INVALID_PARAMETER to tusb_device_state_t 2013-03-24 16:05:50 +07:00
hathach 439a3134b9 refractor
- rename tusbh_device_status_get to tusbh_device_get_state
- replace tusbh_device_status_t by tusb_device_state_t
2013-03-24 16:02:45 +07:00
hathach ce63980386 clean up:
- refractor tusb_handle_device_t device_hdl to uint8_t dev_addr

add keyboard_app.c/h
2013-03-24 15:50:49 +07:00
hathach e6630af5a4 clean up 2013-03-23 23:43:25 +07:00
hathach 0c5e0ef0f3 - add control_pipe_status for usbh_device_info_t to reflect the status transfer of control pipe
- fix bug with hcd_port_reset
  + remove regs->portsc_bit.port_enable in the wait loop as device unplugged can cause this to always fails
- correct the timeout for hcd_controll_stop/reset 16 uframes ~ 2 ms
- potentially fix bugs device unplugged when new address is not assigned
2013-03-23 18:36:43 +07:00
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 ae9b9ead7a continue clean up ehci 2013-03-23 10:23:37 +07:00
hathach 58b252b3f1 clean up ehci 2013-03-23 10:14:47 +07:00
hathach 8beb749761 clean up 2013-03-23 09:57:08 +07:00
hathach 660440d69c refractor extract to function qtd_remove_1st_from_qhd 2013-03-23 02:56:17 +07:00
hathach eddaa8394b fix issue with Interrupt Async Advance
- only acknowledge interrupt that we check
2013-03-23 02:51:41 +07:00
hathach 53a4164b39 use DO PING for highspeed out bulk 2013-03-22 21:50:07 +07:00
hathach 397d62db10 fix bug: adjust all bulk queue head from ehci_data.device 2013-03-22 21:21:00 +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 cd2915e78c house keeping 2013-03-13 21:45:06 +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 dbd3d9618d refractor rename field inactive_next_xact of ehci_qhd_t 2013-03-13 12:29:44 +07:00
hathach 1a932e7437 refractor ehci test files
adding some code for async_advance_isr
add test for async_advance_isr
2013-03-13 12:25:27 +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 63765b37c7 forget to add test file for ehci isr 2013-03-13 00:17:02 +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 60c2caf84a implement port hcd_port_connect_status
clean up
2013-03-12 16:46:47 +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