From 7891595ded1db9afb0ddffdc7d1292844bdc385d Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sat, 21 Jan 2012 21:12:18 +0100 Subject: Added USB device registers. --- hal/usb.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'hal') 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) -- cgit v1.2.3