roverSTM
UM2 2013
Projet M1 Navarro Benjamin
Main Page
Modules
Classes
Files
File List
File Members
All
Classes
Files
Functions
Groups
Pages
Libraries
MyLib
ADXL345.h
1
/*
2
* ADXL345.h
3
*
4
* Created on: 9 fŽvr. 2013
5
* Author: Benjamin Navarro
6
*/
7
8
#ifndef ADXL345_H_
9
#define ADXL345_H_
10
11
#include <stm32f4xx.h>
12
#include <math.h>
13
#include <string>
14
#include <iostream>
15
16
#include "MyLib.h"
17
#include "I2CDevice.h"
18
19
using namespace
std ;
20
21
class
ADXL345
:
public
I2CDevice
{
22
public
:
23
24
ADXL345
(I2C_TypeDef* I2C_Port, uint8_t address = 0xA6, uint32_t speed = 100000);
25
26
int16x3
getRawData();
27
floatx3
getGValues();
28
rollpitch
getRollPitch();
29
30
31
private
:
32
enum
registers {
33
DEVID = 0x00,
34
THRESH_TAP = 0x1D,
35
OFSX = 0x1E,
36
OFSY = 0x1F,
37
OFSZ = 0x20,
38
DUR = 0x21,
39
Latent = 0x22,
40
Window = 0x23,
41
THRESH_ACT = 0x24,
42
THRESH_INACT = 0x25,
43
TIME_INACT = 0x26,
44
ACT_INACT_CTL = 0x27,
45
THRESH_FF = 0x28,
46
TIME_FF = 0x29,
47
TAP_AXES = 0x2A,
48
ACT_TAP_STATUS = 0x2B,
49
BW_RATE = 0x2C,
50
POWER_CTL = 0x2D,
51
INT_ENABLE = 0x2E,
52
INT_MAP = 0x2F,
53
INT_SOURCE = 0x30,
54
DATA_FORMAT = 0x31,
55
DATAX0 = 0x32,
56
DATAX1 = 0x33,
57
DATAY0 = 0x34,
58
DATAY1 = 0x35,
59
DATAZ0 = 0x36,
60
DATAZ1 = 0x37,
61
FIFO_CTL = 0x38,
62
FIFO_STATUS = 0x39,
63
};
64
65
float
scale;
66
};
67
68
69
#endif
/* ADXL345_H_ */
Generated on Thu Mar 28 2013 11:31:09 for roverSTM by
1.8.3.1