Formula Student Electronics & Software
The code for the embedded software
Loading...
Searching...
No Matches
hardwareSettings.hpp
Go to the documentation of this file.
1#pragma once
2
3constexpr int COMPONENT_TIMESTAMP_TIMEOUT = 500;
4constexpr int RES_TIMESTAMP_TIMEOUT = 200;
5constexpr int DC_VOLTAGE_TIMEOUT = 150;
6constexpr int DC_VOLTAGE_HOLD = 1000;
7constexpr int EBS_BUZZER_TIMEOUT = 8000;
8constexpr int LED_BLINK_INTERVAL = 500;
9constexpr int PROCESS_INTERVAL = 100;
10constexpr int INITIAL_CHECKUP_STEP_TIMEOUT = 500;
11constexpr unsigned long READY_TIMEOUT_MS = 5000;
12constexpr unsigned long RELEASE_EBS_TIMEOUT_MS = 1000;
13constexpr unsigned long ENGAGE_EBS_TIMEOUT_MS = 5000;
14constexpr int WD_TIMEOUT_MS = 500;
17constexpr int LIMIT_RPM_INTERVAL = 500000;
18
19constexpr int ADC_MAX_VALUE = 1023;
20constexpr int SOC_PERCENT_MAX = 100;
21constexpr int MAX_MISSION = 7;
22constexpr int PULSES_PER_ROTATION = 48; // TODO: adjust
23constexpr int SECONDS_IN_MINUTE = 60;
24constexpr float MICRO_TO_SECONDS = 1e-6f;
25
26// Number of consecutive different values of a digital input to consider change
27// (to avoid noise)
28constexpr int CHANGE_COUNTER_LIMIT = 5;
29constexpr int WD_PULSE_INTERVAL_MS = 50;
30constexpr int WATCHDOG_TOGGLE_DURATION = 1000;
31constexpr int WATCHDOG_TEST_DURATION = 1000;
32
33/*
34 * ===========
35 * OUTPUT PINS
36 * ===========
37 */
38
39constexpr int ASSI_BLUE_PIN = 25;
40constexpr int ASSI_YELLOW_PIN = 12;
41
42constexpr int EBS_VALVE_1_PIN = 17;
43constexpr int EBS_VALVE_2_PIN = 13;
44
45constexpr int CLOSE_SDC = 21;
46// #define SDC_LOGIC_WATCHDOG_OUT_PIN 10
47constexpr int SDC_BSPD_OUT = 14;
48
49constexpr int BRAKE_LIGHT = 2;
50constexpr int WD_SDC_CLOSE = 40; // high if bspd is high (sdc closed)?
51constexpr int WD_ALIVE = 15;
52
53/*
54 * ==========
55 * INPUT PINS
56 * ==========
57 */
58
59constexpr int ASMS_IN_PIN = 18;
60constexpr int AMI = 23;
61
62// When pressure on the line passes the threshold defined, pin is set to HIGH
63constexpr int EBS_SENSOR1 = 41;
64constexpr int EBS_SENSOR2 = 39;
65constexpr int SDC_BSPD_STATE_PIN = 22;
66
67constexpr int RL_WSS = 4;
68constexpr int RR_WSS = 5;
69constexpr int BRAKE_SENSOR = 38;
70constexpr int SOC = 24;
71constexpr int ATS = 16;
72constexpr int ASATS = 20;
73constexpr int WD_READY = 37;
74constexpr int WD_SDC_RELAY = 33;
constexpr int SDC_BSPD_OUT
constexpr unsigned long READY_TIMEOUT_MS
constexpr int CLOSE_SDC
constexpr int ADC_MAX_VALUE
constexpr int WATCHDOG_TEST_DURATION
constexpr int PROCESS_INTERVAL
constexpr unsigned long RELEASE_EBS_TIMEOUT_MS
constexpr float MICRO_TO_SECONDS
constexpr int ASMS_IN_PIN
constexpr int RR_WSS
constexpr int RES_TIMESTAMP_TIMEOUT
constexpr int LIMIT_RPM_INTERVAL
constexpr int EBS_VALVE_2_PIN
constexpr int SECONDS_IN_MINUTE
constexpr int WD_SDC_RELAY
constexpr int SOC
constexpr unsigned long ENGAGE_EBS_TIMEOUT_MS
constexpr int COMPONENT_TIMESTAMP_TIMEOUT
constexpr int LED_BLINK_INTERVAL
constexpr int CHANGE_COUNTER_LIMIT
constexpr int WD_TIMEOUT_MS
constexpr int EBS_SENSOR2
constexpr int BRAKE_PRESSURE_UPPER_THRESHOLD
constexpr int BRAKE_PRESSURE_LOWER_THRESHOLD
constexpr int RL_WSS
constexpr int DC_VOLTAGE_HOLD
constexpr int WD_SDC_CLOSE
constexpr int WD_READY
constexpr int WD_ALIVE
constexpr int WD_PULSE_INTERVAL_MS
constexpr int INITIAL_CHECKUP_STEP_TIMEOUT
constexpr int ASSI_BLUE_PIN
constexpr int MAX_MISSION
constexpr int EBS_SENSOR1
constexpr int ASATS
constexpr int EBS_VALVE_1_PIN
constexpr int PULSES_PER_ROTATION
constexpr int BRAKE_LIGHT
constexpr int ATS
constexpr int AMI
constexpr int WATCHDOG_TOGGLE_DURATION
constexpr int SOC_PERCENT_MAX
constexpr int EBS_BUZZER_TIMEOUT
constexpr int BRAKE_SENSOR
constexpr int ASSI_YELLOW_PIN
constexpr int SDC_BSPD_STATE_PIN
constexpr int DC_VOLTAGE_TIMEOUT