aboutsummaryrefslogtreecommitdiff
path: root/include/libopencm3/lpc43xx/sdio.h
blob: 3310aa952ebf5d17460127176fa27a99b51ab1f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
 * This file is part of the libopencm3 project.
 *
 * Copyright (C) 2012 Michael Ossmann <mike@ossmann.com>
 *
 * This library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef LPC43XX_SDIO_H
#define LPC43XX_SDIO_H

#include <libopencm3/cm3/common.h>
#include <libopencm3/lpc43xx/memorymap.h>

/* --- SDIO registers ----------------------------------------------------- */

/* Control Register */
#define SDIO_CTRL                       MMIO32(SDIO_BASE + 0x000)

/* Power Enable Register */
#define SDIO_PWREN                      MMIO32(SDIO_BASE + 0x004)

/* Clock Divider Register */
#define SDIO_CLKDIV                     MMIO32(SDIO_BASE + 0x008)

/* SD Clock Source Register */
#define SDIO_CLKSRC                     MMIO32(SDIO_BASE + 0x00C)

/* Clock Enable Register */
#define SDIO_CLKENA                     MMIO32(SDIO_BASE + 0x010)

/* Time-out Register */
#define SDIO_TMOUT                      MMIO32(SDIO_BASE + 0x014)

/* Card Type Register */
#define SDIO_CTYPE                      MMIO32(SDIO_BASE + 0x018)

/* Block Size Register */
#define SDIO_BLKSIZ                     MMIO32(SDIO_BASE + 0x01C)

/* Byte Count Register */
#define SDIO_BYTCNT                     MMIO32(SDIO_BASE + 0x020)

/* Interrupt Mask Register */
#define SDIO_INTMASK                    MMIO32(SDIO_BASE + 0x024)

/* Command Argument Register */
#define SDIO_CMDARG                     MMIO32(SDIO_BASE + 0x028)

/* Command Register */
#define SDIO_CMD                        MMIO32(SDIO_BASE + 0x02C)

/* Response Register 0 */
#define SDIO_RESP0                      MMIO32(SDIO_BASE + 0x030)

/* Response Register 1 */
#define SDIO_RESP1                      MMIO32(SDIO_BASE + 0x034)

/* Response Register 2 */
#define SDIO_RESP2                      MMIO32(SDIO_BASE + 0x038)

/* Response Register 3 */
#define SDIO_RESP3                      MMIO32(SDIO_BASE + 0x03C)

/* Masked Interrupt Status Register */
#define SDIO_MINTSTS                    MMIO32(SDIO_BASE + 0x040)

/* Raw Interrupt Status Register */
#define SDIO_RINTSTS                    MMIO32(SDIO_BASE + 0x044)

/* Status Register */
#define SDIO_STATUS                     MMIO32(SDIO_BASE + 0x048)

/* FIFO Threshold Watermark Register */
#define SDIO_FIFOTH                     MMIO32(SDIO_BASE + 0x04C)

/* Card Detect Register */
#define SDIO_CDETECT                    MMIO32(SDIO_BASE + 0x050)

/* Write Protect Register */
#define SDIO_WRTPRT                     MMIO32(SDIO_BASE + 0x054)

/* Transferred CIU Card Byte Count Register */
#define SDIO_TCBCNT                     MMIO32(SDIO_BASE + 0x05C)

/* Transferred Host to BIU-FIFO Byte Count Register */
#define SDIO_TBBCNT                     MMIO32(SDIO_BASE + 0x060)

/* Debounce Count Register */
#define SDIO_DEBNCE                     MMIO32(SDIO_BASE + 0x064)

/* UHS-1 Register */
#define SDIO_UHS_REG                    MMIO32(SDIO_BASE + 0x074)

/* Hardware Reset */
#define SDIO_RST_N                      MMIO32(SDIO_BASE + 0x078)

/* Bus Mode Register */
#define SDIO_BMOD                       MMIO32(SDIO_BASE + 0x080)

/* Poll Demand Register */
#define SDIO_PLDMND                     MMIO32(SDIO_BASE + 0x084)

/* Descriptor List Base Address Register */
#define SDIO_DBADDR                     MMIO32(SDIO_BASE + 0x088)

/* Internal DMAC Status Register */
#define SDIO_IDSTS                      MMIO32(SDIO_BASE + 0x08C)

/* Internal DMAC Interrupt Enable Register */
#define SDIO_IDINTEN                    MMIO32(SDIO_BASE + 0x090)

/* Current Host Descriptor Address Register */
#define SDIO_DSCADDR                    MMIO32(SDIO_BASE + 0x094)

/* Current Buffer Descriptor Address Register */
#define SDIO_BUFADDR                    MMIO32(SDIO_BASE + 0x098)

/* Data FIFO read/write */
#define SDIO_DATA                       MMIO32(SDIO_BASE + 0x100)

#endif