Gas Pressure Display Updated Power control for Pressure sensor added

Dependencies:   UniGraphic mbed vt100

Committer:
Rhyme
Date:
Fri Feb 16 08:27:50 2018 +0000
Revision:
0:37c8ecde13c2
control PSE530 power via PTC5 (pse530_en)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rhyme 0:37c8ecde13c2 1 #ifndef _MMA8451Q_H_
Rhyme 0:37c8ecde13c2 2 #define _MMA8451Q_H_
Rhyme 0:37c8ecde13c2 3
Rhyme 0:37c8ecde13c2 4 #include "mbed.h"
Rhyme 0:37c8ecde13c2 5 /**
Rhyme 0:37c8ecde13c2 6 * MMA8451Q 3-Axis, 14-bit/8-bit Digital Accelerometer
Rhyme 0:37c8ecde13c2 7 */
Rhyme 0:37c8ecde13c2 8
Rhyme 0:37c8ecde13c2 9 class MMA8451Q {
Rhyme 0:37c8ecde13c2 10 public:
Rhyme 0:37c8ecde13c2 11 /**
Rhyme 0:37c8ecde13c2 12 * MMA8451Q constructor
Rhyme 0:37c8ecde13c2 13 *
Rhyme 0:37c8ecde13c2 14 * @param i2c pointer to the I2C object
Rhyme 0:37c8ecde13c2 15 * @param addr 7bit addr of the I2C peripheral
Rhyme 0:37c8ecde13c2 16 */
Rhyme 0:37c8ecde13c2 17 MMA8451Q(I2C *i2c, int addr);
Rhyme 0:37c8ecde13c2 18
Rhyme 0:37c8ecde13c2 19 /**
Rhyme 0:37c8ecde13c2 20 * MMA8451Q destructor
Rhyme 0:37c8ecde13c2 21 */
Rhyme 0:37c8ecde13c2 22 ~MMA8451Q();
Rhyme 0:37c8ecde13c2 23
Rhyme 0:37c8ecde13c2 24 /**
Rhyme 0:37c8ecde13c2 25 * get all x, y, z data as int16_t
Rhyme 0:37c8ecde13c2 26 * @param data[] three int16_t data will be returned
Rhyme 0:37c8ecde13c2 27 * @returns I2C status 0: success others: I2C error
Rhyme 0:37c8ecde13c2 28 */
Rhyme 0:37c8ecde13c2 29 int getAllRawData(int16_t data[]) ;
Rhyme 0:37c8ecde13c2 30
Rhyme 0:37c8ecde13c2 31 /**
Rhyme 0:37c8ecde13c2 32 * get all x, y, z data as float
Rhyme 0:37c8ecde13c2 33 * @param data three float data will be returned
Rhyme 0:37c8ecde13c2 34 * @returns I2C status 0: success others: I2C error
Rhyme 0:37c8ecde13c2 35 */
Rhyme 0:37c8ecde13c2 36 int getAllData(float value[]) ;
Rhyme 0:37c8ecde13c2 37 int16_t getRawData(uint8_t addr) ;
Rhyme 0:37c8ecde13c2 38 int16_t getRawX(void) ;
Rhyme 0:37c8ecde13c2 39 int16_t getRawY(void) ;
Rhyme 0:37c8ecde13c2 40 int16_t getRawZ(void) ;
Rhyme 0:37c8ecde13c2 41
Rhyme 0:37c8ecde13c2 42 float getAccX(void) ;
Rhyme 0:37c8ecde13c2 43 float getAccY(void) ;
Rhyme 0:37c8ecde13c2 44 float getAccZ(void) ;
Rhyme 0:37c8ecde13c2 45
Rhyme 0:37c8ecde13c2 46 private:
Rhyme 0:37c8ecde13c2 47 I2C *p_i2c;
Rhyme 0:37c8ecde13c2 48 int m_addr;
Rhyme 0:37c8ecde13c2 49 int readRegs(int addr, uint8_t * data, int len);
Rhyme 0:37c8ecde13c2 50 int writeRegs(uint8_t * data, int len);
Rhyme 0:37c8ecde13c2 51 } ;
Rhyme 0:37c8ecde13c2 52
Rhyme 0:37c8ecde13c2 53 #endif /* _MMA8451Q_H_ */