-
Notifications
You must be signed in to change notification settings - Fork 1
/
gpio.h
60 lines (48 loc) · 842 Bytes
/
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
48
49
50
51
52
53
54
55
56
57
58
59
/*
* https://github.com/mrshu/GPIOlib
* Copyright (c) 2011, Copyright (c) 2011 mr.Shu
* All rights reserved.
*
* Modified on 24 June 2012, 11:06 AM
* File: gpio.h
* Author: purinda (purinda@gmail.com)
*
*/
#ifndef H
#define H
#include <cstdio>
class GPIO {
public:
/* Constants */
static const int DIRECTION_OUT = 1;
static const int DIRECTION_IN = 0;
static const int OUTPUT_HIGH = 1;
static const int OUTPUT_LOW = 0;
GPIO();
/**
*
* @param port
* @param DDR
*/
static void open(int port, int DDR);
/**
*
* @param port
*/
static void close(int port);
/**
*
* @param port
* @param value
*/
static int read(int port);
/**
*
* @param port
* @param value
*/
static void write(int port,int value);
virtual ~GPIO();
private:
};
#endif /* H */