LIS3DH Propeller C library
v1.0.0
Propeller C Library for the Parallax LIS3DH 3 Axis Accelerometer with ADC module
|
Simplifies reading Parallax LIS3DH 3-Axis Accelerometer Module with ADC. More...
#include "simpletools.h"
Go to the source code of this file.
Data Structures | |
struct | lis3dh_st |
Typedefs | |
typedef struct lis3dh_st | lis3dh_t |
typedef lis3dh_t | lis3dh |
Functions | |
lis3dh_t * | lis3dh_init (int pinSCK, int pinSDI, int pinCS) |
Initialize the sensor with typical configuration for reading axis and adc. Uses 3-Wire SPI mode. More... | |
lis3dh_t * | lis3dh_init4wire (int pinSCK, int pinSDI, int pinSDO, int pinCS) |
Initialize the sensor with typical configuration for reading axis and adc. Uses 4-Wire SPI mode. More... | |
void | lis3dh_shutdown (lis3dh_t *device) |
Shutdown the sensor, set configuration defaults with sensor disabled and clear buffers. More... | |
int | lis3dh_getWhoAmI (lis3dh_t *device) |
Reads the sensor identification register (WhoAmI). More... | |
void | lis3dh_setResolution (lis3dh_t *device, int bits) |
Sets the bit resolution for the sensor readings. 8-bit, 10-bit or 12-bit. More... | |
int | lis3dh_getResolution (lis3dh_t *device) |
Reads the bit resolution setting from the sensor. 8-bit, 10-bit or 12-bit. More... | |
void | lis3dh_setRange (lis3dh_t *device, int range) |
Sets the g measurement range to +/- 2, +/-4, +/- 8, +- 16 g. More... | |
int | lis3dh_getRange (lis3dh_t *device) |
Reads the g measurement range; one of +/- 2, +/-4, +/- 8, +- 16 g. More... | |
void | lis3dh_setSPImode (lis3dh_t *device, int mode) |
Sets the SPI mode to either 3-wire or 4-wire. More... | |
int | lis3dh_getSPImode (lis3dh_t *device) |
Read the SPI mode currently configured in the LIS3DH module; either 3-wire or 4-wire. More... | |
void | lis3dh_setBDUmode (lis3dh_t *device, int mode) |
Sets the sensor BDU (Block Data Update) mode. More... | |
void | lis3dh_setADCmode (lis3dh_t *device, int adcEnable, int tempEnable) |
Sets ADC mode for the Parallax LIS3DH 3-Axis Accelerometer Module. More... | |
void | lis3dh_adc (lis3dh_t *device, int *ad1, int *ad2, int *ad3) |
Gets raw adc measurements from all three ADC channels. More... | |
int | lis3dh_getADC (lis3dh_t *device, int channel) |
Gets raw adc measurement from a single ADC channel. More... | |
void | lis3dh_adc_mV (lis3dh_t *device, int *ad1, int *ad2, int *ad3) |
Gets mV adc measurements from all three ADC channels. More... | |
int | lis3dh_getADC_mV (lis3dh_t *device, int channel) |
Gets mV adc measurement from a single ADC channel. More... | |
void | lis3dh_adcCal_mV (lis3dh_t *device, int mV_L, int mV_H, int value_L, int value_H) |
Sets the adc calibration values for adc mV reading on AD1. More... | |
void | lis3dh_tempCal_C (lis3dh_t *device, int actualTempC) |
Sets the actual temperature to provide a reference for the relative temperature sensor. More... | |
void | lis3dh_tempCal_F (lis3dh_t *device, int actualTempF) |
Sets the actual temperature to provide a reference for the relative temperature sensor. More... | |
int | lis3dh_tempRaw (lis3dh_t *device) |
Reads the raw relative temperature value from the sensor. More... | |
int | lis3dh_temp_C (lis3dh_t *device) |
Reads the calibrated (referenced) temperature value from the sensor. More... | |
int | lis3dh_temp_F (lis3dh_t *device) |
Reads the calibrated (referenced) temperature value from the sensor. More... | |
int | lis3dh_accel (lis3dh_t *device, int *x, int *y, int *z) |
Gets raw accelerometer measurements from all three axis (x, y, z). More... | |
int | lis3dh_getAccel (lis3dh_t *device, int axis) |
Gets raw accelerometer measurements for a single axis (x, y, or z). More... | |
int | lis3dh_accel_mg (lis3dh_t *device, int *xmg, int *ymg, int *zmg) |
Gets mg (milli-g's) accelerometer measurements from all three axis (x, y, z). More... | |
int | lis3dh_getAccel_mg (lis3dh_t *device, int axis) |
Gets mg (milli-g's) accelerometer measurements from a single axis (x, y, or z). More... | |
int | lis3dh_tilt (lis3dh_t *device, int *ax, int *ay, int *az, int *motion) |
Gets tilt angle measurements for each axis, and magnitude of motion. More... | |
int | lis3dh_tiltConfig (lis3dh_t *device, int avg_factor) |
Optional configuration for tilt sensor. More... | |
void | lis3dh_writeByte (lis3dh_t *device, unsigned char address, unsigned char value) |
write a byte value to an LIS3DH register More... | |
unsigned char | lis3dh_readByte (lis3dh_t *device, unsigned char address) |
Read a value from an LIS3DH register. More... | |
Simplifies reading Parallax LIS3DH 3-Axis Accelerometer Module with ADC.