aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/usb.h
diff options
context:
space:
mode:
authorajmeyer@mit.edu <ajmeyer@mit.edu@749a229e-a60e-11de-b98f-4500b42dc123>2009-12-19 15:14:29 +0000
committerajmeyer@mit.edu <ajmeyer@mit.edu@749a229e-a60e-11de-b98f-4500b42dc123>2009-12-19 15:14:29 +0000
commit6a0091418a8cdad33f7cb9b2a576e91c6960e07a (patch)
tree8d85cf4b3b008686b26b062025c366876c84ee9f /src/lib/usb.h
parentacf59b1abb346998c492b93fee4a680a32f538d5 (diff)
downloadlibrambutan-6a0091418a8cdad33f7cb9b2a576e91c6960e07a.tar.gz
librambutan-6a0091418a8cdad33f7cb9b2a576e91c6960e07a.zip
added a usb.h and usb.c to cover some of the low level access functions that we can use to build the usb serial port. my sandbox widgets are in main.cpp, look at it then throw it out. I adjusted the stm32f10x_conf.h file to properly NOT include certain st lib files that werent being used, and modified the NVIC init to cope with the bootloader
git-svn-id: https://leaflabs.googlecode.com/svn/trunk/library@76 749a229e-a60e-11de-b98f-4500b42dc123
Diffstat (limited to 'src/lib/usb.h')
-rw-r--r--src/lib/usb.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lib/usb.h b/src/lib/usb.h
index d057b1d..3a7e92b 100644
--- a/src/lib/usb.h
+++ b/src/lib/usb.h
@@ -17,11 +17,30 @@ extern "C" {
#define USB_SERIAL_ENDP_RX ((uint16_t) 0x3)
#define USB_SERIAL_BUF_SIZE (0x40)
+#define BOOTLOADER_VECT_TABLE ((uint32_t*)0x20000000)
+
+typedef void (*FuncPtr)(void);
+
+typedef struct {
+ FuncPtr serial_tx_cb;
+ FuncPtr serial_rx_cb;
+ FuncPtr serial_linecoding_cb;
+ uint32_t* serial_count_in;
+ uint32_t* serial_count_out;
+ uint8_t* serial_buffer_out;
+ void* linecoding;
+ uint8_t major_rev;
+ uint8_t minor_rev;
+ void* usb_device_ptr;
+} BootVectTable;
+
+extern BootVectTable* bootVect;
+
void usb_lpIRQHandler(void);
void usb_userToPMABufferCopy(u8 *pbUsrBuf,u16 wPMABufAddr,u16 wNBytes);
void usb_PMAToUserBufferCopy(u8 *pbUsrBuf,u16 wPMABufAddr,u16 wNBytes);
void usb_serialWriteStr(const char *outStr);
-
+uint8_t usb_serialGetRecvLen();
#ifdef __cplusplus
} // extern "C"