Formula Student Electronics & Software
The code for the embedded software
Loading...
Searching...
No Matches
digitalSettings.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 INITIAL_CHECKUP_STEP_TIMEOUT = 500;
10constexpr unsigned long READY_TIMEOUT_MS = 5000;
11constexpr unsigned long RELEASE_EBS_TIMEOUT_MS = 1000;
12constexpr unsigned long ENGAGE_EBS_TIMEOUT_MS = 5000;
13// #define WATCHDOG_TOGGLE_FREQUENCY 100
14// #define WATCHDOG_TIMEOUT 500
15
16constexpr int WHEEL_MEASUREMENT_INTERVAL_MS = 30; // 30ms // TODO(andre): change to adequate value
18constexpr int PULSES_PER_ROTATION = 48;
19
20// Number of consecutive different values of a digital input to consider change
21// (to avoid noise)
23constexpr int WD_PULSE_INTERVAL_MS = 10;
24// TODO(andre): confirm wd timer values
25
26/*
27 * ===========
28 * OUTPUT PINS
29 * ===========
30 */
31
32constexpr int ASSI_BLUE_PIN = 4;
33constexpr int ASSI_YELLOW_PIN = 7;
34
35constexpr int SDC_LOGIC_CLOSE_SDC_PIN = 8;
36// #define SDC_LOGIC_WATCHDOG_OUT_PIN 10
37constexpr int EBS_VALVE_1_PIN = 25;
38constexpr int EBS_VALVE_2_PIN = 30;
39constexpr int MASTER_SDC_OUT_PIN = 31;
40
41/*
42 * ==========
43 * INPUT PINS
44 * ==========
45 */
46
47constexpr int LWSS_PIN = 32;
48
49// When pressure on the line passes the threshold defined, pin is set to HIGH
50constexpr int SENSOR_PRESSURE_2_PIN = 6;
51constexpr int SENSOR_PRESSURE_1_PIN = 5;
52
53// Mission pins
54
55constexpr int MISSION_MANUAL_PIN = 39;
56constexpr int MISSION_AUTOCROSS_PIN = 41;
57constexpr int MISSION_TRACKDRIVE_PIN = 14;
58constexpr int MISSION_SKIDPAD_PIN = 16;
59constexpr int MISSION_INSPECTION_PIN = 18;
60constexpr int MISSION_ACCELERATION_PIN = 20;
61constexpr int MISSION_EBSTEST_PIN = 21;
62
63constexpr int SDC_STATE_PIN = 37;
64// #define SDC_LOGIC_WATCHDOG_IN_PIN 35
65constexpr int ASMS_IN_PIN = 33;
constexpr unsigned long READY_TIMEOUT_MS
constexpr int MISSION_TRACKDRIVE_PIN
constexpr unsigned long RELEASE_EBS_TIMEOUT_MS
constexpr int ASMS_IN_PIN
constexpr int RES_TIMESTAMP_TIMEOUT
constexpr int EBS_VALVE_2_PIN
constexpr int WHEEL_MEASUREMENT_INTERVAL_MIN
constexpr int SENSOR_PRESSURE_2_PIN
constexpr unsigned long ENGAGE_EBS_TIMEOUT_MS
constexpr int COMPONENT_TIMESTAMP_TIMEOUT
constexpr int LED_BLINK_INTERVAL
constexpr int MISSION_INSPECTION_PIN
constexpr int LWSS_PIN
constexpr int MISSION_SKIDPAD_PIN
constexpr int SENSOR_PRESSURE_1_PIN
constexpr int DC_VOLTAGE_HOLD
constexpr int SDC_LOGIC_CLOSE_SDC_PIN
constexpr int WD_PULSE_INTERVAL_MS
constexpr int INITIAL_CHECKUP_STEP_TIMEOUT
constexpr int ASSI_BLUE_PIN
constexpr int WHEEL_MEASUREMENT_INTERVAL_MS
constexpr int EBS_VALVE_1_PIN
constexpr int PULSES_PER_ROTATION
constexpr int MISSION_EBSTEST_PIN
constexpr int DIGITAL_INPUT_COUNTER_LIMIT
constexpr int MASTER_SDC_OUT_PIN
constexpr int MISSION_AUTOCROSS_PIN
constexpr int EBS_BUZZER_TIMEOUT
constexpr int MISSION_MANUAL_PIN
constexpr int ASSI_YELLOW_PIN
constexpr int SDC_STATE_PIN
constexpr int MISSION_ACCELERATION_PIN
constexpr int DC_VOLTAGE_TIMEOUT