Adafruit ADXL343 Library
Classes | Macros | Enumerations
Adafruit_ADXL343.h File Reference
#include "WProgram.h"
#include <Adafruit_BusIO_Register.h>
#include <Adafruit_I2CDevice.h>
#include <Adafruit_SPIDevice.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>

Go to the source code of this file.

Classes

union  int_config
 
class  Adafruit_ADXL343
 

Macros

#define ADXL343_ADDRESS   (0x53)
 
#define ADXL3XX_REG_DEVID   (0x00)
 
#define ADXL3XX_REG_THRESH_TAP   (0x1D)
 
#define ADXL3XX_REG_OFSX   (0x1E)
 
#define ADXL3XX_REG_OFSY   (0x1F)
 
#define ADXL3XX_REG_OFSZ   (0x20)
 
#define ADXL3XX_REG_DUR   (0x21)
 
#define ADXL3XX_REG_LATENT   (0x22)
 
#define ADXL3XX_REG_WINDOW   (0x23)
 
#define ADXL3XX_REG_THRESH_ACT   (0x24)
 
#define ADXL3XX_REG_THRESH_INACT   (0x25)
 
#define ADXL3XX_REG_TIME_INACT   (0x26)
 
#define ADXL3XX_REG_ACT_INACT_CTL   (0x27)
 
#define ADXL3XX_REG_THRESH_FF   (0x28)
 
#define ADXL3XX_REG_TIME_FF   (0x29)
 
#define ADXL3XX_REG_TAP_AXES   (0x2A)
 
#define ADXL3XX_REG_ACT_TAP_STATUS   (0x2B)
 
#define ADXL3XX_REG_BW_RATE   (0x2C)
 
#define ADXL3XX_REG_POWER_CTL   (0x2D)
 
#define ADXL3XX_REG_INT_ENABLE   (0x2E)
 
#define ADXL3XX_REG_INT_MAP   (0x2F)
 
#define ADXL3XX_REG_INT_SOURCE   (0x30)
 
#define ADXL3XX_REG_DATA_FORMAT   (0x31)
 
#define ADXL3XX_REG_DATAX0   (0x32)
 
#define ADXL3XX_REG_DATAX1   (0x33)
 
#define ADXL3XX_REG_DATAY0   (0x34)
 
#define ADXL3XX_REG_DATAY1   (0x35)
 
#define ADXL3XX_REG_DATAZ0   (0x36)
 
#define ADXL3XX_REG_DATAZ1   (0x37)
 
#define ADXL3XX_REG_FIFO_CTL   (0x38)
 
#define ADXL3XX_REG_FIFO_STATUS   (0x39)
 
#define ADXL343_MG2G_MULTIPLIER   (0.004)
 

Enumerations

enum  adxl3xx_dataRate_t {
  ADXL343_DATARATE_3200_HZ = 0b1111, ADXL343_DATARATE_1600_HZ = 0b1110, ADXL343_DATARATE_800_HZ = 0b1101, ADXL343_DATARATE_400_HZ = 0b1100,
  ADXL343_DATARATE_200_HZ = 0b1011, ADXL343_DATARATE_100_HZ = 0b1010, ADXL343_DATARATE_50_HZ = 0b1001, ADXL343_DATARATE_25_HZ = 0b1000,
  ADXL343_DATARATE_12_5_HZ = 0b0111, ADXL343_DATARATE_6_25HZ = 0b0110, ADXL343_DATARATE_3_13_HZ = 0b0101, ADXL343_DATARATE_1_56_HZ = 0b0100,
  ADXL343_DATARATE_0_78_HZ = 0b0011, ADXL343_DATARATE_0_39_HZ = 0b0010, ADXL343_DATARATE_0_20_HZ = 0b0001, ADXL343_DATARATE_0_10_HZ = 0b0000,
  ADXL3XX_DATARATE_3200_HZ = 0b1111, ADXL3XX_DATARATE_1600_HZ = 0b1110, ADXL3XX_DATARATE_800_HZ = 0b1101, ADXL3XX_DATARATE_400_HZ = 0b1100,
  ADXL3XX_DATARATE_200_HZ = 0b1011, ADXL3XX_DATARATE_100_HZ = 0b1010, ADXL3XX_DATARATE_50_HZ = 0b1001, ADXL3XX_DATARATE_25_HZ = 0b1000,
  ADXL3XX_DATARATE_12_5_HZ = 0b0111, ADXL3XX_DATARATE_6_25HZ = 0b0110, ADXL3XX_DATARATE_3_13_HZ = 0b0101, ADXL3XX_DATARATE_1_56_HZ = 0b0100,
  ADXL3XX_DATARATE_0_78_HZ = 0b0011, ADXL3XX_DATARATE_0_39_HZ = 0b0010, ADXL3XX_DATARATE_0_20_HZ = 0b0001, ADXL3XX_DATARATE_0_10_HZ = 0b0000
}
 
