libpynq (release 5EWC0-2023 version 0.2.2 of 2023-09-24 22:22)
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 SWB_AR0 = 0, /* reference pin 0 */
50 SWB_AR1 = 1, /* reference pin 1 */
51 SWB_AR2 = 2, /* reference pin 2 */
52 SWB_AR3 = 3, /* reference pin 3 */
53 SWB_AR4 = 4, /* reference pin 4 */
54 SWB_AR5 = 5, /* reference pin 5 */
55 SWB_AR6 = 6, /* reference pin 6 */
56 SWB_AR7 = 7, /* reference pin 7 */
57 SWB_AR8 = 8, /* reference pin 8 */
58 SWB_AR9 = 9, /* reference pin 9 */
59 SWB_AR10 = 10, /* reference pin 10 */
60 SWB_AR11 = 11, /* reference pin 11 */
61 SWB_AR12 = 12, /* reference pin 12 */
62 SWB_AR13 = 13, /* reference pin 13 */
63
67 SWB_A0 = 14, /* analog input pin 0 */
68 SWB_A1 = 15, /* analog input pin 1 */
69 SWB_A2 = 16, /* analog input pin 2 */
70 SWB_A3 = 17, /* analog input pin 3 */
71 SWB_A4 = 18, /* analog input pin 4 */
72 SWB_A5 = 19, /* analog input pin 5 */
73
77 SWB_SW0 = 20, /* switch input pin 0 */
78 SWB_SW1 = 21, /* switch input pin 1 */
79
83 SWB_BTN0 = 22, /* button input pin 0 */
84 SWB_BTN1 = 23, /* button input pin 1 */
85 SWB_BTN2 = 24, /* button input pin 2 */
86 SWB_BTN3 = 25, /* button input pin 3 */
87
91 SWB_LD0 = 26, /* LED output pin 0 */
92 SWB_LD1 = 27, /* LED output pin 1 */
93 SWB_LD2 = 28, /* LED output pin 2 */
94 SWB_LD3 = 29, /* LED output pin 3 */
95
99 SWB_AR_SCL = 31, /* I2C clock pin */
100 SWB_AR_SDA = 30, /* I2C data pin */
101
106 SWB_LD4B = 32, /* color LED 0 blue input pin */
107 SWB_LD4R = 33, /* color LED 0 red input pin */
108 SWB_LD4G = 34, /* color LED 0 green input pin */
109
110 SWB_LD5B = 35, /* color LED 1 blue input pin */
111 SWB_LD5R = 36, /* color LED 1 red input pin */
112 SWB_LD5G = 37, /* color LED 1 green input pin */
113
117 SWB_RBPI40 = 38, /* RaspberryPi header pin */
118 SWB_RBPI37 = 39, /* RaspberryPi header pin */
119 SWB_RBPI38 = 40, /* RaspberryPi header pin */
120 SWB_RBPI35 = 41, /* RaspberryPi header pin */
121 SWB_RBPI36 = 42, /* RaspberryPi header pin */
122 SWB_RBPI33 = 43, /* RaspberryPi header pin */
123 SWB_RBPI18 = 44, /* RaspberryPi header pin */
124 SWB_RBPI32 = 45, /* RaspberryPi header pin */
125 SWB_RBPI10 = 46, /* RaspberryPi header pin */
126 SWB_RBPI27 = 47, /* RaspberryPi header pin */
127 SWB_RBPI28 = 48, /* RaspberryPi header pin */
128 SWB_RBPI22 = 49, /* RaspberryPi header pin */
129 SWB_RBPI23 = 50, /* RaspberryPi header pin */
130 SWB_RBPI24 = 51, /* RaspberryPi header pin */
131 SWB_RBPI21 = 52, /* RaspberryPi header pin */
132 SWB_RBPI26 = 53, /* RaspberryPi header pin */
133 SWB_RBPI19 = 54, /* RaspberryPi header pin */
134 SWB_RBPI31 = 55, /* RaspberryPi header pin */
135 SWB_RBPI15 = 56, /* RaspberryPi header pin */
136 SWB_RBPI16 = 57, /* RaspberryPi header pin */
137 SWB_RBPI13 = 58, /* RaspberryPi header pin */
138 SWB_RBPI12 = 59, /* RaspberryPi header pin */
139 SWB_RBPI29 = 60, /* RaspberryPi header pin */
140 SWB_RBPI08 = 61, /* RaspberryPi header pin */
141 SWB_RBPI07 = 62, /* RaspberryPi header pin */
142 SWB_RBPI05 = 63, /* RaspberryPi header pin */
143
145} pin_t;
146
150#define PIN_CHECK(pin) \
151 do { \
152 if (pin >= SWB_NUM_PINS) { \
153 pynq_error("pin %u is invalid, must be 0..%u-1.", pin, SWB_NUM_PINS); \
154 } \
155 } while (0);
156
160extern char *const pin_names[64];
164#endif // PINMAP_H
pin_t
Definition pinmap.h:45
char *const pin_names[64]
Pin names.
Definition pinmap.c:24
@ SWB_BTN0
Button input pins.
Definition pinmap.h:83
@ SWB_LD4G
Definition pinmap.h:108
@ SWB_AR1
Definition pinmap.h:50
@ SWB_RBPI33
Definition pinmap.h:122
@ SWB_AR0
Analog reference pins.
Definition pinmap.h:49
@ SWB_RBPI36
Definition pinmap.h:121
@ SWB_RBPI08
Definition pinmap.h:140
@ SWB_A4
Definition pinmap.h:71
@ SWB_SW1
Definition pinmap.h:78
@ SWB_BTN1
Definition pinmap.h:84
@ SWB_RBPI38
Definition pinmap.h:119
@ SWB_RBPI05
Definition pinmap.h:142
@ SWB_RBPI37
Definition pinmap.h:118
@ SWB_RBPI24
Definition pinmap.h:130
@ SWB_AR9
Definition pinmap.h:58
@ SWB_RBPI29
Definition pinmap.h:139
@ SWB_A3
Definition pinmap.h:70
@ SWB_AR4
Definition pinmap.h:53
@ SWB_LD5R
Definition pinmap.h:111
@ SWB_LD5G
Definition pinmap.h:112
@ SWB_BTN2
Definition pinmap.h:85
@ SWB_A0
Analog input pins.
Definition pinmap.h:67
@ SWB_RBPI18
Definition pinmap.h:123
@ SWB_AR7
Definition pinmap.h:56
@ SWB_RBPI27
Definition pinmap.h:126
@ SWB_A2
Definition pinmap.h:69
@ SWB_RBPI26
Definition pinmap.h:132
@ SWB_AR6
Definition pinmap.h:55
@ SWB_RBPI16
Definition pinmap.h:136
@ SWB_AR_SDA
Definition pinmap.h:100
@ SWB_LD2
Definition pinmap.h:93
@ SWB_AR13
Definition pinmap.h:62
@ SWB_RBPI28
Definition pinmap.h:127
@ SWB_LD4R
Definition pinmap.h:107
@ SWB_NUM_PINS
Definition pinmap.h:144
@ SWB_LD5B
Definition pinmap.h:110
@ SWB_RBPI12
Definition pinmap.h:138
@ SWB_AR12
Definition pinmap.h:61
@ SWB_AR11
Definition pinmap.h:60
@ SWB_RBPI32
Definition pinmap.h:124
@ SWB_AR5
Definition pinmap.h:54
@ SWB_AR8
Definition pinmap.h:57
@ SWB_RBPI07
Definition pinmap.h:141
@ SWB_AR10
Definition pinmap.h:59
@ SWB_RBPI22
Definition pinmap.h:128
@ SWB_RBPI40
The RaspberryPi header-pin indexing.
Definition pinmap.h:117
@ SWB_RBPI13
Definition pinmap.h:137
@ SWB_A5
Definition pinmap.h:72
@ SWB_RBPI31
Definition pinmap.h:134
@ SWB_RBPI23
Definition pinmap.h:129
@ SWB_AR3
Definition pinmap.h:52
@ SWB_LD3
Definition pinmap.h:94
@ SWB_RBPI10
Definition pinmap.h:125
@ SWB_RBPI15
Definition pinmap.h:135
@ SWB_SW0
Switch input pins.
Definition pinmap.h:77
@ SWB_AR_SCL
I2C pins.
Definition pinmap.h:99
@ SWB_A1
Definition pinmap.h:68
@ SWB_LD1
Definition pinmap.h:92
@ SWB_LD0
LED output pins.
Definition pinmap.h:91
@ SWB_LD4B
The RGB adresses for SWB_LD4 and SWB_LD5.
Definition pinmap.h:106
@ SWB_RBPI21
Definition pinmap.h:131
@ SWB_AR2
Definition pinmap.h:51
@ SWB_BTN3
Definition pinmap.h:86
@ SWB_RBPI19
Definition pinmap.h:133
@ SWB_RBPI35
Definition pinmap.h:120