-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAccelerometer.h
58 lines (51 loc) · 1.53 KB
/
Accelerometer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Accelerometer.h
*
* Created on: Mar 31, 2016
* Author: student
*/
#ifndef ACCELEROMETER_H_
#define ACCELEROMETER_H_
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* XOUT
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Device : Accelerometer (ADXL330)
* Polarity : Active High
* PCB Device : U2
* PCB TP : TP U14 (Red, Top Left)
* GPIO : P1.0
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#define XOUT_BIT BIT0
#define XOUT_PORT P1OUT
#define XOUT_DDR P1DIR
#define SET_XOUT_AS_INPUT XOUT_DDR &= ~XOUT_BIT
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* YOUT
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Device : Accelerometer (ADXL330)
* Polarity : Active High
* PCB Device : U2
* PCB TP : TP U7 (White, Top Left)
* GPIO : P1.1
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#define YOUT_BIT BIT1
#define YOUT_PORT P1OUT
#define YOUT_DDR P1DIR
#define SET_YOUT_AS_INPUT YOUT_DDR &= ~YOUT_BIT
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ZOUT
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Device : Accelerometer (ADXL330)
* Polarity : Active High
* PCB Device : U2
* PCB TP : TP U8 (Yellow, Bottom Left)
* GPIO : P1.2
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#define ZOUT_BIT BIT2
#define ZOUT_PORT P1OUT
#define ZOUT_DDR P1DIR
#define SET_ZOUT_AS_INPUT YOUT_DDR &= ~ZOUT_BIT
#endif /* ACCELEROMETER_H_ */