; i2c_expander.inc ; ; Copyright (C) 2006,2007 Nuno Sucena Almeida ; ; 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 St, Fifth Floor, Boston, MA 02110-1301 USA ; ; MCP23016 I/O Expanders ; define commands of table 1-3 page 4 of MCP23016 datasheet ; Data Port Registers: #define GP0 H'0' #define GP1 H'1' ; Output Latch Registers: #define OLAT0 H'2' #define OLAT1 H'3' ; Input Polarity Registers #define IPOL0 H'4' #define IPOL1 H'5' ; I/O Direction Registers: ; if a bit is set '1' the pin becomes an input ; and if clear '0' it becomes an output. #define IODIR0 H'6' #define IODIR1 H'7' ; Interrupt Capture Registers: #define INTCAP0 H'8' #define INTCAP1 H'9' ; I/O Expander Control Register: #define IOCON0 H'A' #define IOCON1 H'B'