From 8c7b1948fdc6adecf067ce206d2731d14b2ef77c Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sat, 22 Sep 2012 11:48:16 +0200 Subject: Added SDIO register definition. --- sdio/sdio.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 sdio/sdio.h (limited to 'sdio') diff --git a/sdio/sdio.h b/sdio/sdio.h new file mode 100644 index 0000000..dd9e2e2 --- /dev/null +++ b/sdio/sdio.h @@ -0,0 +1,42 @@ +#ifndef SDIO_H +#define SDIO_H + +#include + +struct SDIO_reg_t { + volatile uint32_t POWER; + volatile uint32_t CLKCR; + volatile uint32_t ARG; + volatile uint32_t CMD; + volatile uint32_t RESPCMD; + volatile uint32_t RESP1; + volatile uint32_t RESP2; + volatile uint32_t RESP3; + volatile uint32_t RESP4; + volatile uint32_t DTIMER; + volatile uint32_t DLEN; + volatile uint32_t DCTRL; + volatile uint32_t DCOUNT; + volatile uint32_t STA; + volatile uint32_t ICR; + volatile uint32_t MASK; + uint32_t _reserved[2]; + volatile uint32_t FIFOCNT; + uint32_t _reserved1[49]; + volatile uint32_t FIFO; +}; + +class SDIO_t { + public: + SDIO_reg_t& reg; + + SDIO_t(uint32_t reg_addr) : reg(*(SDIO_reg_t*)reg_addr) {} +}; + +#if defined(STM32F1) + +#elif defined(STM32F4) +static SDIO_t SDIO(0x40012c00); +#endif + +#endif -- cgit v1.2.3