summaryrefslogtreecommitdiff
path: root/src/class/cdc/cdc_host.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2020-11-02 09:19:34 +0700
committerhathach <[email protected]>2020-11-02 09:19:34 +0700
commit14461beffa4f2e12bc37d523701be65fabd0d8ce (patch)
tree3559622b877e1fc571cb6164d3803f7faa0d917f /src/class/cdc/cdc_host.h
parent2efdc2fb64fec2cba26dc3fd4651583bc0dcf7b3 (diff)
remove legacy blocking usbh_control_xfer()
reworking cdc host driver
Diffstat (limited to 'src/class/cdc/cdc_host.h')
-rw-r--r--src/class/cdc/cdc_host.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/class/cdc/cdc_host.h b/src/class/cdc/cdc_host.h
index f28a0a713..66c2f0727 100644
--- a/src/class/cdc/cdc_host.h
+++ b/src/class/cdc/cdc_host.h
@@ -44,6 +44,18 @@
* \defgroup CDC_Serial_Host Host
* @{ */
+bool tuh_cdc_set_control_line_state(uint8_t dev_addr, bool dtr, bool rts, tuh_control_complete_cb_t complete_cb);
+
+static inline bool tuh_cdc_connect(uint8_t dev_addr, tuh_control_complete_cb_t complete_cb)
+{
+ return tuh_cdc_set_control_line_state(dev_addr, true, true, complete_cb);
+}
+
+static inline bool tuh_cdc_disconnect(uint8_t dev_addr, tuh_control_complete_cb_t complete_cb)
+{
+ return tuh_cdc_set_control_line_state(dev_addr, false, false, complete_cb);
+}
+
/** \brief Check if device support CDC Serial interface or not
* \param[in] dev_addr device address
* \retval true if device supports
@@ -113,6 +125,7 @@ void tuh_cdc_xfer_isr(uint8_t dev_addr, xfer_result_t event, cdc_pipeid_t pipe_i
//--------------------------------------------------------------------+
void cdch_init(void);
bool cdch_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *itf_desc, uint16_t *p_length);
+bool cdch_set_config(uint8_t dev_addr, uint8_t itf_num);
bool cdch_xfer_cb(uint8_t dev_addr, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes);
void cdch_close(uint8_t dev_addr);