]> git.karo-electronics.de Git - linux-beck.git/blob - sound/pci/asihpi/hpi.h
ALSA: asihpi - Split hpi version info into separate header file.
[linux-beck.git] / sound / pci / asihpi / hpi.h
1 /******************************************************************************
2
3     AudioScience HPI driver
4     Copyright (C) 1997-2011  AudioScience Inc. <support@audioscience.com>
5
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of version 2 of the GNU General Public License as
8     published by the Free Software Foundation;
9
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14
15     You should have received a copy of the GNU General Public License
16     along with this program; if not, write to the Free Software
17     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19 */
20 /** \file hpi.h
21
22  AudioScience Hardware Programming Interface (HPI)
23  public API definition.
24
25  The HPI is a low-level hardware abstraction layer to all
26  AudioScience digital audio adapters
27
28 (C) Copyright AudioScience Inc. 1998-2010
29 */
30
31 #ifndef _HPI_H_
32 #define _HPI_H_
33
34 #include <linux/types.h>
35 #define HPI_BUILD_KERNEL_MODE
36
37 /******************************************************************************/
38 /********       HPI API DEFINITIONS                                       *****/
39 /******************************************************************************/
40
41 /*******************************************/
42 /**  Audio format types
43 \ingroup stream
44 */
45 enum HPI_FORMATS {
46 /** Used internally on adapter. */
47         HPI_FORMAT_MIXER_NATIVE = 0,
48 /** 8-bit unsigned PCM. Windows equivalent is WAVE_FORMAT_PCM. */
49         HPI_FORMAT_PCM8_UNSIGNED = 1,
50 /** 16-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM. */
51         HPI_FORMAT_PCM16_SIGNED = 2,
52 /** MPEG-1 Layer-1. */
53         HPI_FORMAT_MPEG_L1 = 3,
54 /** MPEG-1 Layer-2.
55
56 Windows equivalent is WAVE_FORMAT_MPEG.
57
58 The following table shows what combinations of mode and bitrate are possible:
59
60 <table border=1 cellspacing=0 cellpadding=5>
61 <tr>
62 <td><p><b>Bitrate (kbs)</b></p>
63 <td><p><b>Mono</b></p>
64 <td><p><b>Stereo,<br>Joint Stereo or<br>Dual Channel</b></p>
65
66 <tr><td>32<td>X<td>_
67 <tr><td>40<td>_<td>_
68 <tr><td>48<td>X<td>_
69 <tr><td>56<td>X<td>_
70 <tr><td>64<td>X<td>X
71 <tr><td>80<td>X<td>_
72 <tr><td>96<td>X<td>X
73 <tr><td>112<td>X<td>X
74 <tr><td>128<td>X<td>X
75 <tr><td>160<td>X<td>X
76 <tr><td>192<td>X<td>X
77 <tr><td>224<td>_<td>X
78 <tr><td>256<td>-<td>X
79 <tr><td>320<td>-<td>X
80 <tr><td>384<td>_<td>X
81 </table>
82 */
83         HPI_FORMAT_MPEG_L2 = 4,
84 /** MPEG-1 Layer-3.
85 Windows equivalent is WAVE_FORMAT_MPEG.
86
87 The following table shows what combinations of mode and bitrate are possible:
88
89 <table border=1 cellspacing=0 cellpadding=5>
90 <tr>
91 <td><p><b>Bitrate (kbs)</b></p>
92 <td><p><b>Mono<br>Stereo @ 8,<br>11.025 and<br>12kHz*</b></p>
93 <td><p><b>Mono<br>Stereo @ 16,<br>22.050 and<br>24kHz*</b></p>
94 <td><p><b>Mono<br>Stereo @ 32,<br>44.1 and<br>48kHz</b></p>
95
96 <tr><td>16<td>X<td>X<td>_
97 <tr><td>24<td>X<td>X<td>_
98 <tr><td>32<td>X<td>X<td>X
99 <tr><td>40<td>X<td>X<td>X
100 <tr><td>48<td>X<td>X<td>X
101 <tr><td>56<td>X<td>X<td>X
102 <tr><td>64<td>X<td>X<td>X
103 <tr><td>80<td>_<td>X<td>X
104 <tr><td>96<td>_<td>X<td>X
105 <tr><td>112<td>_<td>X<td>X
106 <tr><td>128<td>_<td>X<td>X
107 <tr><td>144<td>_<td>X<td>_
108 <tr><td>160<td>_<td>X<td>X
109 <tr><td>192<td>_<td>_<td>X
110 <tr><td>224<td>_<td>_<td>X
111 <tr><td>256<td>-<td>_<td>X
112 <tr><td>320<td>-<td>_<td>X
113 </table>
114 \b * Available on the ASI6000 series only
115 */
116         HPI_FORMAT_MPEG_L3 = 5,
117 /** Dolby AC-2. */
118         HPI_FORMAT_DOLBY_AC2 = 6,
119 /** Dolbt AC-3. */
120         HPI_FORMAT_DOLBY_AC3 = 7,
121 /** 16-bit PCM big-endian. */
122         HPI_FORMAT_PCM16_BIGENDIAN = 8,
123 /** TAGIT-1 algorithm - hits. */
124         HPI_FORMAT_AA_TAGIT1_HITS = 9,
125 /** TAGIT-1 algorithm - inserts. */
126         HPI_FORMAT_AA_TAGIT1_INSERTS = 10,
127 /** 32-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM.
128 Each sample is a 32bit word. The most significant 24 bits contain a 24-bit
129 sample and the least significant 8 bits are set to 0.
130 */
131         HPI_FORMAT_PCM32_SIGNED = 11,
132 /** Raw bitstream - unknown format. */
133         HPI_FORMAT_RAW_BITSTREAM = 12,
134 /** TAGIT-1 algorithm hits - extended. */
135         HPI_FORMAT_AA_TAGIT1_HITS_EX1 = 13,
136 /** 32-bit PCM as an IEEE float. Windows equivalent is WAVE_FORMAT_IEEE_FLOAT.
137 Each sample is a 32bit word in IEEE754 floating point format.
138 The range is +1.0 to -1.0, which corresponds to digital fullscale.
139 */
140         HPI_FORMAT_PCM32_FLOAT = 14,
141 /** 24-bit PCM signed. Windows equivalent is WAVE_FORMAT_PCM. */
142         HPI_FORMAT_PCM24_SIGNED = 15,
143 /** OEM format 1 - private. */
144         HPI_FORMAT_OEM1 = 16,
145 /** OEM format 2 - private. */
146         HPI_FORMAT_OEM2 = 17,
147 /** Undefined format. */
148         HPI_FORMAT_UNDEFINED = 0xffff
149 };
150
151 /*******************************************/
152 /** Stream States
153 \ingroup stream
154 */
155 enum HPI_STREAM_STATES {
156         /** State stopped - stream is stopped. */
157         HPI_STATE_STOPPED = 1,
158         /** State playing - stream is playing audio. */
159         HPI_STATE_PLAYING = 2,
160         /** State recording - stream is recording. */
161         HPI_STATE_RECORDING = 3,
162         /** State drained - playing stream ran out of data to play. */
163         HPI_STATE_DRAINED = 4,
164         /** State generate sine - to be implemented. */
165         HPI_STATE_SINEGEN = 5,
166         /** State wait - used for inter-card sync to mean waiting for all
167                 cards to be ready. */
168         HPI_STATE_WAIT = 6
169 };
170 /*******************************************/
171 /** Source node types
172 \ingroup mixer
173 */
174 enum HPI_SOURCENODES {
175         /** This define can be used instead of 0 to indicate
176         that there is no valid source node. A control that
177         exists on a destination node can be searched for using a source
178         node value of either 0, or HPI_SOURCENODE_NONE */
179         HPI_SOURCENODE_NONE = 100,
180         /** Out Stream (Play) node. */
181         HPI_SOURCENODE_OSTREAM = 101,
182         /** Line in node - could be analog, AES/EBU or network. */
183         HPI_SOURCENODE_LINEIN = 102,
184         HPI_SOURCENODE_AESEBU_IN = 103,      /**< AES/EBU input node. */
185         HPI_SOURCENODE_TUNER = 104,          /**< tuner node. */
186         HPI_SOURCENODE_RF = 105,             /**< RF input node. */
187         HPI_SOURCENODE_CLOCK_SOURCE = 106,   /**< clock source node. */
188         HPI_SOURCENODE_RAW_BITSTREAM = 107,  /**< raw bitstream node. */
189         HPI_SOURCENODE_MICROPHONE = 108,     /**< microphone node. */
190         /** Cobranet input node -
191             Audio samples come from the Cobranet network and into the device. */
192         HPI_SOURCENODE_COBRANET = 109,
193         HPI_SOURCENODE_ANALOG = 110,         /**< analog input node. */
194         HPI_SOURCENODE_ADAPTER = 111,        /**< adapter node. */
195         /** RTP stream input node - This node is a destination for
196             packets of RTP audio samples from other devices. */
197         HPI_SOURCENODE_RTP_DESTINATION = 112,
198         HPI_SOURCENODE_GP_IN = 113,          /**< general purpose input. */
199         /* !!!Update this  AND hpidebug.h if you add a new sourcenode type!!! */
200         HPI_SOURCENODE_LAST_INDEX = 113      /**< largest ID */
201                 /* AX6 max sourcenode types = 15 */
202 };
203
204 /*******************************************/
205 /** Destination node types
206 \ingroup mixer
207 */
208 enum HPI_DESTNODES {
209         /** This define can be used instead of 0 to indicate
210         that there is no valid destination node. A control that
211         exists on a source node can be searched for using a destination
212         node value of either 0, or HPI_DESTNODE_NONE */
213         HPI_DESTNODE_NONE = 200,
214         /** In Stream (Record) node. */
215         HPI_DESTNODE_ISTREAM = 201,
216         HPI_DESTNODE_LINEOUT = 202,          /**< line out node. */
217         HPI_DESTNODE_AESEBU_OUT = 203,       /**< AES/EBU output node. */
218         HPI_DESTNODE_RF = 204,               /**< RF output node. */
219         HPI_DESTNODE_SPEAKER = 205,          /**< speaker output node. */
220         /** Cobranet output node -
221             Audio samples from the device are sent out on the Cobranet network.*/
222         HPI_DESTNODE_COBRANET = 206,
223         HPI_DESTNODE_ANALOG = 207,           /**< analog output node. */
224         /** RTP stream output node - This node is a source for
225             packets of RTP audio samples that are sent to other devices. */
226         HPI_DESTNODE_RTP_SOURCE = 208,
227         HPI_DESTNODE_GP_OUT = 209,           /**< general purpose output node. */
228         /* !!!Update this AND hpidebug.h if you add a new destnode type!!! */
229         HPI_DESTNODE_LAST_INDEX = 209        /**< largest ID */
230                 /* AX6 max destnode types = 15 */
231 };
232
233 /*******************************************/
234 /** Mixer control types
235 \ingroup mixer
236 */
237 enum HPI_CONTROLS {
238         HPI_CONTROL_GENERIC = 0,        /**< generic control. */
239         HPI_CONTROL_CONNECTION = 1, /**< A connection between nodes. */
240         HPI_CONTROL_VOLUME = 2,       /**< volume control - works in dB_fs. */
241         HPI_CONTROL_METER = 3,  /**< peak meter control. */
242         HPI_CONTROL_MUTE = 4,   /*mute control - not used at present. */
243         HPI_CONTROL_MULTIPLEXER = 5,    /**< multiplexer control. */
244
245         HPI_CONTROL_AESEBU_TRANSMITTER = 6, /**< AES/EBU transmitter control */
246         HPI_CONTROL_AESEBUTX = 6,       /* HPI_CONTROL_AESEBU_TRANSMITTER */
247
248         HPI_CONTROL_AESEBU_RECEIVER = 7, /**< AES/EBU receiver control. */
249         HPI_CONTROL_AESEBURX = 7,       /* HPI_CONTROL_AESEBU_RECEIVER */
250
251         HPI_CONTROL_LEVEL = 8, /**< level/trim control - works in d_bu. */
252         HPI_CONTROL_TUNER = 9,  /**< tuner control. */
253 /*      HPI_CONTROL_ONOFFSWITCH =       10 */
254         HPI_CONTROL_VOX = 11,   /**< vox control. */
255 /*      HPI_CONTROL_AES18_TRANSMITTER = 12 */
256 /*      HPI_CONTROL_AES18_RECEIVER = 13 */
257 /*      HPI_CONTROL_AES18_BLOCKGENERATOR  = 14 */
258         HPI_CONTROL_CHANNEL_MODE = 15,  /**< channel mode control. */
259
260         HPI_CONTROL_BITSTREAM = 16,     /**< bitstream control. */
261         HPI_CONTROL_SAMPLECLOCK = 17,   /**< sample clock control. */
262         HPI_CONTROL_MICROPHONE = 18,    /**< microphone control. */
263         HPI_CONTROL_PARAMETRIC_EQ = 19, /**< parametric EQ control. */
264         HPI_CONTROL_EQUALIZER = 19,     /*HPI_CONTROL_PARAMETRIC_EQ */
265
266         HPI_CONTROL_COMPANDER = 20,     /**< compander control. */
267         HPI_CONTROL_COBRANET = 21,      /**< cobranet control. */
268         HPI_CONTROL_TONEDETECTOR = 22,  /**< tone detector control. */
269         HPI_CONTROL_SILENCEDETECTOR = 23,       /**< silence detector control. */
270         HPI_CONTROL_PAD = 24,   /**< tuner PAD control. */
271         HPI_CONTROL_SRC = 25,   /**< samplerate converter control. */
272         HPI_CONTROL_UNIVERSAL = 26,     /**< universal control. */
273
274 /*  !!! Update this AND hpidebug.h if you add a new control type!!!*/
275         HPI_CONTROL_LAST_INDEX = 26 /**<highest control type ID */
276 /* WARNING types 256 or greater impact bit packing in all AX6 DSP code */
277 };
278
279 /*******************************************/
280 /** Adapter properties
281 These are used in HPI_AdapterSetProperty() and HPI_AdapterGetProperty()
282 \ingroup adapter
283 */
284 enum HPI_ADAPTER_PROPERTIES {
285 /** \internal Used in dwProperty field of HPI_AdapterSetProperty() and
286 HPI_AdapterGetProperty(). This errata applies to all ASI6000 cards with both
287 analog and digital outputs. The CS4224 A/D+D/A has a one sample delay between
288 left and right channels on both its input (ADC) and output (DAC).
289 More details are available in Cirrus Logic errata ER284B2.
290 PDF available from www.cirrus.com, released by Cirrus in 2001.
291 */
292         HPI_ADAPTER_PROPERTY_ERRATA_1 = 1,
293
294 /** Adapter grouping property
295 Indicates whether the adapter supports the grouping API (for ASIO and SSX2)
296 */
297         HPI_ADAPTER_PROPERTY_GROUPING = 2,
298
299 /** Driver SSX2 property
300 Tells the kernel driver to turn on SSX2 stream mapping.
301 This feature is not used by the DSP. In fact the call is completely processed
302 by the driver and is not passed on to the DSP at all.
303 */
304         HPI_ADAPTER_PROPERTY_ENABLE_SSX2 = 3,
305
306 /** Adapter SSX2 property
307 Indicates the state of the adapter's SSX2 setting. This setting is stored in
308 non-volatile memory on the adapter. A typical call sequence would be to use
309 HPI_ADAPTER_PROPERTY_SSX2_SETTING to set SSX2 on the adapter and then to reload
310 the driver. The driver would query HPI_ADAPTER_PROPERTY_SSX2_SETTING during
311 startup and if SSX2 is set, it would then call HPI_ADAPTER_PROPERTY_ENABLE_SSX2
312 to enable SSX2 stream mapping within the kernel level of the driver.
313 */
314         HPI_ADAPTER_PROPERTY_SSX2_SETTING = 4,
315
316 /** Enables/disables PCI(e) IRQ.
317 A setting of 0 indicates that no interrupts are being generated. A DSP boot
318 this property is set to 0. Setting to a non-zero value specifies the number
319 of frames of audio that should be processed between interrupts. This property
320 should be set to multiple of the mixer interval as read back from the
321 HPI_ADAPTER_PROPERTY_INTERVAL property.
322 */
323         HPI_ADAPTER_PROPERTY_IRQ_RATE = 5,
324
325 /** Base number for readonly properties */
326         HPI_ADAPTER_PROPERTY_READONLYBASE = 256,
327
328 /** Readonly adapter latency property.
329 This property returns in the input and output latency in samples.
330 Property 1 is the estimated input latency
331 in samples, while Property 2 is that output latency in  samples.
332 */
333         HPI_ADAPTER_PROPERTY_LATENCY = 256,
334
335 /** Readonly adapter granularity property.
336 The granulariy is the smallest size chunk of stereo samples that is processed by
337 the adapter.
338 This property returns the record granularity in samples in Property 1.
339 Property 2 returns the play granularity.
340 */
341         HPI_ADAPTER_PROPERTY_GRANULARITY = 257,
342
343 /** Readonly adapter number of current channels property.
344 Property 1 is the number of record channels per record device.
345 Property 2 is the number of play channels per playback device.*/
346         HPI_ADAPTER_PROPERTY_CURCHANNELS = 258,
347
348 /** Readonly adapter software version.
349 The SOFTWARE_VERSION property returns the version of the software running
350 on the adapter as Major.Minor.Release.
351 Property 1 contains Major in bits 15..8 and Minor in bits 7..0.
352 Property 2 contains Release in bits 7..0. */
353         HPI_ADAPTER_PROPERTY_SOFTWARE_VERSION = 259,
354
355 /** Readonly adapter MAC address MSBs.
356 The MAC_ADDRESS_MSB property returns
357 the most significant 32 bits of the MAC address.
358 Property 1 contains bits 47..32 of the MAC address.
359 Property 2 contains bits 31..16 of the MAC address. */
360         HPI_ADAPTER_PROPERTY_MAC_ADDRESS_MSB = 260,
361
362 /** Readonly adapter MAC address LSBs
363 The MAC_ADDRESS_LSB property returns
364 the least significant 16 bits of the MAC address.
365 Property 1 contains bits 15..0 of the MAC address. */
366         HPI_ADAPTER_PROPERTY_MAC_ADDRESS_LSB = 261,
367
368 /** Readonly extended adapter type number
369 The EXTENDED_ADAPTER_TYPE property returns the 4 digits of an extended
370 adapter type, i.e ASI8920-0022, 0022 is the extended type.
371 The digits are returned as ASCII characters rather than the hex digits that
372 are returned for the main type
373 Property 1 returns the 1st two (left most) digits, i.e "00"
374 in the example above, the upper byte being the left most digit.
375 Property 2 returns the 2nd two digits, i.e "22" in the example above*/
376         HPI_ADAPTER_PROPERTY_EXTENDED_ADAPTER_TYPE = 262,
377
378 /** Readonly debug log buffer information */
379         HPI_ADAPTER_PROPERTY_LOGTABLEN = 263,
380         HPI_ADAPTER_PROPERTY_LOGTABBEG = 264,
381
382 /** Readonly adapter IP address
383 For 192.168.1.101
384 Property 1 returns the 1st two (left most) digits, i.e 192*256 + 168
385 in the example above, the upper byte being the left most digit.
386 Property 2 returns the 2nd two digits, i.e 1*256 + 101 in the example above, */
387         HPI_ADAPTER_PROPERTY_IP_ADDRESS = 265,
388
389 /** Readonly adapter buffer processed count. Returns a buffer processed count
390 that is incremented every time all buffers for all streams are updated. This
391 is useful for checking completion of all stream operations across the adapter
392 when using grouped streams.
393 */
394         HPI_ADAPTER_PROPERTY_BUFFER_UPDATE_COUNT = 266,
395
396 /** Readonly mixer and stream intervals
397
398 These intervals are  measured in mixer frames.
399 To convert to time, divide  by the adapter samplerate.
400
401 The mixer interval is the number of frames processed in one mixer iteration.
402 The stream update interval is the interval at which streams check for and
403 process data, and BBM host buffer counters are updated.
404
405 Property 1 is the mixer interval in mixer frames.
406 Property 2 is the stream update interval in mixer frames.
407 */
408         HPI_ADAPTER_PROPERTY_INTERVAL = 267,
409 /** Adapter capabilities 1
410 Property 1 - adapter can do multichannel (SSX1)
411 Property 2 - adapter can do stream grouping (supports SSX2)
412 */
413         HPI_ADAPTER_PROPERTY_CAPS1 = 268,
414 /** Adapter capabilities 2
415 Property 1 - adapter can do samplerate conversion (MRX)
416 Property 2 - adapter can do timestretch (TSX)
417 */
418         HPI_ADAPTER_PROPERTY_CAPS2 = 269,
419
420 /** Readonly adapter sync header connection count.
421 */
422         HPI_ADAPTER_PROPERTY_SYNC_HEADER_CONNECTIONS = 270,
423 /** Readonly supports SSX2 property.
424 Indicates the adapter supports SSX2 in some mode setting. The
425 return value is true (1) or false (0). If the current adapter
426 mode is MONO SSX2 is disabled, even though this property will
427 return true.
428 */
429         HPI_ADAPTER_PROPERTY_SUPPORTS_SSX2 = 271,
430 /** Readonly supports PCI(e) IRQ.
431 Indicates that the adapter in it's current mode supports interrupts
432 across the host bus. Note, this does not imply that interrupts are
433 enabled. Instead it indicates that they can be enabled.
434 */
435         HPI_ADAPTER_PROPERTY_SUPPORTS_IRQ = 272
436 };
437
438 /** Adapter mode commands
439
440 Used in wQueryOrSet parameter of HPI_AdapterSetModeEx().
441 \ingroup adapter
442 */
443 enum HPI_ADAPTER_MODE_CMDS {
444         /** Set the mode to the given parameter */
445         HPI_ADAPTER_MODE_SET = 0,
446         /** Return 0 or error depending whether mode is valid,
447         but don't set the mode */
448         HPI_ADAPTER_MODE_QUERY = 1
449 };
450
451 /** Adapter Modes
452  These are used by HPI_AdapterSetModeEx()
453
454 \warning - more than 16 possible modes breaks
455 a bitmask in the Windows WAVE DLL
456 \ingroup adapter
457 */
458 enum HPI_ADAPTER_MODES {
459 /** 4 outstream mode.
460 - ASI6114: 1 instream
461 - ASI6044: 4 instreams
462 - ASI6012: 1 instream
463 - ASI6102: no instreams
464 - ASI6022, ASI6122: 2 instreams
465 - ASI5111, ASI5101: 2 instreams
466 - ASI652x, ASI662x: 2 instreams
467 - ASI654x, ASI664x: 4 instreams
468 */
469         HPI_ADAPTER_MODE_4OSTREAM = 1,
470
471 /** 6 outstream mode.
472 - ASI6012: 1 instream,
473 - ASI6022, ASI6122: 2 instreams
474 - ASI652x, ASI662x: 4 instreams
475 */
476         HPI_ADAPTER_MODE_6OSTREAM = 2,
477
478 /** 8 outstream mode.
479 - ASI6114: 8 instreams
480 - ASI6118: 8 instreams
481 - ASI6585: 8 instreams
482 */
483         HPI_ADAPTER_MODE_8OSTREAM = 3,
484
485 /** 16 outstream mode.
486 - ASI6416 16 instreams
487 - ASI6518, ASI6618 16 instreams
488 - ASI6118 16 mono out and in streams
489 */
490         HPI_ADAPTER_MODE_16OSTREAM = 4,
491
492 /** one outstream mode.
493 - ASI5111 1 outstream, 1 instream
494 */
495         HPI_ADAPTER_MODE_1OSTREAM = 5,
496
497 /** ASI504X mode 1. 12 outstream, 4 instream 0 to 48kHz sample rates
498         (see ASI504X datasheet for more info).
499 */
500         HPI_ADAPTER_MODE_1 = 6,
501
502 /** ASI504X mode 2. 4 outstreams, 4 instreams at 0 to 192kHz sample rates
503         (see ASI504X datasheet for more info).
504 */
505         HPI_ADAPTER_MODE_2 = 7,
506
507 /** ASI504X mode 3. 4 outstreams, 4 instreams at 0 to 192kHz sample rates
508         (see ASI504X datasheet for more info).
509 */
510         HPI_ADAPTER_MODE_3 = 8,
511
512 /** ASI504X multichannel mode.
513         2 outstreams -> 4 line outs = 1 to 8 channel streams),
514         4 lineins -> 1 instream (1 to 8 channel streams) at 0-48kHz.
515         For more info see the SSX Specification.
516 */
517         HPI_ADAPTER_MODE_MULTICHANNEL = 9,
518
519 /** 12 outstream mode.
520 - ASI6514, ASI6614: 2 instreams
521 - ASI6540,ASI6544: 8 instreams
522 - ASI6640,ASI6644: 8 instreams
523 */
524         HPI_ADAPTER_MODE_12OSTREAM = 10,
525
526 /** 9 outstream mode.
527 - ASI6044: 8 instreams
528 */
529         HPI_ADAPTER_MODE_9OSTREAM = 11,
530
531 /** mono mode.
532 - ASI6416: 16 outstreams/instreams
533 - ASI5402: 2 outstreams/instreams
534 */
535         HPI_ADAPTER_MODE_MONO = 12,
536
537 /** Low latency mode.
538 - ASI6416/ASI6316: 1 16 channel outstream and instream
539 */
540         HPI_ADAPTER_MODE_LOW_LATENCY = 13
541 };
542
543 /* Note, adapters can have more than one capability -
544 encoding as bitfield is recommended. */
545 #define HPI_CAPABILITY_NONE             (0)
546 #define HPI_CAPABILITY_MPEG_LAYER3      (1)
547
548 /* Set this equal to maximum capability index,
549 Must not be greater than 32 - see axnvdef.h */
550 #define HPI_CAPABILITY_MAX                      1
551 /* #define HPI_CAPABILITY_AAC              2 */
552
553 /******************************************* STREAM ATTRIBUTES ****/
554
555 /** MPEG Ancillary Data modes
556
557 The mode for the ancillary data insertion or extraction to operate in.
558 \ingroup stream
559 */
560 enum HPI_MPEG_ANC_MODES {
561         /** the MPEG frames have energy information stored in them (5 bytes per stereo frame, 3 per mono) */
562         HPI_MPEG_ANC_HASENERGY = 0,
563         /** the entire ancillary data field is taken up by data from the Anc data buffer
564         On encode, the encoder will insert the energy bytes before filling the remainder
565         of the ancillary data space with data from the ancillary data buffer.
566         */
567         HPI_MPEG_ANC_RAW = 1
568 };
569
570 /** Ancillary Data Alignment
571 \ingroup instream
572 */
573 enum HPI_ISTREAM_MPEG_ANC_ALIGNS {
574         /** data is packed against the end of data, then padded to the end of frame */
575         HPI_MPEG_ANC_ALIGN_LEFT = 0,
576         /** data is packed against the end of the frame */
577         HPI_MPEG_ANC_ALIGN_RIGHT = 1
578 };
579
580 /** MPEG modes
581 MPEG modes - can be used optionally for HPI_FormatCreate()
582 parameter dwAttributes.
583
584 Using any mode setting other than HPI_MPEG_MODE_DEFAULT
585 with single channel format will return an error.
586 \ingroup stream
587 */
588 enum HPI_MPEG_MODES {
589 /** Causes the MPEG-1 Layer II bitstream to be recorded
590 in single_channel mode when the number of channels is 1 and in stereo when the
591 number of channels is 2. */
592         HPI_MPEG_MODE_DEFAULT = 0,
593         /** Standard stereo without joint-stereo compression */
594         HPI_MPEG_MODE_STEREO = 1,
595         /** Joint stereo  */
596         HPI_MPEG_MODE_JOINTSTEREO = 2,
597         /** Left and Right channels are completely independent */
598         HPI_MPEG_MODE_DUALCHANNEL = 3
599 };
600 /******************************************* MIXER ATTRIBUTES ****/
601
602 /* \defgroup mixer_flags Mixer flags for HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES
603 {
604 */
605 #define HPI_MIXER_GET_CONTROL_MULTIPLE_CHANGED  (0)
606 #define HPI_MIXER_GET_CONTROL_MULTIPLE_RESET    (1)
607 /*}*/
608
609 /** Commands used by HPI_MixerStore()
610 \ingroup mixer
611 */
612 enum HPI_MIXER_STORE_COMMAND {
613 /** Save all mixer control settings. */
614         HPI_MIXER_STORE_SAVE = 1,
615 /** Restore all controls from saved. */
616         HPI_MIXER_STORE_RESTORE = 2,
617 /** Delete saved control settings. */
618         HPI_MIXER_STORE_DELETE = 3,
619 /** Enable auto storage of some control settings. */
620         HPI_MIXER_STORE_ENABLE = 4,
621 /** Disable auto storage of some control settings. */
622         HPI_MIXER_STORE_DISABLE = 5,
623 /** Save the attributes of a single control. */
624         HPI_MIXER_STORE_SAVE_SINGLE = 6
625 };
626
627 /****************************/
628 /* CONTROL ATTRIBUTE VALUES */
629 /****************************/
630
631 /** Used by mixer plugin enable functions
632
633 E.g. HPI_ParametricEq_SetState()
634 \ingroup mixer
635 */
636 enum HPI_SWITCH_STATES {
637         HPI_SWITCH_OFF = 0,     /**< turn the mixer plugin on. */
638         HPI_SWITCH_ON = 1       /**< turn the mixer plugin off. */
639 };
640
641 /* Volume control special gain values */
642
643 /** volumes units are 100ths of a dB
644 \ingroup volume
645 */
646 #define HPI_UNITS_PER_dB                100
647 /** turns volume control OFF or MUTE
648 \ingroup volume
649 */
650 #define HPI_GAIN_OFF                    (-100 * HPI_UNITS_PER_dB)
651
652 /** channel mask specifying all channels
653 \ingroup volume
654 */
655 #define HPI_BITMASK_ALL_CHANNELS        (0xFFFFFFFF)
656
657 /** value returned for no signal
658 \ingroup meter
659 */
660 #define HPI_METER_MINIMUM               (-150 * HPI_UNITS_PER_dB)
661
662 /** autofade profiles
663 \ingroup volume
664 */
665 enum HPI_VOLUME_AUTOFADES {
666 /** log fade - dB attenuation changes linearly over time */
667         HPI_VOLUME_AUTOFADE_LOG = 2,
668 /** linear fade - amplitude changes linearly */
669         HPI_VOLUME_AUTOFADE_LINEAR = 3
670 };
671
672 /** The physical encoding format of the AESEBU I/O.
673
674 Used in HPI_Aesebu_Transmitter_SetFormat(), HPI_Aesebu_Receiver_SetFormat()
675 along with related Get and Query functions
676 \ingroup aestx
677 */
678 enum HPI_AESEBU_FORMATS {
679 /** AES/EBU physical format - AES/EBU balanced "professional"  */
680         HPI_AESEBU_FORMAT_AESEBU = 1,
681 /** AES/EBU physical format - S/PDIF unbalanced "consumer"      */
682         HPI_AESEBU_FORMAT_SPDIF = 2
683 };
684
685 /** AES/EBU error status bits
686
687 Returned by HPI_Aesebu_Receiver_GetErrorStatus()
688 \ingroup aesrx
689 */
690 enum HPI_AESEBU_ERRORS {
691 /**  bit0: 1 when PLL is not locked */
692         HPI_AESEBU_ERROR_NOT_LOCKED = 0x01,
693 /**  bit1: 1 when signal quality is poor */
694         HPI_AESEBU_ERROR_POOR_QUALITY = 0x02,
695 /** bit2: 1 when there is a parity error */
696         HPI_AESEBU_ERROR_PARITY_ERROR = 0x04,
697 /**  bit3: 1 when there is a bi-phase coding violation */
698         HPI_AESEBU_ERROR_BIPHASE_VIOLATION = 0x08,
699 /**  bit4: 1 when the validity bit is high */
700         HPI_AESEBU_ERROR_VALIDITY = 0x10,
701 /**  bit5: 1 when the CRC error bit is high */
702         HPI_AESEBU_ERROR_CRC = 0x20
703 };
704
705 /** \addtogroup pad
706 \{
707 */
708 /** The text string containing the station/channel combination. */
709 #define HPI_PAD_CHANNEL_NAME_LEN        16
710 /** The text string containing the artist. */
711 #define HPI_PAD_ARTIST_LEN              64
712 /** The text string containing the title. */
713 #define HPI_PAD_TITLE_LEN               64
714 /** The text string containing the comment. */
715 #define HPI_PAD_COMMENT_LEN             256
716 /** The PTY when the tuner has not received any PTY. */
717 #define HPI_PAD_PROGRAM_TYPE_INVALID    0xffff
718 /** \} */
719
720 /** Data types for PTY string translation.
721 \ingroup rds
722 */
723 enum eHPI_RDS_type {
724         HPI_RDS_DATATYPE_RDS = 0,       /**< RDS bitstream.*/
725         HPI_RDS_DATATYPE_RBDS = 1       /**< RBDS bitstream.*/
726 };
727
728 /** Tuner bands
729
730 Used for HPI_Tuner_SetBand(),HPI_Tuner_GetBand()
731 \ingroup tuner
732 */
733 enum HPI_TUNER_BAND {
734         HPI_TUNER_BAND_AM = 1,   /**< AM band */
735         HPI_TUNER_BAND_FM = 2,   /**< FM band (mono) */
736         HPI_TUNER_BAND_TV_NTSC_M = 3,    /**< NTSC-M TV band*/
737         HPI_TUNER_BAND_TV = 3,  /* use TV_NTSC_M */
738         HPI_TUNER_BAND_FM_STEREO = 4,    /**< FM band (stereo) */
739         HPI_TUNER_BAND_AUX = 5,  /**< auxiliary input */
740         HPI_TUNER_BAND_TV_PAL_BG = 6,    /**< PAL-B/G TV band*/
741         HPI_TUNER_BAND_TV_PAL_I = 7,     /**< PAL-I TV band*/
742         HPI_TUNER_BAND_TV_PAL_DK = 8,    /**< PAL-D/K TV band*/
743         HPI_TUNER_BAND_TV_SECAM_L = 9,   /**< SECAM-L TV band*/
744         HPI_TUNER_BAND_LAST = 9 /**< the index of the last tuner band. */
745 };
746
747 /** Tuner mode attributes
748
749 Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
750 \ingroup tuner
751
752 */
753 enum HPI_TUNER_MODES {
754         HPI_TUNER_MODE_RSS = 1, /**< control  RSS */
755         HPI_TUNER_MODE_RDS = 2  /**< control  RBDS/RDS */
756 };
757
758 /** Tuner mode attribute values
759
760 Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
761 \ingroup tuner
762 */
763 enum HPI_TUNER_MODE_VALUES {
764 /* RSS attribute values */
765         HPI_TUNER_MODE_RSS_DISABLE = 0, /**< RSS disable */
766         HPI_TUNER_MODE_RSS_ENABLE = 1,  /**< RSS enable */
767
768 /* RDS mode attributes */
769         HPI_TUNER_MODE_RDS_DISABLE = 0, /**< RDS - disabled */
770         HPI_TUNER_MODE_RDS_RDS = 1,  /**< RDS - RDS mode */
771         HPI_TUNER_MODE_RDS_RBDS = 2 /**<  RDS - RBDS mode */
772 };
773
774 /** Tuner Status Bits
775
776 These bitfield values are returned by a call to HPI_Tuner_GetStatus().
777 Multiple fields are returned from a single call.
778 \ingroup tuner
779 */
780 enum HPI_TUNER_STATUS_BITS {
781         HPI_TUNER_VIDEO_COLOR_PRESENT = 0x0001, /**< video color is present. */
782         HPI_TUNER_VIDEO_IS_60HZ = 0x0020, /**< 60 hz video detected. */
783         HPI_TUNER_VIDEO_HORZ_SYNC_MISSING = 0x0040, /**< video HSYNC is missing. */
784         HPI_TUNER_VIDEO_STATUS_VALID = 0x0100, /**< video status is valid. */
785         HPI_TUNER_DIGITAL = 0x0200, /**< tuner reports digital programming. */
786         HPI_TUNER_MULTIPROGRAM = 0x0400, /**< tuner reports multiple programs. */
787         HPI_TUNER_PLL_LOCKED = 0x1000, /**< the tuner's PLL is locked. */
788         HPI_TUNER_FM_STEREO = 0x2000 /**< tuner reports back FM stereo. */
789 };
790
791 /** Channel Modes
792 Used for HPI_ChannelModeSet/Get()
793 \ingroup channelmode
794 */
795 enum HPI_CHANNEL_MODES {
796 /** Left channel out = left channel in, Right channel out = right channel in. */
797         HPI_CHANNEL_MODE_NORMAL = 1,
798 /** Left channel out = right channel in, Right channel out = left channel in. */
799         HPI_CHANNEL_MODE_SWAP = 2,
800 /** Left channel out = left channel in, Right channel out = left channel in. */
801         HPI_CHANNEL_MODE_LEFT_TO_STEREO = 3,
802 /** Left channel out = right channel in, Right channel out = right channel in.*/
803         HPI_CHANNEL_MODE_RIGHT_TO_STEREO = 4,
804 /** Left channel out = (left channel in + right channel in)/2,
805     Right channel out = mute. */
806         HPI_CHANNEL_MODE_STEREO_TO_LEFT = 5,
807 /** Left channel out = mute,
808     Right channel out = (right channel in + left channel in)/2. */
809         HPI_CHANNEL_MODE_STEREO_TO_RIGHT = 6,
810         HPI_CHANNEL_MODE_LAST = 6
811 };
812
813 /** SampleClock source values
814 \ingroup sampleclock
815 */
816 enum HPI_SAMPLECLOCK_SOURCES {
817 /** The sampleclock output is derived from its local samplerate generator.
818     The local samplerate may be set using HPI_SampleClock_SetLocalRate(). */
819         HPI_SAMPLECLOCK_SOURCE_LOCAL = 1,
820 /** The adapter is clocked from a dedicated AES/EBU SampleClock input.*/
821         HPI_SAMPLECLOCK_SOURCE_AESEBU_SYNC = 2,
822 /** From external wordclock connector */
823         HPI_SAMPLECLOCK_SOURCE_WORD = 3,
824 /** Board-to-board header */
825         HPI_SAMPLECLOCK_SOURCE_WORD_HEADER = 4,
826 /** FUTURE - SMPTE clock. */
827         HPI_SAMPLECLOCK_SOURCE_SMPTE = 5,
828 /** One of the aesebu inputs */
829         HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT = 6,
830 /** From a network interface e.g. Cobranet or Livewire at either 48 or 96kHz */
831         HPI_SAMPLECLOCK_SOURCE_NETWORK = 8,
832 /** From previous adjacent module (ASI2416 only)*/
833         HPI_SAMPLECLOCK_SOURCE_PREV_MODULE = 10,
834 /*! Update this if you add a new clock source.*/
835         HPI_SAMPLECLOCK_SOURCE_LAST = 10
836 };
837
838 /** Equalizer filter types. Used by HPI_ParametricEq_SetBand()
839 \ingroup parmeq
840 */
841 enum HPI_FILTER_TYPE {
842         HPI_FILTER_TYPE_BYPASS = 0,     /**< filter is turned off */
843
844         HPI_FILTER_TYPE_LOWSHELF = 1,   /**< EQ low shelf */
845         HPI_FILTER_TYPE_HIGHSHELF = 2,  /**< EQ high shelf */
846         HPI_FILTER_TYPE_EQ_BAND = 3,    /**< EQ gain */
847
848         HPI_FILTER_TYPE_LOWPASS = 4,    /**< standard low pass */
849         HPI_FILTER_TYPE_HIGHPASS = 5,   /**< standard high pass */
850         HPI_FILTER_TYPE_BANDPASS = 6,   /**< standard band pass */
851         HPI_FILTER_TYPE_BANDSTOP = 7    /**< standard band stop/notch */
852 };
853
854 /** Async Event sources
855 \ingroup async
856 */
857 enum ASYNC_EVENT_SOURCES {
858         HPI_ASYNC_EVENT_GPIO = 1,       /**< GPIO event. */
859         HPI_ASYNC_EVENT_SILENCE = 2,    /**< silence event detected. */
860         HPI_ASYNC_EVENT_TONE = 3        /**< tone event detected. */
861 };
862 /*******************************************/
863 /** HPI Error codes
864
865 Almost all HPI functions return an error code
866 A return value of zero means there was no error.
867 Otherwise one of these error codes is returned.
868 Error codes can be converted to a descriptive string using HPI_GetErrorText()
869
870 \note When a new error code is added HPI_GetErrorText() MUST be updated.
871 \note Codes 1-100 are reserved for driver use
872 \ingroup utility
873 */
874 enum HPI_ERROR_CODES {
875         /** Message type does not exist. */
876         HPI_ERROR_INVALID_TYPE = 100,
877         /** Object type does not exist. */
878         HPI_ERROR_INVALID_OBJ = 101,
879         /** Function does not exist. */
880         HPI_ERROR_INVALID_FUNC = 102,
881         /** The specified object does not exist. */
882         HPI_ERROR_INVALID_OBJ_INDEX = 103,
883         /** Trying to access an object that has not been opened yet. */
884         HPI_ERROR_OBJ_NOT_OPEN = 104,
885         /** Trying to open an already open object. */
886         HPI_ERROR_OBJ_ALREADY_OPEN = 105,
887         /** PCI, ISA resource not valid. */
888         HPI_ERROR_INVALID_RESOURCE = 106,
889         /* HPI_ERROR_SUBSYSFINDADAPTERS_GETINFO= 107 */
890         /** Default response was never updated with actual error code. */
891         HPI_ERROR_INVALID_RESPONSE = 108,
892         /** wSize field of response was not updated,
893         indicating that the message was not processed. */
894         HPI_ERROR_PROCESSING_MESSAGE = 109,
895         /** The network did not respond in a timely manner. */
896         HPI_ERROR_NETWORK_TIMEOUT = 110,
897         /* An HPI handle is invalid (uninitialised?). */
898         HPI_ERROR_INVALID_HANDLE = 111,
899         /** A function or attribute has not been implemented yet. */
900         HPI_ERROR_UNIMPLEMENTED = 112,
901         /** There are too many clients attempting
902             to access a network resource. */
903         HPI_ERROR_NETWORK_TOO_MANY_CLIENTS = 113,
904         /** Response buffer passed to HPI_Message
905             was smaller than returned response.
906             wSpecificError field of hpi response contains the required size.
907         */
908         HPI_ERROR_RESPONSE_BUFFER_TOO_SMALL = 114,
909         /** The returned response did not match the sent message */
910         HPI_ERROR_RESPONSE_MISMATCH = 115,
911         /** A control setting that should have been cached was not. */
912         HPI_ERROR_CONTROL_CACHING = 116,
913         /** A message buffer in the path to the adapter was smaller
914             than the message size.
915             wSpecificError field of hpi response contains the actual size.
916         */
917         HPI_ERROR_MESSAGE_BUFFER_TOO_SMALL = 117,
918
919         /* HPI_ERROR_TOO_MANY_ADAPTERS= 200 */
920         /** Bad adpater. */
921         HPI_ERROR_BAD_ADAPTER = 201,
922         /** Adapter number out of range or not set properly. */
923         HPI_ERROR_BAD_ADAPTER_NUMBER = 202,
924         /** 2 adapters with the same adapter number. */
925         HPI_ERROR_DUPLICATE_ADAPTER_NUMBER = 203,
926         /** DSP code failed to bootload. (unused?) */
927         HPI_ERROR_DSP_BOOTLOAD = 204,
928         /** Couldn't find or open the DSP code file. */
929         HPI_ERROR_DSP_FILE_NOT_FOUND = 206,
930         /** Internal DSP hardware error. */
931         HPI_ERROR_DSP_HARDWARE = 207,
932         /** Could not allocate memory */
933         HPI_ERROR_MEMORY_ALLOC = 208,
934         /** Failed to correctly load/config PLD. (unused) */
935         HPI_ERROR_PLD_LOAD = 209,
936         /** Unexpected end of file, block length too big etc. */
937         HPI_ERROR_DSP_FILE_FORMAT = 210,
938
939         /** Found but could not open DSP code file. */
940         HPI_ERROR_DSP_FILE_ACCESS_DENIED = 211,
941         /** First DSP code section header not found in DSP file. */
942         HPI_ERROR_DSP_FILE_NO_HEADER = 212,
943         /* HPI_ERROR_DSP_FILE_READ_ERROR= 213, */
944         /** DSP code for adapter family not found. */
945         HPI_ERROR_DSP_SECTION_NOT_FOUND = 214,
946         /** Other OS specific error opening DSP file. */
947         HPI_ERROR_DSP_FILE_OTHER_ERROR = 215,
948         /** Sharing violation opening DSP code file. */
949         HPI_ERROR_DSP_FILE_SHARING_VIOLATION = 216,
950         /** DSP code section header had size == 0. */
951         HPI_ERROR_DSP_FILE_NULL_HEADER = 217,
952
953         /* HPI_ERROR_FLASH = 220, */
954
955         /** Flash has bad checksum */
956         HPI_ERROR_BAD_CHECKSUM = 221,
957         HPI_ERROR_BAD_SEQUENCE = 222,
958         HPI_ERROR_FLASH_ERASE = 223,
959         HPI_ERROR_FLASH_PROGRAM = 224,
960         HPI_ERROR_FLASH_VERIFY = 225,
961         HPI_ERROR_FLASH_TYPE = 226,
962         HPI_ERROR_FLASH_START = 227,
963
964         /** Reserved for OEMs. */
965         HPI_ERROR_RESERVED_1 = 290,
966
967         /* HPI_ERROR_INVALID_STREAM = 300 use HPI_ERROR_INVALID_OBJ_INDEX */
968         /** Invalid compression format. */
969         HPI_ERROR_INVALID_FORMAT = 301,
970         /** Invalid format samplerate */
971         HPI_ERROR_INVALID_SAMPLERATE = 302,
972         /** Invalid format number of channels. */
973         HPI_ERROR_INVALID_CHANNELS = 303,
974         /** Invalid format bitrate. */
975         HPI_ERROR_INVALID_BITRATE = 304,
976         /** Invalid datasize used for stream read/write. */
977         HPI_ERROR_INVALID_DATASIZE = 305,
978         /* HPI_ERROR_BUFFER_FULL = 306 use HPI_ERROR_INVALID_DATASIZE */
979         /* HPI_ERROR_BUFFER_EMPTY = 307 use HPI_ERROR_INVALID_DATASIZE */
980         /** Null data pointer used for stream read/write. */
981         HPI_ERROR_INVALID_DATA_POINTER = 308,
982         /** Packet ordering error for stream read/write. */
983         HPI_ERROR_INVALID_PACKET_ORDER = 309,
984
985         /** Object can't do requested operation in its current
986             state, eg set format, change rec mux state while recording.*/
987         HPI_ERROR_INVALID_OPERATION = 310,
988
989         /** Where a SRG is shared amongst streams, an incompatible samplerate
990             is one that is different to any currently active stream. */
991         HPI_ERROR_INCOMPATIBLE_SAMPLERATE = 311,
992         /** Adapter mode is illegal.*/
993         HPI_ERROR_BAD_ADAPTER_MODE = 312,
994
995         /** There have been too many attempts to set the adapter's
996         capabilities (using bad keys), the card should be returned
997         to ASI if further capabilities updates are required */
998         HPI_ERROR_TOO_MANY_CAPABILITY_CHANGE_ATTEMPTS = 313,
999         /** Streams on different adapters cannot be grouped. */
1000         HPI_ERROR_NO_INTERADAPTER_GROUPS = 314,
1001         /** Streams on different DSPs cannot be grouped. */
1002         HPI_ERROR_NO_INTERDSP_GROUPS = 315,
1003         /** Stream wait cancelled before threshold reached. */
1004         HPI_ERROR_WAIT_CANCELLED = 316,
1005
1006         /** Invalid mixer node for this adapter. */
1007         HPI_ERROR_INVALID_NODE = 400,
1008         /** Invalid control. */
1009         HPI_ERROR_INVALID_CONTROL = 401,
1010         /** Invalid control value was passed. */
1011         HPI_ERROR_INVALID_CONTROL_VALUE = 402,
1012         /** Control attribute not supported by this control. */
1013         HPI_ERROR_INVALID_CONTROL_ATTRIBUTE = 403,
1014         /** Control is disabled. */
1015         HPI_ERROR_CONTROL_DISABLED = 404,
1016         /** I2C transaction failed due to a missing ACK. */
1017         HPI_ERROR_CONTROL_I2C_MISSING_ACK = 405,
1018         HPI_ERROR_I2C_MISSING_ACK = 405,
1019         /** Control is busy, or coming out of
1020         reset and cannot be accessed at this time. */
1021         HPI_ERROR_CONTROL_NOT_READY = 407,
1022
1023         /** Non volatile memory */
1024         HPI_ERROR_NVMEM_BUSY = 450,
1025         HPI_ERROR_NVMEM_FULL = 451,
1026         HPI_ERROR_NVMEM_FAIL = 452,
1027
1028         /** I2C */
1029         HPI_ERROR_I2C_BAD_ADR = 460,
1030
1031         /** Entity errors */
1032         HPI_ERROR_ENTITY_TYPE_MISMATCH = 470,
1033         HPI_ERROR_ENTITY_ITEM_COUNT = 471,
1034         HPI_ERROR_ENTITY_TYPE_INVALID = 472,
1035         HPI_ERROR_ENTITY_ROLE_INVALID = 473,
1036         HPI_ERROR_ENTITY_SIZE_MISMATCH = 474,
1037
1038         /* AES18 specific errors were 500..507 */
1039
1040         /** custom error to use for debugging */
1041         HPI_ERROR_CUSTOM = 600,
1042
1043         /** hpioct32.c can't obtain mutex */
1044         HPI_ERROR_MUTEX_TIMEOUT = 700,
1045
1046         /** Backend errors used to be greater than this.
1047             \deprecated Now, all backends return only errors defined here in hpi.h
1048         */
1049         HPI_ERROR_BACKEND_BASE = 900,
1050
1051         /** Communication with DSP failed */
1052         HPI_ERROR_DSP_COMMUNICATION = 900
1053                 /* Note that the dsp communication error is set to this value so that
1054                    it remains compatible with any software that expects such errors
1055                    to be backend errors i.e. >= 900.
1056                    Do not define any new error codes with values > 900.
1057                  */
1058 };
1059
1060 /** \defgroup maximums HPI maximum values
1061 \{
1062 */
1063 /** Maximum number of adapters per HPI sub-system
1064    WARNING: modifying this value changes the response structure size.*/
1065 #define HPI_MAX_ADAPTERS                20
1066 /** Maximum number of in or out streams per adapter */
1067 #define HPI_MAX_STREAMS                 16
1068 #define HPI_MAX_CHANNELS                2       /* per stream */
1069 #define HPI_MAX_NODES                   8       /* per mixer ? */
1070 #define HPI_MAX_CONTROLS                4       /* per node ? */
1071 /** maximum number of ancillary bytes per MPEG frame */
1072 #define HPI_MAX_ANC_BYTES_PER_FRAME     (64)
1073 #define HPI_STRING_LEN                  16
1074
1075 /** Velocity units */
1076 #define HPI_OSTREAM_VELOCITY_UNITS      4096
1077 /** OutStream timescale units */
1078 #define HPI_OSTREAM_TIMESCALE_UNITS     10000
1079 /** OutStream timescale passthrough - turns timescaling on in passthough mode */
1080 #define HPI_OSTREAM_TIMESCALE_PASSTHROUGH       99999
1081
1082 /**\}*/
1083
1084 /**************/
1085 /* STRUCTURES */
1086 #ifndef DISABLE_PRAGMA_PACK1
1087 #pragma pack(push, 1)
1088 #endif
1089
1090 /** Structure containing sample format information.
1091     See also HPI_FormatCreate().
1092   */
1093 struct hpi_format {
1094         u32 sample_rate;
1095                                 /**< 11025, 32000, 44100 ... */
1096         u32 bit_rate;         /**< for MPEG */
1097         u32 attributes;
1098                                 /**< Stereo/JointStereo/Mono */
1099         u16 mode_legacy;
1100                                 /**< Legacy ancillary mode or idle bit  */
1101         u16 unused;           /**< Unused */
1102         u16 channels; /**< 1,2..., (or ancillary mode or idle bit */
1103         u16 format;   /**< HPI_FORMAT_PCM16, _MPEG etc. see #HPI_FORMATS. */
1104 };
1105
1106 struct hpi_anc_frame {
1107         u32 valid_bits_in_this_frame;
1108         u8 b_data[HPI_MAX_ANC_BYTES_PER_FRAME];
1109 };
1110
1111 /** An object for containing a single async event.
1112 */
1113 struct hpi_async_event {
1114         u16 event_type; /**< type of event. \sa async_event  */
1115         u16 sequence; /**< Sequence number, allows lost event detection */
1116         u32 state; /**< New state */
1117         u32 h_object; /**< handle to the object returning the event. */
1118         union {
1119                 struct {
1120                         u16 index; /**< GPIO bit index. */
1121                 } gpio;
1122                 struct {
1123                         u16 node_index; /**< what node is the control on ? */
1124                         u16 node_type; /**< what type of node is the control on ? */
1125                 } control;
1126         } u;
1127 };
1128
1129 /* skip host side function declarations for
1130    DSP compile and documentation extraction */
1131
1132 #ifndef DISABLE_PRAGMA_PACK1
1133 #pragma pack(pop)
1134 #endif
1135
1136 /*****************/
1137 /* HPI FUNCTIONS */
1138 /*****************/
1139
1140 /* Stream */
1141 u16 hpi_stream_estimate_buffer_size(struct hpi_format *pF,
1142         u32 host_polling_rate_in_milli_seconds, u32 *recommended_buffer_size);
1143
1144 /*************/
1145 /* SubSystem */
1146 /*************/
1147
1148 u16 hpi_subsys_get_version_ex(u32 *pversion_ex);
1149
1150 u16 hpi_subsys_get_num_adapters(int *pn_num_adapters);
1151
1152 u16 hpi_subsys_get_adapter(int iterator, u32 *padapter_index,
1153         u16 *pw_adapter_type);
1154
1155 /***********/
1156 /* Adapter */
1157 /***********/
1158
1159 u16 hpi_adapter_open(u16 adapter_index);
1160
1161 u16 hpi_adapter_close(u16 adapter_index);
1162
1163 u16 hpi_adapter_get_info(u16 adapter_index, u16 *pw_num_outstreams,
1164         u16 *pw_num_instreams, u16 *pw_version, u32 *pserial_number,
1165         u16 *pw_adapter_type);
1166
1167 u16 hpi_adapter_get_module_by_index(u16 adapter_index, u16 module_index,
1168         u16 *pw_num_outputs, u16 *pw_num_inputs, u16 *pw_version,
1169         u32 *pserial_number, u16 *pw_module_type, u32 *ph_module);
1170
1171 u16 hpi_adapter_set_mode(u16 adapter_index, u32 adapter_mode);
1172
1173 u16 hpi_adapter_set_mode_ex(u16 adapter_index, u32 adapter_mode,
1174         u16 query_or_set);
1175
1176 u16 hpi_adapter_get_mode(u16 adapter_index, u32 *padapter_mode);
1177
1178 u16 hpi_adapter_get_assert2(u16 adapter_index, u16 *p_assert_count,
1179         char *psz_assert, u32 *p_param1, u32 *p_param2,
1180         u32 *p_dsp_string_addr, u16 *p_processor_id);
1181
1182 u16 hpi_adapter_test_assert(u16 adapter_index, u16 assert_id);
1183
1184 u16 hpi_adapter_enable_capability(u16 adapter_index, u16 capability, u32 key);
1185
1186 u16 hpi_adapter_self_test(u16 adapter_index);
1187
1188 u16 hpi_adapter_debug_read(u16 adapter_index, u32 dsp_address, char *p_bytes,
1189         int *count_bytes);
1190
1191 u16 hpi_adapter_set_property(u16 adapter_index, u16 property, u16 paramter1,
1192         u16 paramter2);
1193
1194 u16 hpi_adapter_get_property(u16 adapter_index, u16 property,
1195         u16 *pw_paramter1, u16 *pw_paramter2);
1196
1197 u16 hpi_adapter_enumerate_property(u16 adapter_index, u16 index,
1198         u16 what_to_enumerate, u16 property_index, u32 *psetting);
1199 /*************/
1200 /* OutStream */
1201 /*************/
1202 u16 hpi_outstream_open(u16 adapter_index, u16 outstream_index,
1203         u32 *ph_outstream);
1204
1205 u16 hpi_outstream_close(u32 h_outstream);
1206
1207 u16 hpi_outstream_get_info_ex(u32 h_outstream, u16 *pw_state,
1208         u32 *pbuffer_size, u32 *pdata_to_play, u32 *psamples_played,
1209         u32 *pauxiliary_data_to_play);
1210
1211 u16 hpi_outstream_write_buf(u32 h_outstream, const u8 *pb_write_buf,
1212         u32 bytes_to_write, const struct hpi_format *p_format);
1213
1214 u16 hpi_outstream_start(u32 h_outstream);
1215
1216 u16 hpi_outstream_wait_start(u32 h_outstream);
1217
1218 u16 hpi_outstream_stop(u32 h_outstream);
1219
1220 u16 hpi_outstream_sinegen(u32 h_outstream);
1221
1222 u16 hpi_outstream_reset(u32 h_outstream);
1223
1224 u16 hpi_outstream_query_format(u32 h_outstream, struct hpi_format *p_format);
1225
1226 u16 hpi_outstream_set_format(u32 h_outstream, struct hpi_format *p_format);
1227
1228 u16 hpi_outstream_set_punch_in_out(u32 h_outstream, u32 punch_in_sample,
1229         u32 punch_out_sample);
1230
1231 u16 hpi_outstream_set_velocity(u32 h_outstream, short velocity);
1232
1233 u16 hpi_outstream_ancillary_reset(u32 h_outstream, u16 mode);
1234
1235 u16 hpi_outstream_ancillary_get_info(u32 h_outstream, u32 *pframes_available);
1236
1237 u16 hpi_outstream_ancillary_read(u32 h_outstream,
1238         struct hpi_anc_frame *p_anc_frame_buffer,
1239         u32 anc_frame_buffer_size_in_bytes,
1240         u32 number_of_ancillary_frames_to_read);
1241
1242 u16 hpi_outstream_set_time_scale(u32 h_outstream, u32 time_scaleX10000);
1243
1244 u16 hpi_outstream_host_buffer_allocate(u32 h_outstream, u32 size_in_bytes);
1245
1246 u16 hpi_outstream_host_buffer_free(u32 h_outstream);
1247
1248 u16 hpi_outstream_group_add(u32 h_outstream, u32 h_stream);
1249
1250 u16 hpi_outstream_group_get_map(u32 h_outstream, u32 *poutstream_map,
1251         u32 *pinstream_map);
1252
1253 u16 hpi_outstream_group_reset(u32 h_outstream);
1254
1255 /************/
1256 /* InStream */
1257 /************/
1258 u16 hpi_instream_open(u16 adapter_index, u16 instream_index,
1259         u32 *ph_instream);
1260
1261 u16 hpi_instream_close(u32 h_instream);
1262
1263 u16 hpi_instream_query_format(u32 h_instream,
1264         const struct hpi_format *p_format);
1265
1266 u16 hpi_instream_set_format(u32 h_instream,
1267         const struct hpi_format *p_format);
1268
1269 u16 hpi_instream_read_buf(u32 h_instream, u8 *pb_read_buf, u32 bytes_to_read);
1270
1271 u16 hpi_instream_start(u32 h_instream);
1272
1273 u16 hpi_instream_wait_start(u32 h_instream);
1274
1275 u16 hpi_instream_stop(u32 h_instream);
1276
1277 u16 hpi_instream_reset(u32 h_instream);
1278
1279 u16 hpi_instream_get_info_ex(u32 h_instream, u16 *pw_state, u32 *pbuffer_size,
1280         u32 *pdata_recorded, u32 *psamples_recorded,
1281         u32 *pauxiliary_data_recorded);
1282
1283 u16 hpi_instream_ancillary_reset(u32 h_instream, u16 bytes_per_frame,
1284         u16 mode, u16 alignment, u16 idle_bit);
1285
1286 u16 hpi_instream_ancillary_get_info(u32 h_instream, u32 *pframe_space);
1287
1288 u16 hpi_instream_ancillary_write(u32 h_instream,
1289         const struct hpi_anc_frame *p_anc_frame_buffer,
1290         u32 anc_frame_buffer_size_in_bytes,
1291         u32 number_of_ancillary_frames_to_write);
1292
1293 u16 hpi_instream_host_buffer_allocate(u32 h_instream, u32 size_in_bytes);
1294
1295 u16 hpi_instream_host_buffer_free(u32 h_instream);
1296
1297 u16 hpi_instream_group_add(u32 h_instream, u32 h_stream);
1298
1299 u16 hpi_instream_group_get_map(u32 h_instream, u32 *poutstream_map,
1300         u32 *pinstream_map);
1301
1302 u16 hpi_instream_group_reset(u32 h_instream);
1303
1304 /*********/
1305 /* Mixer */
1306 /*********/
1307 u16 hpi_mixer_open(u16 adapter_index, u32 *ph_mixer);
1308
1309 u16 hpi_mixer_close(u32 h_mixer);
1310
1311 u16 hpi_mixer_get_control(u32 h_mixer, u16 src_node_type,
1312         u16 src_node_type_index, u16 dst_node_type, u16 dst_node_type_index,
1313         u16 control_type, u32 *ph_control);
1314
1315 u16 hpi_mixer_get_control_by_index(u32 h_mixer, u16 control_index,
1316         u16 *pw_src_node_type, u16 *pw_src_node_index, u16 *pw_dst_node_type,
1317         u16 *pw_dst_node_index, u16 *pw_control_type, u32 *ph_control);
1318
1319 u16 hpi_mixer_store(u32 h_mixer, enum HPI_MIXER_STORE_COMMAND command,
1320         u16 index);
1321 /************/
1322 /* Controls */
1323 /************/
1324 /******************/
1325 /* Volume control */
1326 /******************/
1327 u16 hpi_volume_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]
1328         );
1329
1330 u16 hpi_volume_get_gain(u32 h_control,
1331         short an_gain0_01dB_out[HPI_MAX_CHANNELS]
1332         );
1333
1334 u16 hpi_volume_set_mute(u32 h_control, u32 mute);
1335
1336 u16 hpi_volume_get_mute(u32 h_control, u32 *mute);
1337
1338 #define hpi_volume_get_range hpi_volume_query_range
1339 u16 hpi_volume_query_range(u32 h_control, short *min_gain_01dB,
1340         short *max_gain_01dB, short *step_gain_01dB);
1341
1342 u16 hpi_volume_query_channels(const u32 h_volume, u32 *p_channels);
1343
1344 u16 hpi_volume_auto_fade(u32 h_control,
1345         short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms);
1346
1347 u16 hpi_volume_auto_fade_profile(u32 h_control,
1348         short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms,
1349         u16 profile);
1350
1351 /*****************/
1352 /* Level control */
1353 /*****************/
1354 u16 hpi_level_query_range(u32 h_control, short *min_gain_01dB,
1355         short *max_gain_01dB, short *step_gain_01dB);
1356
1357 u16 hpi_level_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]
1358         );
1359
1360 u16 hpi_level_get_gain(u32 h_control,
1361         short an_gain0_01dB_out[HPI_MAX_CHANNELS]
1362         );
1363
1364 /*****************/
1365 /* Meter control */
1366 /*****************/
1367 u16 hpi_meter_query_channels(const u32 h_meter, u32 *p_channels);
1368
1369 u16 hpi_meter_get_peak(u32 h_control,
1370         short an_peak0_01dB_out[HPI_MAX_CHANNELS]
1371         );
1372
1373 u16 hpi_meter_get_rms(u32 h_control, short an_peak0_01dB_out[HPI_MAX_CHANNELS]
1374         );
1375
1376 u16 hpi_meter_set_peak_ballistics(u32 h_control, u16 attack, u16 decay);
1377
1378 u16 hpi_meter_set_rms_ballistics(u32 h_control, u16 attack, u16 decay);
1379
1380 u16 hpi_meter_get_peak_ballistics(u32 h_control, u16 *attack, u16 *decay);
1381
1382 u16 hpi_meter_get_rms_ballistics(u32 h_control, u16 *attack, u16 *decay);
1383
1384 /************************/
1385 /* ChannelMode control */
1386 /************************/
1387 u16 hpi_channel_mode_query_mode(const u32 h_mode, const u32 index,
1388         u16 *pw_mode);
1389
1390 u16 hpi_channel_mode_set(u32 h_control, u16 mode);
1391
1392 u16 hpi_channel_mode_get(u32 h_control, u16 *mode);
1393
1394 /*****************/
1395 /* Tuner control */
1396 /*****************/
1397 u16 hpi_tuner_query_band(const u32 h_tuner, const u32 index, u16 *pw_band);
1398
1399 u16 hpi_tuner_set_band(u32 h_control, u16 band);
1400
1401 u16 hpi_tuner_get_band(u32 h_control, u16 *pw_band);
1402
1403 u16 hpi_tuner_query_frequency(const u32 h_tuner, const u32 index,
1404         const u16 band, u32 *pfreq);
1405
1406 u16 hpi_tuner_set_frequency(u32 h_control, u32 freq_ink_hz);
1407
1408 u16 hpi_tuner_get_frequency(u32 h_control, u32 *pw_freq_ink_hz);
1409
1410 u16 hpi_tuner_get_rf_level(u32 h_control, short *pw_level);
1411
1412 u16 hpi_tuner_get_raw_rf_level(u32 h_control, short *pw_level);
1413
1414 u16 hpi_tuner_query_gain(const u32 h_tuner, const u32 index, u16 *pw_gain);
1415
1416 u16 hpi_tuner_set_gain(u32 h_control, short gain);
1417
1418 u16 hpi_tuner_get_gain(u32 h_control, short *pn_gain);
1419
1420 u16 hpi_tuner_get_status(u32 h_control, u16 *pw_status_mask, u16 *pw_status);
1421
1422 u16 hpi_tuner_set_mode(u32 h_control, u32 mode, u32 value);
1423
1424 u16 hpi_tuner_get_mode(u32 h_control, u32 mode, u32 *pn_value);
1425
1426 u16 hpi_tuner_get_rds(u32 h_control, char *p_rds_data);
1427
1428 u16 hpi_tuner_query_deemphasis(const u32 h_tuner, const u32 index,
1429         const u16 band, u32 *pdeemphasis);
1430
1431 u16 hpi_tuner_set_deemphasis(u32 h_control, u32 deemphasis);
1432 u16 hpi_tuner_get_deemphasis(u32 h_control, u32 *pdeemphasis);
1433
1434 u16 hpi_tuner_query_program(const u32 h_tuner, u32 *pbitmap_program);
1435
1436 u16 hpi_tuner_set_program(u32 h_control, u32 program);
1437
1438 u16 hpi_tuner_get_program(u32 h_control, u32 *pprogram);
1439
1440 u16 hpi_tuner_get_hd_radio_dsp_version(u32 h_control, char *psz_dsp_version,
1441         const u32 string_size);
1442
1443 u16 hpi_tuner_get_hd_radio_sdk_version(u32 h_control, char *psz_sdk_version,
1444         const u32 string_size);
1445
1446 u16 hpi_tuner_get_hd_radio_signal_quality(u32 h_control, u32 *pquality);
1447
1448 u16 hpi_tuner_get_hd_radio_signal_blend(u32 h_control, u32 *pblend);
1449
1450 u16 hpi_tuner_set_hd_radio_signal_blend(u32 h_control, const u32 blend);
1451
1452 /***************/
1453 /* PAD control */
1454 /***************/
1455
1456 u16 hpi_pad_get_channel_name(u32 h_control, char *psz_string,
1457         const u32 string_length);
1458
1459 u16 hpi_pad_get_artist(u32 h_control, char *psz_string,
1460         const u32 string_length);
1461
1462 u16 hpi_pad_get_title(u32 h_control, char *psz_string,
1463         const u32 string_length);
1464
1465 u16 hpi_pad_get_comment(u32 h_control, char *psz_string,
1466         const u32 string_length);
1467
1468 u16 hpi_pad_get_program_type(u32 h_control, u32 *ppTY);
1469
1470 u16 hpi_pad_get_rdsPI(u32 h_control, u32 *ppI);
1471
1472 u16 hpi_pad_get_program_type_string(u32 h_control, const u32 data_type,
1473         const u32 pTY, char *psz_string, const u32 string_length);
1474
1475 /****************************/
1476 /* AES/EBU Receiver control */
1477 /****************************/
1478 u16 hpi_aesebu_receiver_query_format(const u32 h_aes_rx, const u32 index,
1479         u16 *pw_format);
1480
1481 u16 hpi_aesebu_receiver_set_format(u32 h_control, u16 source);
1482
1483 u16 hpi_aesebu_receiver_get_format(u32 h_control, u16 *pw_source);
1484
1485 u16 hpi_aesebu_receiver_get_sample_rate(u32 h_control, u32 *psample_rate);
1486
1487 u16 hpi_aesebu_receiver_get_user_data(u32 h_control, u16 index, u16 *pw_data);
1488
1489 u16 hpi_aesebu_receiver_get_channel_status(u32 h_control, u16 index,
1490         u16 *pw_data);
1491
1492 u16 hpi_aesebu_receiver_get_error_status(u32 h_control, u16 *pw_error_data);
1493
1494 /*******************************/
1495 /* AES/EBU Transmitter control */
1496 /*******************************/
1497 u16 hpi_aesebu_transmitter_set_sample_rate(u32 h_control, u32 sample_rate);
1498
1499 u16 hpi_aesebu_transmitter_set_user_data(u32 h_control, u16 index, u16 data);
1500
1501 u16 hpi_aesebu_transmitter_set_channel_status(u32 h_control, u16 index,
1502         u16 data);
1503
1504 u16 hpi_aesebu_transmitter_get_channel_status(u32 h_control, u16 index,
1505         u16 *pw_data);
1506
1507 u16 hpi_aesebu_transmitter_query_format(const u32 h_aes_tx, const u32 index,
1508         u16 *pw_format);
1509
1510 u16 hpi_aesebu_transmitter_set_format(u32 h_control, u16 output_format);
1511
1512 u16 hpi_aesebu_transmitter_get_format(u32 h_control, u16 *pw_output_format);
1513
1514 /***********************/
1515 /* Multiplexer control */
1516 /***********************/
1517 u16 hpi_multiplexer_set_source(u32 h_control, u16 source_node_type,
1518         u16 source_node_index);
1519
1520 u16 hpi_multiplexer_get_source(u32 h_control, u16 *source_node_type,
1521         u16 *source_node_index);
1522
1523 u16 hpi_multiplexer_query_source(u32 h_control, u16 index,
1524         u16 *source_node_type, u16 *source_node_index);
1525
1526 /***************/
1527 /* Vox control */
1528 /***************/
1529 u16 hpi_vox_set_threshold(u32 h_control, short an_gain0_01dB);
1530
1531 u16 hpi_vox_get_threshold(u32 h_control, short *an_gain0_01dB);
1532
1533 /*********************/
1534 /* Bitstream control */
1535 /*********************/
1536 u16 hpi_bitstream_set_clock_edge(u32 h_control, u16 edge_type);
1537
1538 u16 hpi_bitstream_set_data_polarity(u32 h_control, u16 polarity);
1539
1540 u16 hpi_bitstream_get_activity(u32 h_control, u16 *pw_clk_activity,
1541         u16 *pw_data_activity);
1542
1543 /***********************/
1544 /* SampleClock control */
1545 /***********************/
1546
1547 u16 hpi_sample_clock_query_source(const u32 h_clock, const u32 index,
1548         u16 *pw_source);
1549
1550 u16 hpi_sample_clock_set_source(u32 h_control, u16 source);
1551
1552 u16 hpi_sample_clock_get_source(u32 h_control, u16 *pw_source);
1553
1554 u16 hpi_sample_clock_query_source_index(const u32 h_clock, const u32 index,
1555         const u32 source, u16 *pw_source_index);
1556
1557 u16 hpi_sample_clock_set_source_index(u32 h_control, u16 source_index);
1558
1559 u16 hpi_sample_clock_get_source_index(u32 h_control, u16 *pw_source_index);
1560
1561 u16 hpi_sample_clock_get_sample_rate(u32 h_control, u32 *psample_rate);
1562
1563 u16 hpi_sample_clock_query_local_rate(const u32 h_clock, const u32 index,
1564         u32 *psource);
1565
1566 u16 hpi_sample_clock_set_local_rate(u32 h_control, u32 sample_rate);
1567
1568 u16 hpi_sample_clock_get_local_rate(u32 h_control, u32 *psample_rate);
1569
1570 u16 hpi_sample_clock_set_auto(u32 h_control, u32 enable);
1571
1572 u16 hpi_sample_clock_get_auto(u32 h_control, u32 *penable);
1573
1574 u16 hpi_sample_clock_set_local_rate_lock(u32 h_control, u32 lock);
1575
1576 u16 hpi_sample_clock_get_local_rate_lock(u32 h_control, u32 *plock);
1577
1578 /***********************/
1579 /* Microphone control */
1580 /***********************/
1581 u16 hpi_microphone_set_phantom_power(u32 h_control, u16 on_off);
1582
1583 u16 hpi_microphone_get_phantom_power(u32 h_control, u16 *pw_on_off);
1584
1585 /********************************/
1586 /* Parametric Equalizer control */
1587 /********************************/
1588 u16 hpi_parametric_eq_get_info(u32 h_control, u16 *pw_number_of_bands,
1589         u16 *pw_enabled);
1590
1591 u16 hpi_parametric_eq_set_state(u32 h_control, u16 on_off);
1592
1593 u16 hpi_parametric_eq_set_band(u32 h_control, u16 index, u16 type,
1594         u32 frequency_hz, short q100, short gain0_01dB);
1595
1596 u16 hpi_parametric_eq_get_band(u32 h_control, u16 index, u16 *pn_type,
1597         u32 *pfrequency_hz, short *pnQ100, short *pn_gain0_01dB);
1598
1599 u16 hpi_parametric_eq_get_coeffs(u32 h_control, u16 index, short coeffs[5]
1600         );
1601
1602 /*******************************/
1603 /* Compressor Expander control */
1604 /*******************************/
1605
1606 u16 hpi_compander_set_enable(u32 h_control, u32 on);
1607
1608 u16 hpi_compander_get_enable(u32 h_control, u32 *pon);
1609
1610 u16 hpi_compander_set_makeup_gain(u32 h_control, short makeup_gain0_01dB);
1611
1612 u16 hpi_compander_get_makeup_gain(u32 h_control, short *pn_makeup_gain0_01dB);
1613
1614 u16 hpi_compander_set_attack_time_constant(u32 h_control, u32 index,
1615         u32 attack);
1616
1617 u16 hpi_compander_get_attack_time_constant(u32 h_control, u32 index,
1618         u32 *pw_attack);
1619
1620 u16 hpi_compander_set_decay_time_constant(u32 h_control, u32 index,
1621         u32 decay);
1622
1623 u16 hpi_compander_get_decay_time_constant(u32 h_control, u32 index,
1624         u32 *pw_decay);
1625
1626 u16 hpi_compander_set_threshold(u32 h_control, u32 index,
1627         short threshold0_01dB);
1628
1629 u16 hpi_compander_get_threshold(u32 h_control, u32 index,
1630         short *pn_threshold0_01dB);
1631
1632 u16 hpi_compander_set_ratio(u32 h_control, u32 index, u32 ratio100);
1633
1634 u16 hpi_compander_get_ratio(u32 h_control, u32 index, u32 *pw_ratio100);
1635
1636 /********************/
1637 /* Cobranet control */
1638 /********************/
1639 u16 hpi_cobranet_hmi_write(u32 h_control, u32 hmi_address, u32 byte_count,
1640         u8 *pb_data);
1641
1642 u16 hpi_cobranet_hmi_read(u32 h_control, u32 hmi_address, u32 max_byte_count,
1643         u32 *pbyte_count, u8 *pb_data);
1644
1645 u16 hpi_cobranet_hmi_get_status(u32 h_control, u32 *pstatus,
1646         u32 *preadable_size, u32 *pwriteable_size);
1647
1648 u16 hpi_cobranet_get_ip_address(u32 h_control, u32 *pdw_ip_address);
1649
1650 u16 hpi_cobranet_set_ip_address(u32 h_control, u32 dw_ip_address);
1651
1652 u16 hpi_cobranet_get_static_ip_address(u32 h_control, u32 *pdw_ip_address);
1653
1654 u16 hpi_cobranet_set_static_ip_address(u32 h_control, u32 dw_ip_address);
1655
1656 u16 hpi_cobranet_get_macaddress(u32 h_control, u32 *p_mac_msbs,
1657         u32 *p_mac_lsbs);
1658
1659 /*************************/
1660 /* Tone Detector control */
1661 /*************************/
1662 u16 hpi_tone_detector_get_state(u32 hC, u32 *state);
1663
1664 u16 hpi_tone_detector_set_enable(u32 hC, u32 enable);
1665
1666 u16 hpi_tone_detector_get_enable(u32 hC, u32 *enable);
1667
1668 u16 hpi_tone_detector_set_event_enable(u32 hC, u32 event_enable);
1669
1670 u16 hpi_tone_detector_get_event_enable(u32 hC, u32 *event_enable);
1671
1672 u16 hpi_tone_detector_set_threshold(u32 hC, int threshold);
1673
1674 u16 hpi_tone_detector_get_threshold(u32 hC, int *threshold);
1675
1676 u16 hpi_tone_detector_get_frequency(u32 hC, u32 index, u32 *frequency);
1677
1678 /****************************/
1679 /* Silence Detector control */
1680 /****************************/
1681 u16 hpi_silence_detector_get_state(u32 hC, u32 *state);
1682
1683 u16 hpi_silence_detector_set_enable(u32 hC, u32 enable);
1684
1685 u16 hpi_silence_detector_get_enable(u32 hC, u32 *enable);
1686
1687 u16 hpi_silence_detector_set_event_enable(u32 hC, u32 event_enable);
1688
1689 u16 hpi_silence_detector_get_event_enable(u32 hC, u32 *event_enable);
1690
1691 u16 hpi_silence_detector_set_delay(u32 hC, u32 delay);
1692
1693 u16 hpi_silence_detector_get_delay(u32 hC, u32 *delay);
1694
1695 u16 hpi_silence_detector_set_threshold(u32 hC, int threshold);
1696
1697 u16 hpi_silence_detector_get_threshold(u32 hC, int *threshold);
1698 /*********************/
1699 /* Utility functions */
1700 /*********************/
1701
1702 u16 hpi_format_create(struct hpi_format *p_format, u16 channels, u16 format,
1703         u32 sample_rate, u32 bit_rate, u32 attributes);
1704
1705 #endif   /*_HPI_H_ */