GSMA version

Fork of FXOS8700CQ by Thomas Murphy

Embed: (wiki syntax)

« Back to documentation index

FXOS8700CQ Class Reference

FXOS8700CQ Class Reference

A driver on top of mbed-I2C to operate the FXOS8700CQ accelerometer/magnetometer on the FRDM-K64F. More...

#include <FXOS8700CQ.h>

Public Member Functions

 FXOS8700CQ (PinName sda, PinName scl, int addr)
 FXOS8700CQ constructor.
 ~FXOS8700CQ (void)
 FXOS8700CQ destructor.
uint8_t get_whoami (void)
uint8_t status (void)
uint8_t get_data (SRAWDATA *accel_data, SRAWDATA *magn_data)
 Data retrieval from the FXOS8700CQ.
uint8_t get_accel_scale (void)
 Retrieve the full-range scale value of the accelerometer.

Detailed Description

A driver on top of mbed-I2C to operate the FXOS8700CQ accelerometer/magnetometer on the FRDM-K64F.

Code has been completed, but likely not optimized and potentially buggy.

Definition at line 117 of file FXOS8700CQ.h.


Constructor & Destructor Documentation

FXOS8700CQ ( PinName  sda,
PinName  scl,
int  addr 
)

FXOS8700CQ constructor.

Parameters:
sdaSDA pin
sdlSCL pin
addraddress of the I2C peripheral in (7-bit << 1) form

Definition at line 7 of file FXOS8700CQ.cpp.

~FXOS8700CQ ( void   )

FXOS8700CQ destructor.

Definition at line 78 of file FXOS8700CQ.cpp.


Member Function Documentation

uint8_t get_accel_scale ( void   )

Retrieve the full-range scale value of the accelerometer.

Returns:
2, 4, or 8, depending on part configuration; 0 on error

Definition at line 149 of file FXOS8700CQ.cpp.

uint8_t get_data ( SRAWDATA *  accel_data,
SRAWDATA *  magn_data 
)

Data retrieval from the FXOS8700CQ.

Parameters:
accel_datadestination XYZ accelerometer data struct
magn_datadestination XYZ magnetometer data struct
Returns:
0 on success, non-zero on failure

Definition at line 117 of file FXOS8700CQ.cpp.

uint8_t get_whoami ( void   )
Returns:
the contents of device register FXOS8700CQ_WHOAMI 0x0D, should be FXOS8700CQ_WHOAMI_VAL 0xC7

Definition at line 110 of file FXOS8700CQ.cpp.

uint8_t status ( void   )
Returns:
the contents of device register FXOS8700CQ_STATUS 0x00

Definition at line 104 of file FXOS8700CQ.cpp.