Loading...
Searching...
No Matches

Interface definition for the ADXL345. More...

Detailed Description

Interface definition for the ADXL345.

Author
Dylan Laduranty dylan.nosp@m..lad.nosp@m.urant.nosp@m.y@me.nosp@m.sotic.nosp@m..com

Definition in file adxl345.h.

#include "periph/i2c.h"
#include "periph/gpio.h"
+ Include dependency graph for adxl345.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  adxl345_data_t
 ADXL345 result vector struct. More...
 
struct  adxl345_interrupt_t
 Interrupt configuration struct for the ADXL345 sensor. More...
 
struct  adxl345_params_t
 Configuration struct for the ADXL345 sensor. More...
 
struct  adxl345_t
 Device descriptor for the ADXL345 sensor. More...
 

Enumerations

enum  { ADXL345_ADDR_1D = 0x1D , ADXL345_ADDR_53 = 0x53 }
 Possible ADXL345 hardware addresses (wiring specific) More...
 
enum  { ADXL345_MEASURE_MODE , ADXL345_STANDBY_MODE , ADXL345_SLEEP_MODE , ADXL345_AUTOSLEEP_MODE }
 List ADXL345 power mode. More...
 
enum  { ADXL345_RANGE_2G = 0 , ADXL345_RANGE_4G = 1 , ADXL345_RANGE_8G = 2 , ADXL345_RANGE_16G = 3 }
 Define ADXL345 sensitivity. More...
 
enum  {
  ADXL345_RATE_0HZ1 = 0 , ADXL345_RATE_0HZ2 = 1 , ADXL345_RATE_0HZ39 = 2 , ADXL345_RATE_0HZ78 = 3 ,
  ADXL345_RATE_1HZ56 = 4 , ADXL345_RATE_3HZ13 = 5 , ADXL345_RATE_6HZ25 = 6 , ADXL345_RATE_12HZ50 = 7 ,
  ADXL345_RATE_25HZ = 8 , ADXL345_RATE_50HZ = 9 , ADXL345_RATE_100HZ = 10 , ADXL345_RATE_200HZ = 11 ,
  ADXL345_RATE_400HZ = 12 , ADXL345_RATE_800HZ = 13 , ADXL345_RATE_1600HZ = 14 , ADXL345_RATE_3200HZ = 15
}
 List bandwidth rate. More...
 
enum  { ADXL345_BYPASS = 0 , ADXL345_FIFO = 1 , ADXL345_STREAM = 2 , ADXL345_TRIGGER = 3 }
 List fifo mode. More...
 
enum  { ADXL345_INT1 , ADXL345_INT2 }
 Output Interrupt selection. More...
 
enum  {
  ADXL345_OK = 0 , ADXL345_DATA_READY = 1 , ADXL345_NOI2C = -1 , ADXL345_NODEV = -2 ,
  ADXL345_NODATA = -3
}
 Named return values. More...
 

Functions

int adxl345_init (adxl345_t *dev, const adxl345_params_t *params)
 Initialize the ADXL345 accelerometer driver.
 
void adxl345_read (const adxl345_t *dev, adxl345_data_t *data)
 Read accelerometer's data.
 
void adxl345_set_interrupt (const adxl345_t *dev)
 set ADXL345's interrupts configuration
 
void adxl345_set_measure (const adxl345_t *dev)
 set ADXL345's measure mode
 
void adxl345_set_standby (const adxl345_t *dev)
 Set standby mode.
 
void adxl345_set_sleep (const adxl345_t *dev)
 Set sleep mode.
 
void adxl345_set_autosleep (const adxl345_t *dev)
 Set autosleep mode.
 
void adxl345_set_bandwidth_rate (const adxl345_t *dev, uint8_t bw_rate)
 Set bandwidth rate.
 
void adxl345_set_fifo_mode (const adxl345_t *dev, uint8_t mode, uint8_t output, uint8_t value)
 Set fifo mode with its configuration.