hpi.h 56.1 KB
Newer Older
1 2 3
/******************************************************************************

    AudioScience HPI driver
4
    Copyright (C) 1997-2011  AudioScience Inc. <support@audioscience.com>
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

    This program is free software; you can redistribute it and/or modify
    it under the terms of version 2 of the GNU General Public License as
    published by the Free Software Foundation;

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/
/** \file hpi.h

 AudioScience Hardware Programming Interface (HPI)
 public API definition.

 The HPI is a low-level hardware abstraction layer to all
 AudioScience digital audio adapters

(C) Copyright AudioScience Inc. 1998-2010
29 30
*/

31 32 33 34
#ifndef _HPI_H_
#define _HPI_H_

#include <linux/types.h>
35
#define HPI_BUILD_KERNEL_MODE
36 37 38 39

/******************************************************************************/
/********       HPI API DEFINITIONS                                       *****/
/******************************************************************************/
40

41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
/*******************************************/
/**  Audio format types
\ingroup stream
*/
enum HPI_FORMATS {
/** Used internally on adapter. */
	HPI_FORMAT_MIXER_NATIVE = 0,
/** 8-bit unsigned PCM. Windows equivalent is WAVE_FORMAT_PCM. */
	HPI_FORMAT_PCM8_UNSIGNED = 1,
/** 16-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM. */
	HPI_FORMAT_PCM16_SIGNED = 2,
/** MPEG-1 Layer-1. */
	HPI_FORMAT_MPEG_L1 = 3,
/** MPEG-1 Layer-2.

Windows equivalent is WAVE_FORMAT_MPEG.

The following table shows what combinations of mode and bitrate are possible:

<table border=1 cellspacing=0 cellpadding=5>
<tr>
<td><p><b>Bitrate (kbs)</b></p>
<td><p><b>Mono</b></p>
<td><p><b>Stereo,<br>Joint Stereo or<br>Dual Channel</b></p>

<tr><td>32<td>X<td>_
<tr><td>40<td>_<td>_
<tr><td>48<td>X<td>_
<tr><td>56<td>X<td>_
<tr><td>64<td>X<td>X
<tr><td>80<td>X<td>_
<tr><td>96<td>X<td>X
<tr><td>112<td>X<td>X
<tr><td>128<td>X<td>X
<tr><td>160<td>X<td>X
<tr><td>192<td>X<td>X
<tr><td>224<td>_<td>X
<tr><td>256<td>-<td>X
<tr><td>320<td>-<td>X
<tr><td>384<td>_<td>X
</table>
*/
	HPI_FORMAT_MPEG_L2 = 4,
/** MPEG-1 Layer-3.
Windows equivalent is WAVE_FORMAT_MPEG.

The following table shows what combinations of mode and bitrate are possible:

<table border=1 cellspacing=0 cellpadding=5>
<tr>
<td><p><b>Bitrate (kbs)</b></p>
<td><p><b>Mono<br>Stereo @ 8,<br>11.025 and<br>12kHz*</b></p>
<td><p><b>Mono<br>Stereo @ 16,<br>22.050 and<br>24kHz*</b></p>
<td><p><b>Mono<br>Stereo @ 32,<br>44.1 and<br>48kHz</b></p>

<tr><td>16<td>X<td>X<td>_
<tr><td>24<td>X<td>X<td>_
<tr><td>32<td>X<td>X<td>X
<tr><td>40<td>X<td>X<td>X
<tr><td>48<td>X<td>X<td>X
<tr><td>56<td>X<td>X<td>X
<tr><td>64<td>X<td>X<td>X
<tr><td>80<td>_<td>X<td>X
<tr><td>96<td>_<td>X<td>X
<tr><td>112<td>_<td>X<td>X
<tr><td>128<td>_<td>X<td>X
<tr><td>144<td>_<td>X<td>_
<tr><td>160<td>_<td>X<td>X
<tr><td>192<td>_<td>_<td>X
<tr><td>224<td>_<td>_<td>X
<tr><td>256<td>-<td>_<td>X
<tr><td>320<td>-<td>_<td>X
</table>
\b * Available on the ASI6000 series only
*/
	HPI_FORMAT_MPEG_L3 = 5,
/** Dolby AC-2. */
	HPI_FORMAT_DOLBY_AC2 = 6,
/** Dolbt AC-3. */
	HPI_FORMAT_DOLBY_AC3 = 7,
/** 16-bit PCM big-endian. */
	HPI_FORMAT_PCM16_BIGENDIAN = 8,
/** TAGIT-1 algorithm - hits. */
	HPI_FORMAT_AA_TAGIT1_HITS = 9,
/** TAGIT-1 algorithm - inserts. */
	HPI_FORMAT_AA_TAGIT1_INSERTS = 10,
/** 32-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM.
Each sample is a 32bit word. The most significant 24 bits contain a 24-bit
sample and the least significant 8 bits are set to 0.
*/
	HPI_FORMAT_PCM32_SIGNED = 11,
/** Raw bitstream - unknown format. */
	HPI_FORMAT_RAW_BITSTREAM = 12,
/** TAGIT-1 algorithm hits - extended. */
	HPI_FORMAT_AA_TAGIT1_HITS_EX1 = 13,
/** 32-bit PCM as an IEEE float. Windows equivalent is WAVE_FORMAT_IEEE_FLOAT.
Each sample is a 32bit word in IEEE754 floating point format.
The range is +1.0 to -1.0, which corresponds to digital fullscale.
*/
	HPI_FORMAT_PCM32_FLOAT = 14,
/** 24-bit PCM signed. Windows equivalent is WAVE_FORMAT_PCM. */
	HPI_FORMAT_PCM24_SIGNED = 15,
/** OEM format 1 - private. */
	HPI_FORMAT_OEM1 = 16,
/** OEM format 2 - private. */
	HPI_FORMAT_OEM2 = 17,
/** Undefined format. */
	HPI_FORMAT_UNDEFINED = 0xffff
};

/*******************************************/
/** Stream States
\ingroup stream
*/
enum HPI_STREAM_STATES {
	/** State stopped - stream is stopped. */
	HPI_STATE_STOPPED = 1,
	/** State playing - stream is playing audio. */
	HPI_STATE_PLAYING = 2,
	/** State recording - stream is recording. */
	HPI_STATE_RECORDING = 3,
	/** State drained - playing stream ran out of data to play. */
	HPI_STATE_DRAINED = 4,
	/** State generate sine - to be implemented. */
	HPI_STATE_SINEGEN = 5,
	/** State wait - used for inter-card sync to mean waiting for all
		cards to be ready. */
	HPI_STATE_WAIT = 6
};
170
/*******************************************/
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
/** Source node types
\ingroup mixer
*/
enum HPI_SOURCENODES {
	/** This define can be used instead of 0 to indicate
	that there is no valid source node. A control that
	exists on a destination node can be searched for using a source
	node value of either 0, or HPI_SOURCENODE_NONE */
	HPI_SOURCENODE_NONE = 100,
	/** Out Stream (Play) node. */
	HPI_SOURCENODE_OSTREAM = 101,
	/** Line in node - could be analog, AES/EBU or network. */
	HPI_SOURCENODE_LINEIN = 102,
	HPI_SOURCENODE_AESEBU_IN = 103,	     /**< AES/EBU input node. */
	HPI_SOURCENODE_TUNER = 104,	     /**< tuner node. */
	HPI_SOURCENODE_RF = 105,	     /**< RF input node. */
	HPI_SOURCENODE_CLOCK_SOURCE = 106,   /**< clock source node. */
	HPI_SOURCENODE_RAW_BITSTREAM = 107,  /**< raw bitstream node. */
	HPI_SOURCENODE_MICROPHONE = 108,     /**< microphone node. */
	/** Cobranet input node -
	    Audio samples come from the Cobranet network and into the device. */
	HPI_SOURCENODE_COBRANET = 109,
	HPI_SOURCENODE_ANALOG = 110,	     /**< analog input node. */
	HPI_SOURCENODE_ADAPTER = 111,	     /**< adapter node. */
195 196 197
	/** RTP stream input node - This node is a destination for
	    packets of RTP audio samples from other devices. */
	HPI_SOURCENODE_RTP_DESTINATION = 112,
198
	HPI_SOURCENODE_INTERNAL = 113,	     /**< node internal to the device. */
199 200
	HPI_SOURCENODE_AVB = 114,	     /**< AVB input stream */
	HPI_SOURCENODE_BLULINK = 115,	     /**< BLU-link input channel */
201
	/* !!!Update this  AND hpidebug.h if you add a new sourcenode type!!! */
202
	HPI_SOURCENODE_LAST_INDEX = 115	     /**< largest ID */
203 204 205
		/* AX6 max sourcenode types = 15 */
};

206
/*******************************************/
207 208 209 210 211 212 213 214 215 216 217
/** Destination node types
\ingroup mixer
*/
enum HPI_DESTNODES {
	/** This define can be used instead of 0 to indicate
	that there is no valid destination node. A control that
	exists on a source node can be searched for using a destination
	node value of either 0, or HPI_DESTNODE_NONE */
	HPI_DESTNODE_NONE = 200,
	/** In Stream (Record) node. */
	HPI_DESTNODE_ISTREAM = 201,
218
	HPI_DESTNODE_LINEOUT = 202,	     /**< line out node. */
219 220 221 222 223 224 225
	HPI_DESTNODE_AESEBU_OUT = 203,	     /**< AES/EBU output node. */
	HPI_DESTNODE_RF = 204,		     /**< RF output node. */
	HPI_DESTNODE_SPEAKER = 205,	     /**< speaker output node. */
	/** Cobranet output node -
	    Audio samples from the device are sent out on the Cobranet network.*/
	HPI_DESTNODE_COBRANET = 206,
	HPI_DESTNODE_ANALOG = 207,	     /**< analog output node. */
226 227 228
	/** RTP stream output node - This node is a source for
	    packets of RTP audio samples that are sent to other devices. */
	HPI_DESTNODE_RTP_SOURCE = 208,
229 230 231
	HPI_DESTNODE_AVB = 209,		     /**< AVB output stream */
	HPI_DESTNODE_INTERNAL = 210,	     /**< node internal to the device. */
	HPI_DESTNODE_BLULINK = 211,	     /**< BLU-link output channel. */
232
	/* !!!Update this AND hpidebug.h if you add a new destnode type!!! */
233
	HPI_DESTNODE_LAST_INDEX = 211	     /**< largest ID */
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248
		/* AX6 max destnode types = 15 */
};

