-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmcp.h
57 lines (49 loc) · 1.49 KB
/
mcp.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
/*
* mcp.h
*
* Created by Tobias Gall <[email protected]>
* Based on Adafruit's python code for CharLCDPlate
*
* This program 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.
*
*
*/
#ifndef MCP_H
#define MCP_H
#include <stdio.h>
#include <stdlib.h>
#include <linux/types.h>
#include "rpii2c.c"
#define MCP23017_IODIRA 0x00
#define MCP23017_IODIRB 0x01
#define MCP23017_GPIOA 0x12
#define MCP23017_GPIOB 0x13
#define MCP23017_GPPUA 0x0C
#define MCP23017_GPPUB 0x0D
#define MCP23017_OLATA 0x14
#define MCP23017_OLATB 0x15
extern __u16 direction;
void mcpSetup(__u8, __u8);
__u8 mcpChangebit(__u8, __u8, __u8);
void mcpReadChangePin(__u8, __u8, __u8, __u8, __u8);
void mcpPullup(__u8, __u8);
void mcpConfig(__u8, __u8);
void mcpOutput(__u8, __u8);
__u8 mcpInput(__u8);
__u16 mcpRead16(void);
void mcpWrite16(__u8);
void mcpClose(void);
#endif