Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
MPL115.h
00001 //********************** 00002 // MPL115.h for mbed 00003 // 00004 // (C)Copyright 2014 All rights reserved by Y.Onodera 00005 // http://einstlab.web.fc2.com 00006 //********************** 00007 #ifndef MPL115_H_ 00008 #define MPL115_H_ 00009 00010 #define MPL115_ADDR 0xC0 00011 #define MPL115_Padc_MSB 0x00 00012 #define MPL115_Padc_LSB 0x01 00013 #define MPL115_Tadc_MSB 0x02 00014 #define MPL115_Tadc_LSB 0x03 00015 #define MPL115_a0MSB 0x04 00016 #define MPL115_a0LSB 0x05 00017 #define MPL115_b1MSB 0x06 00018 #define MPL115_b1LSB 0x07 00019 #define MPL115_b2MSB 0x08 00020 #define MPL115_b2LSB 0x09 00021 #define MPL115_c12MSB 0x0A 00022 #define MPL115_c12LSB 0x0B 00023 #define MPL115_CONVERT 0x12 00024 00025 #include "mbed.h" 00026 #include "typedef.h" 00027 00028 class MPL115A2{ 00029 public: 00030 MPL115A2 (PinName sda, PinName scl); 00031 MPL115A2 (I2C& p_i2c); 00032 void start(); 00033 short temperature(); 00034 short pressure(); 00035 void init(); 00036 00037 protected: 00038 00039 I2C _i2c; 00040 char buf[8]; 00041 WORD_VAL Padc; 00042 WORD_VAL Tadc; 00043 WORD_VAL a0; 00044 WORD_VAL b1; 00045 WORD_VAL b2; 00046 WORD_VAL c12; 00047 00048 }; 00049 00050 #endif /* MPL115_H_ */ 00051 00052
Generated on Fri Jul 22 2022 16:00:12 by
1.7.2