1 /* 2 * Copyright (c) 2018 The Fuchsia Authors 3 * 4 * Use of this source code is governed by a MIT-style 5 * license that can be found in the LICENSE file or at 6 * https://opensource.org/licenses/MIT 7 */ 8 9 #pragma once 10 11 #include <dev/usb/class/cdcserial.h> 12 #include <lib/cbuf.h> 13 #include <lib/io.h> 14 15 typedef struct { 16 bool online; 17 cdcserial_channel_t cdc_chan; 18 19 print_callback_t print_cb; 20 21 usbc_transfer_t rx_transfer; 22 uint8_t rx_buf[64]; 23 24 spin_lock_t tx_lock; 25 bool transmitting; 26 cbuf_t tx_buf; 27 usbc_transfer_t tx_transfer; 28 } cdcconsole_t; 29 30 void cdcconsole_init(cdcconsole_t *con, int data_ep_addr, int ctrl_ep_addr); 31