18 #ifndef _ADAFRUIT_SENSOR_ADXL343_H 19 #define _ADAFRUIT_SENSOR_ADXL343_H 27 #include <Adafruit_BusIO_Register.h> 28 #include <Adafruit_I2CDevice.h> 29 #include <Adafruit_SPIDevice.h> 30 #include <Adafruit_Sensor.h> 36 #define ADXL343_ADDRESS (0x53) 42 #define ADXL3XX_REG_DEVID (0x00) 43 #define ADXL3XX_REG_THRESH_TAP (0x1D) 44 #define ADXL3XX_REG_OFSX (0x1E) 45 #define ADXL3XX_REG_OFSY (0x1F) 46 #define ADXL3XX_REG_OFSZ (0x20) 47 #define ADXL3XX_REG_DUR (0x21) 48 #define ADXL3XX_REG_LATENT (0x22) 49 #define ADXL3XX_REG_WINDOW (0x23) 50 #define ADXL3XX_REG_THRESH_ACT (0x24) 51 #define ADXL3XX_REG_THRESH_INACT (0x25) 52 #define ADXL3XX_REG_TIME_INACT (0x26) 53 #define ADXL3XX_REG_ACT_INACT_CTL \ 55 #define ADXL3XX_REG_THRESH_FF (0x28) 56 #define ADXL3XX_REG_TIME_FF (0x29) 57 #define ADXL3XX_REG_TAP_AXES (0x2A) 58 #define ADXL3XX_REG_ACT_TAP_STATUS (0x2B) 59 #define ADXL3XX_REG_BW_RATE (0x2C) 60 #define ADXL3XX_REG_POWER_CTL (0x2D) 61 #define ADXL3XX_REG_INT_ENABLE (0x2E) 62 #define ADXL3XX_REG_INT_MAP (0x2F) 63 #define ADXL3XX_REG_INT_SOURCE (0x30) 64 #define ADXL3XX_REG_DATA_FORMAT (0x31) 65 #define ADXL3XX_REG_DATAX0 (0x32) 66 #define ADXL3XX_REG_DATAX1 (0x33) 67 #define ADXL3XX_REG_DATAY0 (0x34) 68 #define ADXL3XX_REG_DATAY1 (0x35) 69 #define ADXL3XX_REG_DATAZ0 (0x36) 70 #define ADXL3XX_REG_DATAZ1 (0x37) 71 #define ADXL3XX_REG_FIFO_CTL (0x38) 72 #define ADXL3XX_REG_FIFO_STATUS (0x39) 78 #define ADXL343_MG2G_MULTIPLIER (0.004) 162 int32_t sensorID = -1);
170 bool getEvent(sensors_event_t *);
171 void getSensor(sensor_t *);
173 uint8_t getDeviceID(
void);
174 void writeRegister(uint8_t reg, uint8_t
value);
175 uint8_t readRegister(uint8_t reg);
176 int16_t read16(uint8_t reg);
180 uint8_t checkInterrupts(
void);
182 void getTrimOffsets(int8_t *x, int8_t *y, int8_t *z);
183 void setTrimOffsets(int8_t x, int8_t y, int8_t z);
188 bool getXYZ(int16_t &x, int16_t &y, int16_t &z);
191 Adafruit_SPIDevice *spi_dev = NULL;
192 Adafruit_I2CDevice *i2c_dev = NULL;
194 TwoWire *_wire = NULL;
195 SPIClass *_spi = NULL;
uint8_t value
Definition: Adafruit_ADXL343.h:133
uint8_t single_tap
Definition: Adafruit_ADXL343.h:141
Definition: Adafruit_ADXL343.h:126
Definition: Adafruit_ADXL343.h:132
uint8_t inactivity
Definition: Adafruit_ADXL343.h:138
Definition: Adafruit_ADXL343.h:107
Definition: Adafruit_ADXL343.h:110
Definition: Adafruit_ADXL343.h:90
#define ADXL343_ADDRESS
Definition: Adafruit_ADXL343.h:36
Definition: Adafruit_ADXL343.h:93
uint8_t data_ready
Definition: Adafruit_ADXL343.h:142
adxl34x_range_t _range
cache of range
Definition: Adafruit_ADXL343.h:197
Definition: Adafruit_ADXL343.h:128
Definition: Adafruit_ADXL343.h:106
Definition: Adafruit_ADXL343.h:112
uint8_t freefall
Definition: Adafruit_ADXL343.h:137
adxl34x_range_t
Definition: Adafruit_ADXL343.h:119
Definition: Adafruit_ADXL343.h:123
Definition: Adafruit_ADXL343.h:125
Definition: Adafruit_ADXL343.h:115
Definition: Adafruit_ADXL343.h:94
uint8_t watermark
Definition: Adafruit_ADXL343.h:136
uint8_t double_tap
Definition: Adafruit_ADXL343.h:140
Definition: Adafruit_ADXL343.h:97
Definition: Adafruit_ADXL343.h:109
Definition: Adafruit_ADXL343.h:114
Definition: Adafruit_ADXL343.h:88
Definition: Adafruit_ADXL343.h:102
struct int_config::@0 bits
Definition: Adafruit_ADXL343.h:85
adxl3xx_dataRate_t
Definition: Adafruit_ADXL343.h:82
Definition: Adafruit_ADXL343.h:83
Definition: Adafruit_ADXL343.h:103
Definition: Adafruit_ADXL343.h:113
Definition: Adafruit_ADXL343.h:86
adxl3xx_int_pin
Definition: Adafruit_ADXL343.h:147
uint8_t _do
SPI software data out.
Definition: Adafruit_ADXL343.h:198
Definition: Adafruit_ADXL343.h:111
Definition: Adafruit_ADXL343.h:87
Definition: Adafruit_ADXL343.h:98
Definition: Adafruit_ADXL343.h:104
Definition: Adafruit_ADXL343.h:95
uint8_t activity
Definition: Adafruit_ADXL343.h:139
Definition: Adafruit_ADXL343.h:157
uint8_t overrun
Definition: Adafruit_ADXL343.h:135
Definition: Adafruit_ADXL343.h:120
Definition: Adafruit_ADXL343.h:89
Definition: Adafruit_ADXL343.h:105
Definition: Adafruit_ADXL343.h:96
Definition: Adafruit_ADXL343.h:84
Definition: Adafruit_ADXL343.h:121
Definition: Adafruit_ADXL343.h:100
Definition: Adafruit_ADXL343.h:92
Definition: Adafruit_ADXL343.h:122
Definition: Adafruit_ADXL343.h:101
Definition: Adafruit_ADXL343.h:108
int32_t _sensorID
User-set sensor identifier.
Definition: Adafruit_ADXL343.h:196
Definition: Adafruit_ADXL343.h:91
Definition: Adafruit_ADXL343.h:127