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.
Dependents: FXOS8700CQ_Int_example 4_accelerometer 4_accelerometer shake_to_wake
Fork of FXOS8700CQ by
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:
-
sda SDA pin sdl SCL pin addr address 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_data destination XYZ accelerometer data struct magn_data destination 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.
Generated on Mon Aug 8 2022 20:35:13 by
1.7.2