/*******************************************/
/** Mixer control types
\ingroup mixer
*/
enum HPI_CONTROLS {
	HPI_CONTROL_GENERIC = 0,	/**< generic control. */
	HPI_CONTROL_CONNECTION = 1, /**< A connection between nodes. */
	HPI_CONTROL_VOLUME = 2,	      /**< volume control - works in dB_fs. */
	HPI_CONTROL_METER = 3,	/**< peak meter control. */
	HPI_CONTROL_MUTE = 4,	/*mute control - not used at present. */
	HPI_CONTROL_MULTIPLEXER = 5,	/**< multiplexer control. */

249
	HPI_CONTROL_AESEBU_TRANSMITTER = 6, /**< AES/EBU transmitter control */
250
	HPI_CONTROL_AESEBUTX = 6,	/* HPI_CONTROL_AESEBU_TRANSMITTER */
251 252

	HPI_CONTROL_AESEBU_RECEIVER = 7, /**< AES/EBU receiver control. */
253
	HPI_CONTROL_AESEBURX = 7,	/* HPI_CONTROL_AESEBU_RECEIVER */
254 255 256 257 258 259 260 261 262 263 264 265 266 267

	HPI_CONTROL_LEVEL = 8, /**< level/trim control - works in d_bu. */
	HPI_CONTROL_TUNER = 9,	/**< tuner control. */
/*      HPI_CONTROL_ONOFFSWITCH =       10 */
	HPI_CONTROL_VOX = 11,	/**< vox control. */
/*      HPI_CONTROL_AES18_TRANSMITTER = 12 */
/*      HPI_CONTROL_AES18_RECEIVER = 13 */
/*      HPI_CONTROL_AES18_BLOCKGENERATOR  = 14 */
	HPI_CONTROL_CHANNEL_MODE = 15,	/**< channel mode control. */

	HPI_CONTROL_BITSTREAM = 16,	/**< bitstream control. */
	HPI_CONTROL_SAMPLECLOCK = 17,	/**< sample clock control. */
	HPI_CONTROL_MICROPHONE = 18,	/**< microphone control. */
	HPI_CONTROL_PARAMETRIC_EQ = 19,	/**< parametric EQ control. */
268
	HPI_CONTROL_EQUALIZER = 19,	/*HPI_CONTROL_PARAMETRIC_EQ */
269 270 271 272 273 274 275 276 277 278 279 280 281 282

	HPI_CONTROL_COMPANDER = 20,	/**< compander control. */
	HPI_CONTROL_COBRANET = 21,	/**< cobranet control. */
	HPI_CONTROL_TONEDETECTOR = 22,	/**< tone detector control. */
	HPI_CONTROL_SILENCEDETECTOR = 23,	/**< silence detector control. */
	HPI_CONTROL_PAD = 24,	/**< tuner PAD control. */
	HPI_CONTROL_SRC = 25,	/**< samplerate converter control. */
	HPI_CONTROL_UNIVERSAL = 26,	/**< universal control. */

/*  !!! Update this AND hpidebug.h if you add a new control type!!!*/
	HPI_CONTROL_LAST_INDEX = 26 /**<highest control type ID */
/* WARNING types 256 or greater impact bit packing in all AX6 DSP code */
};

283
/*******************************************/
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
/** Adapter properties
These are used in HPI_AdapterSetProperty() and HPI_AdapterGetProperty()
\ingroup adapter
*/
enum HPI_ADAPTER_PROPERTIES {
/** \internal Used in dwProperty field of HPI_AdapterSetProperty() and
HPI_AdapterGetProperty(). This errata applies to all ASI6000 cards with both
analog and digital outputs. The CS4224 A/D+D/A has a one sample delay between
left and right channels on both its input (ADC) and output (DAC).
More details are available in Cirrus Logic errata ER284B2.
PDF available from www.cirrus.com, released by Cirrus in 2001.
*/
	HPI_ADAPTER_PROPERTY_ERRATA_1 = 1,

/** Adapter grouping property
Indicates whether the adapter supports the grouping API (for ASIO and SSX2)
*/
	HPI_ADAPTER_PROPERTY_GROUPING = 2,

/** Driver SSX2 property
Tells the kernel driver to turn on SSX2 stream mapping.
This feature is not used by the DSP. In fact the call is completely processed
by the driver and is not passed on to the DSP at all.
*/
	HPI_ADAPTER_PROPERTY_ENABLE_SSX2 = 3,

/** Adapter SSX2 property
Indicates the state of the adapter's SSX2 setting. This setting is stored in
non-volatile memory on the adapter. A typical call sequence would be to use
HPI_ADAPTER_PROPERTY_SSX2_SETTING to set SSX2 on the adapter and then to reload
314 315 316
the driver. The driver would query HPI_ADAPTER_PROPERTY_SSX2_SETTING during
startup and if SSX2 is set, it would then call HPI_ADAPTER_PROPERTY_ENABLE_SSX2
to enable SSX2 stream mapping within the kernel level of the driver.
317 318 319
*/
	HPI_ADAPTER_PROPERTY_SSX2_SETTING = 4,

320 321 322 323 324 325 326 327 328
/** Enables/disables PCI(e) IRQ.
A setting of 0 indicates that no interrupts are being generated. A DSP boot
this property is set to 0. Setting to a non-zero value specifies the number
of frames of audio that should be processed between interrupts. This property
should be set to multiple of the mixer interval as read back from the
HPI_ADAPTER_PROPERTY_INTERVAL property.
*/
	HPI_ADAPTER_PROPERTY_IRQ_RATE = 5,

329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421
/** Base number for readonly properties */
	HPI_ADAPTER_PROPERTY_READONLYBASE = 256,

/** Readonly adapter latency property.
This property returns in the input and output latency in samples.
Property 1 is the estimated input latency
in samples, while Property 2 is that output latency in  samples.
*/
	HPI_ADAPTER_PROPERTY_LATENCY = 256,

/** Readonly adapter granularity property.
The granulariy is the smallest size chunk of stereo samples that is processed by
the adapter.
This property returns the record granularity in samples in Property 1.
Property 2 returns the play granularity.
*/
	HPI_ADAPTER_PROPERTY_GRANULARITY = 257,

/** Readonly adapter number of current channels property.
Property 1 is the number of record channels per record device.
Property 2 is the number of play channels per playback device.*/
	HPI_ADAPTER_PROPERTY_CURCHANNELS = 258,

/** Readonly adapter software version.
The SOFTWARE_VERSION property returns the version of the software running
on the adapter as Major.Minor.Release.
Property 1 contains Major in bits 15..8 and Minor in bits 7..0.
Property 2 contains Release in bits 7..0. */
	HPI_ADAPTER_PROPERTY_SOFTWARE_VERSION = 259,

/** Readonly adapter MAC address MSBs.
The MAC_ADDRESS_MSB property returns
the most significant 32 bits of the MAC address.
Property 1 contains bits 47..32 of the MAC address.
Property 2 contains bits 31..16 of the MAC address. */
	HPI_ADAPTER_PROPERTY_MAC_ADDRESS_MSB = 260,

/** Readonly adapter MAC address LSBs
The MAC_ADDRESS_LSB property returns
the least significant 16 bits of the MAC address.
Property 1 contains bits 15..0 of the MAC address. */
	HPI_ADAPTER_PROPERTY_MAC_ADDRESS_LSB = 261,

/** Readonly extended adapter type number
The EXTENDED_ADAPTER_TYPE property returns the 4 digits of an extended
adapter type, i.e ASI8920-0022, 0022 is the extended type.
The digits are returned as ASCII characters rather than the hex digits that
are returned for the main type
Property 1 returns the 1st two (left most) digits, i.e "00"
in the example above, the upper byte being the left most digit.
Property 2 returns the 2nd two digits, i.e "22" in the example above*/
	HPI_ADAPTER_PROPERTY_EXTENDED_ADAPTER_TYPE = 262,

/** Readonly debug log buffer information */
	HPI_ADAPTER_PROPERTY_LOGTABLEN = 263,
	HPI_ADAPTER_PROPERTY_LOGTABBEG = 264,

/** Readonly adapter IP address
For 192.168.1.101
Property 1 returns the 1st two (left most) digits, i.e 192*256 + 168
in the example above, the upper byte being the left most digit.
Property 2 returns the 2nd two digits, i.e 1*256 + 101 in the example above, */
	HPI_ADAPTER_PROPERTY_IP_ADDRESS = 265,

/** Readonly adapter buffer processed count. Returns a buffer processed count
that is incremented every time all buffers for all streams are updated. This
is useful for checking completion of all stream operations across the adapter
when using grouped streams.
*/
	HPI_ADAPTER_PROPERTY_BUFFER_UPDATE_COUNT = 266,

/** Readonly mixer and stream intervals

These intervals are  measured in mixer frames.
To convert to time, divide  by the adapter samplerate.

The mixer interval is the number of frames processed in one mixer iteration.
The stream update interval is the interval at which streams check for and
process data, and BBM host buffer counters are updated.

Property 1 is the mixer interval in mixer frames.
Property 2 is the stream update interval in mixer frames.
*/
	HPI_ADAPTER_PROPERTY_INTERVAL = 267,
/** Adapter capabilities 1
Property 1 - adapter can do multichannel (SSX1)
Property 2 - adapter can do stream grouping (supports SSX2)
*/
	HPI_ADAPTER_PROPERTY_CAPS1 = 268,
/** Adapter capabilities 2
Property 1 - adapter can do samplerate conversion (MRX)
Property 2 - adapter can do timestretch (TSX)
*/
422 423 424 425 426 427 428 429 430 431 432
	HPI_ADAPTER_PROPERTY_CAPS2 = 269,

/** Readonly adapter sync header connection count.
*/
	HPI_ADAPTER_PROPERTY_SYNC_HEADER_CONNECTIONS = 270,
/** Readonly supports SSX2 property.
Indicates the adapter supports SSX2 in some mode setting. The
return value is true (1) or false (0). If the current adapter
mode is MONO SSX2 is disabled, even though this property will
return true.
*/
433 434 435 436 437 438
	HPI_ADAPTER_PROPERTY_SUPPORTS_SSX2 = 271,
/** Readonly supports PCI(e) IRQ.
Indicates that the adapter in it's current mode supports interrupts
across the host bus. Note, this does not imply that interrupts are
enabled. Instead it indicates that they can be enabled.
*/
439 440 441 442 443 444 445 446 447 448 449 450 451
	HPI_ADAPTER_PROPERTY_SUPPORTS_IRQ = 272,
/** Readonly supports firmware updating.
Indicates that the adapter implements an interface to update firmware
on the adapter.
*/
	HPI_ADAPTER_PROPERTY_SUPPORTS_FW_UPDATE = 273,
/** Readonly Firmware IDs
Identifiy firmware independent of individual adapter type.
May be used as a filter for firmware update images.
Property 1 = Bootloader ID
Property 2 = Main program ID
*/
	HPI_ADAPTER_PROPERTY_FIRMWARE_ID = 274
452 453 454 455
};

