improve host serial drivers

- tuh_control_xfer() update xfer result to user_data if complete
callback = NULL (sync/blocking)
- refactor host serial driver for acm/ftdi/cp210x
This commit is contained in:
hathach
2023-04-28 19:06:08 +07:00
parent 2afef458be
commit 0a43a7b418
3 changed files with 347 additions and 353 deletions

View File

@@ -134,7 +134,11 @@ bool tuh_cdc_read_clear (uint8_t idx);
//--------------------------------------------------------------------+
// Control Endpoint (Request) API
// Each Function will make a USB transfer request to/from device
// Each Function will make a USB control transfer request to/from device
// - If complete_cb is provided, the function will return immediately and invoke
// the callback when request is complete.
// - If complete_cb is NULL, the function will block until request is complete.
// In this case, user_data should be pointed to xfer_result_t to hold the transfer result.
//--------------------------------------------------------------------+
// Request to Set Control Line State: DTR (bit 0), RTS (bit 1)