enum  adxl34x_range_t {
  ADXL343_RANGE_16_G = 0b11, ADXL343_RANGE_8_G = 0b10, ADXL343_RANGE_4_G = 0b01, ADXL343_RANGE_2_G = 0b00,
  ADXL34X_RANGE_16_G = 0b11, ADXL34X_RANGE_8_G = 0b10, ADXL34X_RANGE_4_G = 0b01, ADXL34X_RANGE_2_G = 0b00
}
 
enum  adxl3xx_int_pin { ADXL343_INT1 = 0, ADXL343_INT2 = 1, ADXL3XX_INT1 = 0, ADXL3XX_INT2 = 1 }
 

Detailed Description

Author
Bryan Siepert and K. Townsend (Adafruit Industries)

BSD license (see license.txt)

This is a library for the Adafruit ADS1015 breakout board -—> https://www.adafruit.com/products/???

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

v1.0 - First release

Macro Definition Documentation

◆ ADXL343_ADDRESS

#define ADXL343_ADDRESS   (0x53)

Assumes ALT address pin low

◆ ADXL3XX_REG_DEVID

#define ADXL3XX_REG_DEVID   (0x00)

Device ID

◆ ADXL3XX_REG_THRESH_TAP

#define ADXL3XX_REG_THRESH_TAP   (0x1D)

Tap threshold

◆ ADXL3XX_REG_OFSX

#define ADXL3XX_REG_OFSX   (0x1E)

X-axis offset

◆ ADXL3XX_REG_OFSY

#define ADXL3XX_REG_OFSY   (0x1F)

Y-axis offset

◆ ADXL3XX_REG_OFSZ

#define ADXL3XX_REG_OFSZ   (0x20)

Z-axis offset

◆ ADXL3XX_REG_DUR

#define ADXL3XX_REG_DUR   (0x21)

Tap duration

◆ ADXL3XX_REG_LATENT

#define ADXL3XX_REG_LATENT   (0x22)

Tap latency

◆ ADXL3XX_REG_WINDOW

#define ADXL3XX_REG_WINDOW   (0x23)

Tap window

◆ ADXL3XX_REG_THRESH_ACT

#define ADXL3XX_REG_THRESH_ACT   (0x24)

Activity threshold

◆ ADXL3XX_REG_THRESH_INACT

#define ADXL3XX_REG_THRESH_INACT   (0x25)

Inactivity threshold

◆ ADXL3XX_REG_TIME_INACT

#define ADXL3XX_REG_TIME_INACT   (0x26)

Inactivity time

◆ ADXL3XX_REG_ACT_INACT_CTL

#define ADXL3XX_REG_ACT_INACT_CTL   (0x27)

Axis enable control for activity and inactivity detection

◆ ADXL3XX_REG_THRESH_FF

#define ADXL3XX_REG_THRESH_FF   (0x28)

Free-fall threshold

◆ ADXL3XX_REG_TIME_FF

#define ADXL3XX_REG_TIME_FF   (0x29)

Free-fall time

◆ ADXL3XX_REG_TAP_AXES

#define ADXL3XX_REG_TAP_AXES   (0x2A)

Axis control for single/double tap

◆ ADXL3XX_REG_ACT_TAP_STATUS

#define ADXL3XX_REG_ACT_TAP_STATUS   (0x2B)

Source for single/double tap

◆ ADXL3XX_REG_BW_RATE

#define ADXL3XX_REG_BW_RATE   (0x2C)

Data rate and power mode control

◆ ADXL3XX_REG_POWER_CTL

#define ADXL3XX_REG_POWER_CTL   (0x2D)

Power-saving features control

◆ ADXL3XX_REG_INT_ENABLE

#define ADXL3XX_REG_INT_ENABLE   (0x2E)

Interrupt enable control

◆ ADXL3XX_REG_INT_MAP

#define ADXL3XX_REG_INT_MAP   (0x2F)

Interrupt mapping control

◆ ADXL3XX_REG_INT_SOURCE

#define ADXL3XX_REG_INT_SOURCE   (0x30)

Source of interrupts

◆ ADXL3XX_REG_DATA_FORMAT

#define ADXL3XX_REG_DATA_FORMAT   (0x31)

Data format control

◆ ADXL3XX_REG_DATAX0

#define ADXL3XX_REG_DATAX0   (0x32)

X-axis data 0

◆ ADXL3XX_REG_DATAX1

