diff options
Diffstat (limited to 'hal/usb.h')
-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) |