diff options
author | Marti Bolivar <mbolivar@leaflabs.com> | 2011-09-23 17:56:24 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@leaflabs.com> | 2011-10-18 13:30:18 -0400 |
commit | bbcbf65fd7d074268f4e25ae014965bceb995b79 (patch) | |
tree | d027563c1d4b860d3e77119ee26f75943ced80a2 /libmaple/usb/usb_callbacks.h | |
parent | 2e392bbf59c4c746714d71c99757f02da4c57179 (diff) | |
download | librambutan-bbcbf65fd7d074268f4e25ae014965bceb995b79.tar.gz librambutan-bbcbf65fd7d074268f4e25ae014965bceb995b79.zip |
usb: Disentangle CDC ACM functionality.
Add new usb_cdcacm.h, which provides the virtual serial port API.
This file (and new usb_cdcacm.c) consolidate the VCOM support, which
was previously distributed through descriptors.[hc], usb.[hc],
usb_callbacks.[hc], and usb_config.h.
Add usb_init_usblib() to usb.h, as a way of initializing the USB
peripheral in terms of the data structures required by usb_lib. This
is used by the new usb_cdcacm_enable().
Create new usb_lib_globals.h, with declarations for the usb_lib global
state which is most used throughout the rest of the libmaple USB stack.
Remove descriptors.c and usb_callbacks.[hc]; they are no longer
necessary.
Update the USB README accordingly.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'libmaple/usb/usb_callbacks.h')
-rw-r--r-- | libmaple/usb/usb_callbacks.h | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/libmaple/usb/usb_callbacks.h b/libmaple/usb/usb_callbacks.h deleted file mode 100644 index a71af01..0000000 --- a/libmaple/usb/usb_callbacks.h +++ /dev/null @@ -1,77 +0,0 @@ -/* insert license */ - -#ifndef __USB_CALLBACKS -#define __USB_CALLBACKS - -#include "libmaple.h" -#include "usb_config.h" - -#include "usb_type.h" -#include "usb_core.h" - -#define SET_LINE_CODING 0x20 -#define GET_LINE_CODING 0x21 -#define SET_COMM_FEATURE 0x02 -#define SET_CONTROL_LINE_STATE 0x22 -#define CONTROL_LINE_DTR (0x01) -#define CONTROL_LINE_RTS (0x02) - -#if defined(__cplusplus) -extern "C" { -#endif - -typedef struct { - uint32 bitrate; - uint8 format; - uint8 paritytype; - uint8 datatype; -} USB_Line_Coding; - -typedef enum { - DTR_UNSET, - DTR_HIGH, - DTR_NEGEDGE, - DTR_LOW -} RESET_STATE; - -extern RESET_STATE reset_state; /* tracks DTR/RTS */ -extern uint8 line_dtr_rts; -extern volatile uint32 countTx; -extern uint8 vcomBufferRx[VCOM_RX_BUFLEN]; /* no reason this has to be VCOM_RX_EPSIZE, could be bigger */ -extern volatile uint32 recvBufIn; /* the FIFO in index to the recvbuffer */ -extern volatile uint32 recvBufOut; /* the FIFO out index to the recvbuffer */ -extern volatile uint32 maxNewBytes; -extern volatile uint32 newBytes; - -void vcomDataTxCb(void); -void vcomDataRxCb(void); -void vcomManagementCb(void); - -uint8* vcomGetSetLineCoding(uint16 length); -void vcomSetLineSate(void); - -void usbInit(void); -/* internal functions (as per the usb_core pProperty structure) */ -void usbInit(void); -void usbReset(void); -void usbStatusIn(void); -void usbStatusOut(void); - -RESULT usbDataSetup(uint8 request); -RESULT usbNoDataSetup(uint8 request); -RESULT usbGetInterfaceSetting(uint8,uint8); - -uint8* usbGetDeviceDescriptor(uint16 length); -uint8* usbGetConfigDescriptor(uint16 length); -uint8* usbGetStringDescriptor(uint16 length); - -/* internal callbacks to respond to standard requests */ -void usbSetConfiguration(void); -void usbSetDeviceAddress(void); - -#if defined(__cplusplus) -} -#endif - - -#endif |