aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/usb.h
diff options
context:
space:
mode:
authorajmeyer@mit.edu <ajmeyer@mit.edu@749a229e-a60e-11de-b98f-4500b42dc123>2010-01-07 03:31:35 +0000
committerajmeyer@mit.edu <ajmeyer@mit.edu@749a229e-a60e-11de-b98f-4500b42dc123>2010-01-07 03:31:35 +0000
commit2addfe8c42c6bcdc0a15c751e2436447b73d03fe (patch)
tree07e569cd0fe7fd4a06cb5f71e12ba76dda3d5e2c /src/lib/usb.h
parent5f423270cde82f9dfffb52bdd617e5eb439921c5 (diff)
downloadlibrambutan-2addfe8c42c6bcdc0a15c751e2436447b73d03fe.tar.gz
librambutan-2addfe8c42c6bcdc0a15c751e2436447b73d03fe.zip
Added a print class for USB, works identically to the Serial object. Bugs out if you try and pump more than 64 bytes through it in a single packet (which is really the OS's decision). This can be fixed
git-svn-id: https://leaflabs.googlecode.com/svn/trunk/library@93 749a229e-a60e-11de-b98f-4500b42dc123
Diffstat (limited to 'src/lib/usb.h')
-rw-r--r--src/lib/usb.h28
1 files changed, 6 insertions, 22 deletions
diff --git a/src/lib/usb.h b/src/lib/usb.h
index 3a7e92b..3b7a971 100644
--- a/src/lib/usb.h
+++ b/src/lib/usb.h
@@ -5,10 +5,7 @@
#include "util.h"
#include "cortexm3_macro.h"
#include "usb_regs.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include "bootVect.h"
#define USB_ISR_ADDR (0x08000090)
#define USB_SERIAL_ENDP_TXADDR ((uint32_t) 0xC0)
@@ -17,30 +14,17 @@ 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;
+#ifdef __cplusplus
+extern "C" {
+#endif
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);
+void usb_serialWriteChar(unsigned char ch);
uint8_t usb_serialGetRecvLen();
+void usb_copyRecvBuffer(unsigned char* dest, uint8_t len);
#ifdef __cplusplus
} // extern "C"