diff options
author | AJM <poslathian@poslathian.(none)> | 2010-04-20 14:35:58 -0400 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2010-05-20 22:09:15 -0400 |
commit | bfb86b6c2ac84c691c150e20adcc1b77d57efd10 (patch) | |
tree | feb5286f411417d6832a417e02e07fe1c775f4e7 /core/usb/usb_callbacks.h | |
parent | 0db5696149d8f01275955c94ec55c9c43d7ca390 (diff) | |
download | librambutan-bfb86b6c2ac84c691c150e20adcc1b77d57efd10.tar.gz librambutan-bfb86b6c2ac84c691c150e20adcc1b77d57efd10.zip |
finished the entire low level usb app for virtual com minus the precise handling of get/send data callbacks and toggle line state. completely undebugged for now.
Diffstat (limited to 'core/usb/usb_callbacks.h')
-rw-r--r-- | core/usb/usb_callbacks.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/core/usb/usb_callbacks.h b/core/usb/usb_callbacks.h new file mode 100644 index 0000000..4fe287f --- /dev/null +++ b/core/usb/usb_callbacks.h @@ -0,0 +1,47 @@ +#define SET_LINE_CODING 0x20 +#define GET_LINE_CODING 0x21 +#define SET_CONTROL_LINE_STATE 0x22 +#define CONTROL_LINE_DTR (1 << 0) +#define CONTROL_LINE_RTS (1 << 1) + +typedef struct { + uint32 bitrate; + uint8 format; + uint8 paritytype; + uint8 datatype; +} USB_Line_Coding; + +void vcomDataTxCb(void); +void vcomDataRxCb(void); +void vcomManagementCb(void); + +u8* vcomGetSetLineCoding(uint16 length); +void vcomSetLineSate(uint16 wValue); + +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(u8 request); +RESULT usbNoDataSetup(u8 request); +RESULT usbGetInterfaceSetting(u8,u8); + +u8* usbGetDeviceDescriptor(u16 length); +u8* usbGetConfigDescriptor(u16 length); +u8* usbGetStringDescriptor(u16 length); +u8* usbGetFunctionalDescriptor(u16 length); + +/* internal callbacks to respond to standard requests */ +void usbGetConfiguration(void); +void usbSetConfiguration(void); +void usbGetInterface(void); +void usbSetInterface(void); +void usbGetStatus(void); +void usbClearFeature(void); +void usbSetEndpointFeature(void); +void usbSetDeviceFeature(void); +void usbSetDeviceAddress(void); + |