libpynq (release 5EWC0-2023 version 0.2.6 of 2023-10-24 17:28)
Loading...
Searching...
No Matches
pinmap.h
Go to the documentation of this file.
1/*
2Copyright (c) 2023 Eindhoven University of Technology
3
4Permission is hereby granted, free of charge, to any person obtaining a copy
5of this software and associated documentation files (the "Software"), to deal
6in the Software without restriction, including without limitation the rights
7to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the Software is
9furnished to do so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in all
12copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20SOFTWARE.
21*/
22#ifndef PINMAP_H
23#define PINMAP_H
24
42#define NUM_ANALOG_REFERENCE_PINS 14 /* # analog reference pins */
43#define NUM_ANALOG_IN_PINS 6 /* # analog input pins */
44
45typedef enum {
49 IO_AR0 = 0, /* reference pin 0 */
50 IO_AR1 = 1, /* reference pin 1 */
51 IO_AR2 = 2, /* reference pin 2 */
52 IO_AR3 = 3, /* reference pin 3 */
53 IO_AR4 = 4, /* reference pin 4 */
54 IO_AR5 = 5, /* reference pin 5 */
55 IO_AR6 = 6, /* reference pin 6 */
56 IO_AR7 = 7, /* reference pin 7 */
57 IO_AR8 = 8, /* reference pin 8 */
58 IO_AR9 = 9, /* reference pin 9 */
59 IO_AR10 = 10, /* reference pin 10 */
60 IO_AR11 = 11, /* reference pin 11 */
61 IO_AR12 = 12, /* reference pin 12 */
62 IO_AR13 = 13, /* reference pin 13 */
63
67 IO_A0 = 14, /* analog input pin 0 */
68 IO_A1 = 15, /* analog input pin 1 */
69 IO_A2 = 16, /* analog input pin 2 */
70 IO_A3 = 17, /* analog input pin 3 */
71 IO_A4 = 18, /* analog input pin 4 */
72 IO_A5 = 19, /* analog input pin 5 */
73
77 IO_SW0 = 20, /* switch input pin 0 */
78 IO_SW1 = 21, /* switch input pin 1 */
79
83 IO_BTN0 = 22, /* button input pin 0 */
84 IO_BTN1 = 23, /* button input pin 1 */
85 IO_BTN2 = 24, /* button input pin 2 */
86 IO_BTN3 = 25, /* button input pin 3 */
87
91 IO_LD0 = 26, /* LED output pin 0 */
92 IO_LD1 = 27, /* LED output pin 1 */
93 IO_LD2 = 28, /* LED output pin 2 */
94 IO_LD3 = 29, /* LED output pin 3 */
95
99 IO_AR_SCL = 31, /* I2C clock pin */
100 IO_AR_SDA = 30, /* I2C data pin */
101
106 IO_LD4B = 32, /* color LED 0 blue input pin */
107 IO_LD4R = 33, /* color LED 0 red input pin */
108 IO_LD4G = 34, /* color LED 0 green input pin */
109
110 IO_LD5B = 35, /* color LED 1 blue input pin */
111 IO_LD5R = 36, /* color LED 1 red input pin */
112 IO_LD5G = 37, /* color LED 1 green input pin */
113
117 IO_RBPI40 = 38, /* RaspberryPi header pin */
118 IO_RBPI37 = 39, /* RaspberryPi header pin */
119 IO_RBPI38 = 40, /* RaspberryPi header pin */
120 IO_RBPI35 = 41, /* RaspberryPi header pin */
121 IO_RBPI36 = 42, /* RaspberryPi header pin */
122 IO_RBPI33 = 43, /* RaspberryPi header pin */
123 IO_RBPI18 = 44, /* RaspberryPi header pin */
124 IO_RBPI32 = 45, /* RaspberryPi header pin */
125 IO_RBPI10 = 46, /* RaspberryPi header pin */
126 IO_RBPI27 = 47, /* RaspberryPi header pin */
127 IO_RBPI28 = 48, /* RaspberryPi header pin */
128 IO_RBPI22 = 49, /* RaspberryPi header pin */
129 IO_RBPI23 = 50, /* RaspberryPi header pin */
130 IO_RBPI24 = 51, /* RaspberryPi header pin */
131 IO_RBPI21 = 52, /* RaspberryPi header pin */
132 IO_RBPI26 = 53, /* RaspberryPi header pin */
133 IO_RBPI19 = 54, /* RaspberryPi header pin */
134 IO_RBPI31 = 55, /* RaspberryPi header pin */
135 IO_RBPI15 = 56, /* RaspberryPi header pin */
136 IO_RBPI16 = 57, /* RaspberryPi header pin */
137 IO_RBPI13 = 58, /* RaspberryPi header pin */
138 IO_RBPI12 = 59, /* RaspberryPi header pin */
139 IO_RBPI29 = 60, /* RaspberryPi header pin */
140 IO_RBPI08 = 61, /* RaspberryPi header pin */
141 IO_RBPI07 = 62, /* RaspberryPi header pin */
142 IO_RBPI05 = 63, /* RaspberryPi header pin */
143
145} io_t;
146
150#define IO_PMODA1 IO_RBPI07
151#define IO_PMODA2 IO_RBPI29
152#define IO_PMODA3 IO_RBPI27
153#define IO_PMODA4 IO_RBPI28
154#define IO_PMODA7 IO_RBPI31
155#define IO_PMODA8 IO_RBPI26
156
160#define PIN_CHECK(pin) \
161 do { \
162 if (pin >= IO_NUM_PINS) { \
163 pynq_error("pin %u is invalid, must be 0..%u-1.\n", pin, IO_NUM_PINS); \
164 } \
165 } while (0);
166
170extern char *const pin_names[64];
174#endif // PINMAP_H
io_t
Definition pinmap.h:45
char *const pin_names[64]
Pin names.
Definition pinmap.c:24
@ IO_RBPI28
Definition pinmap.h:127
@ IO_LD0
LED output pins.
Definition pinmap.h:91
@ IO_LD4B
The RGB adresses for IO_LD4 and IO_LD5.
Definition pinmap.h:106
@ IO_AR8
Definition pinmap.h:57
@ IO_RBPI33
Definition pinmap.h:122
@ IO_A5
Definition pinmap.h:72
@ IO_RBPI36
Definition pinmap.h:121
@ IO_LD5G
Definition pinmap.h:112
@ IO_RBPI19
Definition pinmap.h:133
@ IO_AR1
Definition pinmap.h:50
@ IO_RBPI18
Definition pinmap.h:123
@ IO_AR0
Analog reference pins (Arduino header).
Definition pinmap.h:49
@ IO_SW0
Switch input pins.
Definition pinmap.h:77
@ IO_A0
Analog input pins (Arduino header).
Definition pinmap.h:67
@ IO_LD3
Definition pinmap.h:94
@ IO_AR2
Definition pinmap.h:51
@ IO_RBPI27
Definition pinmap.h:126
@ IO_RBPI38
Definition pinmap.h:119
@ IO_A1
Definition pinmap.h:68
@ IO_BTN3
Definition pinmap.h:86
@ IO_BTN1
Definition pinmap.h:84
@ IO_RBPI31
Definition pinmap.h:134
@ IO_AR7
Definition pinmap.h:56
@ IO_SW1
Definition pinmap.h:78
@ IO_LD2
Definition pinmap.h:93
@ IO_RBPI22
Definition pinmap.h:128
@ IO_RBPI26
Definition pinmap.h:132
@ IO_RBPI16
Definition pinmap.h:136
@ IO_LD4G
Definition pinmap.h:108
@ IO_RBPI40
The RaspberryPi header-pin indexing.
Definition pinmap.h:117
@ IO_AR_SCL
I2C pins.
Definition pinmap.h:99
@ IO_AR5
Definition pinmap.h:54
@ IO_AR3
Definition pinmap.h:52
@ IO_BTN0
Button input pins.
Definition pinmap.h:83
@ IO_AR13
Definition pinmap.h:62
@ IO_AR11
Definition pinmap.h:60
@ IO_RBPI37
Definition pinmap.h:118
@ IO_NUM_PINS
Definition pinmap.h:144
@ IO_AR9
Definition pinmap.h:58
@ IO_AR10
Definition pinmap.h:59
@ IO_AR12
Definition pinmap.h:61
@ IO_AR4
Definition pinmap.h:53
@ IO_RBPI29
Definition pinmap.h:139
@ IO_RBPI35
Definition pinmap.h:120
@ IO_RBPI24
Definition pinmap.h:130
@ IO_RBPI05
Definition pinmap.h:142
@ IO_A2
Definition pinmap.h:69
@ IO_LD1
Definition pinmap.h:92
@ IO_RBPI21
Definition pinmap.h:131
@ IO_A3
Definition pinmap.h:70
@ IO_AR_SDA
Definition pinmap.h:100
@ IO_RBPI23
Definition pinmap.h:129
@ IO_RBPI08
Definition pinmap.h:140
@ IO_LD5R
Definition pinmap.h:111
@ IO_RBPI10
Definition pinmap.h:125
@ IO_LD5B
Definition pinmap.h:110
@ IO_LD4R
Definition pinmap.h:107
@ IO_AR6
Definition pinmap.h:55
@ IO_RBPI32
Definition pinmap.h:124
@ IO_RBPI13
Definition pinmap.h:137
@ IO_RBPI07
Definition pinmap.h:141
@ IO_BTN2
Definition pinmap.h:85
@ IO_RBPI15
Definition pinmap.h:135
@ IO_RBPI12
Definition pinmap.h:138
@ IO_A4
Definition pinmap.h:71