Formula Student Electronics & Software
The code for the embedded software
Loading...
Searching...
No Matches
logging.h
Go to the documentation of this file.
1
#ifndef LOGGING_H
2
#define LOGGING_H
3
4
#include <SD.h>
5
#include <FlexCAN_T4.h>
6
#include <SPI.h>
7
8
#define PIN_SPI_CLK 45
9
#define PIN_SPI_MOSI 43
10
#define PIN_SPI_MISO 42
11
#define PIN_SD_CS 44
12
// If you have connected other SPI device then
13
// put here number of pin for disable its.
14
// Provide -1 if you don't have other devices.
15
#define PIN_OTHER_DEVICE_CS -1
16
// Change this value if you have problems with SD card
17
// Available values: SPI_QUARTER_SPEED //SPI_HALF_SPEED
18
// It is enum from SdFat
19
#define SD_CARD_SPEED SPI_FULL_SPEED
20
21
#define BMS_ID 0x666
22
#define BAMO_RESPONSE_ID 0x181
23
#define LOGGING_PERIOD 10
24
25
26
struct
LogEntry
27
{
28
int
year
;
29
int
month
;
30
int
day
;
31
int
hour
;
32
int
minute
;
33
int
second
;
34
uint32_t
millisecond
;
35
};
36
37
38
class
Logging
{
39
40
public
:
41
void
write_to_file
(
int
current
,
int
voltage
,
int
mintmp
,
int
maxtmp
,
int
avgtmp
,
int
apps1
,
int
apps2
,
int
brake
,
int
rpm
,
int
I_actual
,
int
powerStageTmp,
int
motorTmp,
int
Torque,
int
motor_voltage
,
int
battery_voltage
);
42
void
setup_log
();
43
44
private
:
45
46
};
47
48
#endif
voltage
int voltage
Definition
main.cpp:60
I_actual
int I_actual
Definition
main.cpp:70
avgtmp
int avgtmp
Definition
main.cpp:63
apps2
int apps2
Definition
main.cpp:65
battery_voltage
int battery_voltage
Definition
main.cpp:78
motor_voltage
int motor_voltage
Definition
main.cpp:77
brake
int brake
Definition
main.cpp:66
current
int current
Definition
main.cpp:59
mintmp
int mintmp
Definition
main.cpp:61
maxtmp
int maxtmp
Definition
main.cpp:62
apps1
int apps1
Definition
main.cpp:64
rpm
int rpm
Definition
display.cpp:11
Logging
Definition
logging.h:38
Logging::write_to_file
void write_to_file(int current, int voltage, int mintmp, int maxtmp, int avgtmp, int apps1, int apps2, int brake, int rpm, int I_actual, int powerStageTmp, int motorTmp, int Torque, int motor_voltage, int battery_voltage)
Definition
logging.cpp:90
Logging::setup_log
void setup_log()
Definition
logging.cpp:56
LogEntry
Definition
logging.h:27
LogEntry::day
int day
Definition
logging.h:30
LogEntry::month
int month
Definition
logging.h:29
LogEntry::second
int second
Definition
logging.h:33
LogEntry::millisecond
uint32_t millisecond
Definition
logging.h:34
LogEntry::minute
int minute
Definition
logging.h:32
LogEntry::year
int year
Definition
logging.h:28
LogEntry::hour
int hour
Definition
logging.h:31
c1
include
logging.h
Generated by
1.9.8