diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2012-09-22 11:48:16 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2012-09-22 11:48:16 +0200 |
commit | 8c7b1948fdc6adecf067ce206d2731d14b2ef77c (patch) | |
tree | 1efce77633372d030e6d030747a88f90304eead4 /sdio/sdio.h | |
parent | 89baa2a3f6a301a608507f4bf6cfc741e5e06aac (diff) |
Added SDIO register definition.
Diffstat (limited to 'sdio/sdio.h')
-rw-r--r-- | sdio/sdio.h | 42 |
1 files changed, 42 insertions, 0 deletions
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 <stdint.h> + +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 |