-
Notifications
You must be signed in to change notification settings - Fork 1
/
device.yml
321 lines (321 loc) · 9.74 KB
/
device.yml
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
%YAML 1.1
---
# yaml-language-server: $schema=https://harp-tech.org/draft-02/schema/device.json
device: SoundCard
whoAmI: 1280
firmwareVersion: "2.2"
hardwareTargets: "1.1"
registers:
PlaySoundOrFrequency: &frequency
address: 32
type: U16
access: Write
description: Starts the sound index (if less than 32) or frequency (if greater or equal than 32)
Stop:
address: 33
type: U8
access: Write
description: Any value will stop the current sound
AttenuationLeft: &attenuation
address: 34
type: U16
access: Write
description: Configure left channel's attenuation (1 LSB is 0.1dB)
AttenuationRight:
<<: *attenuation
address: 35
description: Configure right channel's attenuation (1 LSB is 0.1dB)
AttenuationBoth:
<<: *attenuation
address: 36
length: 2
description: Configures both attenuation on right and left channels [Att R] [Att L]
AttenuationAndPlaySoundOrFreq:
<<: *attenuation
address: 37
length: 3
description: Configures attenuation and plays sound index [Att R] [Att L] [Index]
Reserved0: &reserved
address: 38
type: U8
access: Read
description: Reserved for future use
visibility: private
Reserved1:
<<: *reserved
address: 39
InputState:
address: 40
type: U8
access: Event
maskType: DigitalInputs
description: State of the digital inputs
ConfigureDI0: &configureDI
address: 41
type: U8
access: Write
maskType: DigitalInputConfiguration
description: Configuration of the digital input 0 (DI0)
ConfigureDI1:
<<: *configureDI
address: 42
description: Configuration of the digital input 1 (DI1)
ConfigureDI2:
<<: *configureDI
address: 43
description: Configuration of the digital input 2 (DI2)
SoundIndexDI0: &soundIndex
address: 44
type: U8
access: Write
description: Specifies the sound index to be played when triggering DI0
SoundIndexDI1:
<<: *soundIndex
address: 45
description: Specifies the sound index to be played when triggering DI1
SoundIndexDI2:
<<: *soundIndex
address: 46
description: Specifies the sound index to be played when triggering DI2
FrequencyDI0:
<<: *frequency
address: 47
description: Specifies the sound frequency to be played when triggering DI0
FrequencyDI1:
<<: *frequency
address: 48
description: Specifies the sound frequency to be played when triggering DI1
FrequencyDI2:
<<: *frequency
address: 49
description: Specifies the sound frequency to be played when triggering DI2
AttenuationLeftDI0:
<<: *attenuation
address: 50
description: Left channel's attenuation (1 LSB is 0.5dB) when triggering DI0
AttenuationLeftDI1:
<<: *attenuation
address: 51
description: Left channel's attenuation (1 LSB is 0.5dB) when triggering DI1
AttenuationLeftDI2:
<<: *attenuation
address: 52
description: Left channel's attenuation (1 LSB is 0.5dB) when triggering DI2
AttenuationRightDI0:
<<: *attenuation
address: 53
description: Right channel's attenuation (1 LSB is 0.5dB) when triggering DI0
AttenuationRightDI1:
<<: *attenuation
address: 54
description: Right channel's attenuation (1 LSB is 0.5dB) when triggering DI1
AttenuationRightDI2:
<<: *attenuation
address: 55
description: Right channel's attenuation (1 LSB is 0.5dB) when triggering DI2
AttenuationAndSoundIndexDI0:
<<: *attenuation
address: 56
length: 3
description: Sound index and attenuation to be played when triggering DI0 [Att R] [Att L] [Index]
AttenuationAndSoundIndexDI1:
<<: *attenuation
address: 57
length: 3
description: Sound index and attenuation to be played when triggering DI1 [Att R] [Att L] [Index]
AttenuationAndSoundIndexDI2:
<<: *attenuation
address: 58
length: 3
description: Sound index and attenuation to be played when triggering DI2 [Att R] [Att L] [Index]
AttenuationAndFrequencyDI0:
<<: *attenuation
address: 59
length: 2
description: Sound index and attenuation to be played when triggering DI0 [Att BOTH] [Frequency]
AttenuationAndFrequencyDI1:
<<: *attenuation
address: 60
length: 2
description: Sound index and attenuation to be played when triggering DI1 [Att BOTH] [Frequency]
AttenuationAndFrequencyDI2:
<<: *attenuation
address: 61
length: 2
description: Sound index and attenuation to be played when triggering DI2 [Att BOTH] [Frequency]
Reserved2:
<<: *reserved
address: 62
Reserved3:
<<: *reserved
address: 63
Reserved4:
<<: *reserved
address: 64
ConfigureDO0: &configureDO
address: 65
type: U8
access: Write
maskType: DigitalOutputConfiguration
description: Configuration of the digital output 0 (DO0)
ConfigureDO1:
<<: *configureDO
address: 66
description: Configuration of the digital output 1 (DO1)
ConfigureDO2:
<<: *configureDO
address: 67
description: Configuration of the digital output 2 (DO2
PulseDO0: &pulseDO
address: 68
type: U8
access: Write
minValue: 1
maxValue: 255
description: Pulse for the digital output 0 (DO0)
PulseDO1:
<<: *pulseDO
address: 69
description: Pulse for the digital output 1 (DO1)
PulseDO2:
<<: *pulseDO
address: 70
description: Pulse for the digital output 2 (DO2)
Reserved5:
<<: *reserved
address: 71
Reserved6:
<<: *reserved
address: 72
Reserved7:
<<: *reserved
address: 73
OutputSet: &output
address: 74
type: U8
access: Write
maskType: DigitalOutputs
description: Set the specified digital output lines
OutputClear:
<<: *output
address: 75
description: Clear the specified digital output lines
OutputToggle:
<<: *output
address: 76
description: Toggle the specified digital output lines
OutputState:
<<: *output
address: 77
description: Write the state of all digital output lines
Reserved8:
<<: *reserved
address: 78
Reserved9:
<<: *reserved
address: 79
ConfigureAdc:
address: 80
type: U8
access: Write
maskType: AdcConfiguration
description: Configuration of Analog Inputs
AnalogData:
address: 81
type: U16
access: Event
length: 5
description: Contains sampled analog input data or dynamic sound parameters controlled by the ADC channels. Values are zero if not used.
payloadSpec:
Adc0:
offset: 0
description: The sampled analog input value on ADC0.
Adc1:
offset: 1
description: The sampled analog input value on ADC1.
AttenuationLeft:
offset: 2
description: The amplitude of the left channel controlled by ADC0.
AttenuationRight:
offset: 3
description: The amplitude of the right channel controlled by ADC0.
Frequency:
offset: 4
description: The output frequency controlled by ADC1.
Commands:
address: 82
type: U8
access: Write
maskType: ControllerCommand
description: Send commands to PIC32 micro-controller
Reserved10:
<<: *reserved
address: 83
Reserved11:
<<: *reserved
address: 84
Reserved12:
<<: *reserved
address: 85
EnableEvents:
address: 86
type: U8
access: Write
maskType: SoundCardEvents
description: Specifies the active events in the SoundCard device
bitMasks:
DigitalInputs:
description: Specifies the state of the digital input lines.
bits:
DI0: 0x1
DigitalOutputs:
description: Specifies the state of the digital output lines.
bits:
DO0: 0x1
DO1: 0x2
DO2: 0x3
SoundCardEvents:
description: Specifies the active events in the SoundCard.
bits:
PlaySoundOrFrequency: 0x1
Stop: 0x2
DigitalInputs: 0x4
AdcValues: 0x8
groupMasks:
DigitalInputConfiguration:
description: Specifies the operation mode of the digital input.
values:
Digital: {value: 0, description: Used as a pure digital input.}
StartAndStopSound: {value: 1, description: Starts sound when rising edge and stop when falling edge.}
StartSound: {value: 2, description: Starts sound when rising edge.}
Stop: {value: 3, description: Stops sound or frequency when rising edge.}
StartAndStopFrequency: {value: 4, description: Starts frequency when rising edge and stop when falling edge.}
StartFrequency: {value: 5, description: Starts frequency when rising edge.}
DigitalOutputConfiguration:
description: Specifies the operation mode of the digital output.
values:
Digital: {value: 0, description: Used as a pure digital output.}
Pulse: {value: 1, description: The digital output will be high during a period specified by register DOxPulse.}
HighWhenSound: {value: 2, description: High when the sound is being played. }
Pulse1MsWhenStart: {value: 3, description: High when sound starts during 1 ms. }
Pulse10MsWhenStart: {value: 4, description: High when sound starts during 10 ms. }
Pulse100MsWhenStart: {value: 5, description: High when sound starts during 100 ms. }
Pulse1MsWhenStop: {value: 6, description: High when sound stops during 1 ms. }
Pulse10MsWhenStop: {value: 7, description: High when sound stops during 10 ms. }
Pulse100MsWhenStop: {value: 8, description: High when sound starts during 100 ms. }
ControllerCommand:
description: Specifies commands to send to the PIC32 micro-controller
values:
DisableBootloader: 0
EnableBootloader: 1
DeleteAllSounds: 255
AdcConfiguration:
description: Specifies the operation mode of the analog inputs.
values:
NotUsed: 0
AdcAdc: 1
AmplitudeBothAdc: 2
AmplitudeLeftAdc: 3
AmplitudeRightAdc: 4
AmplitudeLeftAmplitudeRight: 5
AmplitudeBothFrequency: 6