/** Adapter mode commands

456
Used in wQueryOrSet parameter of HPI_AdapterSetModeEx().
457 458 459
\ingroup adapter
*/
enum HPI_ADAPTER_MODE_CMDS {
460
	/** Set the mode to the given parameter */
461
	HPI_ADAPTER_MODE_SET = 0,
462 463
	/** Return 0 or error depending whether mode is valid,
	but don't set the mode */
464 465 466 467
	HPI_ADAPTER_MODE_QUERY = 1
};

/** Adapter Modes
468
 These are used by HPI_AdapterSetModeEx()
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638

\warning - more than 16 possible modes breaks
a bitmask in the Windows WAVE DLL
\ingroup adapter
*/
enum HPI_ADAPTER_MODES {
/** 4 outstream mode.
- ASI6114: 1 instream
- ASI6044: 4 instreams
- ASI6012: 1 instream
- ASI6102: no instreams
- ASI6022, ASI6122: 2 instreams
- ASI5111, ASI5101: 2 instreams
- ASI652x, ASI662x: 2 instreams
- ASI654x, ASI664x: 4 instreams
*/
	HPI_ADAPTER_MODE_4OSTREAM = 1,

/** 6 outstream mode.
- ASI6012: 1 instream,
- ASI6022, ASI6122: 2 instreams
- ASI652x, ASI662x: 4 instreams
*/
	HPI_ADAPTER_MODE_6OSTREAM = 2,

/** 8 outstream mode.
- ASI6114: 8 instreams
- ASI6118: 8 instreams
- ASI6585: 8 instreams
*/
	HPI_ADAPTER_MODE_8OSTREAM = 3,

/** 16 outstream mode.
- ASI6416 16 instreams
- ASI6518, ASI6618 16 instreams
- ASI6118 16 mono out and in streams
*/
	HPI_ADAPTER_MODE_16OSTREAM = 4,

/** one outstream mode.
- ASI5111 1 outstream, 1 instream
*/
	HPI_ADAPTER_MODE_1OSTREAM = 5,

/** ASI504X mode 1. 12 outstream, 4 instream 0 to 48kHz sample rates
	(see ASI504X datasheet for more info).
*/
	HPI_ADAPTER_MODE_1 = 6,

/** ASI504X mode 2. 4 outstreams, 4 instreams at 0 to 192kHz sample rates
	(see ASI504X datasheet for more info).
*/
	HPI_ADAPTER_MODE_2 = 7,

/** ASI504X mode 3. 4 outstreams, 4 instreams at 0 to 192kHz sample rates
	(see ASI504X datasheet for more info).
*/
	HPI_ADAPTER_MODE_3 = 8,

/** ASI504X multichannel mode.
	2 outstreams -> 4 line outs = 1 to 8 channel streams),
	4 lineins -> 1 instream (1 to 8 channel streams) at 0-48kHz.
	For more info see the SSX Specification.
*/
	HPI_ADAPTER_MODE_MULTICHANNEL = 9,

/** 12 outstream mode.
- ASI6514, ASI6614: 2 instreams
- ASI6540,ASI6544: 8 instreams
- ASI6640,ASI6644: 8 instreams
*/
	HPI_ADAPTER_MODE_12OSTREAM = 10,

/** 9 outstream mode.
- ASI6044: 8 instreams
*/
	HPI_ADAPTER_MODE_9OSTREAM = 11,

/** mono mode.
- ASI6416: 16 outstreams/instreams
- ASI5402: 2 outstreams/instreams
*/
	HPI_ADAPTER_MODE_MONO = 12,

/** Low latency mode.
- ASI6416/ASI6316: 1 16 channel outstream and instream
*/
	HPI_ADAPTER_MODE_LOW_LATENCY = 13
};

/* Note, adapters can have more than one capability -
encoding as bitfield is recommended. */
#define HPI_CAPABILITY_NONE             (0)
#define HPI_CAPABILITY_MPEG_LAYER3      (1)

/* Set this equal to maximum capability index,
Must not be greater than 32 - see axnvdef.h */
#define HPI_CAPABILITY_MAX                      1
/* #define HPI_CAPABILITY_AAC              2 */

/******************************************* STREAM ATTRIBUTES ****/

/** MPEG Ancillary Data modes

The mode for the ancillary data insertion or extraction to operate in.
\ingroup stream
*/
enum HPI_MPEG_ANC_MODES {
	/** the MPEG frames have energy information stored in them (5 bytes per stereo frame, 3 per mono) */
	HPI_MPEG_ANC_HASENERGY = 0,
	/** the entire ancillary data field is taken up by data from the Anc data buffer
	On encode, the encoder will insert the energy bytes before filling the remainder
	of the ancillary data space with data from the ancillary data buffer.
	*/
	HPI_MPEG_ANC_RAW = 1
};

/** Ancillary Data Alignment
\ingroup instream
*/
enum HPI_ISTREAM_MPEG_ANC_ALIGNS {
	/** data is packed against the end of data, then padded to the end of frame */
	HPI_MPEG_ANC_ALIGN_LEFT = 0,
	/** data is packed against the end of the frame */
	HPI_MPEG_ANC_ALIGN_RIGHT = 1
};

/** MPEG modes
MPEG modes - can be used optionally for HPI_FormatCreate()
parameter dwAttributes.

Using any mode setting other than HPI_MPEG_MODE_DEFAULT
with single channel format will return an error.
\ingroup stream
*/
enum HPI_MPEG_MODES {
/** Causes the MPEG-1 Layer II bitstream to be recorded
in single_channel mode when the number of channels is 1 and in stereo when the
number of channels is 2. */
	HPI_MPEG_MODE_DEFAULT = 0,
	/** Standard stereo without joint-stereo compression */
	HPI_MPEG_MODE_STEREO = 1,
	/** Joint stereo  */
	HPI_MPEG_MODE_JOINTSTEREO = 2,
	/** Left and Right channels are completely independent */
	HPI_MPEG_MODE_DUALCHANNEL = 3
};
/******************************************* MIXER ATTRIBUTES ****/

/* \defgroup mixer_flags Mixer flags for HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES
{
*/
#define HPI_MIXER_GET_CONTROL_MULTIPLE_CHANGED  (0)
#define HPI_MIXER_GET_CONTROL_MULTIPLE_RESET    (1)
/*}*/

/** Commands used by HPI_MixerStore()
\ingroup mixer
*/
enum HPI_MIXER_STORE_COMMAND {
/** Save all mixer control settings. */
	HPI_MIXER_STORE_SAVE = 1,
/** Restore all controls from saved. */
	HPI_MIXER_STORE_RESTORE = 2,
/** Delete saved control settings. */
	HPI_MIXER_STORE_DELETE = 3,
/** Enable auto storage of some control settings. */
	HPI_MIXER_STORE_ENABLE = 4,
/** Disable auto storage of some control settings. */
	HPI_MIXER_STORE_DISABLE = 5,
639
/** Unimplemented - save the attributes of a single control. */
640 641 642
	HPI_MIXER_STORE_SAVE_SINGLE = 6
};

643 644 645 646
/****************************/
/* CONTROL ATTRIBUTE VALUES */
/****************************/

647 648
/** Used by mixer plugin enable functions

649
E.g. HPI_ParametricEq_SetState()
650 651 652 653 654 655 656 657
\ingroup mixer
*/
enum HPI_SWITCH_STATES {
	HPI_SWITCH_OFF = 0,	/**< turn the mixer plugin on. */
	HPI_SWITCH_ON = 1	/**< turn the mixer plugin off. */
};

/* Volume control special gain values */
658

659 660 661 662 663 664 665 666 667
/** volumes units are 100ths of a dB
\ingroup volume
*/
#define HPI_UNITS_PER_dB                100
/** turns volume control OFF or MUTE
\ingroup volume
*/
#define HPI_GAIN_OFF                    (-100 * HPI_UNITS_PER_dB)

668 669 670 671 672
/** channel mask specifying all channels
\ingroup volume
*/
#define HPI_BITMASK_ALL_CHANNELS        (0xFFFFFFFF)

673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689
/** value returned for no signal
\ingroup meter
*/
#define HPI_METER_MINIMUM               (-150 * HPI_UNITS_PER_dB)

/** autofade profiles
\ingroup volume
*/
enum HPI_VOLUME_AUTOFADES {
/** log fade - dB attenuation changes linearly over time */
	HPI_VOLUME_AUTOFADE_LOG = 2,
/** linear fade - amplitude changes linearly */
	HPI_VOLUME_AUTOFADE_LINEAR = 3
};

