![]() |
LCD Library 1.1.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-SA 00005 // 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: No 00010 // Extendable: Yes 00011 // 00012 // @file I2CIO.h 00013 // This file implements a basic IO library using the PCF8574 I2C IO Expander 00014 // 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 direction 00019 // read and write uint8_t operations and basic pin level routines to set or read 00020 // a particular IO port. 00021 // 00022 // This library is only compatible with Arduino's SDK version 1.0 00023 // 00024 // @version API 1.0.0 00025 // 00026 // @author F. Malpartida - fmalpartida@gmail.com 00027 // --------------------------------------------------------------------------- 00028 00029 #ifndef _I2CIO_H_ 00030 #define _I2CIO_H_ 00031 00032 #include <inttypes.h> 00033 00034 #define _I2CIO_VERSION "1.0.0" 00035 00043 class I2CIO 00044 { 00045 public: 00051 I2CIO ( ); 00052 00064 int begin ( uint8_t i2cAddr ); 00065 00075 void pinMode ( uint8_t pin, uint8_t dir ); 00076 00085 void portMode ( uint8_t dir ); 00086 00096 uint8_t read ( void ); 00097 00110 uint8_t digitalRead ( uint8_t pin ); 00111 00125 int write ( uint8_t value ); 00126 00138 int digitalWrite ( uint8_t pin, uint8_t level ); 00139 00140 00141 00142 private: 00143 uint8_t _shadow; // Shadow output 00144 uint8_t _dirMask; // Direction mask 00145 uint8_t _i2cAddr; // I2C address 00146 bool _initialised; // Initialised object 00147 00148 }; 00149 00150 #endif