/Users/fmalpartida/Documents/development/mercurial repos/SW/NewLiquidCrystal_lib/I2CIO.h
// ---------------------------------------------------------------------------
// Created by Francisco Malpartida on 20/08/11.
// Copyright (C) - 2018
//
// 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 3 of the License, or
// 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 v3.0
// along with this program.
// If not, see <https://www.gnu.org/licenses/gpl-3.0.en.html>.
//
// ---------------------------------------------------------------------------
//
// This software is furnished "as is", without technical support, and with no
// warranty, express or implied, as to its usefulness for any purpose.
//
// Thread Safe: No
// Extendable: Yes
//
// @file I2CIO.h
// This file implements a basic IO library using the PCF8574 I2C IO Expander
// chip.
//
// @brief
// Implement a basic IO library to drive the PCF8574* I2C IO Expander ASIC.
// The library implements basic IO general methods to configure IO pin direction
// read and write uint8_t operations and basic pin level routines to set or read
// a particular IO port.
//
// @version API 1.0.0
//
// @author F. Malpartida - fmalpartida@gmail.com
// ---------------------------------------------------------------------------
#ifndef _I2CIO_H_
#define _I2CIO_H_
#include <inttypes.h>
#define _I2CIO_VERSION "1.0.0"
class I2CIO
{
public:
I2CIO ( );
int begin ( uint8_t i2cAddr );
void pinMode ( uint8_t pin, uint8_t dir );
void portMode ( uint8_t dir );
uint8_t read ( void );
uint8_t digitalRead ( uint8_t pin );
int write ( uint8_t value );
int digitalWrite ( uint8_t pin, uint8_t level );
private:
uint8_t _shadow; // Shadow output
uint8_t _dirMask; // Direction mask
uint8_t _i2cAddr; // I2C address
bool _initialised; // Initialised object
bool isAvailable (uint8_t i2cAddr);
};
#endif
I2CIO
Definition: I2CIO.h:56
I2CIO::portMode
void portMode(uint8_t dir)
Definition: I2CIO.cpp:123
I2CIO::write
int write(uint8_t value)
Definition: I2CIO.cpp:160
I2CIO::pinMode
void pinMode(uint8_t pin, uint8_t dir)
Definition: I2CIO.cpp:106
I2CIO::digitalWrite
int digitalWrite(uint8_t pin, uint8_t level)
Definition: I2CIO.cpp:204
I2CIO::digitalRead
uint8_t digitalRead(uint8_t pin)
Definition: I2CIO.cpp:187
I2CIO::I2CIO
I2CIO()
Definition: I2CIO.cpp:71
I2CIO::begin
int begin(uint8_t i2cAddr)
Definition: I2CIO.cpp:85
I2CIO::read
uint8_t read(void)
Definition: I2CIO.cpp:141