1 |
/* |
---|
2 |
* Copyright (C) 2009 by Jonathan Woithe |
---|
3 |
* |
---|
4 |
* This file is part of FFADO |
---|
5 |
* FFADO = Free Firewire (pro-)audio drivers for linux |
---|
6 |
* |
---|
7 |
* FFADO is based upon FreeBoB. |
---|
8 |
* |
---|
9 |
* This program is free software: you can redistribute it and/or modify |
---|
10 |
* it under the terms of the GNU General Public License as published by |
---|
11 |
* the Free Software Foundation, either version 2 of the License, or |
---|
12 |
* (at your option) version 3 of the License. |
---|
13 |
* |
---|
14 |
* This program is distributed in the hope that it will be useful, |
---|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 |
* GNU General Public License for more details. |
---|
18 |
* |
---|
19 |
* You should have received a copy of the GNU General Public License |
---|
20 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
21 |
* |
---|
22 |
*/ |
---|
23 |
|
---|
24 |
/* This file contains definitions relating to the RME Fireface interfaces |
---|
25 |
* (Fireface 400 and Fireface 800). Naming convention: |
---|
26 |
* RME_FF_ identifier applies to both FF400 and FF800 |
---|
27 |
* RME_FF400_ identifier specific to the FF400 |
---|
28 |
* RME_FF800_ identifier specific to the FF800 |
---|
29 |
*/ |
---|
30 |
|
---|
31 |
#ifndef _FIREFACE_DEF |
---|
32 |
#define _FIREFACE_DEF |
---|
33 |
|
---|
34 |
/* Boundaries between the speed multipliers */ |
---|
35 |
#define MIN_SPEED 30000 |
---|
36 |
#define MIN_DOUBLE_SPEED 56000 |
---|
37 |
#define MIN_QUAD_SPEED 112000 |
---|
38 |
#define MAX_SPEED 210000 |
---|
39 |
|
---|
40 |
// A flag used to indicate the use of a 800 Mbps bus speed to various |
---|
41 |
// streaming registers of the FF800. |
---|
42 |
#define RME_FF800_STREAMING_SPEED_800 0x800 |
---|
43 |
|
---|
44 |
/* The Command Buffer Address (CBA) is different for the two interfaces */ |
---|
45 |
#define RME_FF400_CMD_BUFFER 0x80100500 |
---|
46 |
#define RME_FF800_CMD_BUFFER 0xfc88f000 |
---|
47 |
|
---|
48 |
/* Offsets for registers at fixed offsets from the device's command buffer address */ |
---|
49 |
#define RME_FF_DDS_SRATE_OFS (0*4) |
---|
50 |
#define RME_FF_CONF1_OFS (5*4) |
---|
51 |
#define RME_FF_CONF2_OFS (6*4) |
---|
52 |
#define RME_FF_CONF3_OFS (7*4) |
---|
53 |
#define RME_FF400_FLASH_CMD_OFS (8*4) // Write only |
---|
54 |
#define RME_FF400_FLASH_STAT_OFS (8*4) // Read only |
---|
55 |
|
---|
56 |
/* General register definitions */ |
---|
57 |
#define RME_FF400_CONF_REG (RME_FF400_CMD_BUFFER + RME_FF_CONF1_OFS) |
---|
58 |
#define RME_FF800_CONF_REG (RME_FF800_CMD_BUFFER + RME_FF_CONF1_OFS) |
---|
59 |
|
---|
60 |
#define RME_FF400_STREAM_INIT_REG (RME_FF400_CMD_BUFFER) // 3 quadlets wide |
---|
61 |
#define RME_FF400_STREAM_INIT_SIZE 3 // Size in quadlets |
---|
62 |
#define RME_FF400_STREAM_SRATE (RME_FF400_CMD_BUFFER) |
---|
63 |
#define RME_FF400_STREAM_CONF0 (RME_FF400_CMD_BUFFER+4) |
---|
64 |
#define RME_FF400_STREAM_CONF1 (RME_FF400_CMD_BUFFER+8) |
---|
65 |
#define RME_FF800_STREAM_INIT_REG 0x20000001cLL // 3 quadlets wide |
---|
66 |
#define RME_FF800_STREAM_INIT_SIZE 3 // Size in quadlets |
---|
67 |
#define RME_FF800_STREAM_SRATE 0x20000001cLL |
---|
68 |
#define RME_FF800_STREAM_CONF0 (0x20000001cLL+4) |
---|
69 |
#define RME_FF800_STREAM_CONF1 (0x20000001cLL+8) |
---|
70 |
#define RME_FF400_STREAM_START_REG (RME_FF400_CMD_BUFFER + 0x001c) // 1 quadlet |
---|
71 |
#define RME_FF800_STREAM_START_REG 0x200000028LL // 1 quadlet |
---|
72 |
#define RME_FF400_STREAM_END_REG (RME_FF400_CMD_BUFFER + 0x0004) // 4 quadlets wide |
---|
73 |
#define RME_FF400_STREAM_END_SIZE 4 // Size in quadlets |
---|
74 |
#define RME_FF800_STREAM_END_REG 0x200000034LL // 3 quadlets wide |
---|
75 |
#define RME_FF800_STREAM_END_SIZE 3 // Size in quadlets |
---|
76 |
|
---|
77 |
#define RME_FF800_HOST_LED_REG 0x200000324LL |
---|
78 |
|
---|
79 |
#define RME_FF800_REVISION_REG 0x200000100LL |
---|
80 |
|
---|
81 |
#define RME_FF_CHANNEL_MUTE_MASK 0x801c0000 // Write only |
---|
82 |
#define RME_FF_STATUS_REG0 0x801c0000 // Read only |
---|
83 |
#define RME_FF_STATUS_REG1 0x801c0004 // Read only |
---|
84 |
|
---|
85 |
#define RME_FF_TCO_READ_REG 0x801f0000 |
---|
86 |
#define RME_FF_TCO_WRITE_REG 0x810f0020 |
---|
87 |
|
---|
88 |
/* Addresses of various blocks in memory-mapped flash */ |
---|
89 |
#define RME_FF400_FLASH_SETTINGS_ADDR 0x00060000 |
---|
90 |
#define RME_FF400_FLASH_MIXER_VOLUME_ADDR 0x00070000 |
---|
91 |
#define RME_FF400_FLASH_MIXER_PAN_ADDR 0x00070800 |
---|
92 |
#define RME_FF400_FLASH_MIXER_HW_ADDR 0x00071000 /* Hardware volume settings, MIDI enable, submix */ |
---|
93 |
#define RME_FF800_FLASH_MIXER_SHADOW_ADDR 0x3000e0000LL |
---|
94 |
#define RME_FF800_FLASH_MIXER_VOLUME_ADDR 0x3000e2000LL |
---|
95 |
#define RME_FF800_FLASH_MIXER_PAN_ADDR 0x3000e2800LL |
---|
96 |
#define RME_FF800_FLASH_MIXER_HW_ADDR 0x3000e3000LL /* H/w volume settings, MIDI enable, submix */ |
---|
97 |
#define RME_FF800_FLASH_SETTINGS_ADDR 0x3000f0000LL |
---|
98 |
|
---|
99 |
/* Flash control registers */ |
---|
100 |
#define RME_FF400_FLASH_BLOCK_ADDR_REG 0x80100288 |
---|
101 |
#define RME_FF400_FLASH_BLOCK_SIZE_REG 0x8010028c |
---|
102 |
#define RME_FF400_FLASH_CMD_REG (RME_FF400_CMD_BUFFER + RME_FF400_FLASH_CMD_OFS) |
---|
103 |
#define RME_FF400_FLASH_STAT_REG (RME_FF400_CMD_BUFFER + RME_FF400_FLASH_STAT_OFS) |
---|
104 |
#define RME_FF400_FLASH_WRITE_BUFFER 0x80100290 |
---|
105 |
#define RME_FF400_FLASH_READ_BUFFER 0x80100290 |
---|
106 |
|
---|
107 |
/* Flash erase control registers on the FF800 */ |
---|
108 |
#define RME_FF800_FLASH_ERASE_VOLUME_REG 0x3fffffff4LL |
---|
109 |
#define RME_FF800_FLASH_ERASE_SETTINGS_REG 0x3fffffff0LL |
---|
110 |
#define RME_FF800_FLASH_ERASE_FIRMWARE_REG 0x3fffffff8LL |
---|
111 |
#define RME_FF800_FLASH_ERASE_CONFIG_REG 0x3fffffffcLL |
---|
112 |
|
---|
113 |
/* Flash erase command values for the FF400 */ |
---|
114 |
#define RME_FF400_FLASH_CMD_WRITE 0x00000001 |
---|
115 |
#define RME_FF400_FLASH_CMD_READ 0x00000002 |
---|
116 |
#define RME_FF400_FLASH_CMD_ERASE_VOLUME 0x0000000e |
---|
117 |
#define RME_FF400_FLASH_CMD_ERASE_SETTINGS 0x0000000d |
---|
118 |
#define RME_FF400_FLASH_CMD_ERASE_CONFIG 0x0000000c |
---|
119 |
#define RME_FF400_FLASH_CMD_GET_REVISION 0x0000000f |
---|
120 |
|
---|
121 |
/* Flags for use with erase_flash() */ |
---|
122 |
#define RME_FF_FLASH_ERASE_VOLUME 1 |
---|
123 |
#define RME_FF_FLASH_ERASE_SETTINGS 2 |
---|
124 |
#define RME_FF_FLASH_ERASE_CONFIG 3 |
---|
125 |
|
---|
126 |
/* Defines for components of the control registers */ |
---|
127 |
// Configuration register 0 |
---|
128 |
#define CR0_PHANTOM_MIC0 0x00000001 |
---|
129 |
#define CR0_PHANTOM_MIC2 0x00000002 |
---|
130 |
#define CR0_FILTER_FPGA 0x00000004 |
---|
131 |
#define CR0_ILEVEL_FPGA_CTRL0 0x00000008 |
---|
132 |
#define CR0_ILEVEL_FPGA_CTRL1 0x00000010 |
---|
133 |
#define CR0_ILEVEL_FPGA_CTRL2 0x00000020 |
---|
134 |
#define CR0_ZEROBIT06 0x00000040 |
---|
135 |
#define CR0_PHANTOM_MIC1 0x00000080 |
---|
136 |
#define CR0_PHANTOM_MIC3 0x00000100 |
---|
137 |
#define CR0_ZEROBIT09 0x00000200 |
---|
138 |
#define CR0_INSTR_DRIVE_FPGA 0x00000200 |
---|
139 |
#define CRO_OLEVEL_FPGA_CTRL_0 0x00000400 |
---|
140 |
#define CRO_OLEVEL_FPGA_CTRL_1 0x00000800 |
---|
141 |
#define CRO_OLEVEL_FPGA_CTRL_2 0x00001000 |
---|
142 |
#define CR0_ZEROBIT13 0x00002000 |
---|
143 |
#define CRO_ZEROBIT14 0x00004000 |
---|
144 |
#define CRO_ZEROBIT15 0x00008000 |
---|
145 |
#define CRO_PHLEVEL_CTRL0 0x00010000 |
---|
146 |
#define CRO_PHLEVEL_CTRL1 0x00020000 |
---|
147 |
|
---|
148 |
#define CR0_PHANTOM_FF400_MIC0 CR0_PHANTOM_MIC0 |
---|
149 |
#define CR0_PHANTOM_FF400_MIC1 CR0_PHANTOM_MIC1 |
---|
150 |
#define CR0_PHANTOM_FF800_MIC7 CR0_PHANTOM_MIC0 |
---|
151 |
#define CR0_PHANTOM_FF800_MIC8 CR0_PHANTOM_MIC1 |
---|
152 |
#define CR0_PHANTOM_FF800_MIC9 CR0_PHANTOM_MIC2 |
---|
153 |
#define CR0_PHANTOM_FF800_MIC10 CR0_PHANTOM_MIC3 |
---|
154 |
#define CR0_ILEVEL_FPGA_LOGAIN CR0_ILEVEL_FPGA_CTRL0 |
---|
155 |
#define CR0_ILEVEL_FPGA_4dBU CR0_ILEVEL_FPGA_CTRL1 |
---|
156 |
#define CR0_ILEVEL_FPGA_m10dBV CR0_ILEVEL_FPGA_CTRL2 |
---|
157 |
#define CR0_OLEVEL_FPGA_HIGAIN CRO_OLEVEL_FPGA_CTRL_0 |
---|
158 |
#define CR0_OLEVEL_FPGA_4dBU CRO_OLEVEL_FPGA_CTRL_1 |
---|
159 |
#define CR0_OLEVEL_FPGA_m10dBV CRO_OLEVEL_FPGA_CTRL_2 |
---|
160 |
#define CR0_PHLEVEL_4dBU 0 |
---|
161 |
#define CRO_PHLEVEL_m10dBV CRO_PHLEVEL_CTRL0 |
---|
162 |
#define CRO_PHLEVEL_HIGAIN CRO_PHLEVEL_CTRL1 |
---|
163 |
|
---|
164 |
// Configuration register 1 |
---|
165 |
#define CR1_ILEVEL_CPLD_CTRL0 0x00000001 |
---|
166 |
#define CR1_ILEVEL_CPLD_CTRL1 0x00000002 |
---|
167 |
#define CR1_INPUT_OPT0_B 0x00000004 // Input optionset 0, option B |
---|
168 |
#define CR1_OLEVEL_CPLD_CTRL0 0x00000008 |
---|
169 |
#define CR1_OLEVEL_CPLD_CTRL1 0x00000010 |
---|
170 |
#define CR1_INPUT_OPT1_A 0x00000020 // Input optionset 1, option A |
---|
171 |
#define CR1_INPUT_OPT1_B 0x00000040 // Input optionset 1, option B |
---|
172 |
#define CR1_INPUT_OPT2_A 0x00000080 // Input optionset 2, option A |
---|
173 |
#define CR1_INPUT_OPT2_B 0x00000100 // Input optionset 2, option B |
---|
174 |
#define CR1_INSTR_DRIVE 0x00000200 |
---|
175 |
#define CR1_INPUT_OPT0_A1 0x00000400 // Input optionset 0, option A bit 1 |
---|
176 |
#define CR1_INPUT_OPT0_A0 0x00000800 // Input optionset 0, option A bit 0 |
---|
177 |
|
---|
178 |
#define CR1_ILEVEL_CPLD_LOGAIN 0 |
---|
179 |
#define CR1_ILEVEL_CPLD_4dBU CR1_ILEVEL_CPLD_CTRL1 |
---|
180 |
#define CR1_ILEVEL_CPLD_m10dBV (CR1_ILEVEL_CPLD_CTRL0 | CR1_ILEVEL_CPLD_CTRL1) |
---|
181 |
#define CR1_OLEVEL_CPLD_m10dBV CR1_OLEVEL_CPLD_CTRL0 |
---|
182 |
#define CR1_OLEVEL_CPLD_HIGAIN CR1_OLEVEL_CPLD_CTRL1 |
---|
183 |
#define CR1_OLEVEL_CPLD_4dBU (CR1_OLEVEL_CPLD_CTRL0 | CR1_OLEVEL_CPLD_CTRL1) |
---|
184 |
#define CR1_FF800_INPUT7_FRONT CR1_INPUT_OPT1_A |
---|
185 |
#define CR1_FF800_INPUT7_REAR CR1_INPUT_OPT1_B |
---|
186 |
#define CR1_FF800_INPUT8_FRONT CR1_INPUT_OPT2_A |
---|
187 |
#define CR1_FF800_INPUT8_REAR CR1_INPUT_OPT2_B |
---|
188 |
#define CR1_FF400_INPUT3_INSTR CR1_INPUT_OPT1_B // To be confirmed |
---|
189 |
#define CR1_FF400_INPUT3_PAD CR1_INPUT_OPT1_A // To be confirmed |
---|
190 |
#define CR1_FF400_INPUT4_INSTR CR1_INPUT_OPT2_B // To be confirmed |
---|
191 |
#define CR1_FF400_INPUT4_PAD CR1_INPUT_OPT2_A // To be confirmed |
---|
192 |
|
---|
193 |
// The input 1 "front" option is strange on the FF800 in that it is |
---|
194 |
// indicated using two bits. The actual bit set depends, curiously enough, |
---|
195 |
// on the "speaker emulation" (aka "filter") setting. How odd. |
---|
196 |
#define CR1_FF800_INPUT1_FRONT CR1_INPUT_OPT0_A0 |
---|
197 |
#define CR1_FF800_INPUT1_FRONT_WITH_FILTER CR1_INPUT_OPT0_A1 |
---|
198 |
#define CR1_FF800_INPUT1_REAR CR1_INPUT_OPT0_B |
---|
199 |
|
---|
200 |
// Configuration register 2 |
---|
201 |
#define CR2_CLOCKMODE_AUTOSYNC 0x00000000 |
---|
202 |
#define CR2_CLOCKMODE_MASTER 0x00000001 |
---|
203 |
#define CR2_FREQ0 0x00000002 |
---|
204 |
#define CR2_FREQ1 0x00000004 |
---|
205 |
#define CR2_DSPEED 0x00000008 |
---|
206 |
#define CR2_QSSPEED 0x00000010 |
---|
207 |
#define CR2_SPDIF_OUT_PRO 0x00000020 |
---|
208 |
#define CR2_SPDIF_OUT_EMP 0x00000040 |
---|
209 |
#define CR2_SPDIF_OUT_NONAUDIO 0x00000080 |
---|
210 |
#define CR2_SPDIF_OUT_ADAT2 0x00000100 // Optical SPDIF on ADAT2 port |
---|
211 |
#define CR2_SPDIF_IN_COAX 0x00000000 |
---|
212 |
#define CR2_SPDIF_IN_ADAT2 0x00000200 // Optical SPDIF on ADAT2 port |
---|
213 |
#define CR2_SYNC_REF0 0x00000400 |
---|
214 |
#define CR2_SYNC_REF1 0x00000800 |
---|
215 |
#define CR2_SYNC_REF2 0x00001000 |
---|
216 |
#define CR2_WORD_CLOCK_1x 0x00002000 |
---|
217 |
#define CR2_TOGGLE_TCO 0x00004000 // Normally set to 0 |
---|
218 |
#define CR2_P12DB_AN0 0x00010000 // Disable soft-limiter. Normally set to 0 |
---|
219 |
#define CR2_FF400_BIT 0x04000000 // Set on FF400, clear on FF800 |
---|
220 |
#define CR2_TMS 0x40000000 // Unit option, normally 0 |
---|
221 |
#define CR2_DROP_AND_STOP 0x80000000 // Normally set to 1 |
---|
222 |
|
---|
223 |
#define CR2_SYNC_ADAT1 0x0 |
---|
224 |
#define CR2_SYNC_ADAT2 (CR2_SYNC_REF0) |
---|
225 |
#define CR2_SYNC_SPDIF (CR2_SYNC_REF0 | CR2_SYNC_REF1) |
---|
226 |
#define CR2_SYNC_WORDCLOCK (CR2_SYNC_REF2) |
---|
227 |
#define CR2_SYNC_TCO (CR2_SYNC_REF0 | CR2_SYNC_REF2) |
---|
228 |
#define CR2_DISABLE_LIMITER CR2_P12DB_AN0 |
---|
229 |
|
---|
230 |
/* Defines for the status registers */ |
---|
231 |
// Status register 0 |
---|
232 |
#define SR0_ADAT1_LOCK 0x00000400 |
---|
233 |
#define SR0_ADAT2_LOCK 0x00000800 |
---|
234 |
#define SR0_ADAT1_SYNC 0x00001000 |
---|
235 |
#define SR0_ADAT2_SYNC 0x00002000 |
---|
236 |
#define SR0_SPDIF_F0 0x00004000 |
---|
237 |
#define SR0_SPDIF_F1 0x00008000 |
---|
238 |
#define SR0_SPDIF_F2 0x00010000 |
---|
239 |
#define SR0_SPDIF_F3 0x00020000 |
---|
240 |
#define SR0_SPDIF_SYNC 0x00040000 |
---|
241 |
#define SR0_OVER 0x00080000 |
---|
242 |
#define SR0_SPDIF_LOCK 0x00100000 |
---|
243 |
#define SR0_SEL_SYNC_REF0 0x00400000 |
---|
244 |
#define SR0_SEL_SYNC_REF1 0x00800000 |
---|
245 |
#define SR0_SEL_SYNC_REF2 0x01000000 |
---|
246 |
#define SR0_INP_FREQ0 0x02000000 |
---|
247 |
#define SR0_INP_FREQ1 0x04000000 |
---|
248 |
#define SR0_INP_FREQ2 0x08000000 |
---|
249 |
#define SR0_INP_FREQ3 0x10000000 |
---|
250 |
#define SR0_WCLK_SYNC 0x20000000 |
---|
251 |
#define SR0_WCLK_LOCK 0x40000000 |
---|
252 |
|
---|
253 |
// It seems the definition of SR0 is a little different depending on whether |
---|
254 |
// 2 or 4 status registers are read. In the case of a request for 2, the |
---|
255 |
// following additional bits are defined. |
---|
256 |
#define SR0_IS_STREAMING 0x00000001 |
---|
257 |
// If 4 quadlets are requested (as is done when checking the streaming |
---|
258 |
// system status), the lowest 10 bits instead represent sample_rate/250 if |
---|
259 |
// locked to an external clock source. |
---|
260 |
#define SR0_STREAMING_FREQ_MASK 0x000003ff |
---|
261 |
|
---|
262 |
#define SR0_ADAT1_STATUS_MASK (SR0_ADAT1_LOCK|SR0_ADAT1_SYNC) |
---|
263 |
#define SR0_ADAT1_STATUS_NOLOCK 0 |
---|
264 |
#define SR0_ADAT1_STATUS_LOCK SR0_ADAT1_LOCK |
---|
265 |
#define SR0_ADAT1_STATUS_SYNC (SR0_ADAT1_LOCK|SR0_ADAT1_SYNC) |
---|
266 |
#define SR0_ADAT2_STATUS_MASK (SR0_ADAT2_LOCK|SR0_ADAT2_SYNC) |
---|
267 |
#define SR0_ADAT2_STATUS_NOLOCK 0 |
---|
268 |
#define SR0_ADAT2_STATUS_LOCK SR0_ADAT2_LOCK |
---|
269 |
#define SR0_ADAT2_STATUS_SYNC (SR0_ADAT2_LOCK|SR0_ADAT2_SYNC) |
---|
270 |
#define SR0_SPDIF_STATUS_MASK (SR0_SPDIF_LOCK|SR0_SPDIF_SYNC) |
---|
271 |
#define SR0_SPDIF_STATUS_NOLOCK 0 |
---|
272 |
#define SR0_SPDIF_STATUS_LOCK SR0_SPDIF_LOCK |
---|
273 |
#define SR0_SPDIF_STATUS_SYNC (SR0_SPDIF_LOCK|SR0_SPDIF_SYNC) |
---|
274 |
#define SR0_WCLK_STATUS_MASK (SR0_WCLK_LOCK|SR0_WCLK_SYNC) |
---|
275 |
#define SR0_WCLK_STATUS_NOLOCK 0 |
---|
276 |
#define SR0_WCLK_STATUS_LOCK SR0_WCLK_LOCK |
---|
277 |
#define SR0_WCLK_STATUS_SYNC (SR0_WCLK_LOCK|SR0_WCLK_SYNC) |
---|
278 |
|
---|
279 |
#define SR0_SPDIF_FREQ_MASK (SR0_SPDIF_F0|SR0_SPDIF_F1|SR0_SPDIF_F2|SR0_SPDIF_F3) |
---|
280 |
#define SR0_SPDIF_FREQ_32k SR0_SPDIF_F0 |
---|
281 |
#define SR0_SPDIF_FREQ_44k1 SR0_SPDIF_F1 |
---|
282 |
#define SR0_SPDIF_FREQ_48k (SR0_SPDIF_F0|SR0_SPDIF_F1) |
---|
283 |
#define SR0_SPDIF_FREQ_64k SR0_SPDIF_F2 |
---|
284 |
#define SR0_SPDIF_FREQ_88k2 (SR0_SPDIF_F0|SR0_SPDIF_F2) |
---|
285 |
#define SR0_SPDIF_FREQ_96k (SR0_SPDIF_F1|SR0_SPDIF_F2) |
---|
286 |
#define SR0_SPDIF_FREQ_128k (SR0_SPDIF_F0|SR0_SPDIF_F1|SR0_SPDIF_F2) |
---|
287 |
#define SR0_SPDIF_FREQ_176k4 SR0_SPDIF_F3 |
---|
288 |
#define SR0_SPDIF_FREQ_192k (SR0_SPDIF_F0|SR0_SPDIF_F3) |
---|
289 |
|
---|
290 |
#define SR0_AUTOSYNC_SRC_MASK (SR0_SEL_SYNC_REF0|SR0_SEL_SYNC_REF1|SR0_SEL_SYNC_REF2) |
---|
291 |
#define SR0_AUTOSYNC_SRC_ADAT1 0 |
---|
292 |
#define SR0_AUTOSYNC_SRC_ADAT2 SR0_SEL_SYNC_REF0 |
---|
293 |
#define SR0_AUTOSYNC_SRC_SPDIF (SR0_SEL_SYNC_REF0|SR0_SEL_SYNC_REF1) |
---|
294 |
#define SR0_AUTOSYNC_SRC_WCLK SR0_SEL_SYNC_REF2 |
---|
295 |
#define SR0_AUTOSYNC_SRC_TCO (SR0_SEL_SYNC_REF0|SR0_SEL_SYNC_REF2) |
---|
296 |
|
---|
297 |
#define SR0_AUTOSYNC_FREQ_MASK (SR0_INP_FREQ0|SR0_INP_FREQ1|SR0_INP_FREQ2|SR0_INP_FREQ3) |
---|
298 |
#define SR0_AUTOSYNC_FREQ_32k SR0_INP_FREQ0 |
---|
299 |
#define SR0_AUTOSYNC_FREQ_44k1 SR0_INP_FREQ1 |
---|
300 |
#define SR0_AUTOSYNC_FREQ_48k (SR0_INP_FREQ0|SR0_INP_FREQ1) |
---|
301 |
#define SR0_AUTOSYNC_FREQ_64k SR0_INP_FREQ2 |
---|
302 |
#define SR0_AUTOSYNC_FREQ_88k2 (SR0_INP_FREQ0|SR0_INP_FREQ2) |
---|
303 |
#define SR0_AUTOSYNC_FREQ_96k (SR0_INP_FREQ1|SR0_INP_FREQ2) |
---|
304 |
#define SR0_AUTOSYNC_FREQ_128k (SR0_INP_FREQ0|SR0_INP_FREQ1|SR0_INP_FREQ2) |
---|
305 |
#define SR0_AUTOSYNC_FREQ_176k4 SR0_INP_FREQ3 |
---|
306 |
#define SR0_AUTOSYNC_FREQ_192k (SR0_INP_FREQ0|SR0_INP_FREQ3) |
---|
307 |
#define SR0_AUTOSYNC_FREQ_NONE 0 |
---|
308 |
|
---|
309 |
// Status register 1 |
---|
310 |
#define SR1_CLOCK_MODE_MASTER 0x00000001 |
---|
311 |
#define SR1_TCO_SYNC 0x00400000 |
---|
312 |
#define SR1_TCO_LOCK 0x00800000 |
---|
313 |
|
---|
314 |
#define SR1_TCO_STATUS_MASK (SR1_TCO_LOCK|SR1_TCO_SYNC) |
---|
315 |
#define SR1_TCO_STATUS_NOLOCK 0 |
---|
316 |
#define SR1_TCO_STATUS_LOCK SR1_TCO_LOCK |
---|
317 |
#define SR1_TCO_STATUS_SYNC (SR1_TCO_LOCK|SR1_TCO_SYNC) |
---|
318 |
|
---|
319 |
/* Structure used to store device settings in the device flash RAM. This |
---|
320 |
* structure mirrors the layout in the Fireface's flash, so it cannot be |
---|
321 |
* altered. Fields named as unused_* are not utilised at present. |
---|
322 |
*/ |
---|
323 |
typedef struct { |
---|
324 |
uint32_t unused_device_id; |
---|
325 |
uint32_t unused_device_rev; |
---|
326 |
uint32_t unused_asio_latency; |
---|
327 |
uint32_t unused_samples_per_frame; |
---|
328 |
uint32_t spdif_input_mode; |
---|
329 |
uint32_t spdif_output_emphasis; |
---|
330 |
uint32_t spdif_output_pro; |
---|
331 |
uint32_t clock_mode; |
---|
332 |
uint32_t spdif_output_nonaudio; |
---|
333 |
uint32_t sync_ref; |
---|
334 |
uint32_t spdif_output_mode; |
---|
335 |
uint32_t unused_check_input; |
---|
336 |
uint32_t unused_status; |
---|
337 |
uint32_t unused_register[4]; |
---|
338 |
uint32_t unused_iso_rx_channel; |
---|
339 |
uint32_t unused_iso_tx_channel; |
---|
340 |
uint32_t unused_timecode; |
---|
341 |
uint32_t unused_device_type; |
---|
342 |
uint32_t unused_number_of_devices; |
---|
343 |
uint32_t tms; |
---|
344 |
uint32_t unused_speed; |
---|
345 |
uint32_t unused_channels_avail_hi; |
---|
346 |
uint32_t unused_channels_avail_lo; |
---|
347 |
uint32_t limit_bandwidth; |
---|
348 |
uint32_t unused_bandwidth_allocated; |
---|
349 |
uint32_t stop_on_dropout; |
---|
350 |
uint32_t input_level; |
---|
351 |
uint32_t output_level; |
---|
352 |
uint32_t mic_plug_select[2]; // Front/rear select for FF800 ch 7/8 |
---|
353 |
// [0] = phones level on FF400 |
---|
354 |
uint32_t mic_phantom[4]; |
---|
355 |
uint32_t instrument_plug_select; // Front/rear select for FF800 ch 1 |
---|
356 |
uint32_t filter; |
---|
357 |
uint32_t fuzz; |
---|
358 |
uint32_t unused_sync_align; |
---|
359 |
uint32_t unused_device_index; |
---|
360 |
uint32_t unused_advanced_dialog; |
---|
361 |
uint32_t sample_rate; |
---|
362 |
uint32_t unused_interleaved; |
---|
363 |
uint32_t unused_sn; |
---|
364 |
uint32_t word_clock_single_speed; |
---|
365 |
uint32_t unused_num_channels; |
---|
366 |
uint32_t unused_dropped_samples; |
---|
367 |
uint32_t p12db_an[10]; |
---|
368 |
} FF_device_flash_settings_t; |
---|
369 |
|
---|
370 |
// Defines used to interpret device flash settings. These appear to be |
---|
371 |
// arbitary from the device's perspective since the device doesn't appear to |
---|
372 |
// directly use these stored settings. The driver loads the flash settings |
---|
373 |
// and then uses them to infer the appropriate values for the configuration |
---|
374 |
// registers. The actual values used here appear to correspond more or less |
---|
375 |
// to the "value" returns from the GUI elements used to represent the |
---|
376 |
// controls under other systems. |
---|
377 |
#define FF_DEV_FLASH_INVALID 0xffffffff |
---|
378 |
#define FF_DEV_FLASH_SPDIF_INPUT_COAX 0x00000002 // To be confirmed |
---|
379 |
#define FF_DEV_FLASH_SPDIF_INPUT_OPTICAL 0x00000001 // To be confirmed |
---|
380 |
#define FF_DEV_FLASH_SPDIF_OUTPUT_COAX 0x00000000 // To be confirmed |
---|
381 |
#define FF_DEV_FLASH_SPDIF_OUTPUT_OPTICAL 0x00000001 // To be confirmed |
---|
382 |
#define FF_DEV_FLASH_SPDIF_OUTPUT_EMPHASIS_ON 0x00000001 |
---|
383 |
#define FF_DEV_FLASH_SPDIF_OUTPUT_PRO_ON 0x00000001 |
---|
384 |
#define FF_DEV_FLASH_SPDIF_OUTPUT_NONAUDIO_ON 0x00000001 |
---|
385 |
#define FF_DEV_FLASH_CLOCK_MODE_MASTER 0x00000002 |
---|
386 |
#define FF_DEV_FLASH_CLOCK_MODE_AUTOSYNC 0x00000001 |
---|
387 |
#define FF_DEV_FLASH_CLOCK_MODE_SLAVE 0x00000001 |
---|
388 |
#define FF_DEV_FLASH_SYNCREF_WORDCLOCK 0x00000001 |
---|
389 |
#define FF_DEV_FLASH_SYNCREF_ADAT1 0x00000002 |
---|
390 |
#define FF_DEV_FLASH_SYNCREF_ADAT2 0x00000003 |
---|
391 |
#define FF_DEV_FLASH_SYNCREF_SPDIF 0x00000004 |
---|
392 |
#define FF_DEV_FLASH_SYNCREC_TCO 0x00000005 |
---|
393 |
#define FF_DEV_FLASH_ILEVEL_LOGAIN 0x00000001 |
---|
394 |
#define FF_DEV_FLASH_ILEVEL_4dBU 0x00000002 |
---|
395 |
#define FF_DEV_FLASH_ILEVEL_m10dBV 0x00000003 |
---|
396 |
#define FF_DEV_FLASH_OLEVEL_HIGAIN 0x00000001 |
---|
397 |
#define FF_DEV_FLASH_OLEVEL_4dBU 0x00000002 |
---|
398 |
#define FF_DEV_FLASH_OLEVEL_m10dBV 0x00000003 |
---|
399 |
#define FF_DEV_FLASH_MIC_PHANTOM_ON 0x00000001 |
---|
400 |
#define FF_DEV_FLASH_SRATE_DDS_INACTIVE 0x00000000 |
---|
401 |
#define FF_DEV_FLASH_WORD_CLOCK_1x 0x00000001 |
---|
402 |
#define FF_DEV_FLASH_PLUG_SELECT_FRONT 0x00000001 // To be confirmed |
---|
403 |
#define FF_DEV_FLASH_PLUG_SELECT_REAR 0x00000000 // To be confirmed |
---|
404 |
|
---|
405 |
// Structure used by FFADO to keep track of the device status. This is |
---|
406 |
// decoupled from any structures used directly by the device, so it can be |
---|
407 |
// added to and ordered freely. When making changes to the device the |
---|
408 |
// configuration registers must be all written to, so any function changing |
---|
409 |
// a parameter must have access to the complete device status. |
---|
410 |
typedef struct { |
---|
411 |
uint32_t mic_phantom[4]; |
---|
412 |
uint32_t spdif_input_mode; |
---|
413 |
uint32_t spdif_output_emphasis; |
---|
414 |
uint32_t spdif_output_pro; |
---|
415 |
uint32_t spdif_output_nonaudio; |
---|
416 |
uint32_t spdif_output_mode; |
---|
417 |
uint32_t clock_mode; |
---|
418 |
uint32_t sync_ref; |
---|
419 |
uint32_t tms; |
---|
420 |
uint32_t limit_bandwidth; |
---|
421 |
uint32_t stop_on_dropout; |
---|
422 |
uint32_t input_level; |
---|
423 |
uint32_t output_level; |
---|
424 |
uint32_t filter; |
---|
425 |
uint32_t fuzz; |
---|
426 |
uint32_t limiter_disable; |
---|
427 |
uint32_t sample_rate; |
---|
428 |
uint32_t word_clock_single_speed; |
---|
429 |
uint32_t phones_level; // Derived from fields in device flash |
---|
430 |
uint32_t input_opt[3]; // Derived from fields in device flash |
---|
431 |
} FF_software_settings_t; |
---|
432 |
|
---|
433 |
// Defines used to interpret the software settings structure. For now we |
---|
434 |
// use the same values as used by the device flash settings to remove the |
---|
435 |
// need for translation between reading the flash and copying it to the |
---|
436 |
// software settings structure, but in principle different values could be |
---|
437 |
// used given translation code. |
---|
438 |
#define FF_SWPARAM_INVALID FF_DEV_FLASH_INVALID |
---|
439 |
#define FF_SWPARAM_SPDIF_INPUT_COAX FF_DEV_FLASH_SPDIF_INPUT_COAX |
---|
440 |
#define FF_SWPARAM_SPDIF_INPUT_OPTICAL FF_DEV_FLASH_SPDIF_INPUT_OPTICAL |
---|
441 |
#define FF_SWPARAM_SPDIF_OUTPUT_COAX FF_DEV_FLASH_SPDIF_OUTPUT_COAX |
---|
442 |
#define FF_SWPARAM_SPDIF_OUTPUT_OPTICAL FF_DEV_FLASH_SPDIF_OUTPUT_OPTICAL |
---|
443 |
#define FF_SWPARAM_SPDIF_OUTPUT_EMPHASIS_ON FF_DEV_FLASH_SPDIF_OUTPUT_EMPHASIS_ON |
---|
444 |
#define FF_SWPARAM_SPDIF_OUTPUT_PRO_ON FF_DEV_FLASH_SPDIF_OUTPUT_PRO_ON |
---|
445 |
#define FF_SWPARAM_SPDIF_OUTPUT_NONAUDIO_ON FF_DEV_FLASH_SPDIF_OUTPUT_NONAUDIO_ON |
---|
446 |
#define FF_SWPARAM_CLOCK_MODE_MASTER FF_DEV_FLASH_CLOCK_MODE_MASTER |
---|
447 |
#define FF_SWPARAM_CLOCK_MODE_AUTOSYNC FF_DEV_FLASH_CLOCK_MODE_AUTOSYNC |
---|
448 |
#define FF_SWPARAM_CLOCK_MODE_SLAVE FF_DEV_FLASH_CLOCK_MODE_SLAVE |
---|
449 |
#define FF_SWPARAM_SYNCREF_WORDCLOCK FF_DEV_FLASH_SYNCREF_WORDCLOCK |
---|
450 |
#define FF_SWPARAM_SYNCREF_ADAT1 FF_DEV_FLASH_SYNCREF_ADAT1 |
---|
451 |
#define FF_SWPARAM_SYNCREF_ADAT2 FF_DEV_FLASH_SYNCREF_ADAT2 |
---|
452 |
#define FF_SWPARAM_SYNCREF_SPDIF FF_DEV_FLASH_SYNCREF_SPDIF |
---|
453 |
#define FF_SWPARAM_SYNCREC_TCO FF_DEV_FLASH_SYNCREC_TCO |
---|
454 |
#define FF_SWPARAM_ILEVEL_LOGAIN FF_DEV_FLASH_ILEVEL_LOGAIN |
---|
455 |
#define FF_SWPARAM_ILEVEL_4dBU FF_DEV_FLASH_ILEVEL_4dBU |
---|
456 |
#define FF_SWPARAM_ILEVEL_m10dBV FF_DEV_FLASH_ILEVEL_m10dBV |
---|
457 |
#define FF_SWPARAM_OLEVEL_HIGAIN FF_DEV_FLASH_OLEVEL_HIGAIN |
---|
458 |
#define FF_SWPARAM_OLEVEL_4dBU FF_DEV_FLASH_OLEVEL_4dBU |
---|
459 |
#define FF_SWPARAM_OLEVEL_m10dBV FF_DEV_FLASH_OLEVEL_m10dBV |
---|
460 |
#define FF_SWPARAM_MIC_PHANTOM_ON FF_DEV_FLASH_MIC_PHANTOM_ON |
---|
461 |
#define FF_SWPARAM_WORD_CLOCK_1x FF_DEV_FLASH_WORD_CLOCK_1x |
---|
462 |
#define FF_SWPARAM_SRATE_DDS_INACTIVE FF_DEV_FLASH_SRATE_DDS_INACTIVE |
---|
463 |
// |
---|
464 |
// The following defines refer to fields in the software parameter record |
---|
465 |
// which are derived from one or more fields in device flash. |
---|
466 |
#define FF_SWPARAM_PHONESLEVEL_HIGAIN 0x00000001 |
---|
467 |
#define FF_SWPARAM_PHONESLEVEL_4dBU 0x00000002 |
---|
468 |
#define FF_SWPARAM_PHONESLEVEL_m10dBV 0x00000003 |
---|
469 |
#define FF_SWPARAM_INPUT_OPT_B 0x00000001 |
---|
470 |
#define FF_SWPARAM_INPUT_OPT_A 0x00000002 |
---|
471 |
|
---|
472 |
#define FF_SWPARAM_FF800_INPUT_OPT_FRONT FF_SWPARAM_INPUT_OPT_A |
---|
473 |
#define FF_SWPARAM_FF800_INPUT_OPT_REAR FF_SWPARAM_INPUT_OPT_B |
---|
474 |
|
---|
475 |
// The general Fireface state |
---|
476 |
typedef struct { |
---|
477 |
uint32_t is_streaming; |
---|
478 |
uint32_t clock_mode; |
---|
479 |
uint32_t autosync_source; |
---|
480 |
uint32_t autosync_freq; |
---|
481 |
uint32_t spdif_freq; |
---|
482 |
uint32_t adat1_sync_status, adat2_sync_status; |
---|
483 |
uint32_t spdif_sync_status; |
---|
484 |
uint32_t wclk_sync_status, tco_sync_status; |
---|
485 |
} FF_state_t; |
---|
486 |
|
---|
487 |
#define FF_STATE_CLOCKMODE_MASTER 0 |
---|
488 |
#define FF_STATE_CLOCKMODE_AUTOSYNC 1 |
---|
489 |
#define FF_STATE_AUTOSYNC_SRC_NOLOCK 0 |
---|
490 |
#define FF_STATE_AUTOSYNC_SRC_ADAT1 1 |
---|
491 |
#define FF_STATE_AUTOSYNC_SRC_ADAT2 2 |
---|
492 |
#define FF_STATE_AUTOSYNC_SRC_SPDIF 3 |
---|
493 |
#define FF_STATE_AUTOSYNC_SRC_WCLK 4 |
---|
494 |
#define FF_STATE_AUTOSYNC_SRC_TCO 5 |
---|
495 |
#define FF_STATE_SYNC_NOLOCK 0 |
---|
496 |
#define FF_STATE_SYNC_LOCKED 1 |
---|
497 |
#define FF_STATE_SYNC_SYNCED 2 |
---|
498 |
|
---|
499 |
// Data structure for the TCO (Time Code Option) state |
---|
500 |
typedef struct { |
---|
501 |
uint32_t input; |
---|
502 |
uint32_t frame_rate; |
---|
503 |
uint32_t word_clock; |
---|
504 |
uint32_t sample_rate; |
---|
505 |
uint32_t pull; |
---|
506 |
uint32_t termination; |
---|
507 |
uint32_t MTC; |
---|
508 |
} FF_TCO_settings_t; |
---|
509 |
|
---|
510 |
// Defines used to configure selected quadlets of the TCO write space. Some |
---|
511 |
// of these are also used when configuring the TCO. The byte indices |
---|
512 |
// referenced in the define names are 0-based. |
---|
513 |
|
---|
514 |
// TCO quadlet 0 |
---|
515 |
#define FF_TCO0_MTC 0x80000000 |
---|
516 |
|
---|
517 |
// TCO quadlet 1 |
---|
518 |
#define FF_TCO1_TCO_lock 0x00000001 |
---|
519 |
#define FF_TCO1_WORD_CLOCK_INPUT_RATE0 0x00000002 |
---|
520 |
#define FF_TCO1_WORD_CLOCK_INPUT_RATE1 0x00000004 |
---|
521 |
#define FF_TCO1_LTC_INPUT_VALID 0x00000008 |
---|
522 |
#define FF_TCO1_WORD_CLOCK_INPUT_VALID 0x00000010 |
---|
523 |
#define FF_TCO1_VIDEO_INPUT_NTSC 0x00000020 |
---|
524 |
#define FF_TCO1_VIDEO_INPUT_PAL 0x00000040 |
---|
525 |
#define FF_TCO1_SET_TC 0x00000100 |
---|
526 |
#define FF_TCO1_SET_DROPFRAME 0x00000200 |
---|
527 |
#define FF_TCO1_LTC_FORMAT0 0x00000400 |
---|
528 |
#define FF_TCO1_LTC_FORMAT1 0x00000800 |
---|
529 |
|
---|
530 |
#define FF_TCO1_WORD_CLOCK_INPUT_1x 0 |
---|
531 |
#define FF_TCO1_WORD_CLOCK_INPUT_2x FF_TCO1_WORD_CLOCK_INPUT_RATE0 |
---|
532 |
#define FF_TCO1_WORD_CLOCK_INPUT_4x FF_TCO1_WORD_CLOCK_INPUT_RATE1 |
---|
533 |
#define FF_TCO1_WORD_CLOCK_INPUT_MASK (FF_TCO1_WORD_CLOCK_INPUT_RATE0|FF_TCO1_WORD_CLOCK_INPUT_RATE1) |
---|
534 |
#define FF_TCO1_VIDEO_INPUT_MASK (FF_TCO1_VIDEO_INPUT_NTSC|FF_TCO1_VIDEO_INPUT_PAL) |
---|
535 |
#define FF_TC01_LTC_FORMAT_24fps 0 |
---|
536 |
#define FF_TCO1_LTC_FORMAT_25fps FF_TCO1_LTC_FORMAT0 |
---|
537 |
#define FF_TC01_LTC_FORMAT_29_97fps FF_TCO1_LTC_FORMAT1 |
---|
538 |
#define FF_TCO1_LTC_FORMAT_29_97dpfs (FF_TCO1_LTC_FORMAT1|FF_TCO1_SET_DROPFRAME) |
---|
539 |
#define FF_TCO1_LTC_FORMAT_30fps (FF_TCO1_LTC_FORMAT0|FF_TCO1_LTC_FORMAT1) |
---|
540 |
#define FF_TCO1_LTC_FORMAT_30dfps (FF_TCO1_LTC_FORMAT0|FF_TCO1_LTC_FORMAT1|FF_TCO1_SET_DROPFRAME) |
---|
541 |
#define FF_TCO1_LTC_FORMAT_MASK (FF_TCO1_LTC_FORMAT0|FF_TCO1_LTC_FORMAT1) |
---|
542 |
|
---|
543 |
// TCO quadlet 2 |
---|
544 |
#define FF_TCO2_TC_RUN 0x00010000 |
---|
545 |
#define FF_TCO2_WORD_CLOCK_CONV0 0x00020000 |
---|
546 |
#define FF_TCO2_WORD_CLOCK_CONV1 0x00040000 |
---|
547 |
#define FF_TCO2_NUM_DROPFRAMES0 0x00080000 // Unused |
---|
548 |
#define FF_TCO2_NUM_DROPFRAMES1 0x00100000 // Unused |
---|
549 |
#define FF_TCO2_SET_JAM_SYNC 0x00200000 |
---|
550 |
#define FF_TCO2_SET_FLYWHEEL 0x00400000 |
---|
551 |
#define FF_TCO2_SET_01_4 0x01000000 |
---|
552 |
#define FF_TCO2_SET_PULLDOWN 0x02000000 |
---|
553 |
#define FF_TCO2_SET_PULLUP 0x04000000 |
---|
554 |
#define FF_TCO2_SET_FREQ 0x08000000 |
---|
555 |
#define FF_TCO2_SET_TERMINATION 0x10000000 |
---|
556 |
#define FF_TCO2_SET_INPUT0 0x20000000 |
---|
557 |
#define FF_TCO2_SET_INPUT1 0x40000000 |
---|
558 |
#define FF_TCO2_SET_FREQ_FROM_APP 0x80000000 |
---|
559 |
|
---|
560 |
#define FF_TCO2_WORD_CLOCK_CONV_1_1 0 |
---|
561 |
#define FF_TCO2_WORD_CLOCK_CONV_44_48 FF_TCO2_WORD_CLOCK_CONV0 |
---|
562 |
#define FF_TCO2_WORD_CLOCK_CONV_48_44 FF_TCO2_WORD_CLOCK_CONV1 |
---|
563 |
#define FF_TCO2_PULL_0 0 |
---|
564 |
#define FF_TCO2_PULL_UP_01 FF_TCO2_SET_PULLUP |
---|
565 |
#define FF_TCO2_PULL_DOWN_01 FF_TCO2_SET_PULLDOWN |
---|
566 |
#define FF_TCO2_PULL_UP_40 (FF_TCO2_SET_PULLUP|FF_TCO2_SET_01_4) |
---|
567 |
#define FF_TCO2_PULL_DOWN_40 (FF_TCO2_SET_PULLDOWN|FF_TCO2_SET_01_4) |
---|
568 |
#define FF_TCO2_INPUT_LTC FF_TCO2_SET_INPUT1 |
---|
569 |
#define FF_TCO2_INPUT_VIDEO FF_TCO2_SET_INPUT0 |
---|
570 |
#define FF_TCO2_INPUT_WORD_CLOCK 0 |
---|
571 |
#define FF_TCO2_SRATE_44_1 0 |
---|
572 |
#define FF_TCO2_SRATE_48 FF_TCO2_SET_FREQ |
---|
573 |
#define FF_TCO2_SRATE_FROM_APP FF_TCO2_SET_FREQ_FROM_APP |
---|
574 |
|
---|
575 |
// Interpretation of the TCO software settings fields |
---|
576 |
#define FF_TCOPARAM_INPUT_LTC 1 |
---|
577 |
#define FF_TCOPARAM_INPUT_VIDEO 2 |
---|
578 |
#define FF_TCOPARAM_INPUT_WCK 3 |
---|
579 |
#define FF_TCOPARAM_FRAMERATE_24fps 1 |
---|
580 |
#define FF_TCOPARAM_FRAMERATE_25fps 2 |
---|
581 |
#define FF_TCOPARAM_FRAMERATE_29_97fps 3 |
---|
582 |
#define FF_TCOPARAM_FRAMERATE_29_97dfps 4 |
---|
583 |
#define FF_TCOPARAM_FRAMERATE_30fps 5 |
---|
584 |
#define FF_TCOPARAM_FRAMERATE_30dfps 6 |
---|
585 |
#define FF_TCOPARAM_WORD_CLOCK_CONV_1_1 1 // 1:1 |
---|
586 |
#define FF_TCOPARAM_WORD_CLOCK_CONV_44_48 2 // 44.1 kHz-> 48 kHz |
---|
587 |
#define FF_TCOPARAM_WORD_CLOCK_CONV_48_44 3 // 48 kHz -> 44.1 kHz |
---|
588 |
#define FF_TCOPARAM_SRATE_44_1 1 // Rate is 44.1 kHz |
---|
589 |
#define FF_TCOPARAM_SRATE_48 2 // Rate is 48 kHz |
---|
590 |
#define FF_TCOPARAM_SRATE_FROM_APP 3 |
---|
591 |
#define FF_TCPPARAM_PULL_NONE 1 |
---|
592 |
#define FF_TCOPARAM_PULL_UP_01 2 // +0.1% |
---|
593 |
#define FF_TCOPARAM_PULL_DOWN_01 3 // -0.1% |
---|
594 |
#define FF_TCOPARAM_PULL_UP_40 4 // +4.0% |
---|
595 |
#define FF_TCOPARAM_PULL_DOWN_40 5 // -4.0% |
---|
596 |
#define FF_TCOPARAM_TERMINATION_ON 1 |
---|
597 |
|
---|
598 |
// The state of the TCO |
---|
599 |
typedef struct { |
---|
600 |
unsigned int locked, ltc_valid; |
---|
601 |
unsigned int hours, minutes, seconds, frames; |
---|
602 |
unsigned int frame_rate; |
---|
603 |
unsigned int drop_frame; |
---|
604 |
unsigned int video_input; |
---|
605 |
unsigned int word_clock_state; |
---|
606 |
float sample_rate; |
---|
607 |
} FF_TCO_state_t; |
---|
608 |
|
---|
609 |
// TCO state field defines |
---|
610 |
#define FF_TCOSTATE_FRAMERATE_24fps 1 |
---|
611 |
#define FF_TCOSTATE_FRAMERATE_25fps 2 |
---|
612 |
#define FF_TCOSTATE_FRAMERATE_29_97fps 3 |
---|
613 |
#define FF_TCOSTATE_FRAMERATE_30fps 4 |
---|
614 |
#define FF_TCOSTATE_VIDEO_NONE 0 |
---|
615 |
#define FF_TCOSTATE_VIDEO_PAL 1 |
---|
616 |
#define FF_TCOSTATE_VIDEO_NTSC 2 |
---|
617 |
#define FF_TCOSTATE_WORDCLOCK_NONE 0 |
---|
618 |
#define FF_TCOSTATE_WORDCLOCK_1x 1 |
---|
619 |
#define FF_TCOSTATE_WORDCLOCK_2x 2 |
---|
620 |
#define FF_TCOSTATE_WORDCLOCK_4x 3 |
---|
621 |
|
---|
622 |
#endif |
---|