sketchbook
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mcp23016reg.h
Go to the documentation of this file.
1 /*
2  * mcp23016:
3  * Copyright (c) 2012-2013 Gordon Henderson
4  *
5  * Header file for code using the MCP23016 GPIO expander
6  * chip.
7  ***********************************************************************
8  * This file is part of wiringPi:
9  * https://projects.drogon.net/raspberry-pi/wiringpi/
10  *
11  * wiringPi is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License as
13  * published by the Free Software Foundation, either version 3 of the
14  * License, or (at your option) any later version.
15  *
16  * wiringPi is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with wiringPi.
23  * If not, see <http://www.gnu.org/licenses/>.
24  ***********************************************************************
25  */
26 
27 // MCP23016 Registers
28 
29 #define MCP23016_GP0 0x00
30 #define MCP23016_GP1 0x01
31 #define MCP23016_OLAT0 0x02
32 #define MCP23016_OLAT1 0x03
33 #define MCP23016_IPOL0 0x04
34 #define MCP23016_IPOL1 0x05
35 #define MCP23016_IODIR0 0x06
36 #define MCP23016_IODIR1 0x07
37 #define MCP23016_INTCAP0 0x08
38 #define MCP23016_INTCAP1 0x09
39 #define MCP23016_IOCON0 0x0A
40 #define MCP23016_IOCON1 0x0B
41 
42 // Bits in the IOCON register
43 
44 #define IOCON_IARES 0x01
45 
46 // Default initialisation mode
47 
48 #define IOCON_INIT 0