Переглянути джерело

Added documentation for configuration format

It's very important to document the format in which configuration is
printed, since being able to reliably read the configuration is
essential to implementing configuration GUIs.  Now it's documented, and
the format is considered stable.
Clara Hobbs 7 роки тому
джерело
коміт
b3f1592f6a
1 змінених файлів з 44 додано та 0 видалено
  1. 44
    0
      docs/console_config.md

+ 44
- 0
docs/console_config.md Переглянути файл

@@ -149,3 +149,47 @@ Usage: `identify`
149 149
 
150 150
 Blinks the LED quickly.  Useful for identifying which device you're connected
151 151
 to if several are plugged in to your computer at once.
152
+
153
+## Configuration Format
154
+
155
+Wherever a configuration object is printed, the following format is used.
156
+
157
+The configuration consists of a number of fields, one per line.  Each field is
158
+of the format:
159
+
160
+    name: value
161
+
162
+Only the `status` field is mandatory.  Any or all other fields may be absent if
163
+their values are not valid or relevant.
164
+
165
+### status
166
+
167
+The `status` field holds the name of the status of the printed configuration
168
+object.  The possible names are:
169
+
170
+* `empty`: A configuration object left empty after the last erase.
171
+* `valid`: The configuration object that holds the current device settings.
172
+* `invalid`: A configuration object that once held settings, but has been
173
+  superseded.
174
+
175
+### flags
176
+
177
+The `flags` field holds zero or more flags.  If no flags are enabled, the
178
+field's value is `(none)`.  Otherwise, the field's value is some combination of
179
+the following words, separated by spaces, representing the flags enabled in
180
+this configuration object:
181
+
182
+* `GiveBack`: allows the power supply to temporarily reduce power to the device
183
+  if necessary.
184
+
185
+### v
186
+
187
+The `v` field holds the fixed voltage of the configuration object, in volts.
188
+The field's value is a floating-point decimal number, followed by a space and a
189
+capital V.  For example: `20.00 V`
190
+
191
+### i
192
+
193
+The `i` field holds the fixed current of the configuration object, in amperes.
194
+The field's value is a floating-point decimal number, followed by a space and a
195
+capital A.  For example: `2.25 A`

Завантаження…
Відмінити
Зберегти