-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.h
138 lines (117 loc) · 3.31 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/**
* @file config.h
* @brief Functions for loading, saving and modifying the config file
*/
#ifndef CONFIG_H_
#define CONFIG_H_
#include "servo.h"
#include <Arduino.h>
/**
* @brief Load the config file from SD card
*/
void loadConfig(void);
/**
* @brief Save the config file to the SD card
*/
void saveConfig(void);
/**
* @brief Get the figure name from the config file
*
* @return Returns the figure name as a char[16]
*/
char* getFigureName(void);
/**
* @brief Get the input name for a given number from the config file
*
* @param number Input number, 0 ... 15
* @return Returns the input name for a given number as a char[8]
*/
char* getInputName(uint8_t number);
/**
* @brief Set the input name for a given number from the config file
*
* @param number Input number, 0 ... 15
* @param name Input name, char[8]
*/
void setInputName(uint8_t number, char* name);
/**
* @brief Get the servo name for a given number from the config file
*
* @param number Servo number, 0 ... 15
* @return Returns the servo name for a given number as a char[8]
*/
char* getServoName(uint8_t number);
/**
* @brief Set the servo name for a given number from the config file
*
* @param number Servo number, 0 ... 15
* @param name Servo name, char[8]
*/
void setServoName(uint8_t number, char* name);
/**
* @brief Get the input data for a given input number
*
* @param number Input number, 0 ... 15
* @return Returns a input_t struct
*/
input_t getInputData(uint8_t number);
/**
* @brief Get the servo data for a given servo number
*
* @param number Servo number, 0 ... 15
* @return Returns a servo_t struct
*/
servo_t getServoData(uint8_t number);
/**
* @brief Get the center position for a given servo
*
* @param number Servo number, 0 ... 15
* @return Returns a uint16_t for the center position of a given servo
*/
uint16_t getServoCenter(uint8_t number);
/**
* @brief Configure Input Min / Max
*
* @param input Input pin to read, 0 ... 15
* @return Returns the Input Min / Max as uint16_t array, 0 ... 1023
*/
uint16_t* minmaxInput(uint8_t input);
/**
* @brief Configure a given input
*
* @param number Input number, 0 ... 15
*/
void configInput(uint8_t number);
/**
* @brief Configure a given servo
*
* @param number Servo number, 0 ... 15
*/
void configServo(uint8_t number);
/**
* @brief Invert a given servo
*
* @param number Servo number, 0 ... 15
*/
void invertServo(uint8_t number);
/**
* @brief Change filter value for a given servo
*
* @param number Servo number, 0 ... 15
*/
void filterServo(uint8_t number);
/**
* @brief Enable/Disable a given servo
*
* @param number Servo number, 0 ... 15
*/
void toggleServo(uint8_t number);
/**
* @brief Prints a list of all enabled servos
*/
void printServos(void);
/**
* @brief Prints a list of all enabled inputs
*/
void printInputs(void);
#endif // CONFIG_H_