3 * Copyright (c) 2012-2013 Gordon Henderson
5 * Header file for code using the MCP23016 GPIO expander
7 ***********************************************************************
8 * This file is part of wiringPi:
9 * https://projects.drogon.net/raspberry-pi/wiringpi/
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.
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.
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 ***********************************************************************
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
42 // Bits in the IOCON register
44 #define IOCON_IARES 0x01
46 // Default initialisation mode