Fork of original LPS331 library Changed the I2C address to 0xBA

Committer:
kholland
Date:
Mon Jan 05 22:45:18 2015 +0000
Revision:
2:283e88a1bed7
Parent:
1:f70e671b008f
Changed address to 0xBA

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yasuyuki 0:ef4f624dc3ec 1 //**********************
yasuyuki 0:ef4f624dc3ec 2 // LPS331.h for mbed
yasuyuki 0:ef4f624dc3ec 3 //
yasuyuki 0:ef4f624dc3ec 4 // (C)Copyright 2014 All rights reserved by Y.Onodera
yasuyuki 0:ef4f624dc3ec 5 // http://einstlab.web.fc2.com
yasuyuki 0:ef4f624dc3ec 6 //**********************
yasuyuki 0:ef4f624dc3ec 7
yasuyuki 0:ef4f624dc3ec 8 #ifndef LPS331_H_
yasuyuki 0:ef4f624dc3ec 9 #define LPS331_H_
yasuyuki 0:ef4f624dc3ec 10
kholland 2:283e88a1bed7 11 #define LPS331_ADDR 0xBA
yasuyuki 0:ef4f624dc3ec 12 #define LPS331_REF_P_XL 0x08
yasuyuki 0:ef4f624dc3ec 13 #define LPS331_REF_P_L 0x09
yasuyuki 0:ef4f624dc3ec 14 #define LPS331_REF_P_H 0x0A
yasuyuki 0:ef4f624dc3ec 15 #define LPS331_WHO_AM_I 0x0F
yasuyuki 0:ef4f624dc3ec 16 #define LPS331_RES_CONF 0x10
yasuyuki 0:ef4f624dc3ec 17 #define LPS331_CTRL_REG1 0x20
yasuyuki 0:ef4f624dc3ec 18 #define LPS331_CTRL_REG2 0x21
yasuyuki 0:ef4f624dc3ec 19 #define LPS331_CTRL_REG3 0x22
yasuyuki 0:ef4f624dc3ec 20 #define LPS331_INT_CFG_REG 0x23
yasuyuki 0:ef4f624dc3ec 21 #define LPS331_INT_SOURCE_REG 0x24
yasuyuki 0:ef4f624dc3ec 22 #define LPS331_THS_P_LOW_REG 0x25
yasuyuki 0:ef4f624dc3ec 23 #define LPS331_THS_P_HIGH_REG 0x26
yasuyuki 0:ef4f624dc3ec 24 #define LPS331_STATUS_REG 0x27
yasuyuki 0:ef4f624dc3ec 25 #define LPS331_PRESS_POUT_XL_REH 0x28
yasuyuki 0:ef4f624dc3ec 26 #define LPS331_PRESS_OUT_L 0x29
yasuyuki 0:ef4f624dc3ec 27 #define LPS331_PRESS_OUT_H 0x2A
yasuyuki 0:ef4f624dc3ec 28 #define LPS331_TEMP_OUT_L 0x2B
yasuyuki 0:ef4f624dc3ec 29 #define LPS331_TEMP_OUT_H 0x2C
yasuyuki 0:ef4f624dc3ec 30 #define LPS331_AMP_CTRL 0x2D
yasuyuki 0:ef4f624dc3ec 31 #define LPS331_DELTA_PRESS_XL 0x3C
yasuyuki 0:ef4f624dc3ec 32 #define LPS331_DELTA_PRESS_H 0x3D
yasuyuki 0:ef4f624dc3ec 33 #define LPS331_DELTA_PRESS_L 0x3E
yasuyuki 0:ef4f624dc3ec 34
yasuyuki 0:ef4f624dc3ec 35 #include "mbed.h"
yasuyuki 0:ef4f624dc3ec 36 #include "typedef.h"
yasuyuki 0:ef4f624dc3ec 37
yasuyuki 0:ef4f624dc3ec 38 class LPS331{
yasuyuki 0:ef4f624dc3ec 39 public:
yasuyuki 0:ef4f624dc3ec 40 LPS331 (PinName sda, PinName scl);
yasuyuki 0:ef4f624dc3ec 41 LPS331 (I2C& p_i2c);
yasuyuki 0:ef4f624dc3ec 42 void init();
yasuyuki 0:ef4f624dc3ec 43
yasuyuki 0:ef4f624dc3ec 44 void put(unsigned char a, unsigned char b);
yasuyuki 0:ef4f624dc3ec 45 void get(unsigned char a);
yasuyuki 0:ef4f624dc3ec 46 long value();
yasuyuki 1:f70e671b008f 47 short temperature();
yasuyuki 0:ef4f624dc3ec 48
yasuyuki 0:ef4f624dc3ec 49 protected:
yasuyuki 0:ef4f624dc3ec 50
yasuyuki 0:ef4f624dc3ec 51 I2C _i2c;
yasuyuki 0:ef4f624dc3ec 52
yasuyuki 0:ef4f624dc3ec 53 DWORD_VAL press;
yasuyuki 1:f70e671b008f 54 WORD_VAL temp;
yasuyuki 0:ef4f624dc3ec 55 char buf[2];
yasuyuki 0:ef4f624dc3ec 56
yasuyuki 0:ef4f624dc3ec 57 };
yasuyuki 0:ef4f624dc3ec 58
yasuyuki 0:ef4f624dc3ec 59 #endif /* LPS331_H_ */
yasuyuki 0:ef4f624dc3ec 60
yasuyuki 0:ef4f624dc3ec 61
yasuyuki 0:ef4f624dc3ec 62