summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2012-01-21 21:12:18 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2012-01-21 21:12:18 +0100
commit7891595ded1db9afb0ddffdc7d1292844bdc385d (patch)
tree8c526b85ac2616122059db348fd96e59f53602b0
parent5f22ed065513388486c909d23dd48a4fee3e76ee (diff)
Added USB device registers.
-rw-r--r--hal/usb.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/hal/usb.h b/hal/usb.h
index 6fbd24f..90a6ddb 100644
--- a/hal/usb.h
+++ b/hal/usb.h
@@ -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)