-
Notifications
You must be signed in to change notification settings - Fork 1
/
Config.h
79 lines (67 loc) · 2.38 KB
/
Config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#pragma once
#include <stdint.h>
#include "variant.h"
namespace config {
/* pinout */
namespace pwm {
/* thrusters */
constexpr int th_horizontal_front_left_pin = 2;
constexpr int th_horizontal_front_right_pin = 3;
constexpr int th_horizontal_back_left_pin = 4;
constexpr int th_horizontal_back_right_pin = 5;
constexpr int th_vertical_front_pin = 6;
constexpr int th_vertical_back_pin = 7;
/* additional custom thrusters */
constexpr int th_custom_0_pin = 8;
constexpr int th_custom_1_pin = 9;
/* cam servos pins */
constexpr int servo_front_pin = A4;
constexpr int servo_back_pin = A5;
/* video multiplexer */
constexpr int cam_select_pin = 10;
/* custom PWM pins */
constexpr int pwm_custom_a2_pin = A2;
constexpr int pwm_custom_a3_pin = A3;
/* manipulator PCA9536 channels */
constexpr int manip_left_ch = 0;
constexpr int manip_right_ch = 1;
constexpr int manip_grab_ch = 2;
constexpr int manip_release_ch = 3;
}
/* indices of thrusters (controlled by SAMD_ISR_SERVO) */
namespace thrusters {
enum thrusters {
horizontal_front_left = 0,
horizontal_front_right,
horizontal_back_left,
horizontal_back_right,
vertical_front,
vertical_back,
custom_0,
custom_1,
};
}
/* indices of servos (controlled by Servo.h) */
namespace servos {
enum servos {
front = 0,
back,
custom_pwm_a2,
manip_grab,
};
}
namespace networking {
constexpr uint8_t selfip[4] = {192, 168, 1, 5};
constexpr uint16_t self_port = 3020;
constexpr uint8_t remoteip[4] = {192, 168, 1, 4};
constexpr uint16_t remote_port = 3010;
constexpr uint8_t cs_pin = 43; // W5500 CS on PA13 pin
}
namespace analog {
constexpr int ammeter_pin = A0;
constexpr int voltmeter_pin = A1;
constexpr double voltage_multiplier = 0.016064;
constexpr double amperage_multiplier = 0.077821;
constexpr double amperage_deflection = 512.0;
} // namespace analog
}