LSM9DS1 Library
0.7.0-alpha
C Library for the LSM9DS1 device.
|
Functions to access the lsm9ds1. More...
#include <stdbool.h>
#include <stdint.h>
#include "lsm9ds1_debug.h"
#include "lsm9ds1_config.h"
Go to the source code of this file.
Data Structures | |
struct | lsm9ds1_data_t |
Stores the raw data for each sub device. More... | |
struct | accelerometer_converted_data_t |
struct | mag_converted_data_t |
struct | gyro_converted_data_t |
struct | lsm9ds1_converted_data_t |
Stores the converted data for each sub device. More... | |
struct | lsm9ds1_device_t |
Data and configurations for the lsm9ds1 device. More... | |
Macros | |
#define | _BUILD_VERSION BUILD_VERSION |
Typedefs | |
typedef struct lsm9ds1_data_t | lsm9ds1_data_t |
Stores the raw data for each sub device. | |
typedef struct accelerometer_converted_data_t | accelerometer_converted_data_t |
typedef struct mag_converted_data_t | mag_converted_data_t |
typedef struct gyro_converted_data_t | gyro_converted_data_t |
typedef struct lsm9ds1_converted_data_t | lsm9ds1_converted_data_t |
Stores the converted data for each sub device. | |
typedef struct lsm9ds1_device_t | lsm9ds1_device_t |
Data and configurations for the lsm9ds1 device. | |
Functions | |
lsm9ds1_status_t | get_temp (lsm9ds1_temperature_t *temperature) |
Read the temperature of the LSM9DS1. More... | |
lsm9ds1_status_t | get_accel (accelerometer_converted_data_t *data) |
Read the accelerometer of the LSM9DS1. More... | |
lsm9ds1_status_t | get_mag (mag_converted_data_t *data) |
Read the magnetometer of the LSM9DS1. More... | |
lsm9ds1_status_t | get_gyro (gyro_converted_data_t *data) |
Read the gyroscope from the LSM9DS1. More... | |
lsm9ds1_status_t | lsm9ds1_init () |
Initialize the LSM9DS1. More... | |
lsm9ds1_status_t | lsm9ds1_close () |
Close the LSM9DS1. More... | |
Functions to access the lsm9ds1.
lsm9ds1_status_t get_accel | ( | accelerometer_converted_data_t * | data | ) |
Read the accelerometer of the LSM9DS1.
Get the current converted accelerometer reading. The X, Y and Z coordinates are returned by this function.
Example Usage:
data | the converted data read from the accelerometer. |
lsm9ds1_status_t get_gyro | ( | gyro_converted_data_t * | data | ) |
Read the gyroscope from the LSM9DS1.
Get the current converted gyroscope reading. The X, Y and Z coordinates are returned by this function.
Example Usage:
data | the converted data read from the gyroscope. |
lsm9ds1_status_t get_mag | ( | mag_converted_data_t * | data | ) |
Read the magnetometer of the LSM9DS1.
Get the current converted magnetometer reading. The X, Y and Z coordinates are returned by this function.
Example Usage:
data | the converted data read from the magnetometer. |
lsm9ds1_status_t get_temp | ( | lsm9ds1_temperature_t * | temperature | ) |
Read the temperature of the LSM9DS1.
Get the current converted temperature reading
Example Usage:
data | the converted data read from the temperature monitor |
lsm9ds1_status_t lsm9ds1_close | ( | ) |
Close the LSM9DS1.
Close the open buses.
Example Usage:
lsm9ds1_status_t lsm9ds1_init | ( | ) |
Initialize the LSM9DS1.
Initialize the lsm9ds1 according to the configuration file found in /etc/lsm9ds1.json. This function only has to be called once.
Example Usage: