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.
Dependencies: mbed
LPS25H.h
00001 //********************** 00002 // LPS25H.h for mbed 00003 // 00004 // (C)Copyright 2014 All rights reserved by Y.Onodera 00005 // http://einstlab.web.fc2.com 00006 //********************** 00007 00008 #ifndef LPS25H_H_ 00009 #define LPS25H_H_ 00010 00011 #define LPS25H_ADDR 0xB8 00012 #define LPS25H_REF_P_XL 0x08 00013 #define LPS25H_REF_P_L 0x09 00014 #define LPS25H_REF_P_H 0x0A 00015 #define LPS25H_WHO_AM_I 0x0F 00016 #define LPS25H_RES_CONF 0x10 00017 #define LPS25H_CTRL_REG1 0x20 00018 #define LPS25H_CTRL_REG2 0x21 00019 #define LPS25H_CTRL_REG3 0x22 00020 #define LPS25H_CTRL_REG4 0x23 00021 #define LPS25H_INT_CFG 0x24 00022 #define LPS25H_INT_SOURCE 0x25 00023 #define LPS25H_STATUS_REG 0x27 00024 #define LPS25H_PRESS_OUT_XL 0x28 00025 #define LPS25H_PRESS_OUT_L 0x29 00026 #define LPS25H_PRESS_OUT_H 0x2A 00027 #define LPS25H_TEMP_OUT_L 0x2B 00028 #define LPS25H_TEMP_OUT_H 0x2C 00029 #define LPS25H_FIFO_CTRL 0x2E 00030 #define LPS25H_FIFO_STATUS 0x2F 00031 #define LPS25H_THS_P_L 0x30 00032 #define LPS25H_THS_P_H 0x31 00033 #define LPS25H_RPDS_L 0x39 00034 #define LPS25H_RPDS_H 0x3A 00035 00036 #include "mbed.h" 00037 #include "typedef.h" 00038 00039 class LPS25H{ 00040 public: 00041 LPS25H (PinName sda, PinName scl); 00042 LPS25H (I2C& p_i2c); 00043 void init(); 00044 00045 void put(unsigned char a, unsigned char b); 00046 void get(unsigned char a); 00047 long pressure(); 00048 short temperature(); 00049 00050 protected: 00051 00052 I2C _i2c; 00053 00054 DWORD_VAL press; 00055 WORD_VAL temp; 00056 char buf[2]; 00057 00058 }; 00059 00060 #endif /* LPS25H_H_ */ 00061 00062
Generated on Thu Jul 14 2022 02:10:31 by
1.7.2