/** The physical encoding format of the AESEBU I/O.

690
Used in HPI_Aesebu_Transmitter_SetFormat(), HPI_Aesebu_Receiver_SetFormat()
691 692 693 694 695 696 697 698 699 700 701 702
along with related Get and Query functions
\ingroup aestx
*/
enum HPI_AESEBU_FORMATS {
/** AES/EBU physical format - AES/EBU balanced "professional"  */
	HPI_AESEBU_FORMAT_AESEBU = 1,
/** AES/EBU physical format - S/PDIF unbalanced "consumer"      */
	HPI_AESEBU_FORMAT_SPDIF = 2
};

/** AES/EBU error status bits

703
Returned by HPI_Aesebu_Receiver_GetErrorStatus()
704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731
\ingroup aesrx
*/
enum HPI_AESEBU_ERRORS {
/**  bit0: 1 when PLL is not locked */
	HPI_AESEBU_ERROR_NOT_LOCKED = 0x01,
/**  bit1: 1 when signal quality is poor */
	HPI_AESEBU_ERROR_POOR_QUALITY = 0x02,
/** bit2: 1 when there is a parity error */
	HPI_AESEBU_ERROR_PARITY_ERROR = 0x04,
/**  bit3: 1 when there is a bi-phase coding violation */
	HPI_AESEBU_ERROR_BIPHASE_VIOLATION = 0x08,
/**  bit4: 1 when the validity bit is high */
	HPI_AESEBU_ERROR_VALIDITY = 0x10,
/**  bit5: 1 when the CRC error bit is high */
	HPI_AESEBU_ERROR_CRC = 0x20
};

/** \addtogroup pad
\{
*/
/** The text string containing the station/channel combination. */
#define HPI_PAD_CHANNEL_NAME_LEN        16
/** The text string containing the artist. */
#define HPI_PAD_ARTIST_LEN              64
/** The text string containing the title. */
#define HPI_PAD_TITLE_LEN               64
/** The text string containing the comment. */
#define HPI_PAD_COMMENT_LEN             256
L
Lucas De Marchi 已提交
732
/** The PTY when the tuner has not received any PTY. */
733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759
#define HPI_PAD_PROGRAM_TYPE_INVALID    0xffff
/** \} */

/** Data types for PTY string translation.
\ingroup rds
*/
enum eHPI_RDS_type {
	HPI_RDS_DATATYPE_RDS = 0,	/**< RDS bitstream.*/
	HPI_RDS_DATATYPE_RBDS = 1	/**< RBDS bitstream.*/
};

/** Tuner bands

Used for HPI_Tuner_SetBand(),HPI_Tuner_GetBand()
\ingroup tuner
*/
enum HPI_TUNER_BAND {
	HPI_TUNER_BAND_AM = 1,	 /**< AM band */
	HPI_TUNER_BAND_FM = 2,	 /**< FM band (mono) */
	HPI_TUNER_BAND_TV_NTSC_M = 3,	 /**< NTSC-M TV band*/
	HPI_TUNER_BAND_TV = 3,	/* use TV_NTSC_M */
	HPI_TUNER_BAND_FM_STEREO = 4,	 /**< FM band (stereo) */
	HPI_TUNER_BAND_AUX = 5,	 /**< auxiliary input */
	HPI_TUNER_BAND_TV_PAL_BG = 6,	 /**< PAL-B/G TV band*/
	HPI_TUNER_BAND_TV_PAL_I = 7,	 /**< PAL-I TV band*/
	HPI_TUNER_BAND_TV_PAL_DK = 8,	 /**< PAL-D/K TV band*/
	HPI_TUNER_BAND_TV_SECAM_L = 9,	 /**< SECAM-L TV band*/
760 761
	HPI_TUNER_BAND_DAB = 10,
	HPI_TUNER_BAND_LAST = 10 /**< the index of the last tuner band. */
762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798
};

/** Tuner mode attributes

Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
\ingroup tuner

*/
enum HPI_TUNER_MODES {
	HPI_TUNER_MODE_RSS = 1,	/**< control  RSS */
	HPI_TUNER_MODE_RDS = 2	/**< control  RBDS/RDS */
};

/** Tuner mode attribute values

Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
\ingroup tuner
*/
enum HPI_TUNER_MODE_VALUES {
/* RSS attribute values */
	HPI_TUNER_MODE_RSS_DISABLE = 0,	/**< RSS disable */
	HPI_TUNER_MODE_RSS_ENABLE = 1,	/**< RSS enable */

/* RDS mode attributes */
	HPI_TUNER_MODE_RDS_DISABLE = 0,	/**< RDS - disabled */
	HPI_TUNER_MODE_RDS_RDS = 1,  /**< RDS - RDS mode */
	HPI_TUNER_MODE_RDS_RBDS = 2 /**<  RDS - RBDS mode */
};

/** Tuner Status Bits

These bitfield values are returned by a call to HPI_Tuner_GetStatus().
Multiple fields are returned from a single call.
\ingroup tuner
*/
enum HPI_TUNER_STATUS_BITS {
	HPI_TUNER_VIDEO_COLOR_PRESENT = 0x0001,	/**< video color is present. */
799 800 801 802 803 804 805
	HPI_TUNER_VIDEO_IS_60HZ = 0x0020, /**< 60 hz video detected. */
	HPI_TUNER_VIDEO_HORZ_SYNC_MISSING = 0x0040, /**< video HSYNC is missing. */
	HPI_TUNER_VIDEO_STATUS_VALID = 0x0100, /**< video status is valid. */
	HPI_TUNER_DIGITAL = 0x0200, /**< tuner reports digital programming. */
	HPI_TUNER_MULTIPROGRAM = 0x0400, /**< tuner reports multiple programs. */
	HPI_TUNER_PLL_LOCKED = 0x1000, /**< the tuner's PLL is locked. */
	HPI_TUNER_FM_STEREO = 0x2000 /**< tuner reports back FM stereo. */
806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850
};

/** Channel Modes
Used for HPI_ChannelModeSet/Get()
\ingroup channelmode
*/
enum HPI_CHANNEL_MODES {
/** Left channel out = left channel in, Right channel out = right channel in. */
	HPI_CHANNEL_MODE_NORMAL = 1,
/** Left channel out = right channel in, Right channel out = left channel in. */
	HPI_CHANNEL_MODE_SWAP = 2,
/** Left channel out = left channel in, Right channel out = left channel in. */
	HPI_CHANNEL_MODE_LEFT_TO_STEREO = 3,
/** Left channel out = right channel in, Right channel out = right channel in.*/
	HPI_CHANNEL_MODE_RIGHT_TO_STEREO = 4,
/** Left channel out = (left channel in + right channel in)/2,
    Right channel out = mute. */
	HPI_CHANNEL_MODE_STEREO_TO_LEFT = 5,
/** Left channel out = mute,
    Right channel out = (right channel in + left channel in)/2. */
	HPI_CHANNEL_MODE_STEREO_TO_RIGHT = 6,
	HPI_CHANNEL_MODE_LAST = 6
};

/** SampleClock source values
\ingroup sampleclock
*/
enum HPI_SAMPLECLOCK_SOURCES {
/** The sampleclock output is derived from its local samplerate generator.
    The local samplerate may be set using HPI_SampleClock_SetLocalRate(). */
	HPI_SAMPLECLOCK_SOURCE_LOCAL = 1,
/** The adapter is clocked from a dedicated AES/EBU SampleClock input.*/
	HPI_SAMPLECLOCK_SOURCE_AESEBU_SYNC = 2,
/** From external wordclock connector */
	HPI_SAMPLECLOCK_SOURCE_WORD = 3,
/** Board-to-board header */
	HPI_SAMPLECLOCK_SOURCE_WORD_HEADER = 4,
/** FUTURE - SMPTE clock. */
	HPI_SAMPLECLOCK_SOURCE_SMPTE = 5,
/** One of the aesebu inputs */
	HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT = 6,
/** From a network interface e.g. Cobranet or Livewire at either 48 or 96kHz */
	HPI_SAMPLECLOCK_SOURCE_NETWORK = 8,
/** From previous adjacent module (ASI2416 only)*/
	HPI_SAMPLECLOCK_SOURCE_PREV_MODULE = 10,
851 852
/** Blu link sample clock*/
	HPI_SAMPLECLOCK_SOURCE_BLULINK = 11,
853
/*! Update this if you add a new clock source.*/
854
	HPI_SAMPLECLOCK_SOURCE_LAST = 11
855 856
};

857
/** Equalizer filter types. Used by HPI_ParametricEq_SetBand()
858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899
\ingroup parmeq
*/
enum HPI_FILTER_TYPE {
	HPI_FILTER_TYPE_BYPASS = 0,	/**< filter is turned off */

	HPI_FILTER_TYPE_LOWSHELF = 1,	/**< EQ low shelf */
	HPI_FILTER_TYPE_HIGHSHELF = 2,	/**< EQ high shelf */
	HPI_FILTER_TYPE_EQ_BAND = 3,	/**< EQ gain */

	HPI_FILTER_TYPE_LOWPASS = 4,	/**< standard low pass */
	HPI_FILTER_TYPE_HIGHPASS = 5,	/**< standard high pass */
	HPI_FILTER_TYPE_BANDPASS = 6,	/**< standard band pass */
	HPI_FILTER_TYPE_BANDSTOP = 7	/**< standard band stop/notch */
};

