forked from picoflamingo/BBCape_EEPROM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pins.h
85 lines (66 loc) · 1.61 KB
/
pins.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
/*
BBCape_EEPROM: BeagleBone Cape EEPRom Generator
Copyright (c) 2013 David Martínez Oliveira
This file is part of BBCape_EEPROM
BBCape_EEPROM 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 3 of the License, or
(at your option) any later version.
BBCape_EEPROM 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 BBCape_EEPROM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PINS_H
#define PINS_H
typedef struct pin_mux_t
{
int conn;
int pin;
char *name;
char *mode[8];
} PIN_MUX;
/* Pins configuration on eeprom */
typedef struct eeprom_pin_t
{
int offset;
char *conn_name;
char *name;
int usage; /* 0 unused 1 used */
int type;
int slew;
int rx;
int pu_pd;
int pu_en;
int reg_off;
int mux_mode;
} EEPROM_PIN;
typedef struct hw_pin_t
{
char *name;
int pinctrl;
} HW_PIN;
typedef struct device_t
{
char *name;
char *dev;
char *ip;
char *target;
int used;
int n;
HW_PIN pin[8];
} DEVICE;
#ifdef __cplusplus
extern "C" {
#endif
void pins_clean ();
int pins_select_pin_by_name (char *pin_name);
void hw_list ();
int hw_add_remove (int i, int v);
int hw_write_dts (char *fname, char *cape_name, char *rev);
#ifdef __cplusplus
}
#endif
#endif