1 /* 2 * Copyright (c) 2022, sakumisu 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 #ifndef USBH_CDC_ACM_H 7 #define USBH_CDC_ACM_H 8 9 #include "usb_cdc.h" 10 11 struct usbh_cdc_acm { 12 struct usbh_hubport *hport; 13 14 struct cdc_line_coding linecoding; 15 uint8_t ctrl_intf; /* Control interface number */ 16 uint8_t data_intf; /* Data interface number */ 17 bool dtr; 18 bool rts; 19 uint8_t minor; 20 usbh_pipe_t bulkin; /* Bulk IN endpoint */ 21 usbh_pipe_t bulkout; /* Bulk OUT endpoint */ 22 #ifdef CONFIG_USBHOST_CDC_ACM_NOTIFY 23 usbh_pipe_t intin; /* Interrupt IN endpoint (optional) */ 24 #endif 25 }; 26 27 #ifdef __cplusplus 28 extern "C" { 29 #endif 30 31 int usbh_cdc_acm_set_line_coding(struct usbh_cdc_acm *cdc_acm_class, struct cdc_line_coding *line_coding); 32 int usbh_cdc_acm_get_line_coding(struct usbh_cdc_acm *cdc_acm_class, struct cdc_line_coding *line_coding); 33 int usbh_cdc_acm_set_line_state(struct usbh_cdc_acm *cdc_acm_class, bool dtr, bool rts); 34 35 void usbh_cdc_acm_run(struct usbh_cdc_acm *cdc_acm_class); 36 void usbh_cdc_acm_stop(struct usbh_cdc_acm *cdc_acm_class); 37 38 #ifdef __cplusplus 39 } 40 #endif 41 42 #endif /* USBH_CDC_ACM_H */ 43