/** Async Event sources
\ingroup async
*/
enum ASYNC_EVENT_SOURCES {
	HPI_ASYNC_EVENT_GPIO = 1,	/**< GPIO event. */
	HPI_ASYNC_EVENT_SILENCE = 2,	/**< silence event detected. */
	HPI_ASYNC_EVENT_TONE = 3	/**< tone event detected. */
};
/*******************************************/
/** HPI Error codes

Almost all HPI functions return an error code
A return value of zero means there was no error.
Otherwise one of these error codes is returned.
Error codes can be converted to a descriptive string using HPI_GetErrorText()

\note When a new error code is added HPI_GetErrorText() MUST be updated.
\note Codes 1-100 are reserved for driver use
\ingroup utility
*/
enum HPI_ERROR_CODES {
	/** Message type does not exist. */
	HPI_ERROR_INVALID_TYPE = 100,
	/** Object type does not exist. */
	HPI_ERROR_INVALID_OBJ = 101,
	/** Function does not exist. */
	HPI_ERROR_INVALID_FUNC = 102,
900
	/** The specified object does not exist. */
901 902 903 904 905 906 907
	HPI_ERROR_INVALID_OBJ_INDEX = 103,
	/** Trying to access an object that has not been opened yet. */
	HPI_ERROR_OBJ_NOT_OPEN = 104,
	/** Trying to open an already open object. */
	HPI_ERROR_OBJ_ALREADY_OPEN = 105,
	/** PCI, ISA resource not valid. */
	HPI_ERROR_INVALID_RESOURCE = 106,
908
	/* HPI_ERROR_SUBSYSFINDADAPTERS_GETINFO= 107 */
909 910 911 912 913 914 915
	/** Default response was never updated with actual error code. */
	HPI_ERROR_INVALID_RESPONSE = 108,
	/** wSize field of response was not updated,
	indicating that the message was not processed. */
	HPI_ERROR_PROCESSING_MESSAGE = 109,
	/** The network did not respond in a timely manner. */
	HPI_ERROR_NETWORK_TIMEOUT = 110,
916
	/* An HPI handle is invalid (uninitialised?). */
917 918 919
	HPI_ERROR_INVALID_HANDLE = 111,
	/** A function or attribute has not been implemented yet. */
	HPI_ERROR_UNIMPLEMENTED = 112,
920 921
	/** There are too many clients attempting
	    to access a network resource. */
922
	HPI_ERROR_NETWORK_TOO_MANY_CLIENTS = 113,
923 924 925 926
	/** Response buffer passed to HPI_Message
	    was smaller than returned response.
	    wSpecificError field of hpi response contains the required size.
	*/
927 928 929
	HPI_ERROR_RESPONSE_BUFFER_TOO_SMALL = 114,
	/** The returned response did not match the sent message */
	HPI_ERROR_RESPONSE_MISMATCH = 115,
930 931
	/** A control setting that should have been cached was not. */
	HPI_ERROR_CONTROL_CACHING = 116,
932 933 934 935 936
	/** A message buffer in the path to the adapter was smaller
	    than the message size.
	    wSpecificError field of hpi response contains the actual size.
	*/
	HPI_ERROR_MESSAGE_BUFFER_TOO_SMALL = 117,
937

938
	/* HPI_ERROR_TOO_MANY_ADAPTERS= 200 */
939 940 941 942 943
	/** Bad adpater. */
	HPI_ERROR_BAD_ADAPTER = 201,
	/** Adapter number out of range or not set properly. */
	HPI_ERROR_BAD_ADAPTER_NUMBER = 202,
	/** 2 adapters with the same adapter number. */
944
	HPI_ERROR_DUPLICATE_ADAPTER_NUMBER = 203,
945
	/** DSP code failed to bootload. Usually a DSP memory test failure. */
946 947 948 949 950 951 952
	HPI_ERROR_DSP_BOOTLOAD = 204,
	/** Couldn't find or open the DSP code file. */
	HPI_ERROR_DSP_FILE_NOT_FOUND = 206,
	/** Internal DSP hardware error. */
	HPI_ERROR_DSP_HARDWARE = 207,
	/** Could not allocate memory */
	HPI_ERROR_MEMORY_ALLOC = 208,
953
	/** Failed to correctly load/config PLD. (unused) */
954 955 956 957 958 959 960 961
	HPI_ERROR_PLD_LOAD = 209,
	/** Unexpected end of file, block length too big etc. */
	HPI_ERROR_DSP_FILE_FORMAT = 210,

	/** Found but could not open DSP code file. */
	HPI_ERROR_DSP_FILE_ACCESS_DENIED = 211,
	/** First DSP code section header not found in DSP file. */
	HPI_ERROR_DSP_FILE_NO_HEADER = 212,
962
	/* HPI_ERROR_DSP_FILE_READ_ERROR= 213, */
963 964 965 966 967 968 969 970 971
	/** DSP code for adapter family not found. */
	HPI_ERROR_DSP_SECTION_NOT_FOUND = 214,
	/** Other OS specific error opening DSP file. */
	HPI_ERROR_DSP_FILE_OTHER_ERROR = 215,
	/** Sharing violation opening DSP code file. */
	HPI_ERROR_DSP_FILE_SHARING_VIOLATION = 216,
	/** DSP code section header had size == 0. */
	HPI_ERROR_DSP_FILE_NULL_HEADER = 217,

972
	/* HPI_ERROR_FLASH = 220, */
973 974

	/** Flash has bad checksum */
975 976 977 978 979 980 981
	HPI_ERROR_BAD_CHECKSUM = 221,
	HPI_ERROR_BAD_SEQUENCE = 222,
	HPI_ERROR_FLASH_ERASE = 223,
	HPI_ERROR_FLASH_PROGRAM = 224,
	HPI_ERROR_FLASH_VERIFY = 225,
	HPI_ERROR_FLASH_TYPE = 226,
	HPI_ERROR_FLASH_START = 227,
982 983 984
	HPI_ERROR_FLASH_READ = 228,
	HPI_ERROR_FLASH_READ_NO_FILE = 229,
	HPI_ERROR_FLASH_SIZE = 230,
985 986 987 988

	/** Reserved for OEMs. */
	HPI_ERROR_RESERVED_1 = 290,

989
	/* HPI_ERROR_INVALID_STREAM = 300 use HPI_ERROR_INVALID_OBJ_INDEX */
990 991 992 993 994 995 996 997 998 999
	/** Invalid compression format. */
	HPI_ERROR_INVALID_FORMAT = 301,
	/** Invalid format samplerate */
	HPI_ERROR_INVALID_SAMPLERATE = 302,
	/** Invalid format number of channels. */
	HPI_ERROR_INVALID_CHANNELS = 303,
	/** Invalid format bitrate. */
	HPI_ERROR_INVALID_BITRATE = 304,
	/** Invalid datasize used for stream read/write. */
	HPI_ERROR_INVALID_DATASIZE = 305,
1000 1001
	/* HPI_ERROR_BUFFER_FULL = 306 use HPI_ERROR_INVALID_DATASIZE */
	/* HPI_ERROR_BUFFER_EMPTY = 307 use HPI_ERROR_INVALID_DATASIZE */
1002 1003
	/** Null data pointer used for stream read/write. */
	HPI_ERROR_INVALID_DATA_POINTER = 308,
1004 1005 1006 1007
	/** Packet ordering error for stream read/write. */
	HPI_ERROR_INVALID_PACKET_ORDER = 309,

	/** Object can't do requested operation in its current
1008
	    state, eg set format, change rec mux state while recording.*/
1009 1010
	HPI_ERROR_INVALID_OPERATION = 310,

1011 1012
	/** Where a SRG is shared amongst streams, an incompatible samplerate
	    is one that is different to any currently active stream. */
1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024
	HPI_ERROR_INCOMPATIBLE_SAMPLERATE = 311,
	/** Adapter mode is illegal.*/
	HPI_ERROR_BAD_ADAPTER_MODE = 312,

	/** There have been too many attempts to set the adapter's
	capabilities (using bad keys), the card should be returned
	to ASI if further capabilities updates are required */
	HPI_ERROR_TOO_MANY_CAPABILITY_CHANGE_ATTEMPTS = 313,
	/** Streams on different adapters cannot be grouped. */
	HPI_ERROR_NO_INTERADAPTER_GROUPS = 314,
	/** Streams on different DSPs cannot be grouped. */
	HPI_ERROR_NO_INTERDSP_GROUPS = 315,
1025 1026
	/** Stream wait cancelled before threshold reached. */
	HPI_ERROR_WAIT_CANCELLED = 316,
1027 1028
	/** A character string is invalid. */
	HPI_ERROR_INVALID_STRING = 317,
1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041

	/** Invalid mixer node for this adapter. */
	HPI_ERROR_INVALID_NODE = 400,
	/** Invalid control. */
	HPI_ERROR_INVALID_CONTROL = 401,
	/** Invalid control value was passed. */
	HPI_ERROR_INVALID_CONTROL_VALUE = 402,
	/** Control attribute not supported by this control. */
	HPI_ERROR_INVALID_CONTROL_ATTRIBUTE = 403,
	/** Control is disabled. */
	HPI_ERROR_CONTROL_DISABLED = 404,
	/** I2C transaction failed due to a missing ACK. */
	HPI_ERROR_CONTROL_I2C_MISSING_ACK = 405,
1042
	HPI_ERROR_I2C_MISSING_ACK = 405,
1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054
	/** Control is busy, or coming out of
	reset and cannot be accessed at this time. */
	HPI_ERROR_CONTROL_NOT_READY = 407,

	/** Non volatile memory */
	HPI_ERROR_NVMEM_BUSY = 450,
	HPI_ERROR_NVMEM_FULL = 451,
	HPI_ERROR_NVMEM_FAIL = 452,

	/** I2C */
	HPI_ERROR_I2C_BAD_ADR = 460,

1055
	/** Entity type did not match requested type */
1056
	HPI_ERROR_ENTITY_TYPE_MISMATCH = 470,
1057
	/** Entity item count did not match requested count */
1058
	HPI_ERROR_ENTITY_ITEM_COUNT = 471,
1059
	/** Entity type is not one of the valid types */
1060
	HPI_ERROR_ENTITY_TYPE_INVALID = 472,
1061
	/** Entity role is not one of the valid roles */
1062
	HPI_ERROR_ENTITY_ROLE_INVALID = 473,
1063
	/** Entity size doesn't match target size */
1064
	HPI_ERROR_ENTITY_SIZE_MISMATCH = 474,
1065 1066 1067 1068 1069 1070 1071 1072 1073

	/* AES18 specific errors were 500..507 */

