blob: 190588fd582bd02cba46caff7f66f01300858cc7 [file] [log] [blame]
Joachim Steigerb1a81c12019-07-26 22:13:51 +02001/* mcp23017 i2c gpio expander read and write utilities
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
16 */
17#pragma once
18
19#define MCP23017_ADDRESS 0x20
20
Harald Weltedd5794c2021-06-03 13:19:46 +020021int mcp23017_init(uint8_t slave, uint8_t iodira, uint8_t iodirb);
Joachim Steigerf7f1ea82019-10-24 18:09:05 +020022int mcp23017_test(uint8_t slave);
23int mcp23017_toggle(uint8_t slave);
Harald Welte731e1992021-06-03 13:11:34 +020024int mcp23017_set_output_a(uint8_t slave, uint8_t val);
25int mcp23017_set_output_b(uint8_t slave, uint8_t val);
Joachim Steigerb1a81c12019-07-26 22:13:51 +020026//int mcp23017_write_byte(uint8_t slave, uint8_t addr, uint8_t byte);
27//int mcp23017_read_byte(uint8_t slave, uint8_t addr);