Skyward boardcore
Loading...
Searching...
No Matches
InternalADCData.h
Go to the documentation of this file.
1
/* Copyright (c) 2021 Skyward Experimental Rocketry
2
* Author: Alberto Nidasio
3
*
4
* Permission is hereby granted, free of charge, to any person obtaining a copy
5
* of this software and associated documentation files (the "Software"), to deal
6
* in the Software without restriction, including without limitation the rights
7
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
* copies of the Software, and to permit persons to whom the Software is
9
* furnished to do so, subject to the following conditions:
10
*
11
* The above copyright notice and this permission notice shall be included in
12
* all copies or substantial portions of the Software.
13
*
14
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
* THE SOFTWARE.
21
*/
22
23
#pragma once
24
25
#include <
sensors/SensorData.h
>
26
27
namespace
Boardcore
28
{
29
30
struct
InternalADCData
31
{
32
uint64_t
timestamp
= 0;
33
float
voltage
[16];
34
float
temperature
;
35
float
vBat
;
36
37
InternalADCData
() :
voltage
(),
temperature
(),
vBat
() {}
38
39
static
std::string
header
()
40
{
41
return
"timestamp,voltage_0,voltage_1,voltage_2,voltage_3,voltage_4,"
42
"voltage_5,voltage_6,voltage_7,voltage_8,voltage_9,voltage_10,"
43
"voltage_11,voltage_12,voltage_13,voltage_14,voltage_15,"
44
"temperature,vBat\n"
;
45
}
46
47
void
print
(std::ostream& os)
const
48
{
49
os <<
timestamp
<<
","
;
50
51
for
(
int
i = 0; i < 16; i++)
52
os <<
voltage
[i] <<
","
;
53
54
os <<
temperature
<<
","
<<
vBat
<<
"\n"
;
55
}
56
};
57
58
}
// namespace Boardcore
SensorData.h
Boardcore
This file includes all the types the logdecoder script will decode.
Definition
ActiveObject.h:31
Boardcore::InternalADCData
Definition
InternalADCData.h:31
Boardcore::InternalADCData::InternalADCData
InternalADCData()
Definition
InternalADCData.h:37
Boardcore::InternalADCData::vBat
float vBat
Definition
InternalADCData.h:35
Boardcore::InternalADCData::header
static std::string header()
Definition
InternalADCData.h:39
Boardcore::InternalADCData::timestamp
uint64_t timestamp
Definition
InternalADCData.h:32
Boardcore::InternalADCData::print
void print(std::ostream &os) const
Definition
InternalADCData.h:47
Boardcore::InternalADCData::voltage
float voltage[16]
Definition
InternalADCData.h:33
Boardcore::InternalADCData::temperature
float temperature
Definition
InternalADCData.h:34
src
shared
drivers
adc
InternalADCData.h
Generated by
1.10.0