	/** custom error to use for debugging */
	HPI_ERROR_CUSTOM = 600,

	/** hpioct32.c can't obtain mutex */
	HPI_ERROR_MUTEX_TIMEOUT = 700,

1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085
	/** Backend errors used to be greater than this.
	    \deprecated Now, all backends return only errors defined here in hpi.h
	*/
	HPI_ERROR_BACKEND_BASE = 900,

	/** Communication with DSP failed */
	HPI_ERROR_DSP_COMMUNICATION = 900
		/* Note that the dsp communication error is set to this value so that
		   it remains compatible with any software that expects such errors
		   to be backend errors i.e. >= 900.
		   Do not define any new error codes with values > 900.
		 */
1086 1087 1088 1089 1090
};

/** \defgroup maximums HPI maximum values
\{
*/
1091
/** Maximum number of PCI HPI adapters */
1092 1093 1094 1095 1096 1097 1098 1099 1100 1101
#define HPI_MAX_ADAPTERS                20
/** Maximum number of in or out streams per adapter */
#define HPI_MAX_STREAMS                 16
#define HPI_MAX_CHANNELS                2	/* per stream */
#define HPI_MAX_NODES                   8	/* per mixer ? */
#define HPI_MAX_CONTROLS                4	/* per node ? */
/** maximum number of ancillary bytes per MPEG frame */
#define HPI_MAX_ANC_BYTES_PER_FRAME     (64)
#define HPI_STRING_LEN                  16

1102 1103 1104
/** Networked adapters have index >= 100 */
#define HPI_MIN_NETWORK_ADAPTER_IDX 100

1105 1106 1107 1108 1109 1110 1111 1112 1113
/** Velocity units */
#define HPI_OSTREAM_VELOCITY_UNITS      4096
/** OutStream timescale units */
#define HPI_OSTREAM_TIMESCALE_UNITS     10000
/** OutStream timescale passthrough - turns timescaling on in passthough mode */
#define HPI_OSTREAM_TIMESCALE_PASSTHROUGH       99999

/**\}*/

1114
/**************/
1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125
/* STRUCTURES */
#ifndef DISABLE_PRAGMA_PACK1
#pragma pack(push, 1)
#endif

/** Structure containing sample format information.
    See also HPI_FormatCreate().
  */
struct hpi_format {
	u32 sample_rate;
				/**< 11025, 32000, 44100 ... */
1126
	u32 bit_rate;		  /**< for MPEG */
1127 1128 1129 1130
	u32 attributes;
				/**< Stereo/JointStereo/Mono */
	u16 mode_legacy;
				/**< Legacy ancillary mode or idle bit  */
1131 1132 1133
	u16 unused;		  /**< Unused */
	u16 channels;	  /**< 1,2..., (or ancillary mode or idle bit */
	u16 format;	  /**< HPI_FORMAT_PCM16, _MPEG etc. see #HPI_FORMATS. */
1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144
};

struct hpi_anc_frame {
	u32 valid_bits_in_this_frame;
	u8 b_data[HPI_MAX_ANC_BYTES_PER_FRAME];
};

/** An object for containing a single async event.
*/
struct hpi_async_event {
	u16 event_type;	/**< type of event. \sa async_event  */
1145 1146 1147
	u16 sequence; /**< Sequence number, allows lost event detection */
	u32 state; /**< New state */
	u32 h_object; /**< handle to the object returning the event. */
1148 1149 1150 1151 1152 1153
	union {
		struct {
			u16 index; /**< GPIO bit index. */
		} gpio;
		struct {
			u16 node_index;	/**< what node is the control on ? */
1154
			u16 node_type; /**< what type of node is the control on ? */
1155 1156 1157 1158 1159 1160 1161 1162
		} control;
	} u;
};

#ifndef DISABLE_PRAGMA_PACK1
#pragma pack(pop)
#endif

1163
/*****************/
1164
/* HPI FUNCTIONS */
1165
/*****************/
1166

1167
/* Stream */
1168 1169 1170
u16 hpi_stream_estimate_buffer_size(struct hpi_format *pF,
	u32 host_polling_rate_in_milli_seconds, u32 *recommended_buffer_size);

1171 1172 1173
/*************/
/* SubSystem */
/*************/
1174

1175
u16 hpi_subsys_get_version_ex(u32 *pversion_ex);
1176

1177
u16 hpi_subsys_get_num_adapters(int *pn_num_adapters);
1178

1179 1180
u16 hpi_subsys_get_adapter(int iterator, u32 *padapter_index,
	u16 *pw_adapter_type);
1181

1182 1183 1184
/***********/
/* Adapter */
/***********/
1185

1186
u16 hpi_adapter_open(u16 adapter_index);
1187

1188
u16 hpi_adapter_close(u16 adapter_index);
1189

1190 1191 1192
u16 hpi_adapter_get_info(u16 adapter_index, u16 *pw_num_outstreams,
	u16 *pw_num_instreams, u16 *pw_version, u32 *pserial_number,
	u16 *pw_adapter_type);
1193

1194 1195 1196
u16 hpi_adapter_get_module_by_index(u16 adapter_index, u16 module_index,
	u16 *pw_num_outputs, u16 *pw_num_inputs, u16 *pw_version,
	u32 *pserial_number, u16 *pw_module_type, u32 *ph_module);
1197

1198
u16 hpi_adapter_set_mode(u16 adapter_index, u32 adapter_mode);
1199

1200 1201
u16 hpi_adapter_set_mode_ex(u16 adapter_index, u32 adapter_mode,
	u16 query_or_set);
1202

1203
u16 hpi_adapter_get_mode(u16 adapter_index, u32 *padapter_mode);
1204

1205 1206 1207
u16 hpi_adapter_get_assert2(u16 adapter_index, u16 *p_assert_count,
	char *psz_assert, u32 *p_param1, u32 *p_param2,
	u32 *p_dsp_string_addr, u16 *p_processor_id);
1208

1209
u16 hpi_adapter_test_assert(u16 adapter_index, u16 assert_id);
1210

1211
u16 hpi_adapter_enable_capability(u16 adapter_index, u16 capability, u32 key);
1212

1213
u16 hpi_adapter_self_test(u16 adapter_index);
1214

1215 1216
u16 hpi_adapter_debug_read(u16 adapter_index, u32 dsp_address, char *p_bytes,
	int *count_bytes);
1217

1218 1219
u16 hpi_adapter_set_property(u16 adapter_index, u16 property, u16 paramter1,
	u16 paramter2);
1220

1221 1222
u16 hpi_adapter_get_property(u16 adapter_index, u16 property,
	u16 *pw_paramter1, u16 *pw_paramter2);
1223

1224 1225 1226 1227 1228 1229 1230
u16 hpi_adapter_enumerate_property(u16 adapter_index, u16 index,
	u16 what_to_enumerate, u16 property_index, u32 *psetting);
/*************/
/* OutStream */
/*************/
u16 hpi_outstream_open(u16 adapter_index, u16 outstream_index,
	u32 *ph_outstream);
1231

1232
u16 hpi_outstream_close(u32 h_outstream);
1233

1234 1235 1236
u16 hpi_outstream_get_info_ex(u32 h_outstream, u16 *pw_state,
	u32 *pbuffer_size, u32 *pdata_to_play, u32 *psamples_played,
	u32 *pauxiliary_data_to_play);
1237

1238 1239
u16 hpi_outstream_write_buf(u32 h_outstream, const u8 *pb_write_buf,
	u32 bytes_to_write, const struct hpi_format *p_format);
1240

1241
u16 hpi_outstream_start(u32 h_outstream);
1242

1243
u16 hpi_outstream_wait_start(u32 h_outstream);
1244

1245
u16 hpi_outstream_stop(u32 h_outstream);
1246

1247
u16 hpi_outstream_sinegen(u32 h_outstream);
1248

1249
u16 hpi_outstream_reset(u32 h_outstream);
1250

1251
u16 hpi_outstream_query_format(u32 h_outstream, struct hpi_format *p_format);
1252

1253
u16 hpi_outstream_set_format(u32 h_outstream, struct hpi_format *p_format);
1254

1255 1256
u16 hpi_outstream_set_punch_in_out(u32 h_outstream, u32 punch_in_sample,
	u32 punch_out_sample);
1257

1258
u16 hpi_outstream_set_velocity(u32 h_outstream, short velocity);
1259

1260
u16 hpi_outstream_ancillary_reset(u32 h_outstream, u16 mode);
1261

1262
u16 hpi_outstream_ancillary_get_info(u32 h_outstream, u32 *pframes_available);
1263

1264 1265
u16 hpi_outstream_ancillary_read(u32 h_outstream,
	struct hpi_anc_frame *p_anc_frame_buffer,
1266 1267 1268
	u32 anc_frame_buffer_size_in_bytes,
	u32 number_of_ancillary_frames_to_read);

1269
u16 hpi_outstream_set_time_scale(u32 h_outstream, u32 time_scaleX10000);
1270

1271
u16 hpi_outstream_host_buffer_allocate(u32 h_outstream, u32 size_in_bytes);
1272

1273
u16 hpi_outstream_host_buffer_free(u32 h_outstream);
1274

1275
u16 hpi_outstream_group_add(u32 h_outstream, u32 h_stream);
1276

1277 1278
u16 hpi_outstream_group_get_map(u32 h_outstream, u32 *poutstream_map,
	u32 *pinstream_map);
1279

1280
u16 hpi_outstream_group_reset(u32 h_outstream);
1281

1282 1283 1284 1285 1286
/************/
/* InStream */
/************/
u16 hpi_instream_open(u16 adapter_index, u16 instream_index,
	u32 *ph_instream);
1287

1288
u16 hpi_instream_close(u32 h_instream);
1289

1290 1291
u16 hpi_instream_query_format(u32 h_instream,
	const struct hpi_format *p_format);
1292

1293 1294
u16 hpi_instream_set_format(u32 h_instream,
	const struct hpi_format *p_format);
1295

1296
u16 hpi_instream_read_buf(u32 h_instream, u8 *pb_read_buf, u32 bytes_to_read);
1297

