Contiki 2.5
Macros | Functions
acc-adxl345.h File Reference

    ADXL345 Accelerometer interface definitions
More...

#include "../drv/mspi-drv.h"
#include <stdio.h>
#include <util/delay.h>

Go to the source code of this file.

Macros

#define ADXL345_CS   2
 
#define ADXL345_DATA_FORMAT_REG   0x31
 
#define ADXL345_DATA_FORMAT_DATA   0x00
 
#define ADXL345_POWER_CTL_REG   0x2D
 
#define ADXL345_POWER_CTL_DATA   0x08
 
#define ADXL345_BW_RATE_REG   0x2C
 
#define ADXL345_BW_RATE_DATA   0x0A
 

Functions

int8_t adxl345_init (void)
 Initialize the ADXL345 Acceleration Sensor. More...
 
uint16_t adxl345_get_x_acceleration (void)
 This function returns the current measured acceleration at the x-axis of the adxl345. More...
 
uint16_t adxl345_get_y_acceleration (void)
 This function returns the current measured acceleration at the y-axis of the adxl345. More...
 
uint16_t adxl345_get_z_acceleration (void)
 This function returns the current measured acceleration at the z-axis of the adxl345. More...
 
acc_data_t adxl345_get_acceleration (void)
 This function returns the current measured acceleration of all axis (x,y,z) More...
 
void adxl345_write (uint8_t reg, uint8_t data)
 This function writes data to the given register of the ADXL345. More...
 
uint8_t adxl345_read (uint8_t reg)
 This function reads from the given register of the ADXL345. More...
 

Detailed Description

    ADXL345 Accelerometer interface definitions
Author
Ulf Kulau kulau.nosp@m.@ibr.nosp@m..cs.t.nosp@m.u-bs.nosp@m..de

Definition in file acc-adxl345.h.