joe holdsworth / mpl115a2

Dependents:   HTTPClient_SuperTweet_MPL115A2 mpl115a2_display_local

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MPL115A2.h Source File

MPL115A2.h

00001 /* 
00002   *@section LICENSE
00003   * This program is free software; you can redistribute it and/or modify 
00004   * it under the terms of the GNU General Public License as published by 
00005   * the Free Software Foundation; either version 2 of the License, or 
00006   * (at your option) any later version.
00007   * 
00008   * This program is distributed in the hope that it will be useful, but 
00009   * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
00010   * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
00011   * for more details.
00012   * 
00013   * You should have received a copy of the GNU General Public License along 
00014   * with this program; if not, write to the Free Software Foundation, Inc., 
00015   * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00016   * 
00017   *@section NOTES 
00018   *MPL115A2 Sensor Library for mbed 
00019   *
00020   *created for arduino by R.N <zan73722@gmail.com>
00021   *ported to mbed by joe holdsworth <joeholdsworth@gmail.com>
00022   *
00023   *2012-05-07 Ported mbed beta version - tested on LPC1768
00024 */
00025 
00026 #ifndef MPL115A2_H
00027 #define MPL115A2_H
00028 
00029 #include "mbed.h"
00030 
00031 class MPL115A2
00032 {
00033     private:
00034         DigitalOut _shdnPin;
00035         bool _bShutdown;
00036         short _i2c_address;
00037         short _sia0, _sib1, _sib2, _sic12, _sic11, _sic22;
00038         unsigned short _uiPadc, _uiTadc;
00039         I2C *_i2c;
00040         Serial *_pc;
00041         bool _debug;
00042        
00043         
00044     public:
00045         MPL115A2(I2C *i2c, const PinName shdnPin = p21);
00046         MPL115A2(I2C *i2c, Serial *pc, const PinName shdnPin = p21); //pass serial for debug
00047         void begin();
00048         void shutdown();
00049         void ReadSensor();
00050         float GetPressure();
00051         float GetTemperature();
00052 };
00053 #endif