Mindstorms 3rd Party ROBOTC Drivers RobotC
[Home] [Download] [Submit a bug/suggestion] [ROBOTC Forums] [Blog] [Support this project]
Defines | Functions | Variables

microchip-mcp23008.h File Reference

Microchip MCP23008 driver. More...

#include "common.h"

Go to the source code of this file.

Defines

#define MCP_REG_IODIR   0x00
#define MCP_REG_IPOL   0x01
#define MCP_REG_GPINTEN   0x02
#define MCP_REG_DEFVAL   0x03
#define MCP_REG_INTCON   0x04
#define MCP_REG_IOCON   0x05
#define MCP_REG_GPPU   0x06
#define MCP_REG_INTF   0x07
#define MCP_REG_INTCAP   0x08
#define MCP_REG_GPIO   0x09
#define MCP_REG_OLAT   0x0A
#define MCP_BIT_INTPOL   1
#define MCP_BIT_ODR   2
#define MCP_BIT_DISSLW   4
#define MCP_BIT_SREAD   5
#define MCP_I2C_ADDR   0x40

Functions

bool MCP23008setupIO (tSensors link, byte addr, byte mask, byte pullup)
bool MCP23008setupIO (tSensors link, byte addr, byte mask)
byte MCP23008readIO (tSensors link, byte addr, byte mask)
byte MCP23008readIO (tSensors link, byte addr)
bool MCP23008writeIO (tSensors link, byte addr, byte mask)
bool MCP23008writeReg (tSensors link, byte addr, byte reg, byte data)
byte MCP23008readReg (tSensors link, byte addr, byte reg)

Variables

tByteArray MCP23008_I2CRequest
tByteArray MCP23008_I2CReply

Detailed Description

Microchip MCP23008 driver.

microchip-mcp23008.h provides an API for the MCP23008 8 port IO expander.

Changelog:

License: You may use this code as you wish, provided you give credit where it's due.

THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 3.59 AND HIGHER.

Author:
Xander Soldaat
Date:
18 June 2009
Version:
0.4

Definition in file microchip-mcp23008.h.