48 #include "serial/uart_usb_lib.h"
59 #ifndef USB_CDC_ACM_HOOK_TX_START
60 #define USB_CDC_ACM_HOOK_TX_START(char)
63 #ifndef USB_CDC_ACM_HOOK_TX_END
64 #define USB_CDC_ACM_HOOK_TX_END(char)
67 #ifndef USB_CDC_ACM_HOOK_CLS_CHANGED
68 #define USB_CDC_ACM_HOOK_CLS_CHANGED(state)
71 #ifndef USB_CDC_ACM_HOOK_CONFIGURED
72 #define USB_CDC_ACM_HOOK_CONFIGURED()
75 #ifndef USB_CDC_ACM_CONF_LOCAL_ECHO
76 #define USB_CDC_ACM_CONF_LOCAL_ECHO 0
83 S_line_coding line_coding;
87 void uart_usb_configure_endpoints() {
88 usb_configure_endpoint(
97 usb_configure_endpoint(
106 usb_configure_endpoint(
119 USB_CDC_ACM_HOOK_CONFIGURED();
123 int usb_stdout_putchar(
char c, FILE *stream)
126 uint8_t uenum = UENUM;
132 if(usb_endpoint_wait_for_write_enabled()!=0)
147 static FILE usb_stdout = FDEV_SETUP_STREAM(usb_stdout_putchar,
160 void uart_usb_set_stdout(
void)
162 stdout = &usb_stdout;
166 static uint8_t uart_usb_control_line_state = 0;
168 uint8_t uart_usb_get_control_line_state(
void) {
169 return uart_usb_control_line_state;
173 void uart_usb_set_control_line_state(uint8_t control_line_state)
175 uart_usb_control_line_state = control_line_state;
176 USB_CDC_ACM_HOOK_CLS_CHANGED(control_line_state);
209 uint8_t uenum = UENUM;
211 USB_CDC_ACM_HOOK_TX_START(data_to_send);
227 USB_CDC_ACM_HOOK_TX_END(data_to_send);
246 uint8_t uenum = UENUM;
259 return (rx_counter!=0);
272 register Uchar data_rx;
275 uint8_t uenum = UENUM;
283 #if USB_CDC_ACM_CONF_LOCAL_ECHO
302 uint8_t uenum = UENUM;
307 usb_endpoint_wait_for_write_enabled();