GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / sound / pci / asihpi / hpi.h
blob23399d02f666247601f25567f600f0666d4232c4
1 /******************************************************************************
3 AudioScience HPI driver
4 Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>
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;
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.
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
20 /** \file hpi.h
22 AudioScience Hardware Programming Interface (HPI)
23 public API definition.
25 The HPI is a low-level hardware abstraction layer to all
26 AudioScience digital audio adapters
29 You must define one operating system that the HPI is to be compiled under
30 HPI_OS_WIN32_USER 32bit Windows
31 HPI_OS_DSP_C6000 DSP TI C6000 (automatically set)
32 HPI_OS_WDM Windows WDM kernel driver
33 HPI_OS_LINUX Linux userspace
34 HPI_OS_LINUX_KERNEL Linux kernel (automatically set)
36 (C) Copyright AudioScience Inc. 1998-2010
37 ******************************************************************************/
38 #ifndef _HPI_H_
39 #define _HPI_H_
40 /* HPI Version
41 If HPI_VER_MINOR is odd then its a development release not intended for the
42 public. If HPI_VER_MINOR is even then is a release version
43 i.e 3.05.02 is a development version
45 #define HPI_VERSION_CONSTRUCTOR(maj, min, rel) \
46 ((maj << 16) + (min << 8) + rel)
48 #define HPI_VER_MAJOR(v) ((int)(v >> 16))
49 #define HPI_VER_MINOR(v) ((int)((v >> 8) & 0xFF))
50 #define HPI_VER_RELEASE(v) ((int)(v & 0xFF))
52 /* Use single digits for versions less that 10 to avoid octal. */
53 #define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 4, 1)
54 #define HPI_VER_STRING "4.04.01"
56 /* Library version as documented in hpi-api-versions.txt */
57 #define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(9, 0, 0)
59 #include <linux/types.h>
60 #define HPI_EXCLUDE_DEPRECATED
62 /******************************************************************************/
63 /******************************************************************************/
64 /******** HPI API DEFINITIONS *****/
65 /******************************************************************************/
66 /******************************************************************************/
67 /*******************************************/
68 /** Audio format types
69 \ingroup stream
71 enum HPI_FORMATS {
72 /** Used internally on adapter. */
73 HPI_FORMAT_MIXER_NATIVE = 0,
74 /** 8-bit unsigned PCM. Windows equivalent is WAVE_FORMAT_PCM. */
75 HPI_FORMAT_PCM8_UNSIGNED = 1,
76 /** 16-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM. */
77 HPI_FORMAT_PCM16_SIGNED = 2,
78 /** MPEG-1 Layer-1. */
79 HPI_FORMAT_MPEG_L1 = 3,
80 /** MPEG-1 Layer-2.
82 Windows equivalent is WAVE_FORMAT_MPEG.
84 The following table shows what combinations of mode and bitrate are possible:
86 <table border=1 cellspacing=0 cellpadding=5>
87 <tr>
88 <td><p><b>Bitrate (kbs)</b></p>
89 <td><p><b>Mono</b></p>
90 <td><p><b>Stereo,<br>Joint Stereo or<br>Dual Channel</b></p>
92 <tr><td>32<td>X<td>_
93 <tr><td>40<td>_<td>_
94 <tr><td>48<td>X<td>_
95 <tr><td>56<td>X<td>_
96 <tr><td>64<td>X<td>X
97 <tr><td>80<td>X<td>_
98 <tr><td>96<td>X<td>X
99 <tr><td>112<td>X<td>X
100 <tr><td>128<td>X<td>X
101 <tr><td>160<td>X<td>X
102 <tr><td>192<td>X<td>X
103 <tr><td>224<td>_<td>X
104 <tr><td>256<td>-<td>X
105 <tr><td>320<td>-<td>X
106 <tr><td>384<td>_<td>X
107 </table>
109 HPI_FORMAT_MPEG_L2 = 4,
110 /** MPEG-1 Layer-3.
111 Windows equivalent is WAVE_FORMAT_MPEG.
113 The following table shows what combinations of mode and bitrate are possible:
115 <table border=1 cellspacing=0 cellpadding=5>
116 <tr>
117 <td><p><b>Bitrate (kbs)</b></p>
118 <td><p><b>Mono<br>Stereo @ 8,<br>11.025 and<br>12kHz*</b></p>
119 <td><p><b>Mono<br>Stereo @ 16,<br>22.050 and<br>24kHz*</b></p>
120 <td><p><b>Mono<br>Stereo @ 32,<br>44.1 and<br>48kHz</b></p>
122 <tr><td>16<td>X<td>X<td>_
123 <tr><td>24<td>X<td>X<td>_
124 <tr><td>32<td>X<td>X<td>X
125 <tr><td>40<td>X<td>X<td>X
126 <tr><td>48<td>X<td>X<td>X
127 <tr><td>56<td>X<td>X<td>X
128 <tr><td>64<td>X<td>X<td>X
129 <tr><td>80<td>_<td>X<td>X
130 <tr><td>96<td>_<td>X<td>X
131 <tr><td>112<td>_<td>X<td>X
132 <tr><td>128<td>_<td>X<td>X
133 <tr><td>144<td>_<td>X<td>_
134 <tr><td>160<td>_<td>X<td>X
135 <tr><td>192<td>_<td>_<td>X
136 <tr><td>224<td>_<td>_<td>X
137 <tr><td>256<td>-<td>_<td>X
138 <tr><td>320<td>-<td>_<td>X
139 </table>
140 \b * Available on the ASI6000 series only
142 HPI_FORMAT_MPEG_L3 = 5,
143 /** Dolby AC-2. */
144 HPI_FORMAT_DOLBY_AC2 = 6,
145 /** Dolbt AC-3. */
146 HPI_FORMAT_DOLBY_AC3 = 7,
147 /** 16-bit PCM big-endian. */
148 HPI_FORMAT_PCM16_BIGENDIAN = 8,
149 /** TAGIT-1 algorithm - hits. */
150 HPI_FORMAT_AA_TAGIT1_HITS = 9,
151 /** TAGIT-1 algorithm - inserts. */
152 HPI_FORMAT_AA_TAGIT1_INSERTS = 10,
153 /** 32-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM.
154 Each sample is a 32bit word. The most significant 24 bits contain a 24-bit
155 sample and the least significant 8 bits are set to 0.
157 HPI_FORMAT_PCM32_SIGNED = 11,
158 /** Raw bitstream - unknown format. */
159 HPI_FORMAT_RAW_BITSTREAM = 12,
160 /** TAGIT-1 algorithm hits - extended. */
161 HPI_FORMAT_AA_TAGIT1_HITS_EX1 = 13,
162 /** 32-bit PCM as an IEEE float. Windows equivalent is WAVE_FORMAT_IEEE_FLOAT.
163 Each sample is a 32bit word in IEEE754 floating point format.
164 The range is +1.0 to -1.0, which corresponds to digital fullscale.
166 HPI_FORMAT_PCM32_FLOAT = 14,
167 /** 24-bit PCM signed. Windows equivalent is WAVE_FORMAT_PCM. */
168 HPI_FORMAT_PCM24_SIGNED = 15,
169 /** OEM format 1 - private. */
170 HPI_FORMAT_OEM1 = 16,
171 /** OEM format 2 - private. */
172 HPI_FORMAT_OEM2 = 17,
173 /** Undefined format. */
174 HPI_FORMAT_UNDEFINED = 0xffff
177 /******************************************* in/out Stream states */
178 /*******************************************/
179 /** Stream States
180 \ingroup stream
182 enum HPI_STREAM_STATES {
183 /** State stopped - stream is stopped. */
184 HPI_STATE_STOPPED = 1,
185 /** State playing - stream is playing audio. */
186 HPI_STATE_PLAYING = 2,
187 /** State recording - stream is recording. */
188 HPI_STATE_RECORDING = 3,
189 /** State drained - playing stream ran out of data to play. */
190 HPI_STATE_DRAINED = 4,
191 /** State generate sine - to be implemented. */
192 HPI_STATE_SINEGEN = 5,
193 /** State wait - used for inter-card sync to mean waiting for all
194 cards to be ready. */
195 HPI_STATE_WAIT = 6
197 /******************************************* mixer source node types */
198 /** Source node types
199 \ingroup mixer
201 enum HPI_SOURCENODES {
202 /** This define can be used instead of 0 to indicate
203 that there is no valid source node. A control that
204 exists on a destination node can be searched for using a source
205 node value of either 0, or HPI_SOURCENODE_NONE */
206 HPI_SOURCENODE_NONE = 100,
207 /** Out Stream (Play) node. */
208 HPI_SOURCENODE_OSTREAM = 101,
209 /** Line in node - could be analog, AES/EBU or network. */
210 HPI_SOURCENODE_LINEIN = 102,
211 HPI_SOURCENODE_AESEBU_IN = 103, /**< AES/EBU input node. */
212 HPI_SOURCENODE_TUNER = 104, /**< tuner node. */
213 HPI_SOURCENODE_RF = 105, /**< RF input node. */
214 HPI_SOURCENODE_CLOCK_SOURCE = 106, /**< clock source node. */
215 HPI_SOURCENODE_RAW_BITSTREAM = 107, /**< raw bitstream node. */
216 HPI_SOURCENODE_MICROPHONE = 108, /**< microphone node. */
217 /** Cobranet input node -
218 Audio samples come from the Cobranet network and into the device. */
219 HPI_SOURCENODE_COBRANET = 109,
220 HPI_SOURCENODE_ANALOG = 110, /**< analog input node. */
221 HPI_SOURCENODE_ADAPTER = 111, /**< adapter node. */
222 /* !!!Update this AND hpidebug.h if you add a new sourcenode type!!! */
223 HPI_SOURCENODE_LAST_INDEX = 111 /**< largest ID */
224 /* AX6 max sourcenode types = 15 */
227 /******************************************* mixer dest node types */
228 /** Destination node types
229 \ingroup mixer
231 enum HPI_DESTNODES {
232 /** This define can be used instead of 0 to indicate
233 that there is no valid destination node. A control that
234 exists on a source node can be searched for using a destination
235 node value of either 0, or HPI_DESTNODE_NONE */
236 HPI_DESTNODE_NONE = 200,
237 /** In Stream (Record) node. */
238 HPI_DESTNODE_ISTREAM = 201,
239 HPI_DESTNODE_LINEOUT = 202, /**< line out node. */
240 HPI_DESTNODE_AESEBU_OUT = 203, /**< AES/EBU output node. */
241 HPI_DESTNODE_RF = 204, /**< RF output node. */
242 HPI_DESTNODE_SPEAKER = 205, /**< speaker output node. */
243 /** Cobranet output node -
244 Audio samples from the device are sent out on the Cobranet network.*/
245 HPI_DESTNODE_COBRANET = 206,
246 HPI_DESTNODE_ANALOG = 207, /**< analog output node. */
248 /* !!!Update this AND hpidebug.h if you add a new destnode type!!! */
249 HPI_DESTNODE_LAST_INDEX = 207 /**< largest ID */
250 /* AX6 max destnode types = 15 */
253 /*******************************************/
254 /** Mixer control types
255 \ingroup mixer
257 enum HPI_CONTROLS {
258 HPI_CONTROL_GENERIC = 0, /**< generic control. */
259 HPI_CONTROL_CONNECTION = 1, /**< A connection between nodes. */
260 HPI_CONTROL_VOLUME = 2, /**< volume control - works in dB_fs. */
261 HPI_CONTROL_METER = 3, /**< peak meter control. */
262 HPI_CONTROL_MUTE = 4, /*mute control - not used at present. */
263 HPI_CONTROL_MULTIPLEXER = 5, /**< multiplexer control. */
265 HPI_CONTROL_AESEBU_TRANSMITTER = 6, /**< AES/EBU transmitter control. */
266 HPI_CONTROL_AESEBUTX = HPI_CONTROL_AESEBU_TRANSMITTER,
268 HPI_CONTROL_AESEBU_RECEIVER = 7, /**< AES/EBU receiver control. */
269 HPI_CONTROL_AESEBURX = HPI_CONTROL_AESEBU_RECEIVER,
271 HPI_CONTROL_LEVEL = 8, /**< level/trim control - works in d_bu. */
272 HPI_CONTROL_TUNER = 9, /**< tuner control. */
273 /* HPI_CONTROL_ONOFFSWITCH = 10 */
274 HPI_CONTROL_VOX = 11, /**< vox control. */
275 /* HPI_CONTROL_AES18_TRANSMITTER = 12 */
276 /* HPI_CONTROL_AES18_RECEIVER = 13 */
277 /* HPI_CONTROL_AES18_BLOCKGENERATOR = 14 */
278 HPI_CONTROL_CHANNEL_MODE = 15, /**< channel mode control. */
280 HPI_CONTROL_BITSTREAM = 16, /**< bitstream control. */
281 HPI_CONTROL_SAMPLECLOCK = 17, /**< sample clock control. */
282 HPI_CONTROL_MICROPHONE = 18, /**< microphone control. */
283 HPI_CONTROL_PARAMETRIC_EQ = 19, /**< parametric EQ control. */
284 HPI_CONTROL_EQUALIZER = HPI_CONTROL_PARAMETRIC_EQ,
286 HPI_CONTROL_COMPANDER = 20, /**< compander control. */
287 HPI_CONTROL_COBRANET = 21, /**< cobranet control. */
288 HPI_CONTROL_TONEDETECTOR = 22, /**< tone detector control. */
289 HPI_CONTROL_SILENCEDETECTOR = 23, /**< silence detector control. */
290 HPI_CONTROL_PAD = 24, /**< tuner PAD control. */
291 HPI_CONTROL_SRC = 25, /**< samplerate converter control. */
292 HPI_CONTROL_UNIVERSAL = 26, /**< universal control. */
294 /* !!! Update this AND hpidebug.h if you add a new control type!!!*/
295 HPI_CONTROL_LAST_INDEX = 26 /**<highest control type ID */
296 /* WARNING types 256 or greater impact bit packing in all AX6 DSP code */
299 /* Shorthand names that match attribute names */
301 /******************************************* ADAPTER ATTRIBUTES ****/
303 /** Adapter properties
304 These are used in HPI_AdapterSetProperty() and HPI_AdapterGetProperty()
305 \ingroup adapter
307 enum HPI_ADAPTER_PROPERTIES {
308 /** \internal Used in dwProperty field of HPI_AdapterSetProperty() and
309 HPI_AdapterGetProperty(). This errata applies to all ASI6000 cards with both
310 analog and digital outputs. The CS4224 A/D+D/A has a one sample delay between
311 left and right channels on both its input (ADC) and output (DAC).
312 More details are available in Cirrus Logic errata ER284B2.
313 PDF available from www.cirrus.com, released by Cirrus in 2001.
315 HPI_ADAPTER_PROPERTY_ERRATA_1 = 1,
317 /** Adapter grouping property
318 Indicates whether the adapter supports the grouping API (for ASIO and SSX2)
320 HPI_ADAPTER_PROPERTY_GROUPING = 2,
322 /** Driver SSX2 property
323 Tells the kernel driver to turn on SSX2 stream mapping.
324 This feature is not used by the DSP. In fact the call is completely processed
325 by the driver and is not passed on to the DSP at all.
327 HPI_ADAPTER_PROPERTY_ENABLE_SSX2 = 3,
329 /** Adapter SSX2 property
330 Indicates the state of the adapter's SSX2 setting. This setting is stored in
331 non-volatile memory on the adapter. A typical call sequence would be to use
332 HPI_ADAPTER_PROPERTY_SSX2_SETTING to set SSX2 on the adapter and then to reload
333 the driver. The driver would query HPI_ADAPTER_PROPERTY_SSX2_SETTING during startup
334 and if SSX2 is set, it would then call HPI_ADAPTER_PROPERTY_ENABLE_SSX2 to enable
335 SSX2 stream mapping within the kernel level of the driver.
337 HPI_ADAPTER_PROPERTY_SSX2_SETTING = 4,
339 /** Base number for readonly properties */
340 HPI_ADAPTER_PROPERTY_READONLYBASE = 256,
342 /** Readonly adapter latency property.
343 This property returns in the input and output latency in samples.
344 Property 1 is the estimated input latency
345 in samples, while Property 2 is that output latency in samples.
347 HPI_ADAPTER_PROPERTY_LATENCY = 256,
349 /** Readonly adapter granularity property.
350 The granulariy is the smallest size chunk of stereo samples that is processed by
351 the adapter.
352 This property returns the record granularity in samples in Property 1.
353 Property 2 returns the play granularity.
355 HPI_ADAPTER_PROPERTY_GRANULARITY = 257,
357 /** Readonly adapter number of current channels property.
358 Property 1 is the number of record channels per record device.
359 Property 2 is the number of play channels per playback device.*/
360 HPI_ADAPTER_PROPERTY_CURCHANNELS = 258,
362 /** Readonly adapter software version.
363 The SOFTWARE_VERSION property returns the version of the software running
364 on the adapter as Major.Minor.Release.
365 Property 1 contains Major in bits 15..8 and Minor in bits 7..0.
366 Property 2 contains Release in bits 7..0. */
367 HPI_ADAPTER_PROPERTY_SOFTWARE_VERSION = 259,
369 /** Readonly adapter MAC address MSBs.
370 The MAC_ADDRESS_MSB property returns
371 the most significant 32 bits of the MAC address.
372 Property 1 contains bits 47..32 of the MAC address.
373 Property 2 contains bits 31..16 of the MAC address. */
374 HPI_ADAPTER_PROPERTY_MAC_ADDRESS_MSB = 260,
376 /** Readonly adapter MAC address LSBs
377 The MAC_ADDRESS_LSB property returns
378 the least significant 16 bits of the MAC address.
379 Property 1 contains bits 15..0 of the MAC address. */
380 HPI_ADAPTER_PROPERTY_MAC_ADDRESS_LSB = 261,
382 /** Readonly extended adapter type number
383 The EXTENDED_ADAPTER_TYPE property returns the 4 digits of an extended
384 adapter type, i.e ASI8920-0022, 0022 is the extended type.
385 The digits are returned as ASCII characters rather than the hex digits that
386 are returned for the main type
387 Property 1 returns the 1st two (left most) digits, i.e "00"
388 in the example above, the upper byte being the left most digit.
389 Property 2 returns the 2nd two digits, i.e "22" in the example above*/
390 HPI_ADAPTER_PROPERTY_EXTENDED_ADAPTER_TYPE = 262,
392 /** Readonly debug log buffer information */
393 HPI_ADAPTER_PROPERTY_LOGTABLEN = 263,
394 HPI_ADAPTER_PROPERTY_LOGTABBEG = 264,
396 /** Readonly adapter IP address
397 For 192.168.1.101
398 Property 1 returns the 1st two (left most) digits, i.e 192*256 + 168
399 in the example above, the upper byte being the left most digit.
400 Property 2 returns the 2nd two digits, i.e 1*256 + 101 in the example above, */
401 HPI_ADAPTER_PROPERTY_IP_ADDRESS = 265,
403 /** Readonly adapter buffer processed count. Returns a buffer processed count
404 that is incremented every time all buffers for all streams are updated. This
405 is useful for checking completion of all stream operations across the adapter
406 when using grouped streams.
408 HPI_ADAPTER_PROPERTY_BUFFER_UPDATE_COUNT = 266,
410 /** Readonly mixer and stream intervals
412 These intervals are measured in mixer frames.
413 To convert to time, divide by the adapter samplerate.
415 The mixer interval is the number of frames processed in one mixer iteration.
416 The stream update interval is the interval at which streams check for and
417 process data, and BBM host buffer counters are updated.
419 Property 1 is the mixer interval in mixer frames.
420 Property 2 is the stream update interval in mixer frames.
422 HPI_ADAPTER_PROPERTY_INTERVAL = 267,
423 /** Adapter capabilities 1
424 Property 1 - adapter can do multichannel (SSX1)
425 Property 2 - adapter can do stream grouping (supports SSX2)
427 HPI_ADAPTER_PROPERTY_CAPS1 = 268,
428 /** Adapter capabilities 2
429 Property 1 - adapter can do samplerate conversion (MRX)
430 Property 2 - adapter can do timestretch (TSX)
432 HPI_ADAPTER_PROPERTY_CAPS2 = 269,
434 /** Readonly adapter sync header connection count.
436 HPI_ADAPTER_PROPERTY_SYNC_HEADER_CONNECTIONS = 270,
437 /** Readonly supports SSX2 property.
438 Indicates the adapter supports SSX2 in some mode setting. The
439 return value is true (1) or false (0). If the current adapter
440 mode is MONO SSX2 is disabled, even though this property will
441 return true.
443 HPI_ADAPTER_PROPERTY_SUPPORTS_SSX2 = 271
446 /** Adapter mode commands
448 Used in wQueryOrSet field of HPI_AdapterSetModeEx().
449 \ingroup adapter
451 enum HPI_ADAPTER_MODE_CMDS {
452 HPI_ADAPTER_MODE_SET = 0,
453 HPI_ADAPTER_MODE_QUERY = 1
456 /** Adapter Modes
457 These are used by HPI_AdapterSetModeEx()
459 \warning - more than 16 possible modes breaks
460 a bitmask in the Windows WAVE DLL
461 \ingroup adapter
463 enum HPI_ADAPTER_MODES {
464 /** 4 outstream mode.
465 - ASI6114: 1 instream
466 - ASI6044: 4 instreams
467 - ASI6012: 1 instream
468 - ASI6102: no instreams
469 - ASI6022, ASI6122: 2 instreams
470 - ASI5111, ASI5101: 2 instreams
471 - ASI652x, ASI662x: 2 instreams
472 - ASI654x, ASI664x: 4 instreams
474 HPI_ADAPTER_MODE_4OSTREAM = 1,
476 /** 6 outstream mode.
477 - ASI6012: 1 instream,
478 - ASI6022, ASI6122: 2 instreams
479 - ASI652x, ASI662x: 4 instreams
481 HPI_ADAPTER_MODE_6OSTREAM = 2,
483 /** 8 outstream mode.
484 - ASI6114: 8 instreams
485 - ASI6118: 8 instreams
486 - ASI6585: 8 instreams
488 HPI_ADAPTER_MODE_8OSTREAM = 3,
490 /** 16 outstream mode.
491 - ASI6416 16 instreams
492 - ASI6518, ASI6618 16 instreams
493 - ASI6118 16 mono out and in streams
495 HPI_ADAPTER_MODE_16OSTREAM = 4,
497 /** one outstream mode.
498 - ASI5111 1 outstream, 1 instream
500 HPI_ADAPTER_MODE_1OSTREAM = 5,
502 /** ASI504X mode 1. 12 outstream, 4 instream 0 to 48kHz sample rates
503 (see ASI504X datasheet for more info).
505 HPI_ADAPTER_MODE_1 = 6,
507 /** ASI504X mode 2. 4 outstreams, 4 instreams at 0 to 192kHz sample rates
508 (see ASI504X datasheet for more info).
510 HPI_ADAPTER_MODE_2 = 7,
512 /** ASI504X mode 3. 4 outstreams, 4 instreams at 0 to 192kHz sample rates
513 (see ASI504X datasheet for more info).
515 HPI_ADAPTER_MODE_3 = 8,
517 /** ASI504X multichannel mode.
518 2 outstreams -> 4 line outs = 1 to 8 channel streams),
519 4 lineins -> 1 instream (1 to 8 channel streams) at 0-48kHz.
520 For more info see the SSX Specification.
522 HPI_ADAPTER_MODE_MULTICHANNEL = 9,
524 /** 12 outstream mode.
525 - ASI6514, ASI6614: 2 instreams
526 - ASI6540,ASI6544: 8 instreams
527 - ASI6640,ASI6644: 8 instreams
529 HPI_ADAPTER_MODE_12OSTREAM = 10,
531 /** 9 outstream mode.
532 - ASI6044: 8 instreams
534 HPI_ADAPTER_MODE_9OSTREAM = 11,
536 /** mono mode.
537 - ASI6416: 16 outstreams/instreams
538 - ASI5402: 2 outstreams/instreams
540 HPI_ADAPTER_MODE_MONO = 12,
542 /** Low latency mode.
543 - ASI6416/ASI6316: 1 16 channel outstream and instream
545 HPI_ADAPTER_MODE_LOW_LATENCY = 13
548 /* Note, adapters can have more than one capability -
549 encoding as bitfield is recommended. */
550 #define HPI_CAPABILITY_NONE (0)
551 #define HPI_CAPABILITY_MPEG_LAYER3 (1)
553 /* Set this equal to maximum capability index,
554 Must not be greater than 32 - see axnvdef.h */
555 #define HPI_CAPABILITY_MAX 1
556 /* #define HPI_CAPABILITY_AAC 2 */
558 /******************************************* STREAM ATTRIBUTES ****/
560 /** MPEG Ancillary Data modes
562 The mode for the ancillary data insertion or extraction to operate in.
563 \ingroup stream
565 enum HPI_MPEG_ANC_MODES {
566 /** the MPEG frames have energy information stored in them (5 bytes per stereo frame, 3 per mono) */
567 HPI_MPEG_ANC_HASENERGY = 0,
568 /** the entire ancillary data field is taken up by data from the Anc data buffer
569 On encode, the encoder will insert the energy bytes before filling the remainder
570 of the ancillary data space with data from the ancillary data buffer.
572 HPI_MPEG_ANC_RAW = 1
575 /** Ancillary Data Alignment
576 \ingroup instream
578 enum HPI_ISTREAM_MPEG_ANC_ALIGNS {
579 /** data is packed against the end of data, then padded to the end of frame */
580 HPI_MPEG_ANC_ALIGN_LEFT = 0,
581 /** data is packed against the end of the frame */
582 HPI_MPEG_ANC_ALIGN_RIGHT = 1
585 /** MPEG modes
586 MPEG modes - can be used optionally for HPI_FormatCreate()
587 parameter dwAttributes.
589 Using any mode setting other than HPI_MPEG_MODE_DEFAULT
590 with single channel format will return an error.
591 \ingroup stream
593 enum HPI_MPEG_MODES {
594 /** Causes the MPEG-1 Layer II bitstream to be recorded
595 in single_channel mode when the number of channels is 1 and in stereo when the
596 number of channels is 2. */
597 HPI_MPEG_MODE_DEFAULT = 0,
598 /** Standard stereo without joint-stereo compression */
599 HPI_MPEG_MODE_STEREO = 1,
600 /** Joint stereo */
601 HPI_MPEG_MODE_JOINTSTEREO = 2,
602 /** Left and Right channels are completely independent */
603 HPI_MPEG_MODE_DUALCHANNEL = 3
605 /******************************************* MIXER ATTRIBUTES ****/
607 /* \defgroup mixer_flags Mixer flags for HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES
610 #define HPI_MIXER_GET_CONTROL_MULTIPLE_CHANGED (0)
611 #define HPI_MIXER_GET_CONTROL_MULTIPLE_RESET (1)
612 /*}*/
614 /** Commands used by HPI_MixerStore()
615 \ingroup mixer
617 enum HPI_MIXER_STORE_COMMAND {
618 /** Save all mixer control settings. */
619 HPI_MIXER_STORE_SAVE = 1,
620 /** Restore all controls from saved. */
621 HPI_MIXER_STORE_RESTORE = 2,
622 /** Delete saved control settings. */
623 HPI_MIXER_STORE_DELETE = 3,
624 /** Enable auto storage of some control settings. */
625 HPI_MIXER_STORE_ENABLE = 4,
626 /** Disable auto storage of some control settings. */
627 HPI_MIXER_STORE_DISABLE = 5,
628 /** Save the attributes of a single control. */
629 HPI_MIXER_STORE_SAVE_SINGLE = 6
632 /************************************* CONTROL ATTRIBUTE VALUES ****/
633 /** Used by mixer plugin enable functions
635 E.g. HPI_ParametricEQ_SetState()
636 \ingroup mixer
638 enum HPI_SWITCH_STATES {
639 HPI_SWITCH_OFF = 0, /**< turn the mixer plugin on. */
640 HPI_SWITCH_ON = 1 /**< turn the mixer plugin off. */
643 /* Volume control special gain values */
644 /** volumes units are 100ths of a dB
645 \ingroup volume
647 #define HPI_UNITS_PER_dB 100
648 /** turns volume control OFF or MUTE
649 \ingroup volume
651 #define HPI_GAIN_OFF (-100 * HPI_UNITS_PER_dB)
653 /** value returned for no signal
654 \ingroup meter
656 #define HPI_METER_MINIMUM (-150 * HPI_UNITS_PER_dB)
658 /** autofade profiles
659 \ingroup volume
661 enum HPI_VOLUME_AUTOFADES {
662 /** log fade - dB attenuation changes linearly over time */
663 HPI_VOLUME_AUTOFADE_LOG = 2,
664 /** linear fade - amplitude changes linearly */
665 HPI_VOLUME_AUTOFADE_LINEAR = 3
668 /** The physical encoding format of the AESEBU I/O.
670 Used in HPI_AESEBU_Transmitter_SetFormat(), HPI_AESEBU_Receiver_SetFormat()
671 along with related Get and Query functions
672 \ingroup aestx
674 enum HPI_AESEBU_FORMATS {
675 /** AES/EBU physical format - AES/EBU balanced "professional" */
676 HPI_AESEBU_FORMAT_AESEBU = 1,
677 /** AES/EBU physical format - S/PDIF unbalanced "consumer" */
678 HPI_AESEBU_FORMAT_SPDIF = 2
681 /** AES/EBU error status bits
683 Returned by HPI_AESEBU_Receiver_GetErrorStatus()
684 \ingroup aesrx
686 enum HPI_AESEBU_ERRORS {
687 /** bit0: 1 when PLL is not locked */
688 HPI_AESEBU_ERROR_NOT_LOCKED = 0x01,
689 /** bit1: 1 when signal quality is poor */
690 HPI_AESEBU_ERROR_POOR_QUALITY = 0x02,
691 /** bit2: 1 when there is a parity error */
692 HPI_AESEBU_ERROR_PARITY_ERROR = 0x04,
693 /** bit3: 1 when there is a bi-phase coding violation */
694 HPI_AESEBU_ERROR_BIPHASE_VIOLATION = 0x08,
695 /** bit4: 1 when the validity bit is high */
696 HPI_AESEBU_ERROR_VALIDITY = 0x10,
697 /** bit5: 1 when the CRC error bit is high */
698 HPI_AESEBU_ERROR_CRC = 0x20
701 /** \addtogroup pad
704 /** The text string containing the station/channel combination. */
705 #define HPI_PAD_CHANNEL_NAME_LEN 16
706 /** The text string containing the artist. */
707 #define HPI_PAD_ARTIST_LEN 64
708 /** The text string containing the title. */
709 #define HPI_PAD_TITLE_LEN 64
710 /** The text string containing the comment. */
711 #define HPI_PAD_COMMENT_LEN 256
712 /** The PTY when the tuner has not recieved any PTY. */
713 #define HPI_PAD_PROGRAM_TYPE_INVALID 0xffff
714 /** \} */
716 /** Data types for PTY string translation.
717 \ingroup rds
719 enum eHPI_RDS_type {
720 HPI_RDS_DATATYPE_RDS = 0, /**< RDS bitstream.*/
721 HPI_RDS_DATATYPE_RBDS = 1 /**< RBDS bitstream.*/
724 /** Tuner bands
726 Used for HPI_Tuner_SetBand(),HPI_Tuner_GetBand()
727 \ingroup tuner
729 enum HPI_TUNER_BAND {
730 HPI_TUNER_BAND_AM = 1, /**< AM band */
731 HPI_TUNER_BAND_FM = 2, /**< FM band (mono) */
732 HPI_TUNER_BAND_TV_NTSC_M = 3, /**< NTSC-M TV band*/
733 HPI_TUNER_BAND_TV = 3, /* use TV_NTSC_M */
734 HPI_TUNER_BAND_FM_STEREO = 4, /**< FM band (stereo) */
735 HPI_TUNER_BAND_AUX = 5, /**< auxiliary input */
736 HPI_TUNER_BAND_TV_PAL_BG = 6, /**< PAL-B/G TV band*/
737 HPI_TUNER_BAND_TV_PAL_I = 7, /**< PAL-I TV band*/
738 HPI_TUNER_BAND_TV_PAL_DK = 8, /**< PAL-D/K TV band*/
739 HPI_TUNER_BAND_TV_SECAM_L = 9, /**< SECAM-L TV band*/
740 HPI_TUNER_BAND_LAST = 9 /**< the index of the last tuner band. */
743 /** Tuner mode attributes
745 Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
746 \ingroup tuner
749 enum HPI_TUNER_MODES {
750 HPI_TUNER_MODE_RSS = 1, /**< control RSS */
751 HPI_TUNER_MODE_RDS = 2 /**< control RBDS/RDS */
754 /** Tuner mode attribute values
756 Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
757 \ingroup tuner
759 enum HPI_TUNER_MODE_VALUES {
760 /* RSS attribute values */
761 HPI_TUNER_MODE_RSS_DISABLE = 0, /**< RSS disable */
762 HPI_TUNER_MODE_RSS_ENABLE = 1, /**< RSS enable */
764 /* RDS mode attributes */
765 HPI_TUNER_MODE_RDS_DISABLE = 0, /**< RDS - disabled */
766 HPI_TUNER_MODE_RDS_RDS = 1, /**< RDS - RDS mode */
767 HPI_TUNER_MODE_RDS_RBDS = 2 /**< RDS - RBDS mode */
770 /** Tuner Level settings
771 \ingroup tuner
773 enum HPI_TUNER_LEVEL {
774 HPI_TUNER_LEVEL_AVERAGE = 0,
775 HPI_TUNER_LEVEL_RAW = 1
778 /** Tuner Status Bits
780 These bitfield values are returned by a call to HPI_Tuner_GetStatus().
781 Multiple fields are returned from a single call.
782 \ingroup tuner
784 enum HPI_TUNER_STATUS_BITS {
785 HPI_TUNER_VIDEO_COLOR_PRESENT = 0x0001, /**< video color is present. */
786 HPI_TUNER_VIDEO_IS_60HZ = 0x0020, /**< 60 hz video detected. */
787 HPI_TUNER_VIDEO_HORZ_SYNC_MISSING = 0x0040, /**< video HSYNC is missing. */
788 HPI_TUNER_VIDEO_STATUS_VALID = 0x0100, /**< video status is valid. */
789 HPI_TUNER_PLL_LOCKED = 0x1000, /**< the tuner's PLL is locked. */
790 HPI_TUNER_FM_STEREO = 0x2000, /**< tuner reports back FM stereo. */
791 HPI_TUNER_DIGITAL = 0x0200, /**< tuner reports digital programming. */
792 HPI_TUNER_MULTIPROGRAM = 0x0400 /**< tuner reports multiple programs. */
795 /** Channel Modes
796 Used for HPI_ChannelModeSet/Get()
797 \ingroup channelmode
799 enum HPI_CHANNEL_MODES {
800 /** Left channel out = left channel in, Right channel out = right channel in. */
801 HPI_CHANNEL_MODE_NORMAL = 1,
802 /** Left channel out = right channel in, Right channel out = left channel in. */
803 HPI_CHANNEL_MODE_SWAP = 2,
804 /** Left channel out = left channel in, Right channel out = left channel in. */
805 HPI_CHANNEL_MODE_LEFT_TO_STEREO = 3,
806 /** Left channel out = right channel in, Right channel out = right channel in.*/
807 HPI_CHANNEL_MODE_RIGHT_TO_STEREO = 4,
808 /** Left channel out = (left channel in + right channel in)/2,
809 Right channel out = mute. */
810 HPI_CHANNEL_MODE_STEREO_TO_LEFT = 5,
811 /** Left channel out = mute,
812 Right channel out = (right channel in + left channel in)/2. */
813 HPI_CHANNEL_MODE_STEREO_TO_RIGHT = 6,
814 HPI_CHANNEL_MODE_LAST = 6
817 /** SampleClock source values
818 \ingroup sampleclock
820 enum HPI_SAMPLECLOCK_SOURCES {
821 /** The sampleclock output is derived from its local samplerate generator.
822 The local samplerate may be set using HPI_SampleClock_SetLocalRate(). */
823 HPI_SAMPLECLOCK_SOURCE_LOCAL = 1,
824 /** The adapter is clocked from a dedicated AES/EBU SampleClock input.*/
825 HPI_SAMPLECLOCK_SOURCE_AESEBU_SYNC = 2,
826 /** From external wordclock connector */
827 HPI_SAMPLECLOCK_SOURCE_WORD = 3,
828 /** Board-to-board header */
829 HPI_SAMPLECLOCK_SOURCE_WORD_HEADER = 4,
830 /** FUTURE - SMPTE clock. */
831 HPI_SAMPLECLOCK_SOURCE_SMPTE = 5,
832 /** One of the aesebu inputs */
833 HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT = 6,
834 /** From a network interface e.g. Cobranet or Livewire at either 48 or 96kHz */
835 HPI_SAMPLECLOCK_SOURCE_NETWORK = 8,
836 /** From previous adjacent module (ASI2416 only)*/
837 HPI_SAMPLECLOCK_SOURCE_PREV_MODULE = 10,
838 /*! Update this if you add a new clock source.*/
839 HPI_SAMPLECLOCK_SOURCE_LAST = 10
842 /** Equalizer filter types. Used by HPI_ParametricEQ_SetBand()
843 \ingroup parmeq
845 enum HPI_FILTER_TYPE {
846 HPI_FILTER_TYPE_BYPASS = 0, /**< filter is turned off */
848 HPI_FILTER_TYPE_LOWSHELF = 1, /**< EQ low shelf */
849 HPI_FILTER_TYPE_HIGHSHELF = 2, /**< EQ high shelf */
850 HPI_FILTER_TYPE_EQ_BAND = 3, /**< EQ gain */
852 HPI_FILTER_TYPE_LOWPASS = 4, /**< standard low pass */
853 HPI_FILTER_TYPE_HIGHPASS = 5, /**< standard high pass */
854 HPI_FILTER_TYPE_BANDPASS = 6, /**< standard band pass */
855 HPI_FILTER_TYPE_BANDSTOP = 7 /**< standard band stop/notch */
858 /** Async Event sources
859 \ingroup async
861 enum ASYNC_EVENT_SOURCES {
862 HPI_ASYNC_EVENT_GPIO = 1, /**< GPIO event. */
863 HPI_ASYNC_EVENT_SILENCE = 2, /**< silence event detected. */
864 HPI_ASYNC_EVENT_TONE = 3 /**< tone event detected. */
866 /*******************************************/
867 /** HPI Error codes
869 Almost all HPI functions return an error code
870 A return value of zero means there was no error.
871 Otherwise one of these error codes is returned.
872 Error codes can be converted to a descriptive string using HPI_GetErrorText()
874 \note When a new error code is added HPI_GetErrorText() MUST be updated.
875 \note Codes 1-100 are reserved for driver use
876 \ingroup utility
878 enum HPI_ERROR_CODES {
879 /** Message type does not exist. */
880 HPI_ERROR_INVALID_TYPE = 100,
881 /** Object type does not exist. */
882 HPI_ERROR_INVALID_OBJ = 101,
883 /** Function does not exist. */
884 HPI_ERROR_INVALID_FUNC = 102,
885 /** The specified object (adapter/Stream) does not exist. */
886 HPI_ERROR_INVALID_OBJ_INDEX = 103,
887 /** Trying to access an object that has not been opened yet. */
888 HPI_ERROR_OBJ_NOT_OPEN = 104,
889 /** Trying to open an already open object. */
890 HPI_ERROR_OBJ_ALREADY_OPEN = 105,
891 /** PCI, ISA resource not valid. */
892 HPI_ERROR_INVALID_RESOURCE = 106,
893 /** GetInfo call from SubSysFindAdapters failed. */
894 HPI_ERROR_SUBSYSFINDADAPTERS_GETINFO = 107,
895 /** Default response was never updated with actual error code. */
896 HPI_ERROR_INVALID_RESPONSE = 108,
897 /** wSize field of response was not updated,
898 indicating that the message was not processed. */
899 HPI_ERROR_PROCESSING_MESSAGE = 109,
900 /** The network did not respond in a timely manner. */
901 HPI_ERROR_NETWORK_TIMEOUT = 110,
902 /** An HPI handle is invalid (uninitialised?). */
903 HPI_ERROR_INVALID_HANDLE = 111,
904 /** A function or attribute has not been implemented yet. */
905 HPI_ERROR_UNIMPLEMENTED = 112,
906 /** There are too many clients attempting to access a network resource. */
907 HPI_ERROR_NETWORK_TOO_MANY_CLIENTS = 113,
908 /** Response buffer passed to HPI_Message was smaller than returned response */
909 HPI_ERROR_RESPONSE_BUFFER_TOO_SMALL = 114,
910 /** The returned response did not match the sent message */
911 HPI_ERROR_RESPONSE_MISMATCH = 115,
913 /** Too many adapters.*/
914 HPI_ERROR_TOO_MANY_ADAPTERS = 200,
915 /** Bad adpater. */
916 HPI_ERROR_BAD_ADAPTER = 201,
917 /** Adapter number out of range or not set properly. */
918 HPI_ERROR_BAD_ADAPTER_NUMBER = 202,
919 /** 2 adapters with the same adapter number. */
920 HPI_DUPLICATE_ADAPTER_NUMBER = 203,
921 /** DSP code failed to bootload. */
922 HPI_ERROR_DSP_BOOTLOAD = 204,
923 /** Adapter failed DSP code self test. */
924 HPI_ERROR_DSP_SELFTEST = 205,
925 /** Couldn't find or open the DSP code file. */
926 HPI_ERROR_DSP_FILE_NOT_FOUND = 206,
927 /** Internal DSP hardware error. */
928 HPI_ERROR_DSP_HARDWARE = 207,
929 /** Could not allocate memory in DOS. */
930 HPI_ERROR_DOS_MEMORY_ALLOC = 208,
931 /** Could not allocate memory */
932 HPI_ERROR_MEMORY_ALLOC = 208,
933 /** Failed to correctly load/config PLD .*/
934 HPI_ERROR_PLD_LOAD = 209,
935 /** Unexpected end of file, block length too big etc. */
936 HPI_ERROR_DSP_FILE_FORMAT = 210,
938 /** Found but could not open DSP code file. */
939 HPI_ERROR_DSP_FILE_ACCESS_DENIED = 211,
940 /** First DSP code section header not found in DSP file. */
941 HPI_ERROR_DSP_FILE_NO_HEADER = 212,
942 /** File read operation on DSP code file failed. */
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,
953 /** Base number for flash errors. */
954 HPI_ERROR_FLASH = 220,
956 /** Flash has bad checksum */
957 HPI_ERROR_BAD_CHECKSUM = (HPI_ERROR_FLASH + 1),
958 HPI_ERROR_BAD_SEQUENCE = (HPI_ERROR_FLASH + 2),
959 HPI_ERROR_FLASH_ERASE = (HPI_ERROR_FLASH + 3),
960 HPI_ERROR_FLASH_PROGRAM = (HPI_ERROR_FLASH + 4),
961 HPI_ERROR_FLASH_VERIFY = (HPI_ERROR_FLASH + 5),
962 HPI_ERROR_FLASH_TYPE = (HPI_ERROR_FLASH + 6),
963 HPI_ERROR_FLASH_START = (HPI_ERROR_FLASH + 7),
965 /** Reserved for OEMs. */
966 HPI_ERROR_RESERVED_1 = 290,
968 /** Stream does not exist. */
969 HPI_ERROR_INVALID_STREAM = 300,
970 /** Invalid compression format. */
971 HPI_ERROR_INVALID_FORMAT = 301,
972 /** Invalid format samplerate */
973 HPI_ERROR_INVALID_SAMPLERATE = 302,
974 /** Invalid format number of channels. */
975 HPI_ERROR_INVALID_CHANNELS = 303,
976 /** Invalid format bitrate. */
977 HPI_ERROR_INVALID_BITRATE = 304,
978 /** Invalid datasize used for stream read/write. */
979 HPI_ERROR_INVALID_DATASIZE = 305,
980 /** Stream buffer is full during stream write. */
981 HPI_ERROR_BUFFER_FULL = 306,
982 /** Stream buffer is empty during stream read. */
983 HPI_ERROR_BUFFER_EMPTY = 307,
984 /** Invalid datasize used for stream read/write. */
985 HPI_ERROR_INVALID_DATA_TRANSFER = 308,
986 /** Packet ordering error for stream read/write. */
987 HPI_ERROR_INVALID_PACKET_ORDER = 309,
989 /** Object can't do requested operation in its current
990 state, eg set format, change rec mux state while recording.*/
991 HPI_ERROR_INVALID_OPERATION = 310,
993 /** Where an SRG is shared amongst streams, an incompatible samplerate is one
994 that is different to any currently playing or recording stream. */
995 HPI_ERROR_INCOMPATIBLE_SAMPLERATE = 311,
996 /** Adapter mode is illegal.*/
997 HPI_ERROR_BAD_ADAPTER_MODE = 312,
999 /** There have been too many attempts to set the adapter's
1000 capabilities (using bad keys), the card should be returned
1001 to ASI if further capabilities updates are required */
1002 HPI_ERROR_TOO_MANY_CAPABILITY_CHANGE_ATTEMPTS = 313,
1003 /** Streams on different adapters cannot be grouped. */
1004 HPI_ERROR_NO_INTERADAPTER_GROUPS = 314,
1005 /** Streams on different DSPs cannot be grouped. */
1006 HPI_ERROR_NO_INTERDSP_GROUPS = 315,
1008 /** Invalid mixer node for this adapter. */
1009 HPI_ERROR_INVALID_NODE = 400,
1010 /** Invalid control. */
1011 HPI_ERROR_INVALID_CONTROL = 401,
1012 /** Invalid control value was passed. */
1013 HPI_ERROR_INVALID_CONTROL_VALUE = 402,
1014 /** Control attribute not supported by this control. */
1015 HPI_ERROR_INVALID_CONTROL_ATTRIBUTE = 403,
1016 /** Control is disabled. */
1017 HPI_ERROR_CONTROL_DISABLED = 404,
1018 /** I2C transaction failed due to a missing ACK. */
1019 HPI_ERROR_CONTROL_I2C_MISSING_ACK = 405,
1020 /** Control is busy, or coming out of
1021 reset and cannot be accessed at this time. */
1022 HPI_ERROR_CONTROL_NOT_READY = 407,
1024 /** Non volatile memory */
1025 HPI_ERROR_NVMEM_BUSY = 450,
1026 HPI_ERROR_NVMEM_FULL = 451,
1027 HPI_ERROR_NVMEM_FAIL = 452,
1029 /** I2C */
1030 HPI_ERROR_I2C_MISSING_ACK = HPI_ERROR_CONTROL_I2C_MISSING_ACK,
1031 HPI_ERROR_I2C_BAD_ADR = 460,
1033 /** Entity errors */
1034 HPI_ERROR_ENTITY_TYPE_MISMATCH = 470,
1035 HPI_ERROR_ENTITY_ITEM_COUNT = 471,
1036 HPI_ERROR_ENTITY_TYPE_INVALID = 472,
1037 HPI_ERROR_ENTITY_ROLE_INVALID = 473,
1039 /* AES18 specific errors were 500..507 */
1041 /** custom error to use for debugging */
1042 HPI_ERROR_CUSTOM = 600,
1044 /** hpioct32.c can't obtain mutex */
1045 HPI_ERROR_MUTEX_TIMEOUT = 700,
1047 /** errors from HPI backends have values >= this */
1048 HPI_ERROR_BACKEND_BASE = 900,
1050 /** indicates a cached u16 value is invalid. */
1051 HPI_ERROR_ILLEGAL_CACHE_VALUE = 0xffff
1054 /** \defgroup maximums HPI maximum values
1057 /** Maximum number of adapters per HPI sub-system
1058 WARNING: modifying this value changes the response structure size.*/
1059 #define HPI_MAX_ADAPTERS 20
1060 /** Maximum number of in or out streams per adapter */
1061 #define HPI_MAX_STREAMS 16
1062 #define HPI_MAX_CHANNELS 2 /* per stream */
1063 #define HPI_MAX_NODES 8 /* per mixer ? */
1064 #define HPI_MAX_CONTROLS 4 /* per node ? */
1065 /** maximum number of ancillary bytes per MPEG frame */
1066 #define HPI_MAX_ANC_BYTES_PER_FRAME (64)
1067 #define HPI_STRING_LEN 16
1069 /** Velocity units */
1070 #define HPI_OSTREAM_VELOCITY_UNITS 4096
1071 /** OutStream timescale units */
1072 #define HPI_OSTREAM_TIMESCALE_UNITS 10000
1073 /** OutStream timescale passthrough - turns timescaling on in passthough mode */
1074 #define HPI_OSTREAM_TIMESCALE_PASSTHROUGH 99999
1076 /**\}*/
1078 /* ////////////////////////////////////////////////////////////////////// */
1079 /* STRUCTURES */
1080 #ifndef DISABLE_PRAGMA_PACK1
1081 #pragma pack(push, 1)
1082 #endif
1084 /** Structure containing sample format information.
1085 See also HPI_FormatCreate().
1087 struct hpi_format {
1088 u32 sample_rate;
1089 /**< 11025, 32000, 44100 ... */
1090 u32 bit_rate; /**< for MPEG */
1091 u32 attributes;
1092 /**< Stereo/JointStereo/Mono */
1093 u16 mode_legacy;
1094 /**< Legacy ancillary mode or idle bit */
1095 u16 unused; /**< unused */
1096 u16 channels; /**< 1,2..., (or ancillary mode or idle bit */
1097 u16 format; /**< HPI_FORMAT_PCM16, _MPEG etc. see #HPI_FORMATS. */
1100 struct hpi_anc_frame {
1101 u32 valid_bits_in_this_frame;
1102 u8 b_data[HPI_MAX_ANC_BYTES_PER_FRAME];
1105 /** An object for containing a single async event.
1107 struct hpi_async_event {
1108 u16 event_type; /**< type of event. \sa async_event */
1109 u16 sequence; /**< sequence number, allows lost event detection */
1110 u32 state; /**< new state */
1111 u32 h_object; /**< handle to the object returning the event. */
1112 union {
1113 struct {
1114 u16 index; /**< GPIO bit index. */
1115 } gpio;
1116 struct {
1117 u16 node_index; /**< what node is the control on ? */
1118 u16 node_type; /**< what type of node is the control on ? */
1119 } control;
1120 } u;
1123 /*/////////////////////////////////////////////////////////////////////////// */
1124 /* Public HPI Entity related definitions */
1126 struct hpi_entity;
1128 enum e_entity_type {
1129 entity_type_null,
1130 entity_type_sequence, /* sequence of potentially heterogeneous TLV entities */
1132 entity_type_reference, /* refers to a TLV entity or NULL */
1134 entity_type_int, /* 32 bit */
1135 entity_type_float, /* ieee754 binary 32 bit encoding */
1136 entity_type_double,
1138 entity_type_cstring,
1139 entity_type_octet,
1140 entity_type_ip4_address,
1141 entity_type_ip6_address,
1142 entity_type_mac_address,
1144 LAST_ENTITY_TYPE
1147 enum e_entity_role {
1148 entity_role_null,
1149 entity_role_value,
1150 entity_role_classname,
1152 entity_role_units,
1153 entity_role_flags,
1154 entity_role_range,
1156 entity_role_mapping,
1157 entity_role_enum,
1159 entity_role_instance_of,
1160 entity_role_depends_on,
1161 entity_role_member_of_group,
1162 entity_role_value_constraint,
1163 entity_role_parameter_port,
1165 entity_role_block,
1166 entity_role_node_group,
1167 entity_role_audio_port,
1168 entity_role_clock_port,
1169 LAST_ENTITY_ROLE
1172 /* skip host side function declarations for
1173 DSP compile and documentation extraction */
1175 struct hpi_hsubsys {
1176 int not_really_used;
1179 #ifndef DISABLE_PRAGMA_PACK1
1180 #pragma pack(pop)
1181 #endif
1183 /*////////////////////////////////////////////////////////////////////////// */
1184 /* HPI FUNCTIONS */
1186 /*/////////////////////////// */
1187 /* DATA and FORMAT and STREAM */
1189 u16 hpi_stream_estimate_buffer_size(struct hpi_format *pF,
1190 u32 host_polling_rate_in_milli_seconds, u32 *recommended_buffer_size);
1192 /*/////////// */
1193 /* SUB SYSTEM */
1194 struct hpi_hsubsys *hpi_subsys_create(void
1197 void hpi_subsys_free(const struct hpi_hsubsys *ph_subsys);
1199 u16 hpi_subsys_get_version(const struct hpi_hsubsys *ph_subsys,
1200 u32 *pversion);
1202 u16 hpi_subsys_get_version_ex(const struct hpi_hsubsys *ph_subsys,
1203 u32 *pversion_ex);
1205 u16 hpi_subsys_get_info(const struct hpi_hsubsys *ph_subsys, u32 *pversion,
1206 u16 *pw_num_adapters, u16 aw_adapter_list[], u16 list_length);
1208 u16 hpi_subsys_find_adapters(const struct hpi_hsubsys *ph_subsys,
1209 u16 *pw_num_adapters, u16 aw_adapter_list[], u16 list_length);
1211 u16 hpi_subsys_get_num_adapters(const struct hpi_hsubsys *ph_subsys,
1212 int *pn_num_adapters);
1214 u16 hpi_subsys_get_adapter(const struct hpi_hsubsys *ph_subsys, int iterator,
1215 u32 *padapter_index, u16 *pw_adapter_type);
1217 u16 hpi_subsys_ssx2_bypass(const struct hpi_hsubsys *ph_subsys, u16 bypass);
1219 u16 hpi_subsys_set_host_network_interface(const struct hpi_hsubsys *ph_subsys,
1220 const char *sz_interface);
1222 /*///////// */
1223 /* ADAPTER */
1225 u16 hpi_adapter_open(const struct hpi_hsubsys *ph_subsys, u16 adapter_index);
1227 u16 hpi_adapter_close(const struct hpi_hsubsys *ph_subsys, u16 adapter_index);
1229 u16 hpi_adapter_get_info(const struct hpi_hsubsys *ph_subsys,
1230 u16 adapter_index, u16 *pw_num_outstreams, u16 *pw_num_instreams,
1231 u16 *pw_version, u32 *pserial_number, u16 *pw_adapter_type);
1233 u16 hpi_adapter_get_module_by_index(const struct hpi_hsubsys *ph_subsys,
1234 u16 adapter_index, u16 module_index, u16 *pw_num_outputs,
1235 u16 *pw_num_inputs, u16 *pw_version, u32 *pserial_number,
1236 u16 *pw_module_type, u32 *ph_module);
1238 u16 hpi_adapter_set_mode(const struct hpi_hsubsys *ph_subsys,
1239 u16 adapter_index, u32 adapter_mode);
1241 u16 hpi_adapter_set_mode_ex(const struct hpi_hsubsys *ph_subsys,
1242 u16 adapter_index, u32 adapter_mode, u16 query_or_set);
1244 u16 hpi_adapter_get_mode(const struct hpi_hsubsys *ph_subsys,
1245 u16 adapter_index, u32 *padapter_mode);
1247 u16 hpi_adapter_get_assert(const struct hpi_hsubsys *ph_subsys,
1248 u16 adapter_index, u16 *assert_present, char *psz_assert,
1249 u16 *pw_line_number);
1251 u16 hpi_adapter_get_assert_ex(const struct hpi_hsubsys *ph_subsys,
1252 u16 adapter_index, u16 *assert_present, char *psz_assert,
1253 u32 *pline_number, u16 *pw_assert_on_dsp);
1255 u16 hpi_adapter_test_assert(const struct hpi_hsubsys *ph_subsys,
1256 u16 adapter_index, u16 assert_id);
1258 u16 hpi_adapter_enable_capability(const struct hpi_hsubsys *ph_subsys,
1259 u16 adapter_index, u16 capability, u32 key);
1261 u16 hpi_adapter_self_test(const struct hpi_hsubsys *ph_subsys,
1262 u16 adapter_index);
1264 u16 hpi_adapter_debug_read(const struct hpi_hsubsys *ph_subsys,
1265 u16 adapter_index, u32 dsp_address, char *p_bytes, int *count_bytes);
1267 u16 hpi_adapter_set_property(const struct hpi_hsubsys *ph_subsys,
1268 u16 adapter_index, u16 property, u16 paramter1, u16 paramter2);
1270 u16 hpi_adapter_get_property(const struct hpi_hsubsys *ph_subsys,
1271 u16 adapter_index, u16 property, u16 *pw_paramter1,
1272 u16 *pw_paramter2);
1274 u16 hpi_adapter_enumerate_property(const struct hpi_hsubsys *ph_subsys,
1275 u16 adapter_index, u16 index, u16 what_to_enumerate,
1276 u16 property_index, u32 *psetting);
1278 /*////////////// */
1279 /* NonVol Memory */
1280 u16 hpi_nv_memory_open(const struct hpi_hsubsys *ph_subsys, u16 adapter_index,
1281 u32 *ph_nv_memory, u16 *pw_size_in_bytes);
1283 u16 hpi_nv_memory_read_byte(const struct hpi_hsubsys *ph_subsys,
1284 u32 h_nv_memory, u16 index, u16 *pw_data);
1286 u16 hpi_nv_memory_write_byte(const struct hpi_hsubsys *ph_subsys,
1287 u32 h_nv_memory, u16 index, u16 data);
1289 /*////////////// */
1290 /* Digital I/O */
1291 u16 hpi_gpio_open(const struct hpi_hsubsys *ph_subsys, u16 adapter_index,
1292 u32 *ph_gpio, u16 *pw_number_input_bits, u16 *pw_number_output_bits);
1294 u16 hpi_gpio_read_bit(const struct hpi_hsubsys *ph_subsys, u32 h_gpio,
1295 u16 bit_index, u16 *pw_bit_data);
1297 u16 hpi_gpio_read_all_bits(const struct hpi_hsubsys *ph_subsys, u32 h_gpio,
1298 u16 aw_all_bit_data[4]
1301 u16 hpi_gpio_write_bit(const struct hpi_hsubsys *ph_subsys, u32 h_gpio,
1302 u16 bit_index, u16 bit_data);
1304 u16 hpi_gpio_write_status(const struct hpi_hsubsys *ph_subsys, u32 h_gpio,
1305 u16 aw_all_bit_data[4]
1308 /**********************/
1309 /* Async Event Object */
1310 /**********************/
1311 u16 hpi_async_event_open(const struct hpi_hsubsys *ph_subsys,
1312 u16 adapter_index, u32 *ph_async);
1314 u16 hpi_async_event_close(const struct hpi_hsubsys *ph_subsys, u32 h_async);
1316 u16 hpi_async_event_wait(const struct hpi_hsubsys *ph_subsys, u32 h_async,
1317 u16 maximum_events, struct hpi_async_event *p_events,
1318 u16 *pw_number_returned);
1320 u16 hpi_async_event_get_count(const struct hpi_hsubsys *ph_subsys,
1321 u32 h_async, u16 *pw_count);
1323 u16 hpi_async_event_get(const struct hpi_hsubsys *ph_subsys, u32 h_async,
1324 u16 maximum_events, struct hpi_async_event *p_events,
1325 u16 *pw_number_returned);
1327 /*/////////// */
1328 /* WATCH-DOG */
1329 u16 hpi_watchdog_open(const struct hpi_hsubsys *ph_subsys, u16 adapter_index,
1330 u32 *ph_watchdog);
1332 u16 hpi_watchdog_set_time(const struct hpi_hsubsys *ph_subsys, u32 h_watchdog,
1333 u32 time_millisec);
1335 u16 hpi_watchdog_ping(const struct hpi_hsubsys *ph_subsys, u32 h_watchdog);
1337 /**************/
1338 /* OUT STREAM */
1339 /**************/
1340 u16 hpi_outstream_open(const struct hpi_hsubsys *ph_subsys, u16 adapter_index,
1341 u16 outstream_index, u32 *ph_outstream);
1343 u16 hpi_outstream_close(const struct hpi_hsubsys *ph_subsys, u32 h_outstream);
1345 u16 hpi_outstream_get_info_ex(const struct hpi_hsubsys *ph_subsys,
1346 u32 h_outstream, u16 *pw_state, u32 *pbuffer_size, u32 *pdata_to_play,
1347 u32 *psamples_played, u32 *pauxiliary_data_to_play);
1349 u16 hpi_outstream_write_buf(const struct hpi_hsubsys *ph_subsys,
1350 u32 h_outstream, const u8 *pb_write_buf, u32 bytes_to_write,
1351 const struct hpi_format *p_format);
1353 u16 hpi_outstream_start(const struct hpi_hsubsys *ph_subsys, u32 h_outstream);
1355 u16 hpi_outstream_wait_start(const struct hpi_hsubsys *ph_subsys,
1356 u32 h_outstream);
1358 u16 hpi_outstream_stop(const struct hpi_hsubsys *ph_subsys, u32 h_outstream);
1360 u16 hpi_outstream_sinegen(const struct hpi_hsubsys *ph_subsys,
1361 u32 h_outstream);
1363 u16 hpi_outstream_reset(const struct hpi_hsubsys *ph_subsys, u32 h_outstream);
1365 u16 hpi_outstream_query_format(const struct hpi_hsubsys *ph_subsys,
1366 u32 h_outstream, struct hpi_format *p_format);
1368 u16 hpi_outstream_set_format(const struct hpi_hsubsys *ph_subsys,
1369 u32 h_outstream, struct hpi_format *p_format);
1371 u16 hpi_outstream_set_punch_in_out(const struct hpi_hsubsys *ph_subsys,
1372 u32 h_outstream, u32 punch_in_sample, u32 punch_out_sample);
1374 u16 hpi_outstream_set_velocity(const struct hpi_hsubsys *ph_subsys,
1375 u32 h_outstream, short velocity);
1377 u16 hpi_outstream_ancillary_reset(const struct hpi_hsubsys *ph_subsys,
1378 u32 h_outstream, u16 mode);
1380 u16 hpi_outstream_ancillary_get_info(const struct hpi_hsubsys *ph_subsys,
1381 u32 h_outstream, u32 *pframes_available);
1383 u16 hpi_outstream_ancillary_read(const struct hpi_hsubsys *ph_subsys,
1384 u32 h_outstream, struct hpi_anc_frame *p_anc_frame_buffer,
1385 u32 anc_frame_buffer_size_in_bytes,
1386 u32 number_of_ancillary_frames_to_read);
1388 u16 hpi_outstream_set_time_scale(const struct hpi_hsubsys *ph_subsys,
1389 u32 h_outstream, u32 time_scaleX10000);
1391 u16 hpi_outstream_host_buffer_allocate(const struct hpi_hsubsys *ph_subsys,
1392 u32 h_outstream, u32 size_in_bytes);
1394 u16 hpi_outstream_host_buffer_free(const struct hpi_hsubsys *ph_subsys,
1395 u32 h_outstream);
1397 u16 hpi_outstream_group_add(const struct hpi_hsubsys *ph_subsys,
1398 u32 h_outstream, u32 h_stream);
1400 u16 hpi_outstream_group_get_map(const struct hpi_hsubsys *ph_subsys,
1401 u32 h_outstream, u32 *poutstream_map, u32 *pinstream_map);
1403 u16 hpi_outstream_group_reset(const struct hpi_hsubsys *ph_subsys,
1404 u32 h_outstream);
1406 /*////////// */
1407 /* IN_STREAM */
1408 u16 hpi_instream_open(const struct hpi_hsubsys *ph_subsys, u16 adapter_index,
1409 u16 instream_index, u32 *ph_instream);
1411 u16 hpi_instream_close(const struct hpi_hsubsys *ph_subsys, u32 h_instream);
1413 u16 hpi_instream_query_format(const struct hpi_hsubsys *ph_subsys,
1414 u32 h_instream, const struct hpi_format *p_format);
1416 u16 hpi_instream_set_format(const struct hpi_hsubsys *ph_subsys,
1417 u32 h_instream, const struct hpi_format *p_format);
1419 u16 hpi_instream_read_buf(const struct hpi_hsubsys *ph_subsys, u32 h_instream,
1420 u8 *pb_read_buf, u32 bytes_to_read);
1422 u16 hpi_instream_start(const struct hpi_hsubsys *ph_subsys, u32 h_instream);
1424 u16 hpi_instream_wait_start(const struct hpi_hsubsys *ph_subsys,
1425 u32 h_instream);
1427 u16 hpi_instream_stop(const struct hpi_hsubsys *ph_subsys, u32 h_instream);
1429 u16 hpi_instream_reset(const struct hpi_hsubsys *ph_subsys, u32 h_instream);
1431 u16 hpi_instream_get_info_ex(const struct hpi_hsubsys *ph_subsys,
1432 u32 h_instream, u16 *pw_state, u32 *pbuffer_size, u32 *pdata_recorded,
1433 u32 *psamples_recorded, u32 *pauxiliary_data_recorded);
1435 u16 hpi_instream_ancillary_reset(const struct hpi_hsubsys *ph_subsys,
1436 u32 h_instream, u16 bytes_per_frame, u16 mode, u16 alignment,
1437 u16 idle_bit);
1439 u16 hpi_instream_ancillary_get_info(const struct hpi_hsubsys *ph_subsys,
1440 u32 h_instream, u32 *pframe_space);
1442 u16 hpi_instream_ancillary_write(const struct hpi_hsubsys *ph_subsys,
1443 u32 h_instream, const struct hpi_anc_frame *p_anc_frame_buffer,
1444 u32 anc_frame_buffer_size_in_bytes,
1445 u32 number_of_ancillary_frames_to_write);
1447 u16 hpi_instream_host_buffer_allocate(const struct hpi_hsubsys *ph_subsys,
1448 u32 h_instream, u32 size_in_bytes);
1450 u16 hpi_instream_host_buffer_free(const struct hpi_hsubsys *ph_subsys,
1451 u32 h_instream);
1453 u16 hpi_instream_group_add(const struct hpi_hsubsys *ph_subsys,
1454 u32 h_instream, u32 h_stream);
1456 u16 hpi_instream_group_get_map(const struct hpi_hsubsys *ph_subsys,
1457 u32 h_instream, u32 *poutstream_map, u32 *pinstream_map);
1459 u16 hpi_instream_group_reset(const struct hpi_hsubsys *ph_subsys,
1460 u32 h_instream);
1462 /*********/
1463 /* MIXER */
1464 /*********/
1465 u16 hpi_mixer_open(const struct hpi_hsubsys *ph_subsys, u16 adapter_index,
1466 u32 *ph_mixer);
1468 u16 hpi_mixer_close(const struct hpi_hsubsys *ph_subsys, u32 h_mixer);
1470 u16 hpi_mixer_get_control(const struct hpi_hsubsys *ph_subsys, u32 h_mixer,
1471 u16 src_node_type, u16 src_node_type_index, u16 dst_node_type,
1472 u16 dst_node_type_index, u16 control_type, u32 *ph_control);
1474 u16 hpi_mixer_get_control_by_index(const struct hpi_hsubsys *ph_subsys,
1475 u32 h_mixer, u16 control_index, u16 *pw_src_node_type,
1476 u16 *pw_src_node_index, u16 *pw_dst_node_type, u16 *pw_dst_node_index,
1477 u16 *pw_control_type, u32 *ph_control);
1479 u16 hpi_mixer_store(const struct hpi_hsubsys *ph_subsys, u32 h_mixer,
1480 enum HPI_MIXER_STORE_COMMAND command, u16 index);
1481 /*************************/
1482 /* mixer CONTROLS */
1483 /*************************/
1484 /*************************/
1485 /* volume control */
1486 /*************************/
1487 u16 hpi_volume_set_gain(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1488 short an_gain0_01dB[HPI_MAX_CHANNELS]
1491 u16 hpi_volume_get_gain(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1492 short an_gain0_01dB_out[HPI_MAX_CHANNELS]
1495 #define hpi_volume_get_range hpi_volume_query_range
1496 u16 hpi_volume_query_range(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1497 short *min_gain_01dB, short *max_gain_01dB, short *step_gain_01dB);
1499 u16 hpi_volume_query_channels(const struct hpi_hsubsys *ph_subsys,
1500 const u32 h_volume, u32 *p_channels);
1502 u16 hpi_volume_auto_fade(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1503 short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms);
1505 u16 hpi_volume_auto_fade_profile(const struct hpi_hsubsys *ph_subsys,
1506 u32 h_control, short an_stop_gain0_01dB[HPI_MAX_CHANNELS],
1507 u32 duration_ms, u16 profile);
1509 /*************************/
1510 /* level control */
1511 /*************************/
1512 u16 hpi_level_query_range(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1513 short *min_gain_01dB, short *max_gain_01dB, short *step_gain_01dB);
1515 u16 hpi_level_set_gain(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1516 short an_gain0_01dB[HPI_MAX_CHANNELS]
1519 u16 hpi_level_get_gain(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1520 short an_gain0_01dB_out[HPI_MAX_CHANNELS]
1523 /*************************/
1524 /* meter control */
1525 /*************************/
1526 u16 hpi_meter_query_channels(const struct hpi_hsubsys *ph_subsys,
1527 const u32 h_meter, u32 *p_channels);
1529 u16 hpi_meter_get_peak(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1530 short an_peak0_01dB_out[HPI_MAX_CHANNELS]
1533 u16 hpi_meter_get_rms(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1534 short an_peak0_01dB_out[HPI_MAX_CHANNELS]
1537 u16 hpi_meter_set_peak_ballistics(const struct hpi_hsubsys *ph_subsys,
1538 u32 h_control, u16 attack, u16 decay);
1540 u16 hpi_meter_set_rms_ballistics(const struct hpi_hsubsys *ph_subsys,
1541 u32 h_control, u16 attack, u16 decay);
1543 u16 hpi_meter_get_peak_ballistics(const struct hpi_hsubsys *ph_subsys,
1544 u32 h_control, u16 *attack, u16 *decay);
1546 u16 hpi_meter_get_rms_ballistics(const struct hpi_hsubsys *ph_subsys,
1547 u32 h_control, u16 *attack, u16 *decay);
1549 /*************************/
1550 /* channel mode control */
1551 /*************************/
1552 u16 hpi_channel_mode_query_mode(const struct hpi_hsubsys *ph_subsys,
1553 const u32 h_mode, const u32 index, u16 *pw_mode);
1555 u16 hpi_channel_mode_set(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1556 u16 mode);
1558 u16 hpi_channel_mode_get(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1559 u16 *mode);
1561 /*************************/
1562 /* Tuner control */
1563 /*************************/
1564 u16 hpi_tuner_query_band(const struct hpi_hsubsys *ph_subsys,
1565 const u32 h_tuner, const u32 index, u16 *pw_band);
1567 u16 hpi_tuner_set_band(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1568 u16 band);
1570 u16 hpi_tuner_get_band(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1571 u16 *pw_band);
1573 u16 hpi_tuner_query_frequency(const struct hpi_hsubsys *ph_subsys,
1574 const u32 h_tuner, const u32 index, const u16 band, u32 *pfreq);
1576 u16 hpi_tuner_set_frequency(const struct hpi_hsubsys *ph_subsys,
1577 u32 h_control, u32 freq_ink_hz);
1579 u16 hpi_tuner_get_frequency(const struct hpi_hsubsys *ph_subsys,
1580 u32 h_control, u32 *pw_freq_ink_hz);
1582 u16 hpi_tuner_getRF_level(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1583 short *pw_level);
1585 u16 hpi_tuner_get_rawRF_level(const struct hpi_hsubsys *ph_subsys,
1586 u32 h_control, short *pw_level);
1588 u16 hpi_tuner_query_gain(const struct hpi_hsubsys *ph_subsys,
1589 const u32 h_tuner, const u32 index, u16 *pw_gain);
1591 u16 hpi_tuner_set_gain(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1592 short gain);
1594 u16 hpi_tuner_get_gain(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1595 short *pn_gain);
1597 u16 hpi_tuner_get_status(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1598 u16 *pw_status_mask, u16 *pw_status);
1600 u16 hpi_tuner_set_mode(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1601 u32 mode, u32 value);
1603 u16 hpi_tuner_get_mode(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1604 u32 mode, u32 *pn_value);
1606 u16 hpi_tuner_getRDS(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1607 char *p_rds_data);
1609 u16 hpi_tuner_query_deemphasis(const struct hpi_hsubsys *ph_subsys,
1610 const u32 h_tuner, const u32 index, const u16 band, u32 *pdeemphasis);
1612 u16 hpi_tuner_set_deemphasis(const struct hpi_hsubsys *ph_subsys,
1613 u32 h_control, u32 deemphasis);
1614 u16 hpi_tuner_get_deemphasis(const struct hpi_hsubsys *ph_subsys,
1615 u32 h_control, u32 *pdeemphasis);
1617 u16 hpi_tuner_query_program(const struct hpi_hsubsys *ph_subsys,
1618 const u32 h_tuner, u32 *pbitmap_program);
1620 u16 hpi_tuner_set_program(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1621 u32 program);
1623 u16 hpi_tuner_get_program(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1624 u32 *pprogram);
1626 u16 hpi_tuner_get_hd_radio_dsp_version(const struct hpi_hsubsys *ph_subsys,
1627 u32 h_control, char *psz_dsp_version, const u32 string_size);
1629 u16 hpi_tuner_get_hd_radio_sdk_version(const struct hpi_hsubsys *ph_subsys,
1630 u32 h_control, char *psz_sdk_version, const u32 string_size);
1632 u16 hpi_tuner_get_hd_radio_signal_quality(const struct hpi_hsubsys *ph_subsys,
1633 u32 h_control, u32 *pquality);
1635 u16 hpi_tuner_get_hd_radio_signal_blend(const struct hpi_hsubsys *ph_subsys,
1636 u32 h_control, u32 *pblend);
1638 u16 hpi_tuner_set_hd_radio_signal_blend(const struct hpi_hsubsys *ph_subsys,
1639 u32 h_control, const u32 blend);
1641 /****************************/
1642 /* PADs control */
1643 /****************************/
1645 u16 HPI_PAD__get_channel_name(const struct hpi_hsubsys *ph_subsys,
1646 u32 h_control, char *psz_string, const u32 string_length);
1648 u16 HPI_PAD__get_artist(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1649 char *psz_string, const u32 string_length);
1651 u16 HPI_PAD__get_title(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1652 char *psz_string, const u32 string_length);
1654 u16 HPI_PAD__get_comment(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1655 char *psz_string, const u32 string_length);
1657 u16 HPI_PAD__get_program_type(const struct hpi_hsubsys *ph_subsys,
1658 u32 h_control, u32 *ppTY);
1660 u16 HPI_PAD__get_rdsPI(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1661 u32 *ppI);
1663 u16 HPI_PAD__get_program_type_string(const struct hpi_hsubsys *ph_subsys,
1664 u32 h_control, const u32 data_type, const u32 pTY, char *psz_string,
1665 const u32 string_length);
1667 /****************************/
1668 /* AES/EBU Receiver control */
1669 /****************************/
1670 u16 HPI_AESEBU__receiver_query_format(const struct hpi_hsubsys *ph_subsys,
1671 const u32 h_aes_rx, const u32 index, u16 *pw_format);
1673 u16 HPI_AESEBU__receiver_set_format(const struct hpi_hsubsys *ph_subsys,
1674 u32 h_control, u16 source);
1676 u16 HPI_AESEBU__receiver_get_format(const struct hpi_hsubsys *ph_subsys,
1677 u32 h_control, u16 *pw_source);
1679 u16 HPI_AESEBU__receiver_get_sample_rate(const struct hpi_hsubsys *ph_subsys,
1680 u32 h_control, u32 *psample_rate);
1682 u16 HPI_AESEBU__receiver_get_user_data(const struct hpi_hsubsys *ph_subsys,
1683 u32 h_control, u16 index, u16 *pw_data);
1685 u16 HPI_AESEBU__receiver_get_channel_status(const struct hpi_hsubsys
1686 *ph_subsys, u32 h_control, u16 index, u16 *pw_data);
1688 u16 HPI_AESEBU__receiver_get_error_status(const struct hpi_hsubsys *ph_subsys,
1689 u32 h_control, u16 *pw_error_data);
1691 /*******************************/
1692 /* AES/EBU Transmitter control */
1693 /*******************************/
1694 u16 HPI_AESEBU__transmitter_set_sample_rate(const struct hpi_hsubsys
1695 *ph_subsys, u32 h_control, u32 sample_rate);
1697 u16 HPI_AESEBU__transmitter_set_user_data(const struct hpi_hsubsys *ph_subsys,
1698 u32 h_control, u16 index, u16 data);
1700 u16 HPI_AESEBU__transmitter_set_channel_status(const struct hpi_hsubsys
1701 *ph_subsys, u32 h_control, u16 index, u16 data);
1703 u16 HPI_AESEBU__transmitter_get_channel_status(const struct hpi_hsubsys
1704 *ph_subsys, u32 h_control, u16 index, u16 *pw_data);
1706 u16 HPI_AESEBU__transmitter_query_format(const struct hpi_hsubsys *ph_subsys,
1707 const u32 h_aes_tx, const u32 index, u16 *pw_format);
1709 u16 HPI_AESEBU__transmitter_set_format(const struct hpi_hsubsys *ph_subsys,
1710 u32 h_control, u16 output_format);
1712 u16 HPI_AESEBU__transmitter_get_format(const struct hpi_hsubsys *ph_subsys,
1713 u32 h_control, u16 *pw_output_format);
1715 /***********************/
1716 /* multiplexer control */
1717 /***********************/
1718 u16 hpi_multiplexer_set_source(const struct hpi_hsubsys *ph_subsys,
1719 u32 h_control, u16 source_node_type, u16 source_node_index);
1721 u16 hpi_multiplexer_get_source(const struct hpi_hsubsys *ph_subsys,
1722 u32 h_control, u16 *source_node_type, u16 *source_node_index);
1724 u16 hpi_multiplexer_query_source(const struct hpi_hsubsys *ph_subsys,
1725 u32 h_control, u16 index, u16 *source_node_type,
1726 u16 *source_node_index);
1728 /***************/
1729 /* VOX control */
1730 /***************/
1731 u16 hpi_vox_set_threshold(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1732 short an_gain0_01dB);
1734 u16 hpi_vox_get_threshold(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1735 short *an_gain0_01dB);
1737 /*********************/
1738 /* Bitstream control */
1739 /*********************/
1740 u16 hpi_bitstream_set_clock_edge(const struct hpi_hsubsys *ph_subsys,
1741 u32 h_control, u16 edge_type);
1743 u16 hpi_bitstream_set_data_polarity(const struct hpi_hsubsys *ph_subsys,
1744 u32 h_control, u16 polarity);
1746 u16 hpi_bitstream_get_activity(const struct hpi_hsubsys *ph_subsys,
1747 u32 h_control, u16 *pw_clk_activity, u16 *pw_data_activity);
1749 /***********************/
1750 /* SampleClock control */
1751 /***********************/
1753 u16 hpi_sample_clock_query_source(const struct hpi_hsubsys *ph_subsys,
1754 const u32 h_clock, const u32 index, u16 *pw_source);
1756 u16 hpi_sample_clock_set_source(const struct hpi_hsubsys *ph_subsys,
1757 u32 h_control, u16 source);
1759 u16 hpi_sample_clock_get_source(const struct hpi_hsubsys *ph_subsys,
1760 u32 h_control, u16 *pw_source);
1762 u16 hpi_sample_clock_query_source_index(const struct hpi_hsubsys *ph_subsys,
1763 const u32 h_clock, const u32 index, const u32 source,
1764 u16 *pw_source_index);
1766 u16 hpi_sample_clock_set_source_index(const struct hpi_hsubsys *ph_subsys,
1767 u32 h_control, u16 source_index);
1769 u16 hpi_sample_clock_get_source_index(const struct hpi_hsubsys *ph_subsys,
1770 u32 h_control, u16 *pw_source_index);
1772 u16 hpi_sample_clock_get_sample_rate(const struct hpi_hsubsys *ph_subsys,
1773 u32 h_control, u32 *psample_rate);
1775 u16 hpi_sample_clock_query_local_rate(const struct hpi_hsubsys *ph_subsys,
1776 const u32 h_clock, const u32 index, u32 *psource);
1778 u16 hpi_sample_clock_set_local_rate(const struct hpi_hsubsys *ph_subsys,
1779 u32 h_control, u32 sample_rate);
1781 u16 hpi_sample_clock_get_local_rate(const struct hpi_hsubsys *ph_subsys,
1782 u32 h_control, u32 *psample_rate);
1784 u16 hpi_sample_clock_set_auto(const struct hpi_hsubsys *ph_subsys,
1785 u32 h_control, u32 enable);
1787 u16 hpi_sample_clock_get_auto(const struct hpi_hsubsys *ph_subsys,
1788 u32 h_control, u32 *penable);
1790 u16 hpi_sample_clock_set_local_rate_lock(const struct hpi_hsubsys *ph_subsys,
1791 u32 h_control, u32 lock);
1793 u16 hpi_sample_clock_get_local_rate_lock(const struct hpi_hsubsys *ph_subsys,
1794 u32 h_control, u32 *plock);
1796 /***********************/
1797 /* Microphone control */
1798 /***********************/
1799 u16 hpi_microphone_set_phantom_power(const struct hpi_hsubsys *ph_subsys,
1800 u32 h_control, u16 on_off);
1802 u16 hpi_microphone_get_phantom_power(const struct hpi_hsubsys *ph_subsys,
1803 u32 h_control, u16 *pw_on_off);
1805 /*******************************
1806 Parametric Equalizer control
1807 *******************************/
1808 u16 hpi_parametricEQ__get_info(const struct hpi_hsubsys *ph_subsys,
1809 u32 h_control, u16 *pw_number_of_bands, u16 *pw_enabled);
1811 u16 hpi_parametricEQ__set_state(const struct hpi_hsubsys *ph_subsys,
1812 u32 h_control, u16 on_off);
1814 u16 hpi_parametricEQ__set_band(const struct hpi_hsubsys *ph_subsys,
1815 u32 h_control, u16 index, u16 type, u32 frequency_hz, short q100,
1816 short gain0_01dB);
1818 u16 hpi_parametricEQ__get_band(const struct hpi_hsubsys *ph_subsys,
1819 u32 h_control, u16 index, u16 *pn_type, u32 *pfrequency_hz,
1820 short *pnQ100, short *pn_gain0_01dB);
1822 u16 hpi_parametricEQ__get_coeffs(const struct hpi_hsubsys *ph_subsys,
1823 u32 h_control, u16 index, short coeffs[5]
1826 /*******************************
1827 Compressor Expander control
1828 *******************************/
1830 u16 hpi_compander_set_enable(const struct hpi_hsubsys *ph_subsys,
1831 u32 h_control, u32 on);
1833 u16 hpi_compander_get_enable(const struct hpi_hsubsys *ph_subsys,
1834 u32 h_control, u32 *pon);
1836 u16 hpi_compander_set_makeup_gain(const struct hpi_hsubsys *ph_subsys,
1837 u32 h_control, short makeup_gain0_01dB);
1839 u16 hpi_compander_get_makeup_gain(const struct hpi_hsubsys *ph_subsys,
1840 u32 h_control, short *pn_makeup_gain0_01dB);
1842 u16 hpi_compander_set_attack_time_constant(const struct hpi_hsubsys
1843 *ph_subsys, u32 h_control, u32 index, u32 attack);
1845 u16 hpi_compander_get_attack_time_constant(const struct hpi_hsubsys
1846 *ph_subsys, u32 h_control, u32 index, u32 *pw_attack);
1848 u16 hpi_compander_set_decay_time_constant(const struct hpi_hsubsys *ph_subsys,
1849 u32 h_control, u32 index, u32 decay);
1851 u16 hpi_compander_get_decay_time_constant(const struct hpi_hsubsys *ph_subsys,
1852 u32 h_control, u32 index, u32 *pw_decay);
1854 u16 hpi_compander_set_threshold(const struct hpi_hsubsys *ph_subsys,
1855 u32 h_control, u32 index, short threshold0_01dB);
1857 u16 hpi_compander_get_threshold(const struct hpi_hsubsys *ph_subsys,
1858 u32 h_control, u32 index, short *pn_threshold0_01dB);
1860 u16 hpi_compander_set_ratio(const struct hpi_hsubsys *ph_subsys,
1861 u32 h_control, u32 index, u32 ratio100);
1863 u16 hpi_compander_get_ratio(const struct hpi_hsubsys *ph_subsys,
1864 u32 h_control, u32 index, u32 *pw_ratio100);
1866 /*******************************
1867 Cobranet HMI control
1868 *******************************/
1869 u16 hpi_cobranet_hmi_write(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1870 u32 hmi_address, u32 byte_count, u8 *pb_data);
1872 u16 hpi_cobranet_hmi_read(const struct hpi_hsubsys *ph_subsys, u32 h_control,
1873 u32 hmi_address, u32 max_byte_count, u32 *pbyte_count, u8 *pb_data);
1875 u16 hpi_cobranet_hmi_get_status(const struct hpi_hsubsys *ph_subsys,
1876 u32 h_control, u32 *pstatus, u32 *preadable_size,
1877 u32 *pwriteable_size);
1879 /*Read the current IP address
1881 u16 hpi_cobranet_getI_paddress(const struct hpi_hsubsys *ph_subsys,
1882 u32 h_control, u32 *pi_paddress);
1884 /* Write the current IP address
1886 u16 hpi_cobranet_setI_paddress(const struct hpi_hsubsys *ph_subsys,
1887 u32 h_control, u32 i_paddress);
1889 /* Read the static IP address
1891 u16 hpi_cobranet_get_staticI_paddress(const struct hpi_hsubsys *ph_subsys,
1892 u32 h_control, u32 *pi_paddress);
1894 /* Write the static IP address
1896 u16 hpi_cobranet_set_staticI_paddress(const struct hpi_hsubsys *ph_subsys,
1897 u32 h_control, u32 i_paddress);
1899 /* Read the MAC address
1901 u16 hpi_cobranet_getMA_caddress(const struct hpi_hsubsys *ph_subsys,
1902 u32 h_control, u32 *pmAC_MS_bs, u32 *pmAC_LS_bs);
1904 /*******************************
1905 Tone Detector control
1906 *******************************/
1907 u16 hpi_tone_detector_get_state(const struct hpi_hsubsys *ph_subsys, u32 hC,
1908 u32 *state);
1910 u16 hpi_tone_detector_set_enable(const struct hpi_hsubsys *ph_subsys, u32 hC,
1911 u32 enable);
1913 u16 hpi_tone_detector_get_enable(const struct hpi_hsubsys *ph_subsys, u32 hC,
1914 u32 *enable);
1916 u16 hpi_tone_detector_set_event_enable(const struct hpi_hsubsys *ph_subsys,
1917 u32 hC, u32 event_enable);
1919 u16 hpi_tone_detector_get_event_enable(const struct hpi_hsubsys *ph_subsys,
1920 u32 hC, u32 *event_enable);
1922 u16 hpi_tone_detector_set_threshold(const struct hpi_hsubsys *ph_subsys,
1923 u32 hC, int threshold);
1925 u16 hpi_tone_detector_get_threshold(const struct hpi_hsubsys *ph_subsys,
1926 u32 hC, int *threshold);
1928 u16 hpi_tone_detector_get_frequency(const struct hpi_hsubsys *ph_subsys,
1929 u32 hC, u32 index, u32 *frequency);
1931 /*******************************
1932 Silence Detector control
1933 *******************************/
1934 u16 hpi_silence_detector_get_state(const struct hpi_hsubsys *ph_subsys,
1935 u32 hC, u32 *state);
1937 u16 hpi_silence_detector_set_enable(const struct hpi_hsubsys *ph_subsys,
1938 u32 hC, u32 enable);
1940 u16 hpi_silence_detector_get_enable(const struct hpi_hsubsys *ph_subsys,
1941 u32 hC, u32 *enable);
1943 u16 hpi_silence_detector_set_event_enable(const struct hpi_hsubsys *ph_subsys,
1944 u32 hC, u32 event_enable);
1946 u16 hpi_silence_detector_get_event_enable(const struct hpi_hsubsys *ph_subsys,
1947 u32 hC, u32 *event_enable);
1949 u16 hpi_silence_detector_set_delay(const struct hpi_hsubsys *ph_subsys,
1950 u32 hC, u32 delay);
1952 u16 hpi_silence_detector_get_delay(const struct hpi_hsubsys *ph_subsys,
1953 u32 hC, u32 *delay);
1955 u16 hpi_silence_detector_set_threshold(const struct hpi_hsubsys *ph_subsys,
1956 u32 hC, int threshold);
1958 u16 hpi_silence_detector_get_threshold(const struct hpi_hsubsys *ph_subsys,
1959 u32 hC, int *threshold);
1961 /*******************************
1962 Universal control
1963 *******************************/
1964 u16 hpi_entity_find_next(struct hpi_entity *container_entity,
1965 enum e_entity_type type, enum e_entity_role role, int recursive_flag,
1966 struct hpi_entity **current_match);
1968 u16 hpi_entity_copy_value_from(struct hpi_entity *entity,
1969 enum e_entity_type type, size_t item_count, void *value_dst_p);
1971 u16 hpi_entity_unpack(struct hpi_entity *entity, enum e_entity_type *type,
1972 size_t *items, enum e_entity_role *role, void **value);
1974 u16 hpi_entity_alloc_and_pack(const enum e_entity_type type,
1975 const size_t item_count, const enum e_entity_role role, void *value,
1976 struct hpi_entity **entity);
1978 void hpi_entity_free(struct hpi_entity *entity);
1980 u16 hpi_universal_info(const struct hpi_hsubsys *ph_subsys, u32 hC,
1981 struct hpi_entity **info);
1983 u16 hpi_universal_get(const struct hpi_hsubsys *ph_subsys, u32 hC,
1984 struct hpi_entity **value);
1986 u16 hpi_universal_set(const struct hpi_hsubsys *ph_subsys, u32 hC,
1987 struct hpi_entity *value);
1989 /*/////////// */
1990 /* DSP CLOCK */
1991 /*/////////// */
1992 u16 hpi_clock_open(const struct hpi_hsubsys *ph_subsys, u16 adapter_index,
1993 u32 *ph_dsp_clock);
1995 u16 hpi_clock_set_time(const struct hpi_hsubsys *ph_subsys, u32 h_clock,
1996 u16 hour, u16 minute, u16 second, u16 milli_second);
1998 u16 hpi_clock_get_time(const struct hpi_hsubsys *ph_subsys, u32 h_clock,
1999 u16 *pw_hour, u16 *pw_minute, u16 *pw_second, u16 *pw_milli_second);
2001 /*/////////// */
2002 /* PROFILE */
2003 /*/////////// */
2004 u16 hpi_profile_open_all(const struct hpi_hsubsys *ph_subsys,
2005 u16 adapter_index, u16 profile_index, u32 *ph_profile,
2006 u16 *pw_max_profiles);
2008 u16 hpi_profile_get(const struct hpi_hsubsys *ph_subsys, u32 h_profile,
2009 u16 index, u16 *pw_seconds, u32 *pmicro_seconds, u32 *pcall_count,
2010 u32 *pmax_micro_seconds, u32 *pmin_micro_seconds);
2012 u16 hpi_profile_start_all(const struct hpi_hsubsys *ph_subsys, u32 h_profile);
2014 u16 hpi_profile_stop_all(const struct hpi_hsubsys *ph_subsys, u32 h_profile);
2016 u16 hpi_profile_get_name(const struct hpi_hsubsys *ph_subsys, u32 h_profile,
2017 u16 index, char *sz_profile_name, u16 profile_name_length);
2019 u16 hpi_profile_get_utilization(const struct hpi_hsubsys *ph_subsys,
2020 u32 h_profile, u32 *putilization);
2022 /*//////////////////// */
2023 /* UTILITY functions */
2025 u16 hpi_format_create(struct hpi_format *p_format, u16 channels, u16 format,
2026 u32 sample_rate, u32 bit_rate, u32 attributes);
2028 /* Until it's verified, this function is for Windows OSs only */
2030 #endif /*_H_HPI_ */
2032 ///////////////////////////////////////////////////////////////////////////////
2033 // See CVS for history. Last complete set in rev 1.146
2034 ////////////////////////////////////////////////////////////////////////////////