/
template24.h
111 lines (99 loc) · 2.74 KB
/
template24.h
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
/*
*
* This file is part of pyA20.
* mapping.h is python GPIO extension.
*
* Copyright (c) 2014 Stefan Mavrodiev @ OLIMEX LTD, <support@olimex.com>
*
* pyA20 is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
* mapping.h from: https://github.com/wdmomoxx/orangepi_ZERO_gpio_pyH2
*
*/
#ifndef __MAPPING_H
#define __MAPPING_H
#include "gpio_lib.h"
/**
Structure that describe all gpio
*/
typedef struct _pin {
char name[10]; // The processor pin
int offset; // Memory offset for the pin
int pin_number; // Number on the connector
}pin_t;
typedef struct _gpio {
char connector_name[10];
pin_t pins[41];
}gpio_t;
gpio_t gpio[] = {
/*
Description of Pinheader, please don't change pinnumer to keep this library consistent! A 'RPi compatible'
pin header (26pin 'model A') looks like the following:
3.3V |··| 5V
GPIO2 |··| 5V
GPIO3 |··| GND
GPIO4 |··| GPIO14
GND |··| GPIO15
GPIO17 |··| GPIO18
GPIO27 |··| GND
GPIO22 |··| GPIO23
3.3V |··| GPIO24
GPIO10 |··| GND
GPIO9 |··| GPIO25
GPIO11 |··| GPIO8
-----------------------
GND |··| GPIO7 (not depoyed on 24 pin header)
replace XZ with the pin which is wired out on this position (e.g. PA10, PG11 etc.)
*/
{"GPIO",
{
//'first row'
{ "GPIO2", SUNXI_GPX(Z), 3 },
{ "GPIO3", SUNXI_GPX(Z), 5 },
{ "GPIO4", SUNXI_GPX(Z), 7 },
{ "GPIO17", SUNXI_GPX(Z), 11 },
{ "GPIO27", SUNXI_GPX(Z), 13 },
{ "GPIO22", SUNXI_GPX(Z), 15 },
{ "GPIO10", SUNXI_GPX(Z), 19 },
{ "GPIO9", SUNXI_GPX(Z), 21 },
{ "GPIO11", SUNXI_GPX(Z), 23 },
//'second row'
{ "GPIO14", SUNXI_GPX(Z), 8 },
{ "GPIO15", SUNXI_GPX(Z), 10 },
{ "GPIO18", SUNXI_GPX(Z), 12 },
{ "GPIO23", SUNXI_GPX(Z), 16 },
{ "GPIO24", SUNXI_GPX(Z), 18 },
{ "GPIO25", SUNXI_GPX(Z), 22 },
{ "GPIO8", SUNXI_GPX(Z), 24 },
{
{ 0, 0, 0}
},
}
},
/*
#define PIN_PG0 SUNXI_GPG(0)
*/
{"LED",
{
{ "POWER_LED", SUNXI_GPX(Z), 1 },
{ "STATUS_LED", SUNXI_GPX(Z), 2 },
{
{ 0, 0, 0}
},
}
},
};
#endif