Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /******************************************************************************
0003 
0004     AudioScience HPI driver
0005     Copyright (C) 1997-2011  AudioScience Inc. <support@audioscience.com>
0006 
0007 
0008 */
0009 /** \file hpi.h
0010 
0011  AudioScience Hardware Programming Interface (HPI)
0012  public API definition.
0013 
0014  The HPI is a low-level hardware abstraction layer to all
0015  AudioScience digital audio adapters
0016 
0017 (C) Copyright AudioScience Inc. 1998-2010
0018 */
0019 
0020 #ifndef _HPI_H_
0021 #define _HPI_H_
0022 
0023 #include <linux/types.h>
0024 #define HPI_BUILD_KERNEL_MODE
0025 
0026 /******************************************************************************/
0027 /********       HPI API DEFINITIONS                                       *****/
0028 /******************************************************************************/
0029 
0030 /*******************************************/
0031 /**  Audio format types
0032 \ingroup stream
0033 */
0034 enum HPI_FORMATS {
0035 /** Used internally on adapter. */
0036     HPI_FORMAT_MIXER_NATIVE = 0,
0037 /** 8-bit unsigned PCM. Windows equivalent is WAVE_FORMAT_PCM. */
0038     HPI_FORMAT_PCM8_UNSIGNED = 1,
0039 /** 16-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM. */
0040     HPI_FORMAT_PCM16_SIGNED = 2,
0041 /** MPEG-1 Layer-1. */
0042     HPI_FORMAT_MPEG_L1 = 3,
0043 /** MPEG-1 Layer-2.
0044 
0045 Windows equivalent is WAVE_FORMAT_MPEG.
0046 
0047 The following table shows what combinations of mode and bitrate are possible:
0048 
0049 <table border=1 cellspacing=0 cellpadding=5>
0050 <tr>
0051 <td><p><b>Bitrate (kbs)</b></p>
0052 <td><p><b>Mono</b></p>
0053 <td><p><b>Stereo,<br>Joint Stereo or<br>Dual Channel</b></p>
0054 
0055 <tr><td>32<td>X<td>_
0056 <tr><td>40<td>_<td>_
0057 <tr><td>48<td>X<td>_
0058 <tr><td>56<td>X<td>_
0059 <tr><td>64<td>X<td>X
0060 <tr><td>80<td>X<td>_
0061 <tr><td>96<td>X<td>X
0062 <tr><td>112<td>X<td>X
0063 <tr><td>128<td>X<td>X
0064 <tr><td>160<td>X<td>X
0065 <tr><td>192<td>X<td>X
0066 <tr><td>224<td>_<td>X
0067 <tr><td>256<td>-<td>X
0068 <tr><td>320<td>-<td>X
0069 <tr><td>384<td>_<td>X
0070 </table>
0071 */
0072     HPI_FORMAT_MPEG_L2 = 4,
0073 /** MPEG-1 Layer-3.
0074 Windows equivalent is WAVE_FORMAT_MPEG.
0075 
0076 The following table shows what combinations of mode and bitrate are possible:
0077 
0078 <table border=1 cellspacing=0 cellpadding=5>
0079 <tr>
0080 <td><p><b>Bitrate (kbs)</b></p>
0081 <td><p><b>Mono<br>Stereo @ 8,<br>11.025 and<br>12kHz*</b></p>
0082 <td><p><b>Mono<br>Stereo @ 16,<br>22.050 and<br>24kHz*</b></p>
0083 <td><p><b>Mono<br>Stereo @ 32,<br>44.1 and<br>48kHz</b></p>
0084 
0085 <tr><td>16<td>X<td>X<td>_
0086 <tr><td>24<td>X<td>X<td>_
0087 <tr><td>32<td>X<td>X<td>X
0088 <tr><td>40<td>X<td>X<td>X
0089 <tr><td>48<td>X<td>X<td>X
0090 <tr><td>56<td>X<td>X<td>X
0091 <tr><td>64<td>X<td>X<td>X
0092 <tr><td>80<td>_<td>X<td>X
0093 <tr><td>96<td>_<td>X<td>X
0094 <tr><td>112<td>_<td>X<td>X
0095 <tr><td>128<td>_<td>X<td>X
0096 <tr><td>144<td>_<td>X<td>_
0097 <tr><td>160<td>_<td>X<td>X
0098 <tr><td>192<td>_<td>_<td>X
0099 <tr><td>224<td>_<td>_<td>X
0100 <tr><td>256<td>-<td>_<td>X
0101 <tr><td>320<td>-<td>_<td>X
0102 </table>
0103 \b * Available on the ASI6000 series only
0104 */
0105     HPI_FORMAT_MPEG_L3 = 5,
0106 /** Dolby AC-2. */
0107     HPI_FORMAT_DOLBY_AC2 = 6,
0108 /** Dolbt AC-3. */
0109     HPI_FORMAT_DOLBY_AC3 = 7,
0110 /** 16-bit PCM big-endian. */
0111     HPI_FORMAT_PCM16_BIGENDIAN = 8,
0112 /** TAGIT-1 algorithm - hits. */
0113     HPI_FORMAT_AA_TAGIT1_HITS = 9,
0114 /** TAGIT-1 algorithm - inserts. */
0115     HPI_FORMAT_AA_TAGIT1_INSERTS = 10,
0116 /** 32-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM.
0117 Each sample is a 32bit word. The most significant 24 bits contain a 24-bit
0118 sample and the least significant 8 bits are set to 0.
0119 */
0120     HPI_FORMAT_PCM32_SIGNED = 11,
0121 /** Raw bitstream - unknown format. */
0122     HPI_FORMAT_RAW_BITSTREAM = 12,
0123 /** TAGIT-1 algorithm hits - extended. */
0124     HPI_FORMAT_AA_TAGIT1_HITS_EX1 = 13,
0125 /** 32-bit PCM as an IEEE float. Windows equivalent is WAVE_FORMAT_IEEE_FLOAT.
0126 Each sample is a 32bit word in IEEE754 floating point format.
0127 The range is +1.0 to -1.0, which corresponds to digital fullscale.
0128 */
0129     HPI_FORMAT_PCM32_FLOAT = 14,
0130 /** 24-bit PCM signed. Windows equivalent is WAVE_FORMAT_PCM. */
0131     HPI_FORMAT_PCM24_SIGNED = 15,
0132 /** OEM format 1 - private. */
0133     HPI_FORMAT_OEM1 = 16,
0134 /** OEM format 2 - private. */
0135     HPI_FORMAT_OEM2 = 17,
0136 /** Undefined format. */
0137     HPI_FORMAT_UNDEFINED = 0xffff
0138 };
0139 
0140 /*******************************************/
0141 /** Stream States
0142 \ingroup stream
0143 */
0144 enum HPI_STREAM_STATES {
0145     /** State stopped - stream is stopped. */
0146     HPI_STATE_STOPPED = 1,
0147     /** State playing - stream is playing audio. */
0148     HPI_STATE_PLAYING = 2,
0149     /** State recording - stream is recording. */
0150     HPI_STATE_RECORDING = 3,
0151     /** State drained - playing stream ran out of data to play. */
0152     HPI_STATE_DRAINED = 4,
0153     /** State generate sine - to be implemented. */
0154     HPI_STATE_SINEGEN = 5,
0155     /** State wait - used for inter-card sync to mean waiting for all
0156         cards to be ready. */
0157     HPI_STATE_WAIT = 6
0158 };
0159 /*******************************************/
0160 /** Source node types
0161 \ingroup mixer
0162 */
0163 enum HPI_SOURCENODES {
0164     /** This define can be used instead of 0 to indicate
0165     that there is no valid source node. A control that
0166     exists on a destination node can be searched for using a source
0167     node value of either 0, or HPI_SOURCENODE_NONE */
0168     HPI_SOURCENODE_NONE = 100,
0169     /** Out Stream (Play) node. */
0170     HPI_SOURCENODE_OSTREAM = 101,
0171     /** Line in node - could be analog, AES/EBU or network. */
0172     HPI_SOURCENODE_LINEIN = 102,
0173     HPI_SOURCENODE_AESEBU_IN = 103,      /**< AES/EBU input node. */
0174     HPI_SOURCENODE_TUNER = 104,      /**< tuner node. */
0175     HPI_SOURCENODE_RF = 105,         /**< RF input node. */
0176     HPI_SOURCENODE_CLOCK_SOURCE = 106,   /**< clock source node. */
0177     HPI_SOURCENODE_RAW_BITSTREAM = 107,  /**< raw bitstream node. */
0178     HPI_SOURCENODE_MICROPHONE = 108,     /**< microphone node. */
0179     /** Cobranet input node -
0180         Audio samples come from the Cobranet network and into the device. */
0181     HPI_SOURCENODE_COBRANET = 109,
0182     HPI_SOURCENODE_ANALOG = 110,         /**< analog input node. */
0183     HPI_SOURCENODE_ADAPTER = 111,        /**< adapter node. */
0184     /** RTP stream input node - This node is a destination for
0185         packets of RTP audio samples from other devices. */
0186     HPI_SOURCENODE_RTP_DESTINATION = 112,
0187     HPI_SOURCENODE_INTERNAL = 113,       /**< node internal to the device. */
0188     HPI_SOURCENODE_AVB = 114,        /**< AVB input stream */
0189     HPI_SOURCENODE_BLULINK = 115,        /**< BLU-link input channel */
0190     /* !!!Update this  AND hpidebug.h if you add a new sourcenode type!!! */
0191     HPI_SOURCENODE_LAST_INDEX = 115      /**< largest ID */
0192         /* AX6 max sourcenode types = 15 */
0193 };
0194 
0195 /*******************************************/
0196 /** Destination node types
0197 \ingroup mixer
0198 */
0199 enum HPI_DESTNODES {
0200     /** This define can be used instead of 0 to indicate
0201     that there is no valid destination node. A control that
0202     exists on a source node can be searched for using a destination
0203     node value of either 0, or HPI_DESTNODE_NONE */
0204     HPI_DESTNODE_NONE = 200,
0205     /** In Stream (Record) node. */
0206     HPI_DESTNODE_ISTREAM = 201,
0207     HPI_DESTNODE_LINEOUT = 202,      /**< line out node. */
0208     HPI_DESTNODE_AESEBU_OUT = 203,       /**< AES/EBU output node. */
0209     HPI_DESTNODE_RF = 204,           /**< RF output node. */
0210     HPI_DESTNODE_SPEAKER = 205,      /**< speaker output node. */
0211     /** Cobranet output node -
0212         Audio samples from the device are sent out on the Cobranet network.*/
0213     HPI_DESTNODE_COBRANET = 206,
0214     HPI_DESTNODE_ANALOG = 207,       /**< analog output node. */
0215     /** RTP stream output node - This node is a source for
0216         packets of RTP audio samples that are sent to other devices. */
0217     HPI_DESTNODE_RTP_SOURCE = 208,
0218     HPI_DESTNODE_AVB = 209,          /**< AVB output stream */
0219     HPI_DESTNODE_INTERNAL = 210,         /**< node internal to the device. */
0220     HPI_DESTNODE_BLULINK = 211,      /**< BLU-link output channel. */
0221     /* !!!Update this AND hpidebug.h if you add a new destnode type!!! */
0222     HPI_DESTNODE_LAST_INDEX = 211        /**< largest ID */
0223         /* AX6 max destnode types = 15 */
0224 };
0225 
0226 /*******************************************/
0227 /** Mixer control types
0228 \ingroup mixer
0229 */
0230 enum HPI_CONTROLS {
0231     HPI_CONTROL_GENERIC = 0,    /**< generic control. */
0232     HPI_CONTROL_CONNECTION = 1, /**< A connection between nodes. */
0233     HPI_CONTROL_VOLUME = 2,       /**< volume control - works in dB_fs. */
0234     HPI_CONTROL_METER = 3,  /**< peak meter control. */
0235     HPI_CONTROL_MUTE = 4,   /*mute control - not used at present. */
0236     HPI_CONTROL_MULTIPLEXER = 5,    /**< multiplexer control. */
0237 
0238     HPI_CONTROL_AESEBU_TRANSMITTER = 6, /**< AES/EBU transmitter control */
0239     HPI_CONTROL_AESEBUTX = 6,   /* HPI_CONTROL_AESEBU_TRANSMITTER */
0240 
0241     HPI_CONTROL_AESEBU_RECEIVER = 7, /**< AES/EBU receiver control. */
0242     HPI_CONTROL_AESEBURX = 7,   /* HPI_CONTROL_AESEBU_RECEIVER */
0243 
0244     HPI_CONTROL_LEVEL = 8, /**< level/trim control - works in d_bu. */
0245     HPI_CONTROL_TUNER = 9,  /**< tuner control. */
0246 /*      HPI_CONTROL_ONOFFSWITCH =       10 */
0247     HPI_CONTROL_VOX = 11,   /**< vox control. */
0248 /*      HPI_CONTROL_AES18_TRANSMITTER = 12 */
0249 /*      HPI_CONTROL_AES18_RECEIVER = 13 */
0250 /*      HPI_CONTROL_AES18_BLOCKGENERATOR  = 14 */
0251     HPI_CONTROL_CHANNEL_MODE = 15,  /**< channel mode control. */
0252 
0253     HPI_CONTROL_BITSTREAM = 16, /**< bitstream control. */
0254     HPI_CONTROL_SAMPLECLOCK = 17,   /**< sample clock control. */
0255     HPI_CONTROL_MICROPHONE = 18,    /**< microphone control. */
0256     HPI_CONTROL_PARAMETRIC_EQ = 19, /**< parametric EQ control. */
0257     HPI_CONTROL_EQUALIZER = 19, /*HPI_CONTROL_PARAMETRIC_EQ */
0258 
0259     HPI_CONTROL_COMPANDER = 20, /**< compander control. */
0260     HPI_CONTROL_COBRANET = 21,  /**< cobranet control. */
0261     HPI_CONTROL_TONEDETECTOR = 22,  /**< tone detector control. */
0262     HPI_CONTROL_SILENCEDETECTOR = 23,   /**< silence detector control. */
0263     HPI_CONTROL_PAD = 24,   /**< tuner PAD control. */
0264     HPI_CONTROL_SRC = 25,   /**< samplerate converter control. */
0265     HPI_CONTROL_UNIVERSAL = 26, /**< universal control. */
0266 
0267 /*  !!! Update this AND hpidebug.h if you add a new control type!!!*/
0268     HPI_CONTROL_LAST_INDEX = 26 /**<highest control type ID */
0269 /* WARNING types 256 or greater impact bit packing in all AX6 DSP code */
0270 };
0271 
0272 /*******************************************/
0273 /** Adapter properties
0274 These are used in HPI_AdapterSetProperty() and HPI_AdapterGetProperty()
0275 \ingroup adapter
0276 */
0277 enum HPI_ADAPTER_PROPERTIES {
0278 /** \internal Used in dwProperty field of HPI_AdapterSetProperty() and
0279 HPI_AdapterGetProperty(). This errata applies to all ASI6000 cards with both
0280 analog and digital outputs. The CS4224 A/D+D/A has a one sample delay between
0281 left and right channels on both its input (ADC) and output (DAC).
0282 More details are available in Cirrus Logic errata ER284B2.
0283 PDF available from www.cirrus.com, released by Cirrus in 2001.
0284 */
0285     HPI_ADAPTER_PROPERTY_ERRATA_1 = 1,
0286 
0287 /** Adapter grouping property
0288 Indicates whether the adapter supports the grouping API (for ASIO and SSX2)
0289 */
0290     HPI_ADAPTER_PROPERTY_GROUPING = 2,
0291 
0292 /** Driver SSX2 property
0293 Tells the kernel driver to turn on SSX2 stream mapping.
0294 This feature is not used by the DSP. In fact the call is completely processed
0295 by the driver and is not passed on to the DSP at all.
0296 */
0297     HPI_ADAPTER_PROPERTY_ENABLE_SSX2 = 3,
0298 
0299 /** Adapter SSX2 property
0300 Indicates the state of the adapter's SSX2 setting. This setting is stored in
0301 non-volatile memory on the adapter. A typical call sequence would be to use
0302 HPI_ADAPTER_PROPERTY_SSX2_SETTING to set SSX2 on the adapter and then to reload
0303 the driver. The driver would query HPI_ADAPTER_PROPERTY_SSX2_SETTING during
0304 startup and if SSX2 is set, it would then call HPI_ADAPTER_PROPERTY_ENABLE_SSX2
0305 to enable SSX2 stream mapping within the kernel level of the driver.
0306 */
0307     HPI_ADAPTER_PROPERTY_SSX2_SETTING = 4,
0308 
0309 /** Enables/disables PCI(e) IRQ.
0310 A setting of 0 indicates that no interrupts are being generated. A DSP boot
0311 this property is set to 0. Setting to a non-zero value specifies the number
0312 of frames of audio that should be processed between interrupts. This property
0313 should be set to multiple of the mixer interval as read back from the
0314 HPI_ADAPTER_PROPERTY_INTERVAL property.
0315 */
0316     HPI_ADAPTER_PROPERTY_IRQ_RATE = 5,
0317 
0318 /** Base number for readonly properties */
0319     HPI_ADAPTER_PROPERTY_READONLYBASE = 256,
0320 
0321 /** Readonly adapter latency property.
0322 This property returns in the input and output latency in samples.
0323 Property 1 is the estimated input latency
0324 in samples, while Property 2 is that output latency in  samples.
0325 */
0326     HPI_ADAPTER_PROPERTY_LATENCY = 256,
0327 
0328 /** Readonly adapter granularity property.
0329 The granulariy is the smallest size chunk of stereo samples that is processed by
0330 the adapter.
0331 This property returns the record granularity in samples in Property 1.
0332 Property 2 returns the play granularity.
0333 */
0334     HPI_ADAPTER_PROPERTY_GRANULARITY = 257,
0335 
0336 /** Readonly adapter number of current channels property.
0337 Property 1 is the number of record channels per record device.
0338 Property 2 is the number of play channels per playback device.*/
0339     HPI_ADAPTER_PROPERTY_CURCHANNELS = 258,
0340 
0341 /** Readonly adapter software version.
0342 The SOFTWARE_VERSION property returns the version of the software running
0343 on the adapter as Major.Minor.Release.
0344 Property 1 contains Major in bits 15..8 and Minor in bits 7..0.
0345 Property 2 contains Release in bits 7..0. */
0346     HPI_ADAPTER_PROPERTY_SOFTWARE_VERSION = 259,
0347 
0348 /** Readonly adapter MAC address MSBs.
0349 The MAC_ADDRESS_MSB property returns
0350 the most significant 32 bits of the MAC address.
0351 Property 1 contains bits 47..32 of the MAC address.
0352 Property 2 contains bits 31..16 of the MAC address. */
0353     HPI_ADAPTER_PROPERTY_MAC_ADDRESS_MSB = 260,
0354 
0355 /** Readonly adapter MAC address LSBs
0356 The MAC_ADDRESS_LSB property returns
0357 the least significant 16 bits of the MAC address.
0358 Property 1 contains bits 15..0 of the MAC address. */
0359     HPI_ADAPTER_PROPERTY_MAC_ADDRESS_LSB = 261,
0360 
0361 /** Readonly extended adapter type number
0362 The EXTENDED_ADAPTER_TYPE property returns the 4 digits of an extended
0363 adapter type, i.e ASI8920-0022, 0022 is the extended type.
0364 The digits are returned as ASCII characters rather than the hex digits that
0365 are returned for the main type
0366 Property 1 returns the 1st two (left most) digits, i.e "00"
0367 in the example above, the upper byte being the left most digit.
0368 Property 2 returns the 2nd two digits, i.e "22" in the example above*/
0369     HPI_ADAPTER_PROPERTY_EXTENDED_ADAPTER_TYPE = 262,
0370 
0371 /** Readonly debug log buffer information */
0372     HPI_ADAPTER_PROPERTY_LOGTABLEN = 263,
0373     HPI_ADAPTER_PROPERTY_LOGTABBEG = 264,
0374 
0375 /** Readonly adapter IP address
0376 For 192.168.1.101
0377 Property 1 returns the 1st two (left most) digits, i.e 192*256 + 168
0378 in the example above, the upper byte being the left most digit.
0379 Property 2 returns the 2nd two digits, i.e 1*256 + 101 in the example above, */
0380     HPI_ADAPTER_PROPERTY_IP_ADDRESS = 265,
0381 
0382 /** Readonly adapter buffer processed count. Returns a buffer processed count
0383 that is incremented every time all buffers for all streams are updated. This
0384 is useful for checking completion of all stream operations across the adapter
0385 when using grouped streams.
0386 */
0387     HPI_ADAPTER_PROPERTY_BUFFER_UPDATE_COUNT = 266,
0388 
0389 /** Readonly mixer and stream intervals
0390 
0391 These intervals are  measured in mixer frames.
0392 To convert to time, divide  by the adapter samplerate.
0393 
0394 The mixer interval is the number of frames processed in one mixer iteration.
0395 The stream update interval is the interval at which streams check for and
0396 process data, and BBM host buffer counters are updated.
0397 
0398 Property 1 is the mixer interval in mixer frames.
0399 Property 2 is the stream update interval in mixer frames.
0400 */
0401     HPI_ADAPTER_PROPERTY_INTERVAL = 267,
0402 /** Adapter capabilities 1
0403 Property 1 - adapter can do multichannel (SSX1)
0404 Property 2 - adapter can do stream grouping (supports SSX2)
0405 */
0406     HPI_ADAPTER_PROPERTY_CAPS1 = 268,
0407 /** Adapter capabilities 2
0408 Property 1 - adapter can do samplerate conversion (MRX)
0409 Property 2 - adapter can do timestretch (TSX)
0410 */
0411     HPI_ADAPTER_PROPERTY_CAPS2 = 269,
0412 
0413 /** Readonly adapter sync header connection count.
0414 */
0415     HPI_ADAPTER_PROPERTY_SYNC_HEADER_CONNECTIONS = 270,
0416 /** Readonly supports SSX2 property.
0417 Indicates the adapter supports SSX2 in some mode setting. The
0418 return value is true (1) or false (0). If the current adapter
0419 mode is MONO SSX2 is disabled, even though this property will
0420 return true.
0421 */
0422     HPI_ADAPTER_PROPERTY_SUPPORTS_SSX2 = 271,
0423 /** Readonly supports PCI(e) IRQ.
0424 Indicates that the adapter in it's current mode supports interrupts
0425 across the host bus. Note, this does not imply that interrupts are
0426 enabled. Instead it indicates that they can be enabled.
0427 */
0428     HPI_ADAPTER_PROPERTY_SUPPORTS_IRQ = 272,
0429 /** Readonly supports firmware updating.
0430 Indicates that the adapter implements an interface to update firmware
0431 on the adapter.
0432 */
0433     HPI_ADAPTER_PROPERTY_SUPPORTS_FW_UPDATE = 273,
0434 /** Readonly Firmware IDs
0435 Identifiy firmware independent of individual adapter type.
0436 May be used as a filter for firmware update images.
0437 Property 1 = Bootloader ID
0438 Property 2 = Main program ID
0439 */
0440     HPI_ADAPTER_PROPERTY_FIRMWARE_ID = 274
0441 };
0442 
0443 /** Adapter mode commands
0444 
0445 Used in wQueryOrSet parameter of HPI_AdapterSetModeEx().
0446 \ingroup adapter
0447 */
0448 enum HPI_ADAPTER_MODE_CMDS {
0449     /** Set the mode to the given parameter */
0450     HPI_ADAPTER_MODE_SET = 0,
0451     /** Return 0 or error depending whether mode is valid,
0452     but don't set the mode */
0453     HPI_ADAPTER_MODE_QUERY = 1
0454 };
0455 
0456 /** Adapter Modes
0457  These are used by HPI_AdapterSetModeEx()
0458 
0459 \warning - more than 16 possible modes breaks
0460 a bitmask in the Windows WAVE DLL
0461 \ingroup adapter
0462 */
0463 enum HPI_ADAPTER_MODES {
0464 /** 4 outstream mode.
0465 - ASI6114: 1 instream
0466 - ASI6044: 4 instreams
0467 - ASI6012: 1 instream
0468 - ASI6102: no instreams
0469 - ASI6022, ASI6122: 2 instreams
0470 - ASI5111, ASI5101: 2 instreams
0471 - ASI652x, ASI662x: 2 instreams
0472 - ASI654x, ASI664x: 4 instreams
0473 */
0474     HPI_ADAPTER_MODE_4OSTREAM = 1,
0475 
0476 /** 6 outstream mode.
0477 - ASI6012: 1 instream,
0478 - ASI6022, ASI6122: 2 instreams
0479 - ASI652x, ASI662x: 4 instreams
0480 */
0481     HPI_ADAPTER_MODE_6OSTREAM = 2,
0482 
0483 /** 8 outstream mode.
0484 - ASI6114: 8 instreams
0485 - ASI6118: 8 instreams
0486 - ASI6585: 8 instreams
0487 */
0488     HPI_ADAPTER_MODE_8OSTREAM = 3,
0489 
0490 /** 16 outstream mode.
0491 - ASI6416 16 instreams
0492 - ASI6518, ASI6618 16 instreams
0493 - ASI6118 16 mono out and in streams
0494 */
0495     HPI_ADAPTER_MODE_16OSTREAM = 4,
0496 
0497 /** one outstream mode.
0498 - ASI5111 1 outstream, 1 instream
0499 */
0500     HPI_ADAPTER_MODE_1OSTREAM = 5,
0501 
0502 /** ASI504X mode 1. 12 outstream, 4 instream 0 to 48kHz sample rates
0503     (see ASI504X datasheet for more info).
0504 */
0505     HPI_ADAPTER_MODE_1 = 6,
0506 
0507 /** ASI504X mode 2. 4 outstreams, 4 instreams at 0 to 192kHz sample rates
0508     (see ASI504X datasheet for more info).
0509 */
0510     HPI_ADAPTER_MODE_2 = 7,
0511 
0512 /** ASI504X mode 3. 4 outstreams, 4 instreams at 0 to 192kHz sample rates
0513     (see ASI504X datasheet for more info).
0514 */
0515     HPI_ADAPTER_MODE_3 = 8,
0516 
0517 /** ASI504X multichannel mode.
0518     2 outstreams -> 4 line outs = 1 to 8 channel streams),
0519     4 lineins -> 1 instream (1 to 8 channel streams) at 0-48kHz.
0520     For more info see the SSX Specification.
0521 */
0522     HPI_ADAPTER_MODE_MULTICHANNEL = 9,
0523 
0524 /** 12 outstream mode.
0525 - ASI6514, ASI6614: 2 instreams
0526 - ASI6540,ASI6544: 8 instreams
0527 - ASI6640,ASI6644: 8 instreams
0528 */
0529     HPI_ADAPTER_MODE_12OSTREAM = 10,
0530 
0531 /** 9 outstream mode.
0532 - ASI6044: 8 instreams
0533 */
0534     HPI_ADAPTER_MODE_9OSTREAM = 11,
0535 
0536 /** mono mode.
0537 - ASI6416: 16 outstreams/instreams
0538 - ASI5402: 2 outstreams/instreams
0539 */
0540     HPI_ADAPTER_MODE_MONO = 12,
0541 
0542 /** Low latency mode.
0543 - ASI6416/ASI6316: 1 16 channel outstream and instream
0544 */
0545     HPI_ADAPTER_MODE_LOW_LATENCY = 13
0546 };
0547 
0548 /* Note, adapters can have more than one capability -
0549 encoding as bitfield is recommended. */
0550 #define HPI_CAPABILITY_NONE             (0)
0551 #define HPI_CAPABILITY_MPEG_LAYER3      (1)
0552 
0553 /* Set this equal to maximum capability index,
0554 Must not be greater than 32 - see axnvdef.h */
0555 #define HPI_CAPABILITY_MAX                      1
0556 /* #define HPI_CAPABILITY_AAC              2 */
0557 
0558 /******************************************* STREAM ATTRIBUTES ****/
0559 
0560 /** MPEG Ancillary Data modes
0561 
0562 The mode for the ancillary data insertion or extraction to operate in.
0563 \ingroup stream
0564 */
0565 enum HPI_MPEG_ANC_MODES {
0566     /** the MPEG frames have energy information stored in them (5 bytes per stereo frame, 3 per mono) */
0567     HPI_MPEG_ANC_HASENERGY = 0,
0568     /** the entire ancillary data field is taken up by data from the Anc data buffer
0569     On encode, the encoder will insert the energy bytes before filling the remainder
0570     of the ancillary data space with data from the ancillary data buffer.
0571     */
0572     HPI_MPEG_ANC_RAW = 1
0573 };
0574 
0575 /** Ancillary Data Alignment
0576 \ingroup instream
0577 */
0578 enum HPI_ISTREAM_MPEG_ANC_ALIGNS {
0579     /** data is packed against the end of data, then padded to the end of frame */
0580     HPI_MPEG_ANC_ALIGN_LEFT = 0,
0581     /** data is packed against the end of the frame */
0582     HPI_MPEG_ANC_ALIGN_RIGHT = 1
0583 };
0584 
0585 /** MPEG modes
0586 MPEG modes - can be used optionally for HPI_FormatCreate()
0587 parameter dwAttributes.
0588 
0589 Using any mode setting other than HPI_MPEG_MODE_DEFAULT
0590 with single channel format will return an error.
0591 \ingroup stream
0592 */
0593 enum HPI_MPEG_MODES {
0594 /** Causes the MPEG-1 Layer II bitstream to be recorded
0595 in single_channel mode when the number of channels is 1 and in stereo when the
0596 number of channels is 2. */
0597     HPI_MPEG_MODE_DEFAULT = 0,
0598     /** Standard stereo without joint-stereo compression */
0599     HPI_MPEG_MODE_STEREO = 1,
0600     /** Joint stereo  */
0601     HPI_MPEG_MODE_JOINTSTEREO = 2,
0602     /** Left and Right channels are completely independent */
0603     HPI_MPEG_MODE_DUALCHANNEL = 3
0604 };
0605 /******************************************* MIXER ATTRIBUTES ****/
0606 
0607 /* \defgroup mixer_flags Mixer flags for HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES
0608 {
0609 */
0610 #define HPI_MIXER_GET_CONTROL_MULTIPLE_CHANGED  (0)
0611 #define HPI_MIXER_GET_CONTROL_MULTIPLE_RESET    (1)
0612 /*}*/
0613 
0614 /** Commands used by HPI_MixerStore()
0615 \ingroup mixer
0616 */
0617 enum HPI_MIXER_STORE_COMMAND {
0618 /** Save all mixer control settings. */
0619     HPI_MIXER_STORE_SAVE = 1,
0620 /** Restore all controls from saved. */
0621     HPI_MIXER_STORE_RESTORE = 2,
0622 /** Delete saved control settings. */
0623     HPI_MIXER_STORE_DELETE = 3,
0624 /** Enable auto storage of some control settings. */
0625     HPI_MIXER_STORE_ENABLE = 4,
0626 /** Disable auto storage of some control settings. */
0627     HPI_MIXER_STORE_DISABLE = 5,
0628 /** Unimplemented - save the attributes of a single control. */
0629     HPI_MIXER_STORE_SAVE_SINGLE = 6
0630 };
0631 
0632 /****************************/
0633 /* CONTROL ATTRIBUTE VALUES */
0634 /****************************/
0635 
0636 /** Used by mixer plugin enable functions
0637 
0638 E.g. HPI_ParametricEq_SetState()
0639 \ingroup mixer
0640 */
0641 enum HPI_SWITCH_STATES {
0642     HPI_SWITCH_OFF = 0, /**< turn the mixer plugin on. */
0643     HPI_SWITCH_ON = 1   /**< turn the mixer plugin off. */
0644 };
0645 
0646 /* Volume control special gain values */
0647 
0648 /** volumes units are 100ths of a dB
0649 \ingroup volume
0650 */
0651 #define HPI_UNITS_PER_dB                100
0652 /** turns volume control OFF or MUTE
0653 \ingroup volume
0654 */
0655 #define HPI_GAIN_OFF                    (-100 * HPI_UNITS_PER_dB)
0656 
0657 /** channel mask specifying all channels
0658 \ingroup volume
0659 */
0660 #define HPI_BITMASK_ALL_CHANNELS        (0xFFFFFFFF)
0661 
0662 /** value returned for no signal
0663 \ingroup meter
0664 */
0665 #define HPI_METER_MINIMUM               (-150 * HPI_UNITS_PER_dB)
0666 
0667 /** autofade profiles
0668 \ingroup volume
0669 */
0670 enum HPI_VOLUME_AUTOFADES {
0671 /** log fade - dB attenuation changes linearly over time */
0672     HPI_VOLUME_AUTOFADE_LOG = 2,
0673 /** linear fade - amplitude changes linearly */
0674     HPI_VOLUME_AUTOFADE_LINEAR = 3
0675 };
0676 
0677 /** The physical encoding format of the AESEBU I/O.
0678 
0679 Used in HPI_Aesebu_Transmitter_SetFormat(), HPI_Aesebu_Receiver_SetFormat()
0680 along with related Get and Query functions
0681 \ingroup aestx
0682 */
0683 enum HPI_AESEBU_FORMATS {
0684 /** AES/EBU physical format - AES/EBU balanced "professional"  */
0685     HPI_AESEBU_FORMAT_AESEBU = 1,
0686 /** AES/EBU physical format - S/PDIF unbalanced "consumer"      */
0687     HPI_AESEBU_FORMAT_SPDIF = 2
0688 };
0689 
0690 /** AES/EBU error status bits
0691 
0692 Returned by HPI_Aesebu_Receiver_GetErrorStatus()
0693 \ingroup aesrx
0694 */
0695 enum HPI_AESEBU_ERRORS {
0696 /**  bit0: 1 when PLL is not locked */
0697     HPI_AESEBU_ERROR_NOT_LOCKED = 0x01,
0698 /**  bit1: 1 when signal quality is poor */
0699     HPI_AESEBU_ERROR_POOR_QUALITY = 0x02,
0700 /** bit2: 1 when there is a parity error */
0701     HPI_AESEBU_ERROR_PARITY_ERROR = 0x04,
0702 /**  bit3: 1 when there is a bi-phase coding violation */
0703     HPI_AESEBU_ERROR_BIPHASE_VIOLATION = 0x08,
0704 /**  bit4: 1 when the validity bit is high */
0705     HPI_AESEBU_ERROR_VALIDITY = 0x10,
0706 /**  bit5: 1 when the CRC error bit is high */
0707     HPI_AESEBU_ERROR_CRC = 0x20
0708 };
0709 
0710 /** \addtogroup pad
0711 \{
0712 */
0713 /** The text string containing the station/channel combination. */
0714 #define HPI_PAD_CHANNEL_NAME_LEN        16
0715 /** The text string containing the artist. */
0716 #define HPI_PAD_ARTIST_LEN              64
0717 /** The text string containing the title. */
0718 #define HPI_PAD_TITLE_LEN               64
0719 /** The text string containing the comment. */
0720 #define HPI_PAD_COMMENT_LEN             256
0721 /** The PTY when the tuner has not received any PTY. */
0722 #define HPI_PAD_PROGRAM_TYPE_INVALID    0xffff
0723 /** \} */
0724 
0725 /** Data types for PTY string translation.
0726 \ingroup rds
0727 */
0728 enum eHPI_RDS_type {
0729     HPI_RDS_DATATYPE_RDS = 0,   /**< RDS bitstream.*/
0730     HPI_RDS_DATATYPE_RBDS = 1   /**< RBDS bitstream.*/
0731 };
0732 
0733 /** Tuner bands
0734 
0735 Used for HPI_Tuner_SetBand(),HPI_Tuner_GetBand()
0736 \ingroup tuner
0737 */
0738 enum HPI_TUNER_BAND {
0739     HPI_TUNER_BAND_AM = 1,   /**< AM band */
0740     HPI_TUNER_BAND_FM = 2,   /**< FM band (mono) */
0741     HPI_TUNER_BAND_TV_NTSC_M = 3,    /**< NTSC-M TV band*/
0742     HPI_TUNER_BAND_TV = 3,  /* use TV_NTSC_M */
0743     HPI_TUNER_BAND_FM_STEREO = 4,    /**< FM band (stereo) */
0744     HPI_TUNER_BAND_AUX = 5,  /**< auxiliary input */
0745     HPI_TUNER_BAND_TV_PAL_BG = 6,    /**< PAL-B/G TV band*/
0746     HPI_TUNER_BAND_TV_PAL_I = 7,     /**< PAL-I TV band*/
0747     HPI_TUNER_BAND_TV_PAL_DK = 8,    /**< PAL-D/K TV band*/
0748     HPI_TUNER_BAND_TV_SECAM_L = 9,   /**< SECAM-L TV band*/
0749     HPI_TUNER_BAND_DAB = 10,
0750     HPI_TUNER_BAND_LAST = 10 /**< the index of the last tuner band. */
0751 };
0752 
0753 /** Tuner mode attributes
0754 
0755 Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
0756 \ingroup tuner
0757 
0758 */
0759 enum HPI_TUNER_MODES {
0760     HPI_TUNER_MODE_RSS = 1, /**< control  RSS */
0761     HPI_TUNER_MODE_RDS = 2  /**< control  RBDS/RDS */
0762 };
0763 
0764 /** Tuner mode attribute values
0765 
0766 Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
0767 \ingroup tuner
0768 */
0769 enum HPI_TUNER_MODE_VALUES {
0770 /* RSS attribute values */
0771     HPI_TUNER_MODE_RSS_DISABLE = 0, /**< RSS disable */
0772     HPI_TUNER_MODE_RSS_ENABLE = 1,  /**< RSS enable */
0773 
0774 /* RDS mode attributes */
0775     HPI_TUNER_MODE_RDS_DISABLE = 0, /**< RDS - disabled */
0776     HPI_TUNER_MODE_RDS_RDS = 1,  /**< RDS - RDS mode */
0777     HPI_TUNER_MODE_RDS_RBDS = 2 /**<  RDS - RBDS mode */
0778 };
0779 
0780 /** Tuner Status Bits
0781 
0782 These bitfield values are returned by a call to HPI_Tuner_GetStatus().
0783 Multiple fields are returned from a single call.
0784 \ingroup tuner
0785 */
0786 enum HPI_TUNER_STATUS_BITS {
0787     HPI_TUNER_VIDEO_COLOR_PRESENT = 0x0001, /**< video color is present. */
0788     HPI_TUNER_VIDEO_IS_60HZ = 0x0020, /**< 60 hz video detected. */
0789     HPI_TUNER_VIDEO_HORZ_SYNC_MISSING = 0x0040, /**< video HSYNC is missing. */
0790     HPI_TUNER_VIDEO_STATUS_VALID = 0x0100, /**< video status is valid. */
0791     HPI_TUNER_DIGITAL = 0x0200, /**< tuner reports digital programming. */
0792     HPI_TUNER_MULTIPROGRAM = 0x0400, /**< tuner reports multiple programs. */
0793     HPI_TUNER_PLL_LOCKED = 0x1000, /**< the tuner's PLL is locked. */
0794     HPI_TUNER_FM_STEREO = 0x2000 /**< tuner reports back FM stereo. */
0795 };
0796 
0797 /** Channel Modes
0798 Used for HPI_ChannelModeSet/Get()
0799 \ingroup channelmode
0800 */
0801 enum HPI_CHANNEL_MODES {
0802 /** Left channel out = left channel in, Right channel out = right channel in. */
0803     HPI_CHANNEL_MODE_NORMAL = 1,
0804 /** Left channel out = right channel in, Right channel out = left channel in. */
0805     HPI_CHANNEL_MODE_SWAP = 2,
0806 /** Left channel out = left channel in, Right channel out = left channel in. */
0807     HPI_CHANNEL_MODE_LEFT_TO_STEREO = 3,
0808 /** Left channel out = right channel in, Right channel out = right channel in.*/
0809     HPI_CHANNEL_MODE_RIGHT_TO_STEREO = 4,
0810 /** Left channel out = (left channel in + right channel in)/2,
0811     Right channel out = mute. */
0812     HPI_CHANNEL_MODE_STEREO_TO_LEFT = 5,
0813 /** Left channel out = mute,
0814     Right channel out = (right channel in + left channel in)/2. */
0815     HPI_CHANNEL_MODE_STEREO_TO_RIGHT = 6,
0816     HPI_CHANNEL_MODE_LAST = 6
0817 };
0818 
0819 /** SampleClock source values
0820 \ingroup sampleclock
0821 */
0822 enum HPI_SAMPLECLOCK_SOURCES {
0823 /** The sampleclock output is derived from its local samplerate generator.
0824     The local samplerate may be set using HPI_SampleClock_SetLocalRate(). */
0825     HPI_SAMPLECLOCK_SOURCE_LOCAL = 1,
0826 /** The adapter is clocked from a dedicated AES/EBU SampleClock input.*/
0827     HPI_SAMPLECLOCK_SOURCE_AESEBU_SYNC = 2,
0828 /** From external wordclock connector */
0829     HPI_SAMPLECLOCK_SOURCE_WORD = 3,
0830 /** Board-to-board header */
0831     HPI_SAMPLECLOCK_SOURCE_WORD_HEADER = 4,
0832 /** FUTURE - SMPTE clock. */
0833     HPI_SAMPLECLOCK_SOURCE_SMPTE = 5,
0834 /** One of the aesebu inputs */
0835     HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT = 6,
0836 /** From a network interface e.g. Cobranet or Livewire at either 48 or 96kHz */
0837     HPI_SAMPLECLOCK_SOURCE_NETWORK = 8,
0838 /** From previous adjacent module (ASI2416 only)*/
0839     HPI_SAMPLECLOCK_SOURCE_PREV_MODULE = 10,
0840 /** Blu link sample clock*/
0841     HPI_SAMPLECLOCK_SOURCE_BLULINK = 11,
0842 /*! Update this if you add a new clock source.*/
0843     HPI_SAMPLECLOCK_SOURCE_LAST = 11
0844 };
0845 
0846 /** Equalizer filter types. Used by HPI_ParametricEq_SetBand()
0847 \ingroup parmeq
0848 */
0849 enum HPI_FILTER_TYPE {
0850     HPI_FILTER_TYPE_BYPASS = 0, /**< filter is turned off */
0851 
0852     HPI_FILTER_TYPE_LOWSHELF = 1,   /**< EQ low shelf */
0853     HPI_FILTER_TYPE_HIGHSHELF = 2,  /**< EQ high shelf */
0854     HPI_FILTER_TYPE_EQ_BAND = 3,    /**< EQ gain */
0855 
0856     HPI_FILTER_TYPE_LOWPASS = 4,    /**< standard low pass */
0857     HPI_FILTER_TYPE_HIGHPASS = 5,   /**< standard high pass */
0858     HPI_FILTER_TYPE_BANDPASS = 6,   /**< standard band pass */
0859     HPI_FILTER_TYPE_BANDSTOP = 7    /**< standard band stop/notch */
0860 };
0861 
0862 /** Async Event sources
0863 \ingroup async
0864 */
0865 enum ASYNC_EVENT_SOURCES {
0866     HPI_ASYNC_EVENT_GPIO = 1,   /**< GPIO event. */
0867     HPI_ASYNC_EVENT_SILENCE = 2,    /**< silence event detected. */
0868     HPI_ASYNC_EVENT_TONE = 3    /**< tone event detected. */
0869 };
0870 /*******************************************/
0871 /** HPI Error codes
0872 
0873 Almost all HPI functions return an error code
0874 A return value of zero means there was no error.
0875 Otherwise one of these error codes is returned.
0876 Error codes can be converted to a descriptive string using HPI_GetErrorText()
0877 
0878 \note When a new error code is added HPI_GetErrorText() MUST be updated.
0879 \note Codes 1-100 are reserved for driver use
0880 \ingroup utility
0881 */
0882 enum HPI_ERROR_CODES {
0883     /** Message type does not exist. */
0884     HPI_ERROR_INVALID_TYPE = 100,
0885     /** Object type does not exist. */
0886     HPI_ERROR_INVALID_OBJ = 101,
0887     /** Function does not exist. */
0888     HPI_ERROR_INVALID_FUNC = 102,
0889     /** The specified object does not exist. */
0890     HPI_ERROR_INVALID_OBJ_INDEX = 103,
0891     /** Trying to access an object that has not been opened yet. */
0892     HPI_ERROR_OBJ_NOT_OPEN = 104,
0893     /** Trying to open an already open object. */
0894     HPI_ERROR_OBJ_ALREADY_OPEN = 105,
0895     /** PCI, ISA resource not valid. */
0896     HPI_ERROR_INVALID_RESOURCE = 106,
0897     /* HPI_ERROR_SUBSYSFINDADAPTERS_GETINFO= 107 */
0898     /** Default response was never updated with actual error code. */
0899     HPI_ERROR_INVALID_RESPONSE = 108,
0900     /** wSize field of response was not updated,
0901     indicating that the message was not processed. */
0902     HPI_ERROR_PROCESSING_MESSAGE = 109,
0903     /** The network did not respond in a timely manner. */
0904     HPI_ERROR_NETWORK_TIMEOUT = 110,
0905     /* An HPI handle is invalid (uninitialised?). */
0906     HPI_ERROR_INVALID_HANDLE = 111,
0907     /** A function or attribute has not been implemented yet. */
0908     HPI_ERROR_UNIMPLEMENTED = 112,
0909     /** There are too many clients attempting
0910         to access a network resource. */
0911     HPI_ERROR_NETWORK_TOO_MANY_CLIENTS = 113,
0912     /** Response buffer passed to HPI_Message
0913         was smaller than returned response.
0914         wSpecificError field of hpi response contains the required size.
0915     */
0916     HPI_ERROR_RESPONSE_BUFFER_TOO_SMALL = 114,
0917     /** The returned response did not match the sent message */
0918     HPI_ERROR_RESPONSE_MISMATCH = 115,
0919     /** A control setting that should have been cached was not. */
0920     HPI_ERROR_CONTROL_CACHING = 116,
0921     /** A message buffer in the path to the adapter was smaller
0922         than the message size.
0923         wSpecificError field of hpi response contains the actual size.
0924     */
0925     HPI_ERROR_MESSAGE_BUFFER_TOO_SMALL = 117,
0926 
0927     /* HPI_ERROR_TOO_MANY_ADAPTERS= 200 */
0928     /** Bad adpater. */
0929     HPI_ERROR_BAD_ADAPTER = 201,
0930     /** Adapter number out of range or not set properly. */
0931     HPI_ERROR_BAD_ADAPTER_NUMBER = 202,
0932     /** 2 adapters with the same adapter number. */
0933     HPI_ERROR_DUPLICATE_ADAPTER_NUMBER = 203,
0934     /** DSP code failed to bootload. Usually a DSP memory test failure. */
0935     HPI_ERROR_DSP_BOOTLOAD = 204,
0936     /** Couldn't find or open the DSP code file. */
0937     HPI_ERROR_DSP_FILE_NOT_FOUND = 206,
0938     /** Internal DSP hardware error. */
0939     HPI_ERROR_DSP_HARDWARE = 207,
0940     /** Could not allocate memory */
0941     HPI_ERROR_MEMORY_ALLOC = 208,
0942     /** Failed to correctly load/config PLD. (unused) */
0943     HPI_ERROR_PLD_LOAD = 209,
0944     /** Unexpected end of file, block length too big etc. */
0945     HPI_ERROR_DSP_FILE_FORMAT = 210,
0946 
0947     /** Found but could not open DSP code file. */
0948     HPI_ERROR_DSP_FILE_ACCESS_DENIED = 211,
0949     /** First DSP code section header not found in DSP file. */
0950     HPI_ERROR_DSP_FILE_NO_HEADER = 212,
0951     /* HPI_ERROR_DSP_FILE_READ_ERROR= 213, */
0952     /** DSP code for adapter family not found. */
0953     HPI_ERROR_DSP_SECTION_NOT_FOUND = 214,
0954     /** Other OS specific error opening DSP file. */
0955     HPI_ERROR_DSP_FILE_OTHER_ERROR = 215,
0956     /** Sharing violation opening DSP code file. */
0957     HPI_ERROR_DSP_FILE_SHARING_VIOLATION = 216,
0958     /** DSP code section header had size == 0. */
0959     HPI_ERROR_DSP_FILE_NULL_HEADER = 217,
0960 
0961     /* HPI_ERROR_FLASH = 220, */
0962 
0963     /** Flash has bad checksum */
0964     HPI_ERROR_BAD_CHECKSUM = 221,
0965     HPI_ERROR_BAD_SEQUENCE = 222,
0966     HPI_ERROR_FLASH_ERASE = 223,
0967     HPI_ERROR_FLASH_PROGRAM = 224,
0968     HPI_ERROR_FLASH_VERIFY = 225,
0969     HPI_ERROR_FLASH_TYPE = 226,
0970     HPI_ERROR_FLASH_START = 227,
0971     HPI_ERROR_FLASH_READ = 228,
0972     HPI_ERROR_FLASH_READ_NO_FILE = 229,
0973     HPI_ERROR_FLASH_SIZE = 230,
0974 
0975     /** Reserved for OEMs. */
0976     HPI_ERROR_RESERVED_1 = 290,
0977 
0978     /* HPI_ERROR_INVALID_STREAM = 300 use HPI_ERROR_INVALID_OBJ_INDEX */
0979     /** Invalid compression format. */
0980     HPI_ERROR_INVALID_FORMAT = 301,
0981     /** Invalid format samplerate */
0982     HPI_ERROR_INVALID_SAMPLERATE = 302,
0983     /** Invalid format number of channels. */
0984     HPI_ERROR_INVALID_CHANNELS = 303,
0985     /** Invalid format bitrate. */
0986     HPI_ERROR_INVALID_BITRATE = 304,
0987     /** Invalid datasize used for stream read/write. */
0988     HPI_ERROR_INVALID_DATASIZE = 305,
0989     /* HPI_ERROR_BUFFER_FULL = 306 use HPI_ERROR_INVALID_DATASIZE */
0990     /* HPI_ERROR_BUFFER_EMPTY = 307 use HPI_ERROR_INVALID_DATASIZE */
0991     /** Null data pointer used for stream read/write. */
0992     HPI_ERROR_INVALID_DATA_POINTER = 308,
0993     /** Packet ordering error for stream read/write. */
0994     HPI_ERROR_INVALID_PACKET_ORDER = 309,
0995 
0996     /** Object can't do requested operation in its current
0997         state, eg set format, change rec mux state while recording.*/
0998     HPI_ERROR_INVALID_OPERATION = 310,
0999 
1000     /** Where a SRG is shared amongst streams, an incompatible samplerate
1001         is one that is different to any currently active stream. */
1002     HPI_ERROR_INCOMPATIBLE_SAMPLERATE = 311,
1003     /** Adapter mode is illegal.*/
1004     HPI_ERROR_BAD_ADAPTER_MODE = 312,
1005 
1006     /** There have been too many attempts to set the adapter's
1007     capabilities (using bad keys), the card should be returned
1008     to ASI if further capabilities updates are required */
1009     HPI_ERROR_TOO_MANY_CAPABILITY_CHANGE_ATTEMPTS = 313,
1010     /** Streams on different adapters cannot be grouped. */
1011     HPI_ERROR_NO_INTERADAPTER_GROUPS = 314,
1012     /** Streams on different DSPs cannot be grouped. */
1013     HPI_ERROR_NO_INTERDSP_GROUPS = 315,
1014     /** Stream wait cancelled before threshold reached. */
1015     HPI_ERROR_WAIT_CANCELLED = 316,
1016     /** A character string is invalid. */
1017     HPI_ERROR_INVALID_STRING = 317,
1018 
1019     /** Invalid mixer node for this adapter. */
1020     HPI_ERROR_INVALID_NODE = 400,
1021     /** Invalid control. */
1022     HPI_ERROR_INVALID_CONTROL = 401,
1023     /** Invalid control value was passed. */
1024     HPI_ERROR_INVALID_CONTROL_VALUE = 402,
1025     /** Control attribute not supported by this control. */
1026     HPI_ERROR_INVALID_CONTROL_ATTRIBUTE = 403,
1027     /** Control is disabled. */
1028     HPI_ERROR_CONTROL_DISABLED = 404,
1029     /** I2C transaction failed due to a missing ACK. */
1030     HPI_ERROR_CONTROL_I2C_MISSING_ACK = 405,
1031     HPI_ERROR_I2C_MISSING_ACK = 405,
1032     /** Control is busy, or coming out of
1033     reset and cannot be accessed at this time. */
1034     HPI_ERROR_CONTROL_NOT_READY = 407,
1035 
1036     /** Non volatile memory */
1037     HPI_ERROR_NVMEM_BUSY = 450,
1038     HPI_ERROR_NVMEM_FULL = 451,
1039     HPI_ERROR_NVMEM_FAIL = 452,
1040 
1041     /** I2C */
1042     HPI_ERROR_I2C_BAD_ADR = 460,
1043 
1044     /** Entity type did not match requested type */
1045     HPI_ERROR_ENTITY_TYPE_MISMATCH = 470,
1046     /** Entity item count did not match requested count */
1047     HPI_ERROR_ENTITY_ITEM_COUNT = 471,
1048     /** Entity type is not one of the valid types */
1049     HPI_ERROR_ENTITY_TYPE_INVALID = 472,
1050     /** Entity role is not one of the valid roles */
1051     HPI_ERROR_ENTITY_ROLE_INVALID = 473,
1052     /** Entity size doesn't match target size */
1053     HPI_ERROR_ENTITY_SIZE_MISMATCH = 474,
1054 
1055     /* AES18 specific errors were 500..507 */
1056 
1057     /** custom error to use for debugging */
1058     HPI_ERROR_CUSTOM = 600,
1059 
1060     /** hpioct32.c can't obtain mutex */
1061     HPI_ERROR_MUTEX_TIMEOUT = 700,
1062 
1063     /** Backend errors used to be greater than this.
1064         \deprecated Now, all backends return only errors defined here in hpi.h
1065     */
1066     HPI_ERROR_BACKEND_BASE = 900,
1067 
1068     /** Communication with DSP failed */
1069     HPI_ERROR_DSP_COMMUNICATION = 900
1070         /* Note that the dsp communication error is set to this value so that
1071            it remains compatible with any software that expects such errors
1072            to be backend errors i.e. >= 900.
1073            Do not define any new error codes with values > 900.
1074          */
1075 };
1076 
1077 /** \defgroup maximums HPI maximum values
1078 \{
1079 */
1080 /** Maximum number of PCI HPI adapters */
1081 #define HPI_MAX_ADAPTERS                20
1082 /** Maximum number of in or out streams per adapter */
1083 #define HPI_MAX_STREAMS                 16
1084 #define HPI_MAX_CHANNELS                2   /* per stream */
1085 #define HPI_MAX_NODES                   8   /* per mixer ? */
1086 #define HPI_MAX_CONTROLS                4   /* per node ? */
1087 /** maximum number of ancillary bytes per MPEG frame */
1088 #define HPI_MAX_ANC_BYTES_PER_FRAME     (64)
1089 #define HPI_STRING_LEN                  16
1090 
1091 /** Networked adapters have index >= 100 */
1092 #define HPI_MIN_NETWORK_ADAPTER_IDX 100
1093 
1094 /** Velocity units */
1095 #define HPI_OSTREAM_VELOCITY_UNITS      4096
1096 /** OutStream timescale units */
1097 #define HPI_OSTREAM_TIMESCALE_UNITS     10000
1098 /** OutStream timescale passthrough - turns timescaling on in passthough mode */
1099 #define HPI_OSTREAM_TIMESCALE_PASSTHROUGH       99999
1100 
1101 /**\}*/
1102 
1103 /**************/
1104 /* STRUCTURES */
1105 #ifndef DISABLE_PRAGMA_PACK1
1106 #pragma pack(push, 1)
1107 #endif
1108 
1109 /** Structure containing sample format information.
1110     See also HPI_FormatCreate().
1111   */
1112 struct hpi_format {
1113     u32 sample_rate;
1114                 /**< 11025, 32000, 44100 ... */
1115     u32 bit_rate;         /**< for MPEG */
1116     u32 attributes;
1117                 /**< Stereo/JointStereo/Mono */
1118     u16 mode_legacy;
1119                 /**< Legacy ancillary mode or idle bit  */
1120     u16 unused;       /**< Unused */
1121     u16 channels;     /**< 1,2..., (or ancillary mode or idle bit */
1122     u16 format;   /**< HPI_FORMAT_PCM16, _MPEG etc. see #HPI_FORMATS. */
1123 };
1124 
1125 struct hpi_anc_frame {
1126     u32 valid_bits_in_this_frame;
1127     u8 b_data[HPI_MAX_ANC_BYTES_PER_FRAME];
1128 };
1129 
1130 /** An object for containing a single async event.
1131 */
1132 struct hpi_async_event {
1133     u16 event_type; /**< type of event. \sa async_event  */
1134     u16 sequence; /**< Sequence number, allows lost event detection */
1135     u32 state; /**< New state */
1136     u32 h_object; /**< handle to the object returning the event. */
1137     union {
1138         struct {
1139             u16 index; /**< GPIO bit index. */
1140         } gpio;
1141         struct {
1142             u16 node_index; /**< what node is the control on ? */
1143             u16 node_type; /**< what type of node is the control on ? */
1144         } control;
1145     } u;
1146 };
1147 
1148 #ifndef DISABLE_PRAGMA_PACK1
1149 #pragma pack(pop)
1150 #endif
1151 
1152 /*****************/
1153 /* HPI FUNCTIONS */
1154 /*****************/
1155 
1156 /* Stream */
1157 u16 hpi_stream_estimate_buffer_size(struct hpi_format *pF,
1158     u32 host_polling_rate_in_milli_seconds, u32 *recommended_buffer_size);
1159 
1160 /*************/
1161 /* SubSystem */
1162 /*************/
1163 
1164 u16 hpi_subsys_get_version_ex(u32 *pversion_ex);
1165 
1166 u16 hpi_subsys_get_num_adapters(int *pn_num_adapters);
1167 
1168 u16 hpi_subsys_get_adapter(int iterator, u32 *padapter_index,
1169     u16 *pw_adapter_type);
1170 
1171 /***********/
1172 /* Adapter */
1173 /***********/
1174 
1175 u16 hpi_adapter_open(u16 adapter_index);
1176 
1177 u16 hpi_adapter_close(u16 adapter_index);
1178 
1179 u16 hpi_adapter_get_info(u16 adapter_index, u16 *pw_num_outstreams,
1180     u16 *pw_num_instreams, u16 *pw_version, u32 *pserial_number,
1181     u16 *pw_adapter_type);
1182 
1183 u16 hpi_adapter_get_module_by_index(u16 adapter_index, u16 module_index,
1184     u16 *pw_num_outputs, u16 *pw_num_inputs, u16 *pw_version,
1185     u32 *pserial_number, u16 *pw_module_type, u32 *ph_module);
1186 
1187 u16 hpi_adapter_set_mode(u16 adapter_index, u32 adapter_mode);
1188 
1189 u16 hpi_adapter_set_mode_ex(u16 adapter_index, u32 adapter_mode,
1190     u16 query_or_set);
1191 
1192 u16 hpi_adapter_get_mode(u16 adapter_index, u32 *padapter_mode);
1193 
1194 u16 hpi_adapter_get_assert2(u16 adapter_index, u16 *p_assert_count,
1195     char *psz_assert, u32 *p_param1, u32 *p_param2,
1196     u32 *p_dsp_string_addr, u16 *p_processor_id);
1197 
1198 u16 hpi_adapter_test_assert(u16 adapter_index, u16 assert_id);
1199 
1200 u16 hpi_adapter_enable_capability(u16 adapter_index, u16 capability, u32 key);
1201 
1202 u16 hpi_adapter_self_test(u16 adapter_index);
1203 
1204 u16 hpi_adapter_debug_read(u16 adapter_index, u32 dsp_address, char *p_bytes,
1205     int *count_bytes);
1206 
1207 u16 hpi_adapter_set_property(u16 adapter_index, u16 property, u16 paramter1,
1208     u16 paramter2);
1209 
1210 u16 hpi_adapter_get_property(u16 adapter_index, u16 property,
1211     u16 *pw_paramter1, u16 *pw_paramter2);
1212 
1213 u16 hpi_adapter_enumerate_property(u16 adapter_index, u16 index,
1214     u16 what_to_enumerate, u16 property_index, u32 *psetting);
1215 /*************/
1216 /* OutStream */
1217 /*************/
1218 u16 hpi_outstream_open(u16 adapter_index, u16 outstream_index,
1219     u32 *ph_outstream);
1220 
1221 u16 hpi_outstream_close(u32 h_outstream);
1222 
1223 u16 hpi_outstream_get_info_ex(u32 h_outstream, u16 *pw_state,
1224     u32 *pbuffer_size, u32 *pdata_to_play, u32 *psamples_played,
1225     u32 *pauxiliary_data_to_play);
1226 
1227 u16 hpi_outstream_write_buf(u32 h_outstream, const u8 *pb_write_buf,
1228     u32 bytes_to_write, const struct hpi_format *p_format);
1229 
1230 u16 hpi_outstream_start(u32 h_outstream);
1231 
1232 u16 hpi_outstream_wait_start(u32 h_outstream);
1233 
1234 u16 hpi_outstream_stop(u32 h_outstream);
1235 
1236 u16 hpi_outstream_sinegen(u32 h_outstream);
1237 
1238 u16 hpi_outstream_reset(u32 h_outstream);
1239 
1240 u16 hpi_outstream_query_format(u32 h_outstream, struct hpi_format *p_format);
1241 
1242 u16 hpi_outstream_set_format(u32 h_outstream, struct hpi_format *p_format);
1243 
1244 u16 hpi_outstream_set_punch_in_out(u32 h_outstream, u32 punch_in_sample,
1245     u32 punch_out_sample);
1246 
1247 u16 hpi_outstream_set_velocity(u32 h_outstream, short velocity);
1248 
1249 u16 hpi_outstream_ancillary_reset(u32 h_outstream, u16 mode);
1250 
1251 u16 hpi_outstream_ancillary_get_info(u32 h_outstream, u32 *pframes_available);
1252 
1253 u16 hpi_outstream_ancillary_read(u32 h_outstream,
1254     struct hpi_anc_frame *p_anc_frame_buffer,
1255     u32 anc_frame_buffer_size_in_bytes,
1256     u32 number_of_ancillary_frames_to_read);
1257 
1258 u16 hpi_outstream_set_time_scale(u32 h_outstream, u32 time_scaleX10000);
1259 
1260 u16 hpi_outstream_host_buffer_allocate(u32 h_outstream, u32 size_in_bytes);
1261 
1262 u16 hpi_outstream_host_buffer_free(u32 h_outstream);
1263 
1264 u16 hpi_outstream_group_add(u32 h_outstream, u32 h_stream);
1265 
1266 u16 hpi_outstream_group_get_map(u32 h_outstream, u32 *poutstream_map,
1267     u32 *pinstream_map);
1268 
1269 u16 hpi_outstream_group_reset(u32 h_outstream);
1270 
1271 /************/
1272 /* InStream */
1273 /************/
1274 u16 hpi_instream_open(u16 adapter_index, u16 instream_index,
1275     u32 *ph_instream);
1276 
1277 u16 hpi_instream_close(u32 h_instream);
1278 
1279 u16 hpi_instream_query_format(u32 h_instream,
1280     const struct hpi_format *p_format);
1281 
1282 u16 hpi_instream_set_format(u32 h_instream,
1283     const struct hpi_format *p_format);
1284 
1285 u16 hpi_instream_read_buf(u32 h_instream, u8 *pb_read_buf, u32 bytes_to_read);
1286 
1287 u16 hpi_instream_start(u32 h_instream);
1288 
1289 u16 hpi_instream_wait_start(u32 h_instream);
1290 
1291 u16 hpi_instream_stop(u32 h_instream);
1292 
1293 u16 hpi_instream_reset(u32 h_instream);
1294 
1295 u16 hpi_instream_get_info_ex(u32 h_instream, u16 *pw_state, u32 *pbuffer_size,
1296     u32 *pdata_recorded, u32 *psamples_recorded,
1297     u32 *pauxiliary_data_recorded);
1298 
1299 u16 hpi_instream_ancillary_reset(u32 h_instream, u16 bytes_per_frame,
1300     u16 mode, u16 alignment, u16 idle_bit);
1301 
1302 u16 hpi_instream_ancillary_get_info(u32 h_instream, u32 *pframe_space);
1303 
1304 u16 hpi_instream_ancillary_write(u32 h_instream,
1305     const struct hpi_anc_frame *p_anc_frame_buffer,
1306     u32 anc_frame_buffer_size_in_bytes,
1307     u32 number_of_ancillary_frames_to_write);
1308 
1309 u16 hpi_instream_host_buffer_allocate(u32 h_instream, u32 size_in_bytes);
1310 
1311 u16 hpi_instream_host_buffer_free(u32 h_instream);
1312 
1313 u16 hpi_instream_group_add(u32 h_instream, u32 h_stream);
1314 
1315 u16 hpi_instream_group_get_map(u32 h_instream, u32 *poutstream_map,
1316     u32 *pinstream_map);
1317 
1318 u16 hpi_instream_group_reset(u32 h_instream);
1319 
1320 /*********/
1321 /* Mixer */
1322 /*********/
1323 u16 hpi_mixer_open(u16 adapter_index, u32 *ph_mixer);
1324 
1325 u16 hpi_mixer_close(u32 h_mixer);
1326 
1327 u16 hpi_mixer_get_control(u32 h_mixer, u16 src_node_type,
1328     u16 src_node_type_index, u16 dst_node_type, u16 dst_node_type_index,
1329     u16 control_type, u32 *ph_control);
1330 
1331 u16 hpi_mixer_get_control_by_index(u32 h_mixer, u16 control_index,
1332     u16 *pw_src_node_type, u16 *pw_src_node_index, u16 *pw_dst_node_type,
1333     u16 *pw_dst_node_index, u16 *pw_control_type, u32 *ph_control);
1334 
1335 u16 hpi_mixer_store(u32 h_mixer, enum HPI_MIXER_STORE_COMMAND command,
1336     u16 index);
1337 /************/
1338 /* Controls */
1339 /************/
1340 /******************/
1341 /* Volume control */
1342 /******************/
1343 u16 hpi_volume_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]
1344     );
1345 
1346 u16 hpi_volume_get_gain(u32 h_control,
1347     short an_gain0_01dB_out[HPI_MAX_CHANNELS]
1348     );
1349 
1350 u16 hpi_volume_set_mute(u32 h_control, u32 mute);
1351 
1352 u16 hpi_volume_get_mute(u32 h_control, u32 *mute);
1353 
1354 #define hpi_volume_get_range hpi_volume_query_range
1355 u16 hpi_volume_query_range(u32 h_control, short *min_gain_01dB,
1356     short *max_gain_01dB, short *step_gain_01dB);
1357 
1358 u16 hpi_volume_query_channels(const u32 h_control, u32 *p_channels);
1359 
1360 u16 hpi_volume_auto_fade(u32 h_control,
1361     short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms);
1362 
1363 u16 hpi_volume_auto_fade_profile(u32 h_control,
1364     short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms,
1365     u16 profile);
1366 
1367 u16 hpi_volume_query_auto_fade_profile(const u32 h_control, const u32 i,
1368     u16 *profile);
1369 
1370 /*****************/
1371 /* Level control */
1372 /*****************/
1373 u16 hpi_level_query_range(u32 h_control, short *min_gain_01dB,
1374     short *max_gain_01dB, short *step_gain_01dB);
1375 
1376 u16 hpi_level_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]
1377     );
1378 
1379 u16 hpi_level_get_gain(u32 h_control,
1380     short an_gain0_01dB_out[HPI_MAX_CHANNELS]
1381     );
1382 
1383 /*****************/
1384 /* Meter control */
1385 /*****************/
1386 u16 hpi_meter_query_channels(const u32 h_meter, u32 *p_channels);
1387 
1388 u16 hpi_meter_get_peak(u32 h_control,
1389     short an_peak0_01dB_out[HPI_MAX_CHANNELS]
1390     );
1391 
1392 u16 hpi_meter_get_rms(u32 h_control, short an_peak0_01dB_out[HPI_MAX_CHANNELS]
1393     );
1394 
1395 u16 hpi_meter_set_peak_ballistics(u32 h_control, u16 attack, u16 decay);
1396 
1397 u16 hpi_meter_set_rms_ballistics(u32 h_control, u16 attack, u16 decay);
1398 
1399 u16 hpi_meter_get_peak_ballistics(u32 h_control, u16 *attack, u16 *decay);
1400 
1401 u16 hpi_meter_get_rms_ballistics(u32 h_control, u16 *attack, u16 *decay);
1402 
1403 /************************/
1404 /* ChannelMode control */
1405 /************************/
1406 u16 hpi_channel_mode_query_mode(const u32 h_mode, const u32 index,
1407     u16 *pw_mode);
1408 
1409 u16 hpi_channel_mode_set(u32 h_control, u16 mode);
1410 
1411 u16 hpi_channel_mode_get(u32 h_control, u16 *mode);
1412 
1413 /*****************/
1414 /* Tuner control */
1415 /*****************/
1416 u16 hpi_tuner_query_band(const u32 h_tuner, const u32 index, u16 *pw_band);
1417 
1418 u16 hpi_tuner_set_band(u32 h_control, u16 band);
1419 
1420 u16 hpi_tuner_get_band(u32 h_control, u16 *pw_band);
1421 
1422 u16 hpi_tuner_query_frequency(const u32 h_tuner, const u32 index,
1423     const u16 band, u32 *pfreq);
1424 
1425 u16 hpi_tuner_set_frequency(u32 h_control, u32 freq_ink_hz);
1426 
1427 u16 hpi_tuner_get_frequency(u32 h_control, u32 *pw_freq_ink_hz);
1428 
1429 u16 hpi_tuner_get_rf_level(u32 h_control, short *pw_level);
1430 
1431 u16 hpi_tuner_get_raw_rf_level(u32 h_control, short *pw_level);
1432 
1433 u16 hpi_tuner_query_gain(const u32 h_tuner, const u32 index, u16 *pw_gain);
1434 
1435 u16 hpi_tuner_set_gain(u32 h_control, short gain);
1436 
1437 u16 hpi_tuner_get_gain(u32 h_control, short *pn_gain);
1438 
1439 u16 hpi_tuner_get_status(u32 h_control, u16 *pw_status_mask, u16 *pw_status);
1440 
1441 u16 hpi_tuner_set_mode(u32 h_control, u32 mode, u32 value);
1442 
1443 u16 hpi_tuner_get_mode(u32 h_control, u32 mode, u32 *pn_value);
1444 
1445 u16 hpi_tuner_get_rds(u32 h_control, char *p_rds_data);
1446 
1447 u16 hpi_tuner_query_deemphasis(const u32 h_tuner, const u32 index,
1448     const u16 band, u32 *pdeemphasis);
1449 
1450 u16 hpi_tuner_set_deemphasis(u32 h_control, u32 deemphasis);
1451 u16 hpi_tuner_get_deemphasis(u32 h_control, u32 *pdeemphasis);
1452 
1453 u16 hpi_tuner_query_program(const u32 h_tuner, u32 *pbitmap_program);
1454 
1455 u16 hpi_tuner_set_program(u32 h_control, u32 program);
1456 
1457 u16 hpi_tuner_get_program(u32 h_control, u32 *pprogram);
1458 
1459 u16 hpi_tuner_get_hd_radio_dsp_version(u32 h_control, char *psz_dsp_version,
1460     const u32 string_size);
1461 
1462 u16 hpi_tuner_get_hd_radio_sdk_version(u32 h_control, char *psz_sdk_version,
1463     const u32 string_size);
1464 
1465 u16 hpi_tuner_get_hd_radio_signal_quality(u32 h_control, u32 *pquality);
1466 
1467 u16 hpi_tuner_get_hd_radio_signal_blend(u32 h_control, u32 *pblend);
1468 
1469 u16 hpi_tuner_set_hd_radio_signal_blend(u32 h_control, const u32 blend);
1470 
1471 /***************/
1472 /* PAD control */
1473 /***************/
1474 
1475 u16 hpi_pad_get_channel_name(u32 h_control, char *psz_string,
1476     const u32 string_length);
1477 
1478 u16 hpi_pad_get_artist(u32 h_control, char *psz_string,
1479     const u32 string_length);
1480 
1481 u16 hpi_pad_get_title(u32 h_control, char *psz_string,
1482     const u32 string_length);
1483 
1484 u16 hpi_pad_get_comment(u32 h_control, char *psz_string,
1485     const u32 string_length);
1486 
1487 u16 hpi_pad_get_program_type(u32 h_control, u32 *ppTY);
1488 
1489 u16 hpi_pad_get_rdsPI(u32 h_control, u32 *ppI);
1490 
1491 u16 hpi_pad_get_program_type_string(u32 h_control, const u32 data_type,
1492     const u32 pTY, char *psz_string, const u32 string_length);
1493 
1494 /****************************/
1495 /* AES/EBU Receiver control */
1496 /****************************/
1497 u16 hpi_aesebu_receiver_query_format(const u32 h_aes_rx, const u32 index,
1498     u16 *pw_format);
1499 
1500 u16 hpi_aesebu_receiver_set_format(u32 h_control, u16 source);
1501 
1502 u16 hpi_aesebu_receiver_get_format(u32 h_control, u16 *pw_source);
1503 
1504 u16 hpi_aesebu_receiver_get_sample_rate(u32 h_control, u32 *psample_rate);
1505 
1506 u16 hpi_aesebu_receiver_get_user_data(u32 h_control, u16 index, u16 *pw_data);
1507 
1508 u16 hpi_aesebu_receiver_get_channel_status(u32 h_control, u16 index,
1509     u16 *pw_data);
1510 
1511 u16 hpi_aesebu_receiver_get_error_status(u32 h_control, u16 *pw_error_data);
1512 
1513 /*******************************/
1514 /* AES/EBU Transmitter control */
1515 /*******************************/
1516 u16 hpi_aesebu_transmitter_set_sample_rate(u32 h_control, u32 sample_rate);
1517 
1518 u16 hpi_aesebu_transmitter_set_user_data(u32 h_control, u16 index, u16 data);
1519 
1520 u16 hpi_aesebu_transmitter_set_channel_status(u32 h_control, u16 index,
1521     u16 data);
1522 
1523 u16 hpi_aesebu_transmitter_get_channel_status(u32 h_control, u16 index,
1524     u16 *pw_data);
1525 
1526 u16 hpi_aesebu_transmitter_query_format(const u32 h_aes_tx, const u32 index,
1527     u16 *pw_format);
1528 
1529 u16 hpi_aesebu_transmitter_set_format(u32 h_control, u16 output_format);
1530 
1531 u16 hpi_aesebu_transmitter_get_format(u32 h_control, u16 *pw_output_format);
1532 
1533 /***********************/
1534 /* Multiplexer control */
1535 /***********************/
1536 u16 hpi_multiplexer_set_source(u32 h_control, u16 source_node_type,
1537     u16 source_node_index);
1538 
1539 u16 hpi_multiplexer_get_source(u32 h_control, u16 *source_node_type,
1540     u16 *source_node_index);
1541 
1542 u16 hpi_multiplexer_query_source(u32 h_control, u16 index,
1543     u16 *source_node_type, u16 *source_node_index);
1544 
1545 /***************/
1546 /* Vox control */
1547 /***************/
1548 u16 hpi_vox_set_threshold(u32 h_control, short an_gain0_01dB);
1549 
1550 u16 hpi_vox_get_threshold(u32 h_control, short *an_gain0_01dB);
1551 
1552 /*********************/
1553 /* Bitstream control */
1554 /*********************/
1555 u16 hpi_bitstream_set_clock_edge(u32 h_control, u16 edge_type);
1556 
1557 u16 hpi_bitstream_set_data_polarity(u32 h_control, u16 polarity);
1558 
1559 u16 hpi_bitstream_get_activity(u32 h_control, u16 *pw_clk_activity,
1560     u16 *pw_data_activity);
1561 
1562 /***********************/
1563 /* SampleClock control */
1564 /***********************/
1565 
1566 u16 hpi_sample_clock_query_source(const u32 h_clock, const u32 index,
1567     u16 *pw_source);
1568 
1569 u16 hpi_sample_clock_set_source(u32 h_control, u16 source);
1570 
1571 u16 hpi_sample_clock_get_source(u32 h_control, u16 *pw_source);
1572 
1573 u16 hpi_sample_clock_query_source_index(const u32 h_clock, const u32 index,
1574     const u32 source, u16 *pw_source_index);
1575 
1576 u16 hpi_sample_clock_set_source_index(u32 h_control, u16 source_index);
1577 
1578 u16 hpi_sample_clock_get_source_index(u32 h_control, u16 *pw_source_index);
1579 
1580 u16 hpi_sample_clock_get_sample_rate(u32 h_control, u32 *psample_rate);
1581 
1582 u16 hpi_sample_clock_query_local_rate(const u32 h_clock, const u32 index,
1583     u32 *psource);
1584 
1585 u16 hpi_sample_clock_set_local_rate(u32 h_control, u32 sample_rate);
1586 
1587 u16 hpi_sample_clock_get_local_rate(u32 h_control, u32 *psample_rate);
1588 
1589 u16 hpi_sample_clock_set_auto(u32 h_control, u32 enable);
1590 
1591 u16 hpi_sample_clock_get_auto(u32 h_control, u32 *penable);
1592 
1593 u16 hpi_sample_clock_set_local_rate_lock(u32 h_control, u32 lock);
1594 
1595 u16 hpi_sample_clock_get_local_rate_lock(u32 h_control, u32 *plock);
1596 
1597 /***********************/
1598 /* Microphone control */
1599 /***********************/
1600 u16 hpi_microphone_set_phantom_power(u32 h_control, u16 on_off);
1601 
1602 u16 hpi_microphone_get_phantom_power(u32 h_control, u16 *pw_on_off);
1603 
1604 /********************************/
1605 /* Parametric Equalizer control */
1606 /********************************/
1607 u16 hpi_parametric_eq_get_info(u32 h_control, u16 *pw_number_of_bands,
1608     u16 *pw_enabled);
1609 
1610 u16 hpi_parametric_eq_set_state(u32 h_control, u16 on_off);
1611 
1612 u16 hpi_parametric_eq_set_band(u32 h_control, u16 index, u16 type,
1613     u32 frequency_hz, short q100, short gain0_01dB);
1614 
1615 u16 hpi_parametric_eq_get_band(u32 h_control, u16 index, u16 *pn_type,
1616     u32 *pfrequency_hz, short *pnQ100, short *pn_gain0_01dB);
1617 
1618 u16 hpi_parametric_eq_get_coeffs(u32 h_control, u16 index, short coeffs[5]
1619     );
1620 
1621 /*******************************/
1622 /* Compressor Expander control */
1623 /*******************************/
1624 
1625 u16 hpi_compander_set_enable(u32 h_control, u32 on);
1626 
1627 u16 hpi_compander_get_enable(u32 h_control, u32 *pon);
1628 
1629 u16 hpi_compander_set_makeup_gain(u32 h_control, short makeup_gain0_01dB);
1630 
1631 u16 hpi_compander_get_makeup_gain(u32 h_control, short *pn_makeup_gain0_01dB);
1632 
1633 u16 hpi_compander_set_attack_time_constant(u32 h_control, u32 index,
1634     u32 attack);
1635 
1636 u16 hpi_compander_get_attack_time_constant(u32 h_control, u32 index,
1637     u32 *pw_attack);
1638 
1639 u16 hpi_compander_set_decay_time_constant(u32 h_control, u32 index,
1640     u32 decay);
1641 
1642 u16 hpi_compander_get_decay_time_constant(u32 h_control, u32 index,
1643     u32 *pw_decay);
1644 
1645 u16 hpi_compander_set_threshold(u32 h_control, u32 index,
1646     short threshold0_01dB);
1647 
1648 u16 hpi_compander_get_threshold(u32 h_control, u32 index,
1649     short *pn_threshold0_01dB);
1650 
1651 u16 hpi_compander_set_ratio(u32 h_control, u32 index, u32 ratio100);
1652 
1653 u16 hpi_compander_get_ratio(u32 h_control, u32 index, u32 *pw_ratio100);
1654 
1655 /********************/
1656 /* Cobranet control */
1657 /********************/
1658 u16 hpi_cobranet_hmi_write(u32 h_control, u32 hmi_address, u32 byte_count,
1659     u8 *pb_data);
1660 
1661 u16 hpi_cobranet_hmi_read(u32 h_control, u32 hmi_address, u32 max_byte_count,
1662     u32 *pbyte_count, u8 *pb_data);
1663 
1664 u16 hpi_cobranet_hmi_get_status(u32 h_control, u32 *pstatus,
1665     u32 *preadable_size, u32 *pwriteable_size);
1666 
1667 u16 hpi_cobranet_get_ip_address(u32 h_control, u32 *pdw_ip_address);
1668 
1669 u16 hpi_cobranet_set_ip_address(u32 h_control, u32 dw_ip_address);
1670 
1671 u16 hpi_cobranet_get_static_ip_address(u32 h_control, u32 *pdw_ip_address);
1672 
1673 u16 hpi_cobranet_set_static_ip_address(u32 h_control, u32 dw_ip_address);
1674 
1675 u16 hpi_cobranet_get_macaddress(u32 h_control, u32 *p_mac_msbs,
1676     u32 *p_mac_lsbs);
1677 
1678 /*************************/
1679 /* Tone Detector control */
1680 /*************************/
1681 u16 hpi_tone_detector_get_state(u32 hC, u32 *state);
1682 
1683 u16 hpi_tone_detector_set_enable(u32 hC, u32 enable);
1684 
1685 u16 hpi_tone_detector_get_enable(u32 hC, u32 *enable);
1686 
1687 u16 hpi_tone_detector_set_event_enable(u32 hC, u32 event_enable);
1688 
1689 u16 hpi_tone_detector_get_event_enable(u32 hC, u32 *event_enable);
1690 
1691 u16 hpi_tone_detector_set_threshold(u32 hC, int threshold);
1692 
1693 u16 hpi_tone_detector_get_threshold(u32 hC, int *threshold);
1694 
1695 u16 hpi_tone_detector_get_frequency(u32 hC, u32 index, u32 *frequency);
1696 
1697 /****************************/
1698 /* Silence Detector control */
1699 /****************************/
1700 u16 hpi_silence_detector_get_state(u32 hC, u32 *state);
1701 
1702 u16 hpi_silence_detector_set_enable(u32 hC, u32 enable);
1703 
1704 u16 hpi_silence_detector_get_enable(u32 hC, u32 *enable);
1705 
1706 u16 hpi_silence_detector_set_event_enable(u32 hC, u32 event_enable);
1707 
1708 u16 hpi_silence_detector_get_event_enable(u32 hC, u32 *event_enable);
1709 
1710 u16 hpi_silence_detector_set_delay(u32 hC, u32 delay);
1711 
1712 u16 hpi_silence_detector_get_delay(u32 hC, u32 *delay);
1713 
1714 u16 hpi_silence_detector_set_threshold(u32 hC, int threshold);
1715 
1716 u16 hpi_silence_detector_get_threshold(u32 hC, int *threshold);
1717 /*********************/
1718 /* Utility functions */
1719 /*********************/
1720 
1721 u16 hpi_format_create(struct hpi_format *p_format, u16 channels, u16 format,
1722     u32 sample_rate, u32 bit_rate, u32 attributes);
1723 
1724 #endif   /*_HPI_H_ */