-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathADXL362.h
72 lines (52 loc) · 1.69 KB
/
ADXL362.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
Arduino Library for Analog Devices ADXL362 - Micropower 3-axis accelerometer
go to http://www.analog.com/ADXL362 for datasheet
License: CC BY-SA 3.0: Creative Commons Share-alike 3.0. Feel free
to use and abuse this code however you'd like. If you find it useful
please attribute, and SHARE-ALIKE!
Created June 2012
by Anne Mahaffey - hosted on http://annem.github.com/ADXL362
Modified May 2013
by Jonathan Ruiz de Garibay
*/
#include "Arduino.h"
#ifndef ADXL362_h
#define ADXL362_h
class ADXL362
{
public:
ADXL362();
//
// Basic Device control and readback functions
//
void begin(int16_t chipSelectPin = 10);
void beginMeasure();
int16_t readXData();
int16_t readYData();
int16_t readZData();
void readXYZTData(int16_t &XData, int16_t &YData, int16_t &ZData, int16_t &Temperature);
int16_t readTemp();
//
// Activity/Inactivity interrupt functions
//
void setupDCActivityInterrupt(int16_t threshold, byte time);
void setupDCInactivityInterrupt(int16_t threshold, int16_t time);
void setupACActivityInterrupt(int16_t threshold, byte time);
void setupACInactivityInterrupt(int16_t threshold, int16_t time);
// need to add the following functions
// void mapINT1(
// void mapINT2
// void autoSleep
// void activityInterruptControl
// -Activity, Inactivity, Both
// - Referenced, Absolute
// - Free Fall, Linked Mode, Loop Mode
void checkAllControlRegs();
// Low-level SPI control, to simplify overall coding
byte SPIreadOneRegister(byte regAddress);
void SPIwriteOneRegister(byte regAddress, byte regValue);
int16_t SPIreadTwoRegisters(byte regAddress);
void SPIwriteTwoRegisters(byte regAddress, int16_t twoRegValue);
private:
};
#endif