![]() | LCD Library 1.2.1 LCD Library - LCD control class hierarchy library. Drop in replacement for the LiquidCrystal Library. |
00001 // ---------------------------------------------------------------------------00002 // Created by Francisco Malpartida on 20/08/11.00003 // Copyright 2011 - Under creative commons license 3.0:00004 // Attribution-ShareAlike CC BY-SA00005 //00006 // This software is furnished "as is", without technical support, and with no 00007 // warranty, express or implied, as to its usefulness for any purpose.00008 //00009 // Thread Safe: No00010 // Extendable: Yes00011 //00012 // @file I2CIO.h00013 // This file implements a basic IO library using the PCF8574 I2C IO Expander00014 // chip.00015 // 00016 // @brief 00017 // Implement a basic IO library to drive the PCF8574* I2C IO Expander ASIC.00018 // The library implements basic IO general methods to configure IO pin direction00019 // read and write uint8_t operations and basic pin level routines to set or read00020 // a particular IO port.00021 //00022 // @version API 1.0.000023 //00024 // @author F. Malpartida - fmalpartida@gmail.com00025 // ---------------------------------------------------------------------------00026 00027 #ifndef _I2CIO_H_00028 #define _I2CIO_H_00029 00030 #include <inttypes.h>00031 00032#define _I2CIO_VERSION "1.0.0"00033 00041class I2CIO00042 { 00043 public: 00049 I2CIO ( ); 00050 00062 intbegin ( uint8_t i2cAddr ); 00063 00073 voidpinMode ( uint8_t pin, uint8_t dir ); 00074 00083 voidportMode ( uint8_t dir ); 00084 00094 uint8_t read ( void ); 00095 00108 uint8_t digitalRead ( uint8_t pin ); 00109 00123 intwrite ( uint8_t value ); 00124 00136 intdigitalWrite ( uint8_t pin, uint8_t level ); 00137 00138 00139 00140 private: 00141 uint8_t _shadow; // Shadow output00142 uint8_t _dirMask; // Direction mask00143 uint8_t _i2cAddr; // I2C address00144 bool _initialised; // Initialised object00145 00146 }; 00147 00148 #endif