summaryrefslogtreecommitdiff
path: root/hal
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2012-04-22 23:07:52 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2012-04-22 23:07:52 +0200
commita75f2ed11d49f6db8da08fd01d66bcb2ca2f7fcf (patch)
treecd207cf6f51de7220c6a913055f25314787823ff /hal
parent2529ce991e6eda9f8235084ed1b7a7e408c86866 (diff)
Added support for multiple FIFOs.
Diffstat (limited to 'hal')
-rw-r--r--hal/usb.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/hal/usb.h b/hal/usb.h
index 8376727..c8c550f 100644
--- a/hal/usb.h
+++ b/hal/usb.h
@@ -62,20 +62,25 @@ struct USB_dev_oep_reg_t {
uint32_t _reserved2[3];
};
+union USB_fifo_reg_t {
+ volatile uint32_t reg;
+ volatile uint32_t buf[1024];
+};
+
class USB_t {
public:
USB_reg_t& reg;
USB_dev_reg_t& dev_reg;
USB_dev_iep_reg_t* const dev_iep_reg;
USB_dev_oep_reg_t* const dev_oep_reg;
- volatile uint32_t& fifo;
+ USB_fifo_reg_t* const fifo;
USB_t(uint32_t reg_addr) :
reg(*(USB_reg_t*)reg_addr),
dev_reg(*(USB_dev_reg_t*)(reg_addr + 0x800)),
dev_iep_reg((USB_dev_iep_reg_t*)(reg_addr + 0x900)),
dev_oep_reg((USB_dev_oep_reg_t*)(reg_addr + 0xb00)),
- fifo(*(volatile uint32_t*)(reg_addr + 0x1000)) {}
+ fifo((USB_fifo_reg_t*)(reg_addr + 0x1000)) {}
};
#if defined(STM32F1)