diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2012-09-20 21:23:37 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2012-09-20 21:43:57 +0200 |
commit | 89baa2a3f6a301a608507f4bf6cfc741e5e06aac (patch) | |
tree | 6adf5943348ff00961d5e6e871b0363498e2c618 /usb/f1_usb_def.h | |
parent | d2e7c6170752b085bbfed155308511790984ccab (diff) |
Added F1 USB driver.
Diffstat (limited to 'usb/f1_usb_def.h')
-rw-r--r-- | usb/f1_usb_def.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/usb/f1_usb_def.h b/usb/f1_usb_def.h new file mode 100644 index 0000000..0e42f6f --- /dev/null +++ b/usb/f1_usb_def.h @@ -0,0 +1,35 @@ +#ifndef F1_USB_DEF_H +#define F1_USB_DEF_H + +#include <stdint.h> + +class F1_USB_t { + private: + struct F1_USB_reg_t { + volatile uint32_t EPR[16]; + volatile uint32_t CNTR; + volatile uint32_t ISTR; + volatile uint32_t FNR; + volatile uint32_t DADDR; + volatile uint32_t BTABLE; + }; + + struct F1_USB_bufd_t { + volatile uint32_t ADDR_TX; + volatile uint32_t COUNT_TX; + volatile uint32_t ADDR_RX; + volatile uint32_t COUNT_RX; + }; + + public: + F1_USB_reg_t& reg; + F1_USB_bufd_t* bufd; + volatile uint32_t* buf; + + F1_USB_t(uint32_t reg_addr, uint32_t buf_addr) : + reg(*(F1_USB_reg_t*)reg_addr), + bufd((F1_USB_bufd_t*)buf_addr), + buf((volatile uint32_t*)buf_addr) {} +}; + +#endif |