-
Notifications
You must be signed in to change notification settings - Fork 0
/
c_gpio.h
executable file
·47 lines (43 loc) · 1.32 KB
/
c_gpio.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
/*
* This file is part of RPIO.
*
* Copyright
*
* Copyright (C) 2013 Chris Hager <[email protected]>
*
* License
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details at
* <http://www.gnu.org/licenses/lgpl-3.0-standalone.html>
*
* Documentation
*
* http://pythonhosted.org/RPIO
*/
int setup(void);
void setup_gpio(int gpio, int direction, int pud);
void output_gpio(int gpio, int value);
int input_gpio(int gpio);
void cleanup(void);
int gpio_function(int gpio);
void set_pullupdn(int gpio, int pud);
#define SETUP_OK 0
#define SETUP_DEVMEM_FAIL 1
#define SETUP_MALLOC_FAIL 2
#define SETUP_MMAP_FAIL 3
#define INPUT 1 // is really 0 for control register!
#define OUTPUT 0 // is really 1 for control register!
#define ALT0 4
#define HIGH 1
#define LOW 0
#define PUD_OFF 0
#define PUD_DOWN 1
#define PUD_UP 2