libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
iomuxc.h
Go to the documentation of this file.
1
/** @defgroup VF6xx_iomuxc_defines IO MUX Controller Defines
2
*
3
* @brief <b>Defined Constants and Types for the VF6xx IO MUX Controller</b>
4
*
5
* @ingroup VF6xx_defines
6
*
7
* @version 1.0.0
8
*
9
* @author @htmlonly © @endhtmlonly 2014
10
* Stefan Agner <stefan@agner.ch>
11
*
12
* @date 03 July 2014
13
*
14
* LGPL License Terms @ref lgpl_license
15
* */
16
/*
17
* This file is part of the libopencm3 project.
18
*
19
* Copyright (C) 2014 Stefan Agner <stefan@agner.ch>
20
*
21
* This library is free software: you can redistribute it and/or modify
22
* it under the terms of the GNU Lesser General Public License as published by
23
* the Free Software Foundation, either version 3 of the License, or
24
* (at your option) any later version.
25
*
26
* This library is distributed in the hope that it will be useful,
27
* but WITHOUT ANY WARRANTY; without even the implied warranty of
28
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29
* GNU Lesser General Public License for more details.
30
*
31
* You should have received a copy of the GNU Lesser General Public License
32
* along with this library. If not, see <http://www.gnu.org/licenses/>.
33
*/
34
35
#ifndef LIBOPENCM3_VF6XX_IOMUXC_H
36
#define LIBOPENCM3_VF6XX_IOMUXC_H
37
38
#include <
libopencm3/cm3/common.h
>
39
#include <
libopencm3/vf6xx/memorymap.h
>
40
41
/* --- Convenience macros -------------------------------------------------- */
42
43
/****************************************************************************/
44
/** @defgroup iomuxc_reg IO MUX Controller register
45
@ingroup VF6xx_iomuxc_defines
46
47
@{*/
48
#define IOMUXC(pad) MMIO32(IOMUXC_BASE + (0x4 * (pad)))
49
50
#define IOMUXC_PAD(mode, speed, dse, pus, flags) \
51
((IOMUXC_##mode) << IOMUXC_MUX_MODE_SHIFT | \
52
(IOMUXC_##speed) << IOMUXC_SPEED_SHIFT | \
53
(IOMUXC_##dse) << IOMUXC_DSE_SHIFT | \
54
(IOMUXC_##pus) << IOMUXC_PUS_SHIFT | \
55
(flags))
56
57
58
/* --- GPIO registers ------------------------------------------------------ */
59
60
#define IOMUXC_MUX_MODE_SHIFT 20
61
#define IOMUXC_MUX_MODE_MASK (0x7 << 20)
62
#define IOMUXC_MUX_MODE_ALT0 0x0
63
#define IOMUXC_MUX_MODE_ALT1 0x1
64
#define IOMUXC_MUX_MODE_ALT2 0x2
65
#define IOMUXC_MUX_MODE_ALT3 0x3
66
#define IOMUXC_MUX_MODE_ALT4 0x4
67
#define IOMUXC_MUX_MODE_ALT5 0x5
68
#define IOMUXC_MUX_MODE_ALT6 0x6
69
#define IOMUXC_MUX_MODE_ALT7 0x7
70
#define IOMUXC_SPEED_SHIFT 12
71
#define IOMUXC_SPEED_MASK (0x3 << 12)
72
#define IOMUXC_SPEED_LOW 0x0
73
#define IOMUXC_SPEED_MEDIUM 0x1
74
#define IOMUXC_SPEED_HIGH 0x3
75
#define IOMUXC_SRE (0x1 << 11)
76
#define IOMUXC_ODE (0x1 << 10)
77
#define IOMUXC_HYS (0x1 << 9)
78
#define IOMUXC_DSE_SHIFT 6
79
#define IOMUXC_DSE_MASK (0x7 << 6)
80
#define IOMUXC_DSE_OFF 0x0
81
#define IOMUXC_DSE_150OHM 0x1
82
#define IOMUXC_DSE_75OHM 0x2
83
#define IOMUXC_DSE_50OHM 0x3
84
#define IOMUXC_DSE_37OHM 0x4
85
#define IOMUXC_DSE_30OHM 0x5
86
#define IOMUXC_DSE_25OHM 0x6
87
#define IOMUXC_DSE_20OHM 0x7
88
#define IOMUXC_PUS_SHIFT 4
89
#define IOMUXC_PUS_MASK (0x3 << 4)
90
#define IOMUXC_PUS_PD_100KOHM 0x0
91
#define IOMUXC_PUS_PU_47KOHM 0x1
92
#define IOMUXC_PUS_PU_100KOHM 0x2
93
#define IOMUXC_PUS_PU_22KOHM 0x3
94
#define IOMUXC_PKE (0x1 << 3)
95
#define IOMUXC_PUE (0x1 << 2)
96
#define IOMUXC_OBE (0x1 << 1)
97
#define IOMUXC_IBE (0x1 << 0)
98
99
100
/* --- Type definitions ---------------------------------------------------- */
101
/*---------------------------------------------------------------------------*/
102
/** @brief IO-MUX Pads
103
104
Pads available by the IO-MUX controller
105
*/
106
107
enum
vf6xx_pad
{
108
PTA6
,
109
PTA8
,
110
PTA9
,
111
PTA10
,
112
PTA11
,
113
PTA12
,
114
PTA16
,
115
PTA17
,
116
PTA18
,
117
PTA19
,
118
PTA20
,
119
PTA21
,
120
PTA22
,
121
PTA23
,
122
PTA24
,
123
PTA25
,
124
PTA26
,
125
PTA27
,
126
PTA28
,
127
PTA29
,
128
PTA30
,
129
PTA31
,
130
PTB0
,
131
PTB1
,
132
PTB2
,
133
PTB3
,
134
PTB4
,
135
PTB5
,
136
PTB6
,
137
PTB7
,
138
PTB8
,
139
PTB9
,
140
PTB10
,
141
PTB11
,
142
PTB12
,
143
PTB13
,
144
PTB14
,
145
PTB15
,
146
PTB16
,
147
PTB17
,
148
PTB18
,
149
PTB19
,
150
PTB20
,
151
PTB21
,
152
PTB22
,
153
PTC0
,
154
PTC1
,
155
PTC2
,
156
PTC3
,
157
PTC4
,
158
PTC5
,
159
PTC6
,
160
PTC7
,
161
PTC8
,
162
PTC9
,
163
PTC10
,
164
PTC11
,
165
PTC12
,
166
PTC13
,
167
PTC14
,
168
PTC15
,
169
PTC16
,
170
PTC17
,
171
PTD31
,
172
PTD30
,
173
PTD29
,
174
PTD28
,
175
PTD27
,
176
PTD26
,
177
PTD25
,
178
PTD24
,
179
PTD23
,
180
PTD22
,
181
PTD21
,
182
PTD20
,
183
PTD19
,
184
PTD18
,
185
PTD17
,
186
PTD16
,
187
PTD0
,
188
PTD1
,
189
PTD2
,
190
PTD3
,
191
PTD4
,
192
PTD5
,
193
PTD6
,
194
PTD7
,
195
PTD8
,
196
PTD9
,
197
PTD10
,
198
PTD11
,
199
PTD12
,
200
PTD13
,
201
PTB23
,
202
PTB24
,
203
PTB25
,
204
PTB26
,
205
PTB27
,
206
PTB28
,
207
PTC26
,
208
PTC27
,
209
PTC28
,
210
PTC29
,
211
PTC30
,
212
PTC31
,
213
PTE0
,
214
PTE1
,
215
PTE2
,
216
PTE3
,
217
PTE4
,
218
PTE5
,
219
PTE6
,
220
PTE7
,
221
PTE8
,
222
PTE9
,
223
PTE10
,
224
PTE11
,
225
PTE12
,
226
PTE13
,
227
PTE14
,
228
PTE15
,
229
PTE16
,
230
PTE17
,
231
PTE18
,
232
PTE19
,
233
PTE20
,
234
PTE21
,
235
PTE22
,
236
PTE23
,
237
PTE24
,
238
PTE25
,
239
PTE26
,
240
PTE27
,
241
PTE28
,
242
PTA7
,
243
};
244
245
246
/* --- Function prototypes ------------------------------------------------- */
247
248
#include <
libopencm3/cm3/common.h
>
249
250
BEGIN_DECLS
251
252
void
iomuxc_mux
(
enum
vf6xx_pad
pad, uint32_t muxc);
253
254
END_DECLS
255
256
#endif
common.h
END_DECLS
#define END_DECLS
Definition:
common.h:34
BEGIN_DECLS
#define BEGIN_DECLS
Definition:
common.h:33
iomuxc_mux
void iomuxc_mux(enum vf6xx_pad pad, uint32_t muxc)
Set GPIO.
Definition:
iomuxc.c:51
vf6xx_pad
vf6xx_pad
IO-MUX Pads.
Definition:
iomuxc.h:107
PTB27
@ PTB27
Definition:
iomuxc.h:205
PTB9
@ PTB9
Definition:
iomuxc.h:139
PTC4
@ PTC4
Definition:
iomuxc.h:157
PTD31
@ PTD31
Definition:
iomuxc.h:171
PTC7
@ PTC7
Definition:
iomuxc.h:160
PTC8
@ PTC8
Definition:
iomuxc.h:161
PTB24
@ PTB24
Definition:
iomuxc.h:202
PTE0
@ PTE0
Definition:
iomuxc.h:213
PTD30
@ PTD30
Definition:
iomuxc.h:172
PTE17
@ PTE17
Definition:
iomuxc.h:230
PTC26
@ PTC26
Definition:
iomuxc.h:207
PTB11
@ PTB11
Definition:
iomuxc.h:141
PTB20
@ PTB20
Definition:
iomuxc.h:150
PTA20
@ PTA20
Definition:
iomuxc.h:118
PTD10
@ PTD10
Definition:
iomuxc.h:197
PTC9
@ PTC9
Definition:
iomuxc.h:162
PTD27
@ PTD27
Definition:
iomuxc.h:175
PTE16
@ PTE16
Definition:
iomuxc.h:229
PTA9
@ PTA9
Definition:
iomuxc.h:110
PTE4
@ PTE4
Definition:
iomuxc.h:217
PTD28
@ PTD28
Definition:
iomuxc.h:174
PTE27
@ PTE27
Definition:
iomuxc.h:240
PTD13
@ PTD13
Definition:
iomuxc.h:200
PTB26
@ PTB26
Definition:
iomuxc.h:204
PTD5
@ PTD5
Definition:
iomuxc.h:192
PTC28
@ PTC28
Definition:
iomuxc.h:209
PTC2
@ PTC2
Definition:
iomuxc.h:155
PTD4
@ PTD4
Definition:
iomuxc.h:191
PTB6
@ PTB6
Definition:
iomuxc.h:136
PTD25
@ PTD25
Definition:
iomuxc.h:177
PTD29
@ PTD29
Definition:
iomuxc.h:173
PTB2
@ PTB2
Definition:
iomuxc.h:132
PTE13
@ PTE13
Definition:
iomuxc.h:226
PTD9
@ PTD9
Definition:
iomuxc.h:196
PTE20
@ PTE20
Definition:
iomuxc.h:233
PTB5
@ PTB5
Definition:
iomuxc.h:135
PTB19
@ PTB19
Definition:
iomuxc.h:149
PTC5
@ PTC5
Definition:
iomuxc.h:158
PTE2
@ PTE2
Definition:
iomuxc.h:215
PTE15
@ PTE15
Definition:
iomuxc.h:228
PTD2
@ PTD2
Definition:
iomuxc.h:189
PTC17
@ PTC17
Definition:
iomuxc.h:170
PTB15
@ PTB15
Definition:
iomuxc.h:145
PTE26
@ PTE26
Definition:
iomuxc.h:239
PTE18
@ PTE18
Definition:
iomuxc.h:231
PTA30
@ PTA30
Definition:
iomuxc.h:128
PTA17
@ PTA17
Definition:
iomuxc.h:115
PTC10
@ PTC10
Definition:
iomuxc.h:163
PTA11
@ PTA11
Definition:
iomuxc.h:112
PTE10
@ PTE10
Definition:
iomuxc.h:223
PTD3
@ PTD3
Definition:
iomuxc.h:190
PTB16
@ PTB16
Definition:
iomuxc.h:146
PTE23
@ PTE23
Definition:
iomuxc.h:236
PTD26
@ PTD26
Definition:
iomuxc.h:176
PTD20
@ PTD20
Definition:
iomuxc.h:182
PTB28
@ PTB28
Definition:
iomuxc.h:206
PTE12
@ PTE12
Definition:
iomuxc.h:225
PTD6
@ PTD6
Definition:
iomuxc.h:193
PTA23
@ PTA23
Definition:
iomuxc.h:121
PTD7
@ PTD7
Definition:
iomuxc.h:194
PTB10
@ PTB10
Definition:
iomuxc.h:140
PTB18
@ PTB18
Definition:
iomuxc.h:148
PTC15
@ PTC15
Definition:
iomuxc.h:168
PTB8
@ PTB8
Definition:
iomuxc.h:138
PTC30
@ PTC30
Definition:
iomuxc.h:211
PTC16
@ PTC16
Definition:
iomuxc.h:169
PTE1
@ PTE1
Definition:
iomuxc.h:214
PTA18
@ PTA18
Definition:
iomuxc.h:116
PTB4
@ PTB4
Definition:
iomuxc.h:134
PTA31
@ PTA31
Definition:
iomuxc.h:129
PTB1
@ PTB1
Definition:
iomuxc.h:131
PTA27
@ PTA27
Definition:
iomuxc.h:125
PTC0
@ PTC0
Definition:
iomuxc.h:153
PTA10
@ PTA10
Definition:
iomuxc.h:111
PTE7
@ PTE7
Definition:
iomuxc.h:220
PTA21
@ PTA21
Definition:
iomuxc.h:119
PTB21
@ PTB21
Definition:
iomuxc.h:151
PTE21
@ PTE21
Definition:
iomuxc.h:234
PTD21
@ PTD21
Definition:
iomuxc.h:181
PTD19
@ PTD19
Definition:
iomuxc.h:183
PTC31
@ PTC31
Definition:
iomuxc.h:212
PTC14
@ PTC14
Definition:
iomuxc.h:167
PTB0
@ PTB0
Definition:
iomuxc.h:130
PTE3
@ PTE3
Definition:
iomuxc.h:216
PTC12
@ PTC12
Definition:
iomuxc.h:165
PTB13
@ PTB13
Definition:
iomuxc.h:143
PTC1
@ PTC1
Definition:
iomuxc.h:154
PTE6
@ PTE6
Definition:
iomuxc.h:219
PTC13
@ PTC13
Definition:
iomuxc.h:166
PTA29
@ PTA29
Definition:
iomuxc.h:127
PTD23
@ PTD23
Definition:
iomuxc.h:179
PTD0
@ PTD0
Definition:
iomuxc.h:187
PTE19
@ PTE19
Definition:
iomuxc.h:232
PTA8
@ PTA8
Definition:
iomuxc.h:109
PTD18
@ PTD18
Definition:
iomuxc.h:184
PTE22
@ PTE22
Definition:
iomuxc.h:235
PTE25
@ PTE25
Definition:
iomuxc.h:238
PTA22
@ PTA22
Definition:
iomuxc.h:120
PTD11
@ PTD11
Definition:
iomuxc.h:198
PTA24
@ PTA24
Definition:
iomuxc.h:122
PTD16
@ PTD16
Definition:
iomuxc.h:186
PTC11
@ PTC11
Definition:
iomuxc.h:164
PTB23
@ PTB23
Definition:
iomuxc.h:201
PTD22
@ PTD22
Definition:
iomuxc.h:180
PTA25
@ PTA25
Definition:
iomuxc.h:123
PTA28
@ PTA28
Definition:
iomuxc.h:126
PTD24
@ PTD24
Definition:
iomuxc.h:178
PTB22
@ PTB22
Definition:
iomuxc.h:152
PTA12
@ PTA12
Definition:
iomuxc.h:113
PTE8
@ PTE8
Definition:
iomuxc.h:221
PTB14
@ PTB14
Definition:
iomuxc.h:144
PTA16
@ PTA16
Definition:
iomuxc.h:114
PTB7
@ PTB7
Definition:
iomuxc.h:137
PTA6
@ PTA6
Definition:
iomuxc.h:108
PTB25
@ PTB25
Definition:
iomuxc.h:203
PTE14
@ PTE14
Definition:
iomuxc.h:227
PTD12
@ PTD12
Definition:
iomuxc.h:199
PTE24
@ PTE24
Definition:
iomuxc.h:237
PTE5
@ PTE5
Definition:
iomuxc.h:218
PTE28
@ PTE28
Definition:
iomuxc.h:241
PTD1
@ PTD1
Definition:
iomuxc.h:188
PTB3
@ PTB3
Definition:
iomuxc.h:133
PTB17
@ PTB17
Definition:
iomuxc.h:147
PTC27
@ PTC27
Definition:
iomuxc.h:208
PTC29
@ PTC29
Definition:
iomuxc.h:210
PTC3
@ PTC3
Definition:
iomuxc.h:156
PTA26
@ PTA26
Definition:
iomuxc.h:124
PTD17
@ PTD17
Definition:
iomuxc.h:185
PTA7
@ PTA7
Definition:
iomuxc.h:242
PTC6
@ PTC6
Definition:
iomuxc.h:159
PTB12
@ PTB12
Definition:
iomuxc.h:142
PTD8
@ PTD8
Definition:
iomuxc.h:195
PTA19
@ PTA19
Definition:
iomuxc.h:117
PTE11
@ PTE11
Definition:
iomuxc.h:224
PTE9
@ PTE9
Definition:
iomuxc.h:222
memorymap.h
include
libopencm3
vf6xx
iomuxc.h
Generated on Tue Mar 7 2023 16:13:10 for libopencm3 by
1.9.4