summaryrefslogtreecommitdiff
path: root/src/class/cdc/cdc_host.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-12-22 18:28:06 +0700
committerhathach <[email protected]>2022-12-22 18:28:06 +0700
commit05c119ce975668eff814c78d5306589fc2d24530 (patch)
tree3ce1ed8374d19006f9acd4ab3ef7b46ed48f6b68 /src/class/cdc/cdc_host.h
parent11233e4d3e04ceab1ad6e33d37a166aa48c436de (diff)
cdc host, add set line coding API
Diffstat (limited to 'src/class/cdc/cdc_host.h')
-rw-r--r--src/class/cdc/cdc_host.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/class/cdc/cdc_host.h b/src/class/cdc/cdc_host.h
index 5407c646d..9bf5af46c 100644
--- a/src/class/cdc/cdc_host.h
+++ b/src/class/cdc/cdc_host.h
@@ -37,11 +37,16 @@
// Class Driver Configuration
//--------------------------------------------------------------------+
-// Set DTR ( bit 0), RTS (bit 1) on enumeration/mounted
-#ifndef CFG_TUH_CDC_SET_DTRRTS_ON_ENUM
-#define CFG_TUH_CDC_SET_DTRRTS_ON_ENUM 0
+// Set Line Control state on enumeration/mounted: DTR ( bit 0), RTS (bit 1)
+#ifndef CFG_TUH_CDC_LINE_CONTROL_ON_ENUM
+#define CFG_TUH_CDC_LINE_CONTROL_ON_ENUM 0
#endif
+// Set Line Coding on enumeration/mounted, value for cdc_line_coding_t
+//#ifndef CFG_TUH_CDC_LINE_CODING_ON_ENUM
+//#define CFG_TUH_CDC_LINE_CODING_ON_ENUM { 115200, CDC_LINE_CONDING_STOP_BITS_1, CDC_LINE_CODING_PARITY_NONE, 8 }
+//#endif
+
// RX FIFO size
#ifndef CFG_TUH_CDC_RX_BUFSIZE
#define CFG_TUH_CDC_RX_BUFSIZE USBH_EPSIZE_BULK_MAX
@@ -130,9 +135,12 @@ bool tuh_cdc_read_clear (uint8_t idx);
// Control Endpoint (Request) API
//--------------------------------------------------------------------+
-// Send control request to Set Control Line State: DTR (bit 0), RTS (bit 1)
+// Request to Set Control Line State: DTR (bit 0), RTS (bit 1)
bool tuh_cdc_set_control_line_state(uint8_t idx, uint16_t line_state, tuh_xfer_cb_t complete_cb, uintptr_t user_data);
+// Request to Set Line Coding
+bool tuh_cdc_set_line_coding(uint8_t idx, cdc_line_coding_t const* line_coding, tuh_xfer_cb_t complete_cb, uintptr_t user_data);
+
// Connect by set both DTR, RTS
static inline bool tuh_cdc_connect(uint8_t idx, tuh_xfer_cb_t complete_cb, uintptr_t user_data)
{