#define ADXL3XX_REG_DATAX1   (0x33)

X-axis data 1

◆ ADXL3XX_REG_DATAY0

#define ADXL3XX_REG_DATAY0   (0x34)

Y-axis data 0

◆ ADXL3XX_REG_DATAY1

#define ADXL3XX_REG_DATAY1   (0x35)

Y-axis data 1

◆ ADXL3XX_REG_DATAZ0

#define ADXL3XX_REG_DATAZ0   (0x36)

Z-axis data 0

◆ ADXL3XX_REG_DATAZ1

#define ADXL3XX_REG_DATAZ1   (0x37)

Z-axis data 1

◆ ADXL3XX_REG_FIFO_CTL

#define ADXL3XX_REG_FIFO_CTL   (0x38)

FIFO control

◆ ADXL3XX_REG_FIFO_STATUS

#define ADXL3XX_REG_FIFO_STATUS   (0x39)

FIFO status

◆ ADXL343_MG2G_MULTIPLIER

#define ADXL343_MG2G_MULTIPLIER   (0.004)

4mg per lsb

Enumeration Type Documentation

◆ adxl3xx_dataRate_t

Used with register 0x2C (ADXL3XX_REG_BW_RATE) to set bandwidth

Enumerator
ADXL343_DATARATE_3200_HZ 

3200Hz Bandwidth

ADXL343_DATARATE_1600_HZ 

1600Hz Bandwidth

ADXL343_DATARATE_800_HZ 

800Hz Bandwidth

ADXL343_DATARATE_400_HZ 

400Hz Bandwidth

ADXL343_DATARATE_200_HZ 

200Hz Bandwidth

ADXL343_DATARATE_100_HZ 

100Hz Bandwidth

ADXL343_DATARATE_50_HZ 

50Hz Bandwidth

ADXL343_DATARATE_25_HZ 

25Hz Bandwidth

ADXL343_DATARATE_12_5_HZ 

12.5Hz Bandwidth

ADXL343_DATARATE_6_25HZ 

6.25Hz Bandwidth

ADXL343_DATARATE_3_13_HZ 

3.13Hz Bandwidth

ADXL343_DATARATE_1_56_HZ 

1.56Hz Bandwidth

ADXL343_DATARATE_0_78_HZ 

0.78Hz Bandwidth

ADXL343_DATARATE_0_39_HZ 

0.39Hz Bandwidth

ADXL343_DATARATE_0_20_HZ 

0.20Hz Bandwidth

ADXL343_DATARATE_0_10_HZ 

0.10Hz Bandwidth (default value)

ADXL3XX_DATARATE_3200_HZ 

3200Hz Bandwidth

ADXL3XX_DATARATE_1600_HZ 

1600Hz Bandwidth

ADXL3XX_DATARATE_800_HZ 

800Hz Bandwidth

ADXL3XX_DATARATE_400_HZ 

400Hz Bandwidth

ADXL3XX_DATARATE_200_HZ 

200Hz Bandwidth

ADXL3XX_DATARATE_100_HZ 

100Hz Bandwidth

ADXL3XX_DATARATE_50_HZ 

50Hz Bandwidth

ADXL3XX_DATARATE_25_HZ 

25Hz Bandwidth

ADXL3XX_DATARATE_12_5_HZ 

12.5Hz Bandwidth

ADXL3XX_DATARATE_6_25HZ 

6.25Hz Bandwidth

ADXL3XX_DATARATE_3_13_HZ 

3.13Hz Bandwidth

ADXL3XX_DATARATE_1_56_HZ 

1.56Hz Bandwidth

ADXL3XX_DATARATE_0_78_HZ 

0.78Hz Bandwidth

ADXL3XX_DATARATE_0_39_HZ 

0.39Hz Bandwidth

ADXL3XX_DATARATE_0_20_HZ 

0.20Hz Bandwidth

ADXL3XX_DATARATE_0_10_HZ 

0.10Hz Bandwidth (default value)

◆ adxl34x_range_t

Used with register 0x31 (ADXL3XX_REG_DATA_FORMAT) to set g range

Enumerator
ADXL343_RANGE_16_G 

+/- 16g

ADXL343_RANGE_8_G 

+/- 8g

ADXL343_RANGE_4_G 

+/- 4g

ADXL343_RANGE_2_G 

+/- 2g (default value)

ADXL34X_RANGE_16_G 

+/- 16g

ADXL34X_RANGE_8_G 

+/- 8g

ADXL34X_RANGE_4_G 

+/- 4g

ADXL34X_RANGE_2_G 

+/- 2g (default value)

◆ adxl3xx_int_pin

Possible interrupt pin outputs on the ADXL343.