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: MotionSensor
Fork of FXOS8700Q by
FXOS8700Q.h
- Committer:
- JimCarver
- Date:
- 2014-04-07
- Revision:
- 0:2562215f5bc0
- Child:
- 1:8b53edef272f
File content as of revision 0:2562215f5bc0:
#ifndef FXOS8700Q_H
#define FXOS8700Q_H
#include "mbed.h"
// FXOS8700CQ I2C address
#define FXOS8700CQ_SLAVE_ADDR 0x3C // with pins SA0=0, SA1=0
// FXOS8700CQ internal register addresses
#define FXOS8700CQ_STATUS 0x00
#define FXOS8700CQ_WHOAMI 0x0D
#define FXOS8700CQ_XYZ_DATA_CFG 0x0E
#define FXOS8700CQ_CTRL_REG1 0x2A
#define FXOS8700CQ_M_CTRL_REG1 0x5B
#define FXOS8700CQ_M_CTRL_REG2 0x5C
#define FXOS8700CQ_WHOAMI_VAL 0xC7
class FXOS8700Q
{
public:
/**
* MPL3115A2 constructor
*
* @param sda SDA pin
* @param sdl SCL pin
* @param addr addr of the I2C peripheral
*/
FXOS8700Q(PinName sda, PinName scl);
/**
* Get the value of the WHO_AM_I register
*
* @returns DEVICE_ID value == ??
*/
//uint8_t getDeviceID();
/**
* Return the STATUS register value
*
* @returns STATUS register value
*/
//unsigned char getStatus( void);
/**
* Get the Accelerometer & Magnetometer values
* Accelerometer data is in G's
* MAgnetometer Data is in microteslas
*
* @returns altimeter value as float
*/
void ReadXYZ(float * a, float * m);
private:
I2C _i2c;
/** Set the device in active mode
*/
void begin( void);
void RegRead( char reg, char * d, int len);
};
#endif
