diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2012-04-22 23:07:52 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2012-04-22 23:07:52 +0200 |
commit | a75f2ed11d49f6db8da08fd01d66bcb2ca2f7fcf (patch) | |
tree | cd207cf6f51de7220c6a913055f25314787823ff /hal | |
parent | 2529ce991e6eda9f8235084ed1b7a7e408c86866 (diff) |
Added support for multiple FIFOs.
Diffstat (limited to 'hal')
-rw-r--r-- | hal/usb.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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) |