summaryrefslogtreecommitdiff
path: root/hal
diff options
context:
space:
mode:
Diffstat (limited to 'hal')
-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)