TeensyNanoExoCode
Loading...
Searching...
No Matches
Config.h
Go to the documentation of this file.
1
2#ifndef Config_h
3#define Config_h
4
5#include "Arduino.h"
6#include "LogLevels.h"
7 #define FIRMWARE_VERSION 0_1_0
8
9 #define AK_Board_V0_1 1
10 #define AK_Board_V0_3 2
11 #define AK_Board_V0_4 3
12 #define AK_Board_V0_5_1 4
13
14 // TODO : Incorporate into parse INI
15 #define BOARD_VERSION AK_Board_V0_3
16 #define REAL_TIME_I2C 1
17 #define LOOP_FREQ_HZ 500
18 #define LOOP_TIME_TOLERANCE 0.1
19
20 #define USE_SPEED_CHECK 0
21
22 // MACRO magic to convert a define to a string
23 #define VAL(str) #str
24 #define TOSTRING(str) VAL(str)
25
26 namespace logging
27 {
29 const int baud_rate = 115200;
30 }
31
32 namespace sync_time
33 {
34 const unsigned int NUM_START_STOP_BLINKS = 1; // the number of times to have the LED on during the start stop sequence
35 const unsigned int SYNC_HALF_PERIOD_US = 125000; // half blink period in micro seconds
36 const unsigned int SYNC_START_STOP_HALF_PERIOD_US = 4 * SYNC_HALF_PERIOD_US; // Half blink period for the begining and end of the sequence. This is usually longer so it is easy to identify.
37 }
38
39 namespace fsr_config
40 {
41 const float FSR_UPPER_THRESHOLD = 0.25;
42 const float FSR_LOWER_THRESHOLD = 0.15;
44 }
45
46 namespace analog
47 {
48 const float RESOLUTION = 12; // The resolution of the analog to digital converter
49 const float COUNTS = 4096; // The number of counts the ADC can have
50 }
51
53 {
54 const float AI_CNT_TO_V = 3.3 / 4096; // conversion from count to voltage
55 const float TRQ_V_TO_NM = 53.70; // conversion from voltage to Nm (Negative do to mismatch in torque sensor and motor torque directions)
56 }
57
58 namespace BLE_times
59 {
60 const float _status_msg_delay = 1000000; //microseconds
61 const float _real_time_msg_delay = 20000; //microseconds
62 const float _update_delay = 1000; //microseconds
63 const float _poll_timeout = 4; //milliseconds
64 }
65
66 // Update this namespace for future exo updates to display correct information on app
67 namespace exo_info
68 {
69 const String FirmwareVersion = String(TOSTRING(FIRMWARE_VERSION)); // string to add to firmware char
70 const String PCBVersion = String(TOSTRING(BOARD_VERSION)); // string to add to pcb char
71 const String DeviceName = String("NULL"); // string to add to device char, if you would like the system to set it use "NULL"
72 }
73
74 namespace UART_times
75 {
76 const float UPDATE_PERIOD = 1000; //microseconds, time between updating data over uart
77 const float COMS_MCU_TIMEOUT = 5000; //microseconds
78 const float CONT_MCU_TIMEOUT = 1000;
79 const float CONFIG_TIMEOUT = 8000; // milliseconds
80 }
81
82#endif
#define BOARD_VERSION
Definition Config.h:15
#define TOSTRING(str)
Definition Config.h:24
#define FIRMWARE_VERSION
Definition Config.h:7
LogLevel
Definition LogLevels.h:5
Definition Config.h:59
const float _poll_timeout
Definition Config.h:63
const float _status_msg_delay
Definition Config.h:60
const float _update_delay
Definition Config.h:62
const float _real_time_msg_delay
Definition Config.h:61
Definition Config.h:75
const float COMS_MCU_TIMEOUT
Definition Config.h:77
const float CONFIG_TIMEOUT
Definition Config.h:79
const float UPDATE_PERIOD
Definition Config.h:76
const float CONT_MCU_TIMEOUT
Definition Config.h:78
Definition Config.h:47
const float RESOLUTION
Definition Config.h:48
const float COUNTS
Definition Config.h:49
Definition Config.h:68
const String FirmwareVersion
Definition Config.h:69
const String DeviceName
Definition Config.h:71
const String PCBVersion
Definition Config.h:70
Definition Config.h:40
const float FSR_LOWER_THRESHOLD
Definition Config.h:42
const float FSR_UPPER_THRESHOLD
Definition Config.h:41
const float SCHMITT_DELTA
Definition Config.h:43
Definition Config.h:27
const int baud_rate
Definition Config.h:29
const LogLevel level
Definition Config.h:28
Definition Config.h:33
const unsigned int SYNC_HALF_PERIOD_US
Definition Config.h:35
const unsigned int NUM_START_STOP_BLINKS
Definition Config.h:34
const unsigned int SYNC_START_STOP_HALF_PERIOD_US
Definition Config.h:36
Definition Config.h:53
const float TRQ_V_TO_NM
Definition Config.h:55
const float AI_CNT_TO_V
Definition Config.h:54