Vinay Shrivastav / FXOS8700CQ

Fork of FXOS8700CQ by Mac Lobdell

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.
uint8_t config_int (void)
 configure external interrupts
uint8_t config_feature (void)
 configure feature (tap detection, motion detection, etc)
void clear_int (void)
 clear interrupt

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 138 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 84 of file FXOS8700CQ.cpp.


Member Function Documentation

void clear_int ( void   )

clear interrupt

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

Definition at line 128 of file FXOS8700CQ.cpp.

uint8_t config_feature ( void   )

configure feature (tap detection, motion detection, etc)

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

Definition at line 145 of file FXOS8700CQ.cpp.

uint8_t config_int ( void   )

configure external interrupts

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

Definition at line 99 of file FXOS8700CQ.cpp.

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 222 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 190 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 183 of file FXOS8700CQ.cpp.

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

Definition at line 177 of file FXOS8700CQ.cpp.