Driver for the FXOS8700 3-axis accelerometer/magnetometer. More...
Driver for the FXOS8700 3-axis accelerometer/magnetometer.
The connection between the MCU and the FXOS8700 is based on the I2C-interface.
This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.
Modules | |
FXOS8700 accelerometer/magnetometer driver compile configuration | |
Files | |
file | fxos8700_params.h |
Default configuration for FXOS8700 devices. | |
file | fxos8700_regs.h |
Register definitions for FXOS8700 devices. | |
file | fxos8700.h |
Interface definition for the FXOS8700 sensor driver. | |
Data Structures | |
struct | fxos8700_params_t |
Parameters needed for device initialization. More... | |
struct | fxos8700_measurement_t |
Individual 3-axis measurement. More... | |
struct | fxos8700_t |
Device descriptor for a FXOS8700 device. More... | |
Enumerations | |
enum | { FXOS8700_OK = 0, FXOS8700_ADDRERR = -1, FXOS8700_NOBUS = -2, FXOS8700_NODEV = -3, FXOS8700_BUSERR = -4 } |
FXOS8700 specific return values. More... | |
Functions | |
int | fxos8700_init (fxos8700_t *dev, const fxos8700_params_t *params) |
Initialize an FXOS8700 device. More... | |
int | fxos8700_set_active (const fxos8700_t *dev) |
Convenience function for turning on the FXOS8700. More... | |
int | fxos8700_set_idle (const fxos8700_t *dev) |
Convenience function for turning off the FXOS8700. More... | |
int | fxos8700_read (const fxos8700_t *dev, fxos8700_measurement_t *acc, fxos8700_measurement_t *mag) |
Convenience function for reading acceleration and magnetic field. More... | |
int | fxos8700_read_cached (const void *dev, fxos8700_measurement_t *acc, fxos8700_measurement_t *mag) |
Extended read function including caching capability. More... | |
anonymous enum |
FXOS8700 specific return values.
Definition at line 58 of file fxos8700.h.
int fxos8700_init | ( | fxos8700_t * | dev, |
const fxos8700_params_t * | params | ||
) |
Initialize an FXOS8700 device.
[out] | dev | device descriptor |
[in] | params | parameters for device |
int fxos8700_read | ( | const fxos8700_t * | dev, |
fxos8700_measurement_t * | acc, | ||
fxos8700_measurement_t * | mag | ||
) |
Convenience function for reading acceleration and magnetic field.
This function will trigger a new conversion, wait for the conversion to be finished and the get the results from the device.
[in] | dev | device descriptor of sensor |
[out] | acc | 3-axis acceleration [in milli grativy acceleration (mg) ] |
[out] | mag | 3-axis magnetic field [in degree milli Gauss (mGs) ] |
int fxos8700_read_cached | ( | const void * | dev, |
fxos8700_measurement_t * | acc, | ||
fxos8700_measurement_t * | mag | ||
) |
Extended read function including caching capability.
This function will return cached values if they are within the sampling period (FXOS8700_RENEW_INTERVAL), or will trigger a new conversion, wait for the conversion to be finished and the get the results from the device.
[in] | dev | device descriptor of sensor |
[out] | acc | 3-axis acceleration [in milli grativy acceleration (mg) ] |
[out] | mag | 3-axis magnetic field [in degree milli Gauss (mGs) ] |
int fxos8700_set_active | ( | const fxos8700_t * | dev | ) |
Convenience function for turning on the FXOS8700.
This function will trigger a new conversion, wait for the conversion to be finished and the get the results from the device.
[in] | dev | device descriptor of sensor |
int fxos8700_set_idle | ( | const fxos8700_t * | dev | ) |
Convenience function for turning off the FXOS8700.
This function will trigger a new conversion, wait for the conversion to be finished and the get the results from the device.
[in] | dev | device descriptor of sensor |