1298
u16 hpi_instream_start(u32 h_instream);
1299

1300
u16 hpi_instream_wait_start(u32 h_instream);
1301

1302
u16 hpi_instream_stop(u32 h_instream);
1303

1304
u16 hpi_instream_reset(u32 h_instream);
1305

1306 1307 1308
u16 hpi_instream_get_info_ex(u32 h_instream, u16 *pw_state, u32 *pbuffer_size,
	u32 *pdata_recorded, u32 *psamples_recorded,
	u32 *pauxiliary_data_recorded);
1309

1310 1311
u16 hpi_instream_ancillary_reset(u32 h_instream, u16 bytes_per_frame,
	u16 mode, u16 alignment, u16 idle_bit);
1312

1313
u16 hpi_instream_ancillary_get_info(u32 h_instream, u32 *pframe_space);
1314

1315 1316
u16 hpi_instream_ancillary_write(u32 h_instream,
	const struct hpi_anc_frame *p_anc_frame_buffer,
1317 1318 1319
	u32 anc_frame_buffer_size_in_bytes,
	u32 number_of_ancillary_frames_to_write);

1320
u16 hpi_instream_host_buffer_allocate(u32 h_instream, u32 size_in_bytes);
1321

1322
u16 hpi_instream_host_buffer_free(u32 h_instream);
1323

1324
u16 hpi_instream_group_add(u32 h_instream, u32 h_stream);
1325

1326 1327
u16 hpi_instream_group_get_map(u32 h_instream, u32 *poutstream_map,
	u32 *pinstream_map);
1328

1329
u16 hpi_instream_group_reset(u32 h_instream);
1330 1331

/*********/
1332
/* Mixer */
1333
/*********/
1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354
u16 hpi_mixer_open(u16 adapter_index, u32 *ph_mixer);

u16 hpi_mixer_close(u32 h_mixer);

u16 hpi_mixer_get_control(u32 h_mixer, u16 src_node_type,
	u16 src_node_type_index, u16 dst_node_type, u16 dst_node_type_index,
	u16 control_type, u32 *ph_control);

u16 hpi_mixer_get_control_by_index(u32 h_mixer, u16 control_index,
	u16 *pw_src_node_type, u16 *pw_src_node_index, u16 *pw_dst_node_type,
	u16 *pw_dst_node_index, u16 *pw_control_type, u32 *ph_control);

u16 hpi_mixer_store(u32 h_mixer, enum HPI_MIXER_STORE_COMMAND command,
	u16 index);
/************/
/* Controls */
/************/
/******************/
/* Volume control */
/******************/
u16 hpi_volume_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]
1355 1356
	);

1357
u16 hpi_volume_get_gain(u32 h_control,
1358 1359 1360
	short an_gain0_01dB_out[HPI_MAX_CHANNELS]
	);

1361 1362 1363 1364
u16 hpi_volume_set_mute(u32 h_control, u32 mute);

u16 hpi_volume_get_mute(u32 h_control, u32 *mute);

1365
#define hpi_volume_get_range hpi_volume_query_range
1366 1367
u16 hpi_volume_query_range(u32 h_control, short *min_gain_01dB,
	short *max_gain_01dB, short *step_gain_01dB);
1368

1369
u16 hpi_volume_query_channels(const u32 h_control, u32 *p_channels);
1370

1371
u16 hpi_volume_auto_fade(u32 h_control,
1372 1373
	short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms);

1374 1375 1376
u16 hpi_volume_auto_fade_profile(u32 h_control,
	short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms,
	u16 profile);
1377

1378 1379 1380
u16 hpi_volume_query_auto_fade_profile(const u32 h_control, const u32 i,
	u16 *profile);

1381 1382 1383 1384 1385
/*****************/
/* Level control */
/*****************/
u16 hpi_level_query_range(u32 h_control, short *min_gain_01dB,
	short *max_gain_01dB, short *step_gain_01dB);
1386

1387
u16 hpi_level_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]
1388 1389
	);

1390
u16 hpi_level_get_gain(u32 h_control,
1391 1392 1393
	short an_gain0_01dB_out[HPI_MAX_CHANNELS]
	);

1394 1395 1396 1397
/*****************/
/* Meter control */
/*****************/
u16 hpi_meter_query_channels(const u32 h_meter, u32 *p_channels);
1398

1399
u16 hpi_meter_get_peak(u32 h_control,
1400 1401 1402
	short an_peak0_01dB_out[HPI_MAX_CHANNELS]
	);

1403
u16 hpi_meter_get_rms(u32 h_control, short an_peak0_01dB_out[HPI_MAX_CHANNELS]
1404 1405
	);

1406
u16 hpi_meter_set_peak_ballistics(u32 h_control, u16 attack, u16 decay);
1407

1408
u16 hpi_meter_set_rms_ballistics(u32 h_control, u16 attack, u16 decay);
1409

1410
u16 hpi_meter_get_peak_ballistics(u32 h_control, u16 *attack, u16 *decay);
1411

1412
u16 hpi_meter_get_rms_ballistics(u32 h_control, u16 *attack, u16 *decay);
1413

1414 1415 1416 1417 1418
/************************/
/* ChannelMode control */
/************************/
u16 hpi_channel_mode_query_mode(const u32 h_mode, const u32 index,
	u16 *pw_mode);
1419

1420
u16 hpi_channel_mode_set(u32 h_control, u16 mode);
1421

1422
u16 hpi_channel_mode_get(u32 h_control, u16 *mode);
1423

1424 1425 1426 1427
/*****************/
/* Tuner control */
/*****************/
u16 hpi_tuner_query_band(const u32 h_tuner, const u32 index, u16 *pw_band);
1428

1429
u16 hpi_tuner_set_band(u32 h_control, u16 band);
1430

1431
u16 hpi_tuner_get_band(u32 h_control, u16 *pw_band);
1432

1433 1434
u16 hpi_tuner_query_frequency(const u32 h_tuner, const u32 index,
	const u16 band, u32 *pfreq);
1435

1436
u16 hpi_tuner_set_frequency(u32 h_control, u32 freq_ink_hz);
1437

1438
u16 hpi_tuner_get_frequency(u32 h_control, u32 *pw_freq_ink_hz);
1439

1440
u16 hpi_tuner_get_rf_level(u32 h_control, short *pw_level);
1441

1442
u16 hpi_tuner_get_raw_rf_level(u32 h_control, short *pw_level);
1443

1444
u16 hpi_tuner_query_gain(const u32 h_tuner, const u32 index, u16 *pw_gain);
1445

1446
u16 hpi_tuner_set_gain(u32 h_control, short gain);
1447

1448
u16 hpi_tuner_get_gain(u32 h_control, short *pn_gain);
1449

1450
u16 hpi_tuner_get_status(u32 h_control, u16 *pw_status_mask, u16 *pw_status);
1451

1452
u16 hpi_tuner_set_mode(u32 h_control, u32 mode, u32 value);
1453

1454
u16 hpi_tuner_get_mode(u32 h_control, u32 mode, u32 *pn_value);
1455

1456
u16 hpi_tuner_get_rds(u32 h_control, char *p_rds_data);
1457

1458 1459
u16 hpi_tuner_query_deemphasis(const u32 h_tuner, const u32 index,
	const u16 band, u32 *pdeemphasis);
1460

1461 1462
u16 hpi_tuner_set_deemphasis(u32 h_control, u32 deemphasis);
u16 hpi_tuner_get_deemphasis(u32 h_control, u32 *pdeemphasis);
1463

1464
u16 hpi_tuner_query_program(const u32 h_tuner, u32 *pbitmap_program);
1465

1466
u16 hpi_tuner_set_program(u32 h_control, u32 program);
1467

1468
u16 hpi_tuner_get_program(u32 h_control, u32 *pprogram);
1469

1470 1471
u16 hpi_tuner_get_hd_radio_dsp_version(u32 h_control, char *psz_dsp_version,
	const u32 string_size);
1472

1473 1474
u16 hpi_tuner_get_hd_radio_sdk_version(u32 h_control, char *psz_sdk_version,
	const u32 string_size);
1475

1476
u16 hpi_tuner_get_hd_radio_signal_quality(u32 h_control, u32 *pquality);
1477

1478
u16 hpi_tuner_get_hd_radio_signal_blend(u32 h_control, u32 *pblend);
1479

1480
u16 hpi_tuner_set_hd_radio_signal_blend(u32 h_control, const u32 blend);
1481

1482 1483 1484
/***************/
/* PAD control */
/***************/
1485

1486 1487
u16 hpi_pad_get_channel_name(u32 h_control, char *psz_string,
	const u32 string_length);
1488

1489 1490
u16 hpi_pad_get_artist(u32 h_control, char *psz_string,
	const u32 string_length);
1491

1492 1493
u16 hpi_pad_get_title(u32 h_control, char *psz_string,
	const u32 string_length);
1494

1495 1496
u16 hpi_pad_get_comment(u32 h_control, char *psz_string,
	const u32 string_length);
1497

1498
u16 hpi_pad_get_program_type(u32 h_control, u32 *ppTY);
1499

1500
u16 hpi_pad_get_rdsPI(u32 h_control, u32 *ppI);
1501

1502 1503
u16 hpi_pad_get_program_type_string(u32 h_control, const u32 data_type,
	const u32 pTY, char *psz_string, const u32 string_length);
1504 1505 1506 1507

/****************************/
/* AES/EBU Receiver control */
/****************************/
1508 1509
u16 hpi_aesebu_receiver_query_format(const u32 h_aes_rx, const u32 index,
	u16 *pw_format);
1510

1511
u16 hpi_aesebu_receiver_set_format(u32 h_control, u16 source);
1512

1513
u16 hpi_aesebu_receiver_get_format(u32 h_control, u16 *pw_source);
1514

1515
u16 hpi_aesebu_receiver_get_sample_rate(u32 h_control, u32 *psample_rate);
1516

1517
u16 hpi_aesebu_receiver_get_user_data(u32 h_control, u16 index, u16 *pw_data);
1518

1519 1520
u16 hpi_aesebu_receiver_get_channel_status(u32 h_control, u16 index,
	u16 *pw_data);
1521

1522
u16 hpi_aesebu_receiver_get_error_status(u32 h_control, u16 *pw_error_data);
1523 1524 1525 1526

/*******************************/
/* AES/EBU Transmitter control */
/*******************************/
1527
u16 hpi_aesebu_transmitter_set_sample_rate(u32 h_control, u32 sample_rate);
1528

1529
u16 hpi_aesebu_transmitter_set_user_data(u32 h_control, u16 index, u16 data);
1530

1531 1532
u16 hpi_aesebu_transmitter_set_channel_status(u32 h_control, u16 index,
	u16 data);
1533

1534 1535
u16 hpi_aesebu_transmitter_get_channel_status(u32 h_control, u16 index,
	u16 *pw_data);
1536

1537 1538
u16 hpi_aesebu_transmitter_query_format(const u32 h_aes_tx, const u32 index,
	u16 *pw_format);
1539

1540
u16 hpi_aesebu_transmitter_set_format(u32 h_control, u16 output_format);
1541

1542
u16 hpi_aesebu_transmitter_get_format(u32 h_control, u16 *pw_output_format);
1543 1544

/***********************/
1545
/* Multiplexer control */
1546
/***********************/
1547 1548
u16 hpi_multiplexer_set_source(u32 h_control, u16 source_node_type,
	u16 source_node_index);
1549

1550
u16 hpi_multiplexer_get_source(u32 h_control, u16 *source_node_type,
1551 1552
	u16 *source_node_index);

1553 1554 1555
u16 hpi_multiplexer_query_source(u32 h_control, u16 index,
	u16 *source_node_type, u16 *source_node_index);

1556
/***************/
1557
/* Vox control */
1558
/***************/
1559
u16 hpi_vox_set_threshold(u32 h_control, short an_gain0_01dB);
1560

1561
u16 hpi_vox_get_threshold(u32 h_control, short *an_gain0_01dB);
1562 1563 1564 1565

/*********************/
/* Bitstream control */
/*********************/
1566
u16 hpi_bitstream_set_clock_edge(u32 h_control, u16 edge_type);
1567

1568
u16 hpi_bitstream_set_data_polarity(u32 h_control, u16 polarity);
1569

1570 1571
u16 hpi_bitstream_get_activity(u32 h_control, u16 *pw_clk_activity,
	u16 *pw_data_activity);
1572 1573 1574 1575 1576

/***********************/
/* SampleClock control */
/***********************/

1577 1578
u16 hpi_sample_clock_query_source(const u32 h_clock, const u32 index,
	u16 *pw_source);
1579

1580
u16 hpi_sample_clock_set_source(u32 h_control, u16 source);
1581

1582
u16 hpi_sample_clock_get_source(u32 h_control, u16 *pw_source);
1583

1584 1585
u16 hpi_sample_clock_query_source_index(const u32 h_clock, const u32 index,
	const u32 source, u16 *pw_source_index);
1586

1587
u16 hpi_sample_clock_set_source_index(u32 h_control, u16 source_index);
1588

1589
u16 hpi_sample_clock_get_source_index(u32 h_control, u16 *pw_source_index);
1590

1591
u16 hpi_sample_clock_get_sample_rate(u32 h_control, u32 *psample_rate);
1592

1593 1594
u16 hpi_sample_clock_query_local_rate(const u32 h_clock, const u32 index,
	u32 *psource);
1595

1596
u16 hpi_sample_clock_set_local_rate(u32 h_control, u32 sample_rate);
1597

1598
u16 hpi_sample_clock_get_local_rate(u32 h_control, u32 *psample_rate);
1599

1600
u16 hpi_sample_clock_set_auto(u32 h_control, u32 enable);
1601

1602
u16 hpi_sample_clock_get_auto(u32 h_control, u32 *penable);
1603

1604
u16 hpi_sample_clock_set_local_rate_lock(u32 h_control, u32 lock);
1605

1606
u16 hpi_sample_clock_get_local_rate_lock(u32 h_control, u32 *plock);
1607 1608 1609 1610

/***********************/
/* Microphone control */
/***********************/
1611
u16 hpi_microphone_set_phantom_power(u32 h_control, u16 on_off);
1612

1613
u16 hpi_microphone_get_phantom_power(u32 h_control, u16 *pw_on_off);
1614

1615 1616 1617 1618 1619
/********************************/
/* Parametric Equalizer control */
/********************************/
u16 hpi_parametric_eq_get_info(u32 h_control, u16 *pw_number_of_bands,
	u16 *pw_enabled);
1620

1621
u16 hpi_parametric_eq_set_state(u32 h_control, u16 on_off);
1622

1623 1624
u16 hpi_parametric_eq_set_band(u32 h_control, u16 index, u16 type,
	u32 frequency_hz, short q100, short gain0_01dB);
1625

1626 1627
u16 hpi_parametric_eq_get_band(u32 h_control, u16 index, u16 *pn_type,
	u32 *pfrequency_hz, short *pnQ100, short *pn_gain0_01dB);
1628

1629
u16 hpi_parametric_eq_get_coeffs(u32 h_control, u16 index, short coeffs[5]
1630 1631
	);

1632 1633 1634
/*******************************/
/* Compressor Expander control */
/*******************************/
1635

1636
u16 hpi_compander_set_enable(u32 h_control, u32 on);
1637

1638
u16 hpi_compander_get_enable(u32 h_control, u32 *pon);
1639

1640
u16 hpi_compander_set_makeup_gain(u32 h_control, short makeup_gain0_01dB);
1641

1642
u16 hpi_compander_get_makeup_gain(u32 h_control, short *pn_makeup_gain0_01dB);
1643

1644 1645
u16 hpi_compander_set_attack_time_constant(u32 h_control, u32 index,
	u32 attack);
1646

1647 1648
u16 hpi_compander_get_attack_time_constant(u32 h_control, u32 index,
	u32 *pw_attack);
1649

1650 1651
u16 hpi_compander_set_decay_time_constant(u32 h_control, u32 index,
	u32 decay);
1652

1653 1654
u16 hpi_compander_get_decay_time_constant(u32 h_control, u32 index,
	u32 *pw_decay);
1655

1656 1657
u16 hpi_compander_set_threshold(u32 h_control, u32 index,
	short threshold0_01dB);
1658

1659 1660
u16 hpi_compander_get_threshold(u32 h_control, u32 index,
	short *pn_threshold0_01dB);
1661

1662
u16 hpi_compander_set_ratio(u32 h_control, u32 index, u32 ratio100);
1663

1664
u16 hpi_compander_get_ratio(u32 h_control, u32 index, u32 *pw_ratio100);
1665

1666 1667 1668 1669 1670
/********************/
/* Cobranet control */
/********************/
u16 hpi_cobranet_hmi_write(u32 h_control, u32 hmi_address, u32 byte_count,
	u8 *pb_data);
1671

1672 1673
u16 hpi_cobranet_hmi_read(u32 h_control, u32 hmi_address, u32 max_byte_count,
	u32 *pbyte_count, u8 *pb_data);
1674

1675 1676
u16 hpi_cobranet_hmi_get_status(u32 h_control, u32 *pstatus,
	u32 *preadable_size, u32 *pwriteable_size);
1677

1678
u16 hpi_cobranet_get_ip_address(u32 h_control, u32 *pdw_ip_address);
1679

1680
u16 hpi_cobranet_set_ip_address(u32 h_control, u32 dw_ip_address);
1681

1682
u16 hpi_cobranet_get_static_ip_address(u32 h_control, u32 *pdw_ip_address);
1683

1684
u16 hpi_cobranet_set_static_ip_address(u32 h_control, u32 dw_ip_address);
1685

1686 1687
u16 hpi_cobranet_get_macaddress(u32 h_control, u32 *p_mac_msbs,
	u32 *p_mac_lsbs);
1688

1689 1690 1691 1692
/*************************/
/* Tone Detector control */
/*************************/
u16 hpi_tone_detector_get_state(u32 hC, u32 *state);
1693

1694
u16 hpi_tone_detector_set_enable(u32 hC, u32 enable);
1695

1696
u16 hpi_tone_detector_get_enable(u32 hC, u32 *enable);
1697

1698
u16 hpi_tone_detector_set_event_enable(u32 hC, u32 event_enable);
1699

1700
u16 hpi_tone_detector_get_event_enable(u32 hC, u32 *event_enable);
1701

1702
u16 hpi_tone_detector_set_threshold(u32 hC, int threshold);
1703

1704
u16 hpi_tone_detector_get_threshold(u32 hC, int *threshold);
1705

1706
u16 hpi_tone_detector_get_frequency(u32 hC, u32 index, u32 *frequency);
1707

1708 1709 1710 1711
/****************************/
/* Silence Detector control */
/****************************/
u16 hpi_silence_detector_get_state(u32 hC, u32 *state);
1712

1713
u16 hpi_silence_detector_set_enable(u32 hC, u32 enable);
1714

1715
u16 hpi_silence_detector_get_enable(u32 hC, u32 *enable);
1716

1717
u16 hpi_silence_detector_set_event_enable(u32 hC, u32 event_enable);
1718

1719
u16 hpi_silence_detector_get_event_enable(u32 hC, u32 *event_enable);
1720

1721
u16 hpi_silence_detector_set_delay(u32 hC, u32 delay);
1722

1723
u16 hpi_silence_detector_get_delay(u32 hC, u32 *delay);
1724

1725
u16 hpi_silence_detector_set_threshold(u32 hC, int threshold);
1726

1727 1728 1729 1730
u16 hpi_silence_detector_get_threshold(u32 hC, int *threshold);
/*********************/
/* Utility functions */
/*********************/
1731 1732 1733 1734

u16 hpi_format_create(struct hpi_format *p_format, u16 channels, u16 format,
	u32 sample_rate, u32 bit_rate, u32 attributes);

1735
#endif	 /*_HPI_H_ */