diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-04-27 14:54:50 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-05-25 11:52:13 -0400 |
commit | c381d03aad5c3ee761169b7c7bced519cc14da29 (patch) | |
tree | 7cf1028a3a24d0fa21e94fdc2ca30ba7250fac49 /src/generic/usbstd_cdc.h | |
parent | c812a40a3782415e454b04bf7bd2158a6f0ec8b5 (diff) | |
download | kutter-c381d03aad5c3ee761169b7c7bced519cc14da29.tar.gz kutter-c381d03aad5c3ee761169b7c7bced519cc14da29.tar.xz kutter-c381d03aad5c3ee761169b7c7bced519cc14da29.zip |
lpc176x: Initial support for serial over usb
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/generic/usbstd_cdc.h')
-rw-r--r-- | src/generic/usbstd_cdc.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/generic/usbstd_cdc.h b/src/generic/usbstd_cdc.h new file mode 100644 index 00000000..e6873a31 --- /dev/null +++ b/src/generic/usbstd_cdc.h @@ -0,0 +1,49 @@ +// Standard definitions for USB CDC devices +#ifndef __GENERIC_USBSTD_CDC_H +#define __GENERIC_USBSTD_CDC_H + +#define USB_CDC_SUBCLASS_ACM 0x02 + +#define USB_CDC_ACM_PROTO_AT_V25TER 1 + +struct usb_cdc_header_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDescriptorSubType; + uint16_t bcdCDC; +} PACKED; + +#define USB_CDC_HEADER_TYPE 0x00 +#define USB_CDC_ACM_TYPE 0x02 +#define USB_CDC_UNION_TYPE 0x06 + +#define USB_CDC_CS_INTERFACE 0x24 +#define USB_CDC_CS_ENDPOINT 0x25 + +struct usb_cdc_acm_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDescriptorSubType; + uint8_t bmCapabilities; +} PACKED; + +struct usb_cdc_union_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDescriptorSubType; + uint8_t bMasterInterface0; + uint8_t bSlaveInterface0; +} PACKED; + +#define USB_CDC_REQ_SET_LINE_CODING 0x20 +#define USB_CDC_REQ_GET_LINE_CODING 0x21 +#define USB_CDC_REQ_SET_CONTROL_LINE_STATE 0x22 + +struct usb_cdc_line_coding { + uint32_t dwDTERate; + uint8_t bCharFormat; + uint8_t bParityType; + uint8_t bDataBits; +} PACKED; + +#endif // usbstd_cdc.h |