MRAS
Multi Rocket Avionics System
Loading...
Searching...
No Matches
ADXL375.h
1#ifndef ARDUINO_ADXL375_ADXL375_H
2#define ARDUINO_ADXL375_ADXL375_H
3
4#include "Arduino.h"
5#include "Wire.h"
6#include "SPI.h"
7#include "protocol.h"
8#include "ADXL375_register.h"
9#include "ADXL375_constants.h"
10#include "Vector.h"
11#include "DynamicFifo.h"
12
13#define ADXL375_ACC_CONVERSION_FACTOR 0.00981 * 49
14
15class ADXL375 {
16protected:
17
18 protocol *device;
19
20public:
21 /*
22 * @brief Constructor overload for I2C protocol
23 * @param pipe
24 * @param freq
25 */
26 ADXL375(TwoWire *pipe, uint32_t freq);
27
28 /*
29 * @brief Constructor overload for SPI protocol
30 * @param chipSelect
31 * @param spi
32 * @param settings
33 */
34 ADXL375(byte chipSelect, SPIClass& spi, uint32_t freq);
35
36 /*
37 * @brief begin the device
38 */
39 void begin() {
40 device->protocol_begin();
41 default_configuration();
42 // any other set up etc
43
44 }
45
46 byte who_am_i();
47
48 uint8_t set_spi_mode(bool enable);
49
50 uint8_t set_INTERRUPT(int bit_num, bool set_pin, ADXL375_INTERRUPTS interrupt, bool enable);
51
52 uint8_t set_low_DATA_RATE(ADXL375_Low_power_ODR rate);
53
63 uint8_t set_data_rate(ADXL375_ODR rate);
64
65 uint8_t set_measure_mode(bool enable);
66
67 uint8_t ac_coupled_mode(bool enable);
68
69 uint8_t set_fifo_mode(ADXL375_FIFO_MODES mode);
70
71 uint8_t default_configuration();
72
77 float self_test();
78
79 Vector<double, 3> get_accel();
80
81 protocol* get_device() {
82 return device;
83 }
84
89 uint8_t reset();
90};
91
92
93
94
95
96//uint8_t set_adxl_ODR(ADXL375_ODR rate);
97//uint8_t low_power_mode();
98//uint8_t auto_sleep_mode();
99//uint8_t standby_mode();
100//uint8_t set_FIFO_mode(ADXL375_FIFO_MODES mode);
101//uint8_t adxl_self_test();
102//
103//
104//
105//class Activity{
106//
107// public:
108// //- Value of zero is true any other value is false is the convention
109//
110// uint8_t THRESH_SHOCK(bool enable);//Will return true or false
111//
112// uint8_t ACT_INACT_CTL(bool enable);//Will return true or false
113//
114// uint8_t ACT_SHOCK_STATUS(bool enable);
115// // Will be used to validate if the shock and activity returned by the above functions in the class
116//
117//
118//};
119//
120// uint8_t BW_RATE(bool enable); // Controls the device bandwidth and output data rate
121// uint8_t POWER_CTL(bool enable);//Controls if the sensor is measuring, sleeping or awake based on the activity class output
122//
124//
125// //public:
126// uint8_t DATA_FORMAT(bool enable);//Controls the presentation of data to register 0x32 through 0x37
127// uint8_t OUTPUT_DATA();//This class can be called for each axes to get output for each axes
129//
130// uint8_t get_offset(bool enable);
133// //returns the offset value based on the register specified.
134//
135//
136// //uint8_t calculate_acc_data();
137// //Calculates acceleration data for any axes based on the register specified
138//
139//
140//
141//
142
143#endif
144
145
146
147
148
149
150
151
152
153
Definition: ADXL375.h:15
float self_test()
Definition: ADXL375.cpp:123
uint8_t reset()
Definition: ADXL375.cpp:100
uint8_t set_data_rate(ADXL375_ODR rate)
Definition: ADXL375.cpp:36