diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2012-01-21 21:12:18 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2012-01-21 21:12:18 +0100 |
commit | 7891595ded1db9afb0ddffdc7d1292844bdc385d (patch) | |
tree | 8c526b85ac2616122059db348fd96e59f53602b0 | |
parent | 5f22ed065513388486c909d23dd48a4fee3e76ee (diff) |
Added USB device registers.
-rw-r--r-- | hal/usb.h | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -25,12 +25,27 @@ struct USB_reg_t { volatile uint32_t DIEPTXF3; }; +struct USB_dev_reg_t { + volatile uint32_t DCFG; + volatile uint32_t DCTL; + volatile uint32_t DSTS; + volatile uint32_t DIEPMSK; + volatile uint32_t DOEPMSK; + volatile uint32_t DAINT; + volatile uint32_t DAINTMSK; + volatile uint32_t DVBUSDIS; + volatile uint32_t DVBUSPULSE; + volatile uint32_t DIEPEMPMSK; +}; + class USB_t { public: USB_reg_t& reg; + USB_dev_reg_t& dev_reg; - USB_t(uint32_t reg_addr) : reg(*(USB_reg_t*)reg_addr) {} - + USB_t(uint32_t reg_addr) : + reg(*(USB_reg_t*)reg_addr), + dev_reg(*(USB_dev_reg_t*)(reg_addr + 0x800)) {} }; #if defined(STM32F1) |