Contiki-Inga 3.x
|
ADXL345 Accelerometer interface definitionsMore...
Go to the source code of this file.
Macros | |
#define | ADXL345_CS 2 |
#define | ADXL345_DEVICE_ID_REG 0x00 |
Device ID Register. | |
#define | ADXL345_OUTX_LOW_REG 0x32 |
x Acceleration Data register (high) | |
#define | ADXL345_OUTX_HIGH_REG 0x33 |
x Acceleration Data register (low) | |
#define | ADXL345_OUTY_LOW_REG 0x34 |
y Acceleration Data register (high) | |
#define | ADXL345_OUTY_HIGH_REG 0x35 |
y Acceleration Data register (low) | |
#define | ADXL345_OUTZ_LOW_REG 0x36 |
z Acceleration Data register (high) | |
#define | ADXL345_OUTZ_HIGH_REG 0x37 |
z Acceleration Data register (low) | |
#define | adxl345_raw_to_mg(raw) (raw * 62) / 16; |
Convert raw value to mg value. | |
BW_RATE register/bits | |
#define | ADXL345_BW_RATE_REG 0x2C |
ADXL Data Rate and Power Mode Control Register. More... | |
#define | ADXL345_LOW_POWER 4 |
Low power bit pos. More... | |
#define | ADXL345_RATE_L 0 |
Rate bits [4] pos. More... | |
POWER_CTL register/bits | |
#define | ADXL345_POWER_CTL_REG 0x2D |
ADXL Power Control Register. More... | |
#define | ADXL345_LINK 5 |
Link bit pos. More... | |
#define | ADXL345_AUTO_SLEEP 4 |
AUTO_SLEEP bit pos. More... | |
#define | ADXL345_MEASURE 3 |
Measure bit pos. More... | |
#define | ADXL345_SLEEP 2 |
Sleep bit pos. More... | |
#define | ADXL345_WAKEUP_L 0 |
Wakeup bits [2] LSB pos. More... | |
DATA_FORMAT register/bits | |
#define | ADXL345_DATA_FORMAT_REG 0x31 |
ADXL Data Format Register Register. More... | |
#define | ADXL345_SELF_TEST 7 |
SELF_TEST bit pos. More... | |
#define | ADXL345_SPI 6 |
SPI bit pos. More... | |
#define | ADXL345_INT_INVERT 5 |
INT_INVERT bit pos. More... | |
#define | ADXL345_FULL_RES 3 |
FULL_RES bit pos. More... | |
#define | ADXL345_JUSTIFY 2 |
Justify bit pos. More... | |
#define | ADXL345_RANGE_L 0 |
Range bits [2] LSB pos. More... | |
FIFO_CTL register/bits | |
#define | ADXL345_FIFO_CTL_REG 0x38 |
FIFO control register. | |
#define | ADXL345_FIFO_MODE_L 6 |
FIFO_MODE bits [2] LSB pos. More... | |
#define | ADXL345_TRIGGER 5 |
Trigger bit pos. More... | |
#define | ADXL345_SAMPLES_L 0 |
Samples bits [5] LSB pos. More... | |
FIFO_STATUS register/bits | |
#define | ADXL345_FIFO_STATUS_REG 0x39 |
FIFO status register. | |
#define | ADXL345_FIFO_TRIG 7 |
FIFO_TRIG bit pos. More... | |
#define | ADXL345_ENTRIES_L 0 |
Entries bits [6] LSB pos. More... | |
g range settings | |
#define | ADXL345_MODE_2G (0x0 << ADXL345_RANGE_L) |
+/- 2g, 256 LSB/g | |
#define | ADXL345_MODE_4G (0x1 << ADXL345_RANGE_L) |
+/- 4g, 128 LSB/g | |
#define | ADXL345_MODE_8G (0x2 << ADXL345_RANGE_L) |
+/- 8g, 64 LSB/g | |
#define | ADXL345_MODE_16G (0x3 << ADXL345_RANGE_L) |
+/- 16g, 32 LSB/g | |
FIFO mode settings | |
#define | ADXL345_MODE_BYPASS (0x0 << ADXL345_FIFO_MODE_L) |
#define | ADXL345_MODE_FIFO (0x1 << ADXL345_FIFO_MODE_L) |
#define | ADXL345_MODE_STREAM (0x2 << ADXL345_FIFO_MODE_L) |
#define | ADXL345_MODE_TRIGGER (0x3 << ADXL345_FIFO_MODE_L) |
Power mode settings | |
#define | ADXL345_PMODE_SLEEP 1 |
#define | ADXL345_PMODE_WAKEUP 3 |
#define | ADXL345_PMODE_STANDBY 4 |
Values for output data rate | |
| |
#define | ADXL345_ODR_0HZ10 (0x0 << ADXL345_RATE_L) |
#define | ADXL345_ODR_0HZ20 (0x1 << ADXL345_RATE_L) |
#define | ADXL345_ODR_0HZ39 (0x2 << ADXL345_RATE_L) |
#define | ADXL345_ODR_0HZ78 (0x3 << ADXL345_RATE_L) |
#define | ADXL345_ODR_1HZ56 (0x4 << ADXL345_RATE_L) |
#define | ADXL345_ODR_3HZ13 (0x5 << ADXL345_RATE_L) |
#define | ADXL345_ODR_6HZ25 (0x6 << ADXL345_RATE_L) |
#define | ADXL345_ODR_12HZ5 (0x7 << ADXL345_RATE_L) |
#define | ADXL345_ODR_25HZ (0x8 << ADXL345_RATE_L) |
#define | ADXL345_ODR_50HZ (0x9 << ADXL345_RATE_L) |
#define | ADXL345_ODR_100HZ (0xA << ADXL345_RATE_L) |
#define | ADXL345_ODR_200HZ (0xB << ADXL345_RATE_L) |
#define | ADXL345_ODR_400HZ (0xC << ADXL345_RATE_L) |
#define | ADXL345_ODR_800HZ (0xD << ADXL345_RATE_L) |
#define | ADXL345_ODR_1600HZ (0xE << ADXL345_RATE_L) |
#define | ADXL345_ODR_3200HZ (0xF << ADXL345_RATE_L) |
Functions | |
int8_t | adxl345_available (void) |
Checks if ADXL345 is available. More... | |
int8_t | adxl345_init (void) |
Initialize the ADXL345 accelerometer. More... | |
void | adxl345_deinit (void) |
Deinitilizes the ADX345 accelerometer. More... | |
int8_t | adxl345_ready (void) |
Checks whether the device is ready or not by reading the ID. More... | |
void | adxl345_set_g_range (uint8_t range) |
void | adxl345_set_data_rate (uint8_t rate) |
void | adxl345_set_fifomode (uint8_t mode) |
void | adxl345_set_powermode (uint8_t mode) |
uint8_t | adxl345_get_fifo_level () |
Returns the current fill level of the internal FIFO (when operating in FIFO/Stream mode). More... | |
int16_t | adxl345_get_x (void) |
This function returns the current measured acceleration at the x-axis of the adxl345. More... | |
int16_t | adxl345_get_y (void) |
This function returns the current measured acceleration at the y-axis of the adxl345. More... | |
int16_t | adxl345_get_z (void) |
This function returns the current measured acceleration at the z-axis of the adxl345. More... | |
acc_data_t | adxl345_get (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... | |
ADXL345 Accelerometer interface definitions
Definition in file adxl345.h.