blob: 20887241a3ae0e1d686c9851baa2dafd29e028f0 [file] [log] [blame]
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001/******************************************************************************
2
3 AudioScience HPI driver
Eliot Blennerhassett509a7142011-07-22 15:53:04 +12004 Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02005
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of version 2 of the GNU General Public License as
8 published by the Free Software Foundation;
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19*/
20/** \file hpi.h
21
22 AudioScience Hardware Programming Interface (HPI)
23 public API definition.
24
25 The HPI is a low-level hardware abstraction layer to all
26 AudioScience digital audio adapters
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +020027
28(C) Copyright AudioScience Inc. 1998-2010
Eliot Blennerhassettba944552011-02-10 17:26:04 +130029*/
30
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +020031#ifndef _HPI_H_
32#define _HPI_H_
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +020033
34#include <linux/types.h>
Eliot Blennerhassetta287ca22011-02-10 17:26:17 +130035#define HPI_BUILD_KERNEL_MODE
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +020036
37/******************************************************************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +020038/******** HPI API DEFINITIONS *****/
39/******************************************************************************/
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +130040
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +020041/*******************************************/
42/** Audio format types
43\ingroup stream
44*/
45enum HPI_FORMATS {
46/** Used internally on adapter. */
47 HPI_FORMAT_MIXER_NATIVE = 0,
48/** 8-bit unsigned PCM. Windows equivalent is WAVE_FORMAT_PCM. */
49 HPI_FORMAT_PCM8_UNSIGNED = 1,
50/** 16-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM. */
51 HPI_FORMAT_PCM16_SIGNED = 2,
52/** MPEG-1 Layer-1. */
53 HPI_FORMAT_MPEG_L1 = 3,
54/** MPEG-1 Layer-2.
55
56Windows equivalent is WAVE_FORMAT_MPEG.
57
58The following table shows what combinations of mode and bitrate are possible:
59
60<table border=1 cellspacing=0 cellpadding=5>
61<tr>
62<td><p><b>Bitrate (kbs)</b></p>
63<td><p><b>Mono</b></p>
64<td><p><b>Stereo,<br>Joint Stereo or<br>Dual Channel</b></p>
65
66<tr><td>32<td>X<td>_
67<tr><td>40<td>_<td>_
68<tr><td>48<td>X<td>_
69<tr><td>56<td>X<td>_
70<tr><td>64<td>X<td>X
71<tr><td>80<td>X<td>_
72<tr><td>96<td>X<td>X
73<tr><td>112<td>X<td>X
74<tr><td>128<td>X<td>X
75<tr><td>160<td>X<td>X
76<tr><td>192<td>X<td>X
77<tr><td>224<td>_<td>X
78<tr><td>256<td>-<td>X
79<tr><td>320<td>-<td>X
80<tr><td>384<td>_<td>X
81</table>
82*/
83 HPI_FORMAT_MPEG_L2 = 4,
84/** MPEG-1 Layer-3.
85Windows equivalent is WAVE_FORMAT_MPEG.
86
87The following table shows what combinations of mode and bitrate are possible:
88
89<table border=1 cellspacing=0 cellpadding=5>
90<tr>
91<td><p><b>Bitrate (kbs)</b></p>
92<td><p><b>Mono<br>Stereo @ 8,<br>11.025 and<br>12kHz*</b></p>
93<td><p><b>Mono<br>Stereo @ 16,<br>22.050 and<br>24kHz*</b></p>
94<td><p><b>Mono<br>Stereo @ 32,<br>44.1 and<br>48kHz</b></p>
95
96<tr><td>16<td>X<td>X<td>_
97<tr><td>24<td>X<td>X<td>_
98<tr><td>32<td>X<td>X<td>X
99<tr><td>40<td>X<td>X<td>X
100<tr><td>48<td>X<td>X<td>X
101<tr><td>56<td>X<td>X<td>X
102<tr><td>64<td>X<td>X<td>X
103<tr><td>80<td>_<td>X<td>X
104<tr><td>96<td>_<td>X<td>X
105<tr><td>112<td>_<td>X<td>X
106<tr><td>128<td>_<td>X<td>X
107<tr><td>144<td>_<td>X<td>_
108<tr><td>160<td>_<td>X<td>X
109<tr><td>192<td>_<td>_<td>X
110<tr><td>224<td>_<td>_<td>X
111<tr><td>256<td>-<td>_<td>X
112<tr><td>320<td>-<td>_<td>X
113</table>
114\b * Available on the ASI6000 series only
115*/
116 HPI_FORMAT_MPEG_L3 = 5,
117/** Dolby AC-2. */
118 HPI_FORMAT_DOLBY_AC2 = 6,
119/** Dolbt AC-3. */
120 HPI_FORMAT_DOLBY_AC3 = 7,
121/** 16-bit PCM big-endian. */
122 HPI_FORMAT_PCM16_BIGENDIAN = 8,
123/** TAGIT-1 algorithm - hits. */
124 HPI_FORMAT_AA_TAGIT1_HITS = 9,
125/** TAGIT-1 algorithm - inserts. */
126 HPI_FORMAT_AA_TAGIT1_INSERTS = 10,
127/** 32-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM.
128Each sample is a 32bit word. The most significant 24 bits contain a 24-bit
129sample and the least significant 8 bits are set to 0.
130*/
131 HPI_FORMAT_PCM32_SIGNED = 11,
132/** Raw bitstream - unknown format. */
133 HPI_FORMAT_RAW_BITSTREAM = 12,
134/** TAGIT-1 algorithm hits - extended. */
135 HPI_FORMAT_AA_TAGIT1_HITS_EX1 = 13,
136/** 32-bit PCM as an IEEE float. Windows equivalent is WAVE_FORMAT_IEEE_FLOAT.
137Each sample is a 32bit word in IEEE754 floating point format.
138The range is +1.0 to -1.0, which corresponds to digital fullscale.
139*/
140 HPI_FORMAT_PCM32_FLOAT = 14,
141/** 24-bit PCM signed. Windows equivalent is WAVE_FORMAT_PCM. */
142 HPI_FORMAT_PCM24_SIGNED = 15,
143/** OEM format 1 - private. */
144 HPI_FORMAT_OEM1 = 16,
145/** OEM format 2 - private. */
146 HPI_FORMAT_OEM2 = 17,
147/** Undefined format. */
148 HPI_FORMAT_UNDEFINED = 0xffff
149};
150
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200151/*******************************************/
152/** Stream States
153\ingroup stream
154*/
155enum HPI_STREAM_STATES {
156 /** State stopped - stream is stopped. */
157 HPI_STATE_STOPPED = 1,
158 /** State playing - stream is playing audio. */
159 HPI_STATE_PLAYING = 2,
160 /** State recording - stream is recording. */
161 HPI_STATE_RECORDING = 3,
162 /** State drained - playing stream ran out of data to play. */
163 HPI_STATE_DRAINED = 4,
164 /** State generate sine - to be implemented. */
165 HPI_STATE_SINEGEN = 5,
166 /** State wait - used for inter-card sync to mean waiting for all
167 cards to be ready. */
168 HPI_STATE_WAIT = 6
169};
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300170/*******************************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200171/** Source node types
172\ingroup mixer
173*/
174enum HPI_SOURCENODES {
175 /** This define can be used instead of 0 to indicate
176 that there is no valid source node. A control that
177 exists on a destination node can be searched for using a source
178 node value of either 0, or HPI_SOURCENODE_NONE */
179 HPI_SOURCENODE_NONE = 100,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200180 /** Out Stream (Play) node. */
181 HPI_SOURCENODE_OSTREAM = 101,
182 /** Line in node - could be analog, AES/EBU or network. */
183 HPI_SOURCENODE_LINEIN = 102,
184 HPI_SOURCENODE_AESEBU_IN = 103, /**< AES/EBU input node. */
185 HPI_SOURCENODE_TUNER = 104, /**< tuner node. */
186 HPI_SOURCENODE_RF = 105, /**< RF input node. */
187 HPI_SOURCENODE_CLOCK_SOURCE = 106, /**< clock source node. */
188 HPI_SOURCENODE_RAW_BITSTREAM = 107, /**< raw bitstream node. */
189 HPI_SOURCENODE_MICROPHONE = 108, /**< microphone node. */
190 /** Cobranet input node -
191 Audio samples come from the Cobranet network and into the device. */
192 HPI_SOURCENODE_COBRANET = 109,
193 HPI_SOURCENODE_ANALOG = 110, /**< analog input node. */
194 HPI_SOURCENODE_ADAPTER = 111, /**< adapter node. */
Eliot Blennerhassettb7f12482011-07-22 15:52:55 +1200195 /** RTP stream input node - This node is a destination for
196 packets of RTP audio samples from other devices. */
197 HPI_SOURCENODE_RTP_DESTINATION = 112,
Eliot Blennerhassett502f2712011-12-22 13:38:39 +1300198 HPI_SOURCENODE_INTERNAL = 113, /**< node internal to the device. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200199 /* !!!Update this AND hpidebug.h if you add a new sourcenode type!!! */
Eliot Blennerhassettb7f12482011-07-22 15:52:55 +1200200 HPI_SOURCENODE_LAST_INDEX = 113 /**< largest ID */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200201 /* AX6 max sourcenode types = 15 */
202};
203
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300204/*******************************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200205/** Destination node types
206\ingroup mixer
207*/
208enum HPI_DESTNODES {
209 /** This define can be used instead of 0 to indicate
210 that there is no valid destination node. A control that
211 exists on a source node can be searched for using a destination
212 node value of either 0, or HPI_DESTNODE_NONE */
213 HPI_DESTNODE_NONE = 200,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200214 /** In Stream (Record) node. */
215 HPI_DESTNODE_ISTREAM = 201,
Eliot Blennerhassettb7f12482011-07-22 15:52:55 +1200216 HPI_DESTNODE_LINEOUT = 202, /**< line out node. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200217 HPI_DESTNODE_AESEBU_OUT = 203, /**< AES/EBU output node. */
218 HPI_DESTNODE_RF = 204, /**< RF output node. */
219 HPI_DESTNODE_SPEAKER = 205, /**< speaker output node. */
220 /** Cobranet output node -
221 Audio samples from the device are sent out on the Cobranet network.*/
222 HPI_DESTNODE_COBRANET = 206,
223 HPI_DESTNODE_ANALOG = 207, /**< analog output node. */
Eliot Blennerhassettb7f12482011-07-22 15:52:55 +1200224 /** RTP stream output node - This node is a source for
225 packets of RTP audio samples that are sent to other devices. */
226 HPI_DESTNODE_RTP_SOURCE = 208,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200227 /* !!!Update this AND hpidebug.h if you add a new destnode type!!! */
Eliot Blennerhassett502f2712011-12-22 13:38:39 +1300228 HPI_DESTNODE_LAST_INDEX = 208 /**< largest ID */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200229 /* AX6 max destnode types = 15 */
230};
231
232/*******************************************/
233/** Mixer control types
234\ingroup mixer
235*/
236enum HPI_CONTROLS {
237 HPI_CONTROL_GENERIC = 0, /**< generic control. */
238 HPI_CONTROL_CONNECTION = 1, /**< A connection between nodes. */
239 HPI_CONTROL_VOLUME = 2, /**< volume control - works in dB_fs. */
240 HPI_CONTROL_METER = 3, /**< peak meter control. */
241 HPI_CONTROL_MUTE = 4, /*mute control - not used at present. */
242 HPI_CONTROL_MULTIPLEXER = 5, /**< multiplexer control. */
243
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300244 HPI_CONTROL_AESEBU_TRANSMITTER = 6, /**< AES/EBU transmitter control */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300245 HPI_CONTROL_AESEBUTX = 6, /* HPI_CONTROL_AESEBU_TRANSMITTER */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200246
247 HPI_CONTROL_AESEBU_RECEIVER = 7, /**< AES/EBU receiver control. */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300248 HPI_CONTROL_AESEBURX = 7, /* HPI_CONTROL_AESEBU_RECEIVER */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200249
250 HPI_CONTROL_LEVEL = 8, /**< level/trim control - works in d_bu. */
251 HPI_CONTROL_TUNER = 9, /**< tuner control. */
252/* HPI_CONTROL_ONOFFSWITCH = 10 */
253 HPI_CONTROL_VOX = 11, /**< vox control. */
254/* HPI_CONTROL_AES18_TRANSMITTER = 12 */
255/* HPI_CONTROL_AES18_RECEIVER = 13 */
256/* HPI_CONTROL_AES18_BLOCKGENERATOR = 14 */
257 HPI_CONTROL_CHANNEL_MODE = 15, /**< channel mode control. */
258
259 HPI_CONTROL_BITSTREAM = 16, /**< bitstream control. */
260 HPI_CONTROL_SAMPLECLOCK = 17, /**< sample clock control. */
261 HPI_CONTROL_MICROPHONE = 18, /**< microphone control. */
262 HPI_CONTROL_PARAMETRIC_EQ = 19, /**< parametric EQ control. */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300263 HPI_CONTROL_EQUALIZER = 19, /*HPI_CONTROL_PARAMETRIC_EQ */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200264
265 HPI_CONTROL_COMPANDER = 20, /**< compander control. */
266 HPI_CONTROL_COBRANET = 21, /**< cobranet control. */
267 HPI_CONTROL_TONEDETECTOR = 22, /**< tone detector control. */
268 HPI_CONTROL_SILENCEDETECTOR = 23, /**< silence detector control. */
269 HPI_CONTROL_PAD = 24, /**< tuner PAD control. */
270 HPI_CONTROL_SRC = 25, /**< samplerate converter control. */
271 HPI_CONTROL_UNIVERSAL = 26, /**< universal control. */
272
273/* !!! Update this AND hpidebug.h if you add a new control type!!!*/
274 HPI_CONTROL_LAST_INDEX = 26 /**<highest control type ID */
275/* WARNING types 256 or greater impact bit packing in all AX6 DSP code */
276};
277
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300278/*******************************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200279/** Adapter properties
280These are used in HPI_AdapterSetProperty() and HPI_AdapterGetProperty()
281\ingroup adapter
282*/
283enum HPI_ADAPTER_PROPERTIES {
284/** \internal Used in dwProperty field of HPI_AdapterSetProperty() and
285HPI_AdapterGetProperty(). This errata applies to all ASI6000 cards with both
286analog and digital outputs. The CS4224 A/D+D/A has a one sample delay between
287left and right channels on both its input (ADC) and output (DAC).
288More details are available in Cirrus Logic errata ER284B2.
289PDF available from www.cirrus.com, released by Cirrus in 2001.
290*/
291 HPI_ADAPTER_PROPERTY_ERRATA_1 = 1,
292
293/** Adapter grouping property
294Indicates whether the adapter supports the grouping API (for ASIO and SSX2)
295*/
296 HPI_ADAPTER_PROPERTY_GROUPING = 2,
297
298/** Driver SSX2 property
299Tells the kernel driver to turn on SSX2 stream mapping.
300This feature is not used by the DSP. In fact the call is completely processed
301by the driver and is not passed on to the DSP at all.
302*/
303 HPI_ADAPTER_PROPERTY_ENABLE_SSX2 = 3,
304
305/** Adapter SSX2 property
306Indicates the state of the adapter's SSX2 setting. This setting is stored in
307non-volatile memory on the adapter. A typical call sequence would be to use
308HPI_ADAPTER_PROPERTY_SSX2_SETTING to set SSX2 on the adapter and then to reload
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300309the driver. The driver would query HPI_ADAPTER_PROPERTY_SSX2_SETTING during
310startup and if SSX2 is set, it would then call HPI_ADAPTER_PROPERTY_ENABLE_SSX2
311to enable SSX2 stream mapping within the kernel level of the driver.
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200312*/
313 HPI_ADAPTER_PROPERTY_SSX2_SETTING = 4,
314
Eliot Blennerhassettbd33c1c2011-02-10 17:26:16 +1300315/** Enables/disables PCI(e) IRQ.
316A setting of 0 indicates that no interrupts are being generated. A DSP boot
317this property is set to 0. Setting to a non-zero value specifies the number
318of frames of audio that should be processed between interrupts. This property
319should be set to multiple of the mixer interval as read back from the
320HPI_ADAPTER_PROPERTY_INTERVAL property.
321*/
322 HPI_ADAPTER_PROPERTY_IRQ_RATE = 5,
323
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200324/** Base number for readonly properties */
325 HPI_ADAPTER_PROPERTY_READONLYBASE = 256,
326
327/** Readonly adapter latency property.
328This property returns in the input and output latency in samples.
329Property 1 is the estimated input latency
330in samples, while Property 2 is that output latency in samples.
331*/
332 HPI_ADAPTER_PROPERTY_LATENCY = 256,
333
334/** Readonly adapter granularity property.
335The granulariy is the smallest size chunk of stereo samples that is processed by
336the adapter.
337This property returns the record granularity in samples in Property 1.
338Property 2 returns the play granularity.
339*/
340 HPI_ADAPTER_PROPERTY_GRANULARITY = 257,
341
342/** Readonly adapter number of current channels property.
343Property 1 is the number of record channels per record device.
344Property 2 is the number of play channels per playback device.*/
345 HPI_ADAPTER_PROPERTY_CURCHANNELS = 258,
346
347/** Readonly adapter software version.
348The SOFTWARE_VERSION property returns the version of the software running
349on the adapter as Major.Minor.Release.
350Property 1 contains Major in bits 15..8 and Minor in bits 7..0.
351Property 2 contains Release in bits 7..0. */
352 HPI_ADAPTER_PROPERTY_SOFTWARE_VERSION = 259,
353
354/** Readonly adapter MAC address MSBs.
355The MAC_ADDRESS_MSB property returns
356the most significant 32 bits of the MAC address.
357Property 1 contains bits 47..32 of the MAC address.
358Property 2 contains bits 31..16 of the MAC address. */
359 HPI_ADAPTER_PROPERTY_MAC_ADDRESS_MSB = 260,
360
361/** Readonly adapter MAC address LSBs
362The MAC_ADDRESS_LSB property returns
363the least significant 16 bits of the MAC address.
364Property 1 contains bits 15..0 of the MAC address. */
365 HPI_ADAPTER_PROPERTY_MAC_ADDRESS_LSB = 261,
366
367/** Readonly extended adapter type number
368The EXTENDED_ADAPTER_TYPE property returns the 4 digits of an extended
369adapter type, i.e ASI8920-0022, 0022 is the extended type.
370The digits are returned as ASCII characters rather than the hex digits that
371are returned for the main type
372Property 1 returns the 1st two (left most) digits, i.e "00"
373in the example above, the upper byte being the left most digit.
374Property 2 returns the 2nd two digits, i.e "22" in the example above*/
375 HPI_ADAPTER_PROPERTY_EXTENDED_ADAPTER_TYPE = 262,
376
377/** Readonly debug log buffer information */
378 HPI_ADAPTER_PROPERTY_LOGTABLEN = 263,
379 HPI_ADAPTER_PROPERTY_LOGTABBEG = 264,
380
381/** Readonly adapter IP address
382For 192.168.1.101
383Property 1 returns the 1st two (left most) digits, i.e 192*256 + 168
384in the example above, the upper byte being the left most digit.
385Property 2 returns the 2nd two digits, i.e 1*256 + 101 in the example above, */
386 HPI_ADAPTER_PROPERTY_IP_ADDRESS = 265,
387
388/** Readonly adapter buffer processed count. Returns a buffer processed count
389that is incremented every time all buffers for all streams are updated. This
390is useful for checking completion of all stream operations across the adapter
391when using grouped streams.
392*/
393 HPI_ADAPTER_PROPERTY_BUFFER_UPDATE_COUNT = 266,
394
395/** Readonly mixer and stream intervals
396
397These intervals are measured in mixer frames.
398To convert to time, divide by the adapter samplerate.
399
400The mixer interval is the number of frames processed in one mixer iteration.
401The stream update interval is the interval at which streams check for and
402process data, and BBM host buffer counters are updated.
403
404Property 1 is the mixer interval in mixer frames.
405Property 2 is the stream update interval in mixer frames.
406*/
407 HPI_ADAPTER_PROPERTY_INTERVAL = 267,
408/** Adapter capabilities 1
409Property 1 - adapter can do multichannel (SSX1)
410Property 2 - adapter can do stream grouping (supports SSX2)
411*/
412 HPI_ADAPTER_PROPERTY_CAPS1 = 268,
413/** Adapter capabilities 2
414Property 1 - adapter can do samplerate conversion (MRX)
415Property 2 - adapter can do timestretch (TSX)
416*/
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +1200417 HPI_ADAPTER_PROPERTY_CAPS2 = 269,
418
419/** Readonly adapter sync header connection count.
420*/
421 HPI_ADAPTER_PROPERTY_SYNC_HEADER_CONNECTIONS = 270,
422/** Readonly supports SSX2 property.
423Indicates the adapter supports SSX2 in some mode setting. The
424return value is true (1) or false (0). If the current adapter
425mode is MONO SSX2 is disabled, even though this property will
426return true.
427*/
Eliot Blennerhassettbd33c1c2011-02-10 17:26:16 +1300428 HPI_ADAPTER_PROPERTY_SUPPORTS_SSX2 = 271,
429/** Readonly supports PCI(e) IRQ.
430Indicates that the adapter in it's current mode supports interrupts
431across the host bus. Note, this does not imply that interrupts are
432enabled. Instead it indicates that they can be enabled.
433*/
Eliot Blennerhassett812550e2011-12-22 13:38:46 +1300434 HPI_ADAPTER_PROPERTY_SUPPORTS_IRQ = 272,
435/** Readonly supports firmware updating.
436Indicates that the adapter implements an interface to update firmware
437on the adapter.
438*/
439 HPI_ADAPTER_PROPERTY_SUPPORTS_FW_UPDATE = 273,
440/** Readonly Firmware IDs
441Identifiy firmware independent of individual adapter type.
442May be used as a filter for firmware update images.
443Property 1 = Bootloader ID
444Property 2 = Main program ID
445*/
446 HPI_ADAPTER_PROPERTY_FIRMWARE_ID = 274
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200447};
448
449/** Adapter mode commands
450
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300451Used in wQueryOrSet parameter of HPI_AdapterSetModeEx().
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200452\ingroup adapter
453*/
454enum HPI_ADAPTER_MODE_CMDS {
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300455 /** Set the mode to the given parameter */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200456 HPI_ADAPTER_MODE_SET = 0,
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300457 /** Return 0 or error depending whether mode is valid,
458 but don't set the mode */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200459 HPI_ADAPTER_MODE_QUERY = 1
460};
461
462/** Adapter Modes
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300463 These are used by HPI_AdapterSetModeEx()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200464
465\warning - more than 16 possible modes breaks
466a bitmask in the Windows WAVE DLL
467\ingroup adapter
468*/
469enum HPI_ADAPTER_MODES {
470/** 4 outstream mode.
471- ASI6114: 1 instream
472- ASI6044: 4 instreams
473- ASI6012: 1 instream
474- ASI6102: no instreams
475- ASI6022, ASI6122: 2 instreams
476- ASI5111, ASI5101: 2 instreams
477- ASI652x, ASI662x: 2 instreams
478- ASI654x, ASI664x: 4 instreams
479*/
480 HPI_ADAPTER_MODE_4OSTREAM = 1,
481
482/** 6 outstream mode.
483- ASI6012: 1 instream,
484- ASI6022, ASI6122: 2 instreams
485- ASI652x, ASI662x: 4 instreams
486*/
487 HPI_ADAPTER_MODE_6OSTREAM = 2,
488
489/** 8 outstream mode.
490- ASI6114: 8 instreams
491- ASI6118: 8 instreams
492- ASI6585: 8 instreams
493*/
494 HPI_ADAPTER_MODE_8OSTREAM = 3,
495
496/** 16 outstream mode.
497- ASI6416 16 instreams
498- ASI6518, ASI6618 16 instreams
499- ASI6118 16 mono out and in streams
500*/
501 HPI_ADAPTER_MODE_16OSTREAM = 4,
502
503/** one outstream mode.
504- ASI5111 1 outstream, 1 instream
505*/
506 HPI_ADAPTER_MODE_1OSTREAM = 5,
507
508/** ASI504X mode 1. 12 outstream, 4 instream 0 to 48kHz sample rates
509 (see ASI504X datasheet for more info).
510*/
511 HPI_ADAPTER_MODE_1 = 6,
512
513/** ASI504X mode 2. 4 outstreams, 4 instreams at 0 to 192kHz sample rates
514 (see ASI504X datasheet for more info).
515*/
516 HPI_ADAPTER_MODE_2 = 7,
517
518/** ASI504X mode 3. 4 outstreams, 4 instreams at 0 to 192kHz sample rates
519 (see ASI504X datasheet for more info).
520*/
521 HPI_ADAPTER_MODE_3 = 8,
522
523/** ASI504X multichannel mode.
524 2 outstreams -> 4 line outs = 1 to 8 channel streams),
525 4 lineins -> 1 instream (1 to 8 channel streams) at 0-48kHz.
526 For more info see the SSX Specification.
527*/
528 HPI_ADAPTER_MODE_MULTICHANNEL = 9,
529
530/** 12 outstream mode.
531- ASI6514, ASI6614: 2 instreams
532- ASI6540,ASI6544: 8 instreams
533- ASI6640,ASI6644: 8 instreams
534*/
535 HPI_ADAPTER_MODE_12OSTREAM = 10,
536
537/** 9 outstream mode.
538- ASI6044: 8 instreams
539*/
540 HPI_ADAPTER_MODE_9OSTREAM = 11,
541
542/** mono mode.
543- ASI6416: 16 outstreams/instreams
544- ASI5402: 2 outstreams/instreams
545*/
546 HPI_ADAPTER_MODE_MONO = 12,
547
548/** Low latency mode.
549- ASI6416/ASI6316: 1 16 channel outstream and instream
550*/
551 HPI_ADAPTER_MODE_LOW_LATENCY = 13
552};
553
554/* Note, adapters can have more than one capability -
555encoding as bitfield is recommended. */
556#define HPI_CAPABILITY_NONE (0)
557#define HPI_CAPABILITY_MPEG_LAYER3 (1)
558
559/* Set this equal to maximum capability index,
560Must not be greater than 32 - see axnvdef.h */
561#define HPI_CAPABILITY_MAX 1
562/* #define HPI_CAPABILITY_AAC 2 */
563
564/******************************************* STREAM ATTRIBUTES ****/
565
566/** MPEG Ancillary Data modes
567
568The mode for the ancillary data insertion or extraction to operate in.
569\ingroup stream
570*/
571enum HPI_MPEG_ANC_MODES {
572 /** the MPEG frames have energy information stored in them (5 bytes per stereo frame, 3 per mono) */
573 HPI_MPEG_ANC_HASENERGY = 0,
574 /** the entire ancillary data field is taken up by data from the Anc data buffer
575 On encode, the encoder will insert the energy bytes before filling the remainder
576 of the ancillary data space with data from the ancillary data buffer.
577 */
578 HPI_MPEG_ANC_RAW = 1
579};
580
581/** Ancillary Data Alignment
582\ingroup instream
583*/
584enum HPI_ISTREAM_MPEG_ANC_ALIGNS {
585 /** data is packed against the end of data, then padded to the end of frame */
586 HPI_MPEG_ANC_ALIGN_LEFT = 0,
587 /** data is packed against the end of the frame */
588 HPI_MPEG_ANC_ALIGN_RIGHT = 1
589};
590
591/** MPEG modes
592MPEG modes - can be used optionally for HPI_FormatCreate()
593parameter dwAttributes.
594
595Using any mode setting other than HPI_MPEG_MODE_DEFAULT
596with single channel format will return an error.
597\ingroup stream
598*/
599enum HPI_MPEG_MODES {
600/** Causes the MPEG-1 Layer II bitstream to be recorded
601in single_channel mode when the number of channels is 1 and in stereo when the
602number of channels is 2. */
603 HPI_MPEG_MODE_DEFAULT = 0,
604 /** Standard stereo without joint-stereo compression */
605 HPI_MPEG_MODE_STEREO = 1,
606 /** Joint stereo */
607 HPI_MPEG_MODE_JOINTSTEREO = 2,
608 /** Left and Right channels are completely independent */
609 HPI_MPEG_MODE_DUALCHANNEL = 3
610};
611/******************************************* MIXER ATTRIBUTES ****/
612
613/* \defgroup mixer_flags Mixer flags for HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES
614{
615*/
616#define HPI_MIXER_GET_CONTROL_MULTIPLE_CHANGED (0)
617#define HPI_MIXER_GET_CONTROL_MULTIPLE_RESET (1)
618/*}*/
619
620/** Commands used by HPI_MixerStore()
621\ingroup mixer
622*/
623enum HPI_MIXER_STORE_COMMAND {
624/** Save all mixer control settings. */
625 HPI_MIXER_STORE_SAVE = 1,
626/** Restore all controls from saved. */
627 HPI_MIXER_STORE_RESTORE = 2,
628/** Delete saved control settings. */
629 HPI_MIXER_STORE_DELETE = 3,
630/** Enable auto storage of some control settings. */
631 HPI_MIXER_STORE_ENABLE = 4,
632/** Disable auto storage of some control settings. */
633 HPI_MIXER_STORE_DISABLE = 5,
Eliot Blennerhassett812550e2011-12-22 13:38:46 +1300634/** Unimplemented - save the attributes of a single control. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200635 HPI_MIXER_STORE_SAVE_SINGLE = 6
636};
637
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300638/****************************/
639/* CONTROL ATTRIBUTE VALUES */
640/****************************/
641
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200642/** Used by mixer plugin enable functions
643
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300644E.g. HPI_ParametricEq_SetState()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200645\ingroup mixer
646*/
647enum HPI_SWITCH_STATES {
648 HPI_SWITCH_OFF = 0, /**< turn the mixer plugin on. */
649 HPI_SWITCH_ON = 1 /**< turn the mixer plugin off. */
650};
651
652/* Volume control special gain values */
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300653
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200654/** volumes units are 100ths of a dB
655\ingroup volume
656*/
657#define HPI_UNITS_PER_dB 100
658/** turns volume control OFF or MUTE
659\ingroup volume
660*/
661#define HPI_GAIN_OFF (-100 * HPI_UNITS_PER_dB)
662
Eliot Blennerhassettfc3a3992011-02-10 17:26:11 +1300663/** channel mask specifying all channels
664\ingroup volume
665*/
666#define HPI_BITMASK_ALL_CHANNELS (0xFFFFFFFF)
667
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200668/** value returned for no signal
669\ingroup meter
670*/
671#define HPI_METER_MINIMUM (-150 * HPI_UNITS_PER_dB)
672
673/** autofade profiles
674\ingroup volume
675*/
676enum HPI_VOLUME_AUTOFADES {
677/** log fade - dB attenuation changes linearly over time */
678 HPI_VOLUME_AUTOFADE_LOG = 2,
679/** linear fade - amplitude changes linearly */
680 HPI_VOLUME_AUTOFADE_LINEAR = 3
681};
682
683/** The physical encoding format of the AESEBU I/O.
684
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300685Used in HPI_Aesebu_Transmitter_SetFormat(), HPI_Aesebu_Receiver_SetFormat()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200686along with related Get and Query functions
687\ingroup aestx
688*/
689enum HPI_AESEBU_FORMATS {
690/** AES/EBU physical format - AES/EBU balanced "professional" */
691 HPI_AESEBU_FORMAT_AESEBU = 1,
692/** AES/EBU physical format - S/PDIF unbalanced "consumer" */
693 HPI_AESEBU_FORMAT_SPDIF = 2
694};
695
696/** AES/EBU error status bits
697
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300698Returned by HPI_Aesebu_Receiver_GetErrorStatus()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200699\ingroup aesrx
700*/
701enum HPI_AESEBU_ERRORS {
702/** bit0: 1 when PLL is not locked */
703 HPI_AESEBU_ERROR_NOT_LOCKED = 0x01,
704/** bit1: 1 when signal quality is poor */
705 HPI_AESEBU_ERROR_POOR_QUALITY = 0x02,
706/** bit2: 1 when there is a parity error */
707 HPI_AESEBU_ERROR_PARITY_ERROR = 0x04,
708/** bit3: 1 when there is a bi-phase coding violation */
709 HPI_AESEBU_ERROR_BIPHASE_VIOLATION = 0x08,
710/** bit4: 1 when the validity bit is high */
711 HPI_AESEBU_ERROR_VALIDITY = 0x10,
712/** bit5: 1 when the CRC error bit is high */
713 HPI_AESEBU_ERROR_CRC = 0x20
714};
715
716/** \addtogroup pad
717\{
718*/
719/** The text string containing the station/channel combination. */
720#define HPI_PAD_CHANNEL_NAME_LEN 16
721/** The text string containing the artist. */
722#define HPI_PAD_ARTIST_LEN 64
723/** The text string containing the title. */
724#define HPI_PAD_TITLE_LEN 64
725/** The text string containing the comment. */
726#define HPI_PAD_COMMENT_LEN 256
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300727/** The PTY when the tuner has not received any PTY. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200728#define HPI_PAD_PROGRAM_TYPE_INVALID 0xffff
729/** \} */
730
731/** Data types for PTY string translation.
732\ingroup rds
733*/
734enum eHPI_RDS_type {
735 HPI_RDS_DATATYPE_RDS = 0, /**< RDS bitstream.*/
736 HPI_RDS_DATATYPE_RBDS = 1 /**< RBDS bitstream.*/
737};
738
739/** Tuner bands
740
741Used for HPI_Tuner_SetBand(),HPI_Tuner_GetBand()
742\ingroup tuner
743*/
744enum HPI_TUNER_BAND {
745 HPI_TUNER_BAND_AM = 1, /**< AM band */
746 HPI_TUNER_BAND_FM = 2, /**< FM band (mono) */
747 HPI_TUNER_BAND_TV_NTSC_M = 3, /**< NTSC-M TV band*/
748 HPI_TUNER_BAND_TV = 3, /* use TV_NTSC_M */
749 HPI_TUNER_BAND_FM_STEREO = 4, /**< FM band (stereo) */
750 HPI_TUNER_BAND_AUX = 5, /**< auxiliary input */
751 HPI_TUNER_BAND_TV_PAL_BG = 6, /**< PAL-B/G TV band*/
752 HPI_TUNER_BAND_TV_PAL_I = 7, /**< PAL-I TV band*/
753 HPI_TUNER_BAND_TV_PAL_DK = 8, /**< PAL-D/K TV band*/
754 HPI_TUNER_BAND_TV_SECAM_L = 9, /**< SECAM-L TV band*/
755 HPI_TUNER_BAND_LAST = 9 /**< the index of the last tuner band. */
756};
757
758/** Tuner mode attributes
759
760Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
761\ingroup tuner
762
763*/
764enum HPI_TUNER_MODES {
765 HPI_TUNER_MODE_RSS = 1, /**< control RSS */
766 HPI_TUNER_MODE_RDS = 2 /**< control RBDS/RDS */
767};
768
769/** Tuner mode attribute values
770
771Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
772\ingroup tuner
773*/
774enum HPI_TUNER_MODE_VALUES {
775/* RSS attribute values */
776 HPI_TUNER_MODE_RSS_DISABLE = 0, /**< RSS disable */
777 HPI_TUNER_MODE_RSS_ENABLE = 1, /**< RSS enable */
778
779/* RDS mode attributes */
780 HPI_TUNER_MODE_RDS_DISABLE = 0, /**< RDS - disabled */
781 HPI_TUNER_MODE_RDS_RDS = 1, /**< RDS - RDS mode */
782 HPI_TUNER_MODE_RDS_RBDS = 2 /**< RDS - RBDS mode */
783};
784
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200785/** Tuner Status Bits
786
787These bitfield values are returned by a call to HPI_Tuner_GetStatus().
788Multiple fields are returned from a single call.
789\ingroup tuner
790*/
791enum HPI_TUNER_STATUS_BITS {
792 HPI_TUNER_VIDEO_COLOR_PRESENT = 0x0001, /**< video color is present. */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300793 HPI_TUNER_VIDEO_IS_60HZ = 0x0020, /**< 60 hz video detected. */
794 HPI_TUNER_VIDEO_HORZ_SYNC_MISSING = 0x0040, /**< video HSYNC is missing. */
795 HPI_TUNER_VIDEO_STATUS_VALID = 0x0100, /**< video status is valid. */
796 HPI_TUNER_DIGITAL = 0x0200, /**< tuner reports digital programming. */
797 HPI_TUNER_MULTIPROGRAM = 0x0400, /**< tuner reports multiple programs. */
798 HPI_TUNER_PLL_LOCKED = 0x1000, /**< the tuner's PLL is locked. */
799 HPI_TUNER_FM_STEREO = 0x2000 /**< tuner reports back FM stereo. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200800};
801
802/** Channel Modes
803Used for HPI_ChannelModeSet/Get()
804\ingroup channelmode
805*/
806enum HPI_CHANNEL_MODES {
807/** Left channel out = left channel in, Right channel out = right channel in. */
808 HPI_CHANNEL_MODE_NORMAL = 1,
809/** Left channel out = right channel in, Right channel out = left channel in. */
810 HPI_CHANNEL_MODE_SWAP = 2,
811/** Left channel out = left channel in, Right channel out = left channel in. */
812 HPI_CHANNEL_MODE_LEFT_TO_STEREO = 3,
813/** Left channel out = right channel in, Right channel out = right channel in.*/
814 HPI_CHANNEL_MODE_RIGHT_TO_STEREO = 4,
815/** Left channel out = (left channel in + right channel in)/2,
816 Right channel out = mute. */
817 HPI_CHANNEL_MODE_STEREO_TO_LEFT = 5,
818/** Left channel out = mute,
819 Right channel out = (right channel in + left channel in)/2. */
820 HPI_CHANNEL_MODE_STEREO_TO_RIGHT = 6,
821 HPI_CHANNEL_MODE_LAST = 6
822};
823
824/** SampleClock source values
825\ingroup sampleclock
826*/
827enum HPI_SAMPLECLOCK_SOURCES {
828/** The sampleclock output is derived from its local samplerate generator.
829 The local samplerate may be set using HPI_SampleClock_SetLocalRate(). */
830 HPI_SAMPLECLOCK_SOURCE_LOCAL = 1,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200831/** The adapter is clocked from a dedicated AES/EBU SampleClock input.*/
832 HPI_SAMPLECLOCK_SOURCE_AESEBU_SYNC = 2,
833/** From external wordclock connector */
834 HPI_SAMPLECLOCK_SOURCE_WORD = 3,
835/** Board-to-board header */
836 HPI_SAMPLECLOCK_SOURCE_WORD_HEADER = 4,
837/** FUTURE - SMPTE clock. */
838 HPI_SAMPLECLOCK_SOURCE_SMPTE = 5,
839/** One of the aesebu inputs */
840 HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT = 6,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200841/** From a network interface e.g. Cobranet or Livewire at either 48 or 96kHz */
842 HPI_SAMPLECLOCK_SOURCE_NETWORK = 8,
843/** From previous adjacent module (ASI2416 only)*/
844 HPI_SAMPLECLOCK_SOURCE_PREV_MODULE = 10,
845/*! Update this if you add a new clock source.*/
846 HPI_SAMPLECLOCK_SOURCE_LAST = 10
847};
848
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300849/** Equalizer filter types. Used by HPI_ParametricEq_SetBand()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200850\ingroup parmeq
851*/
852enum HPI_FILTER_TYPE {
853 HPI_FILTER_TYPE_BYPASS = 0, /**< filter is turned off */
854
855 HPI_FILTER_TYPE_LOWSHELF = 1, /**< EQ low shelf */
856 HPI_FILTER_TYPE_HIGHSHELF = 2, /**< EQ high shelf */
857 HPI_FILTER_TYPE_EQ_BAND = 3, /**< EQ gain */
858
859 HPI_FILTER_TYPE_LOWPASS = 4, /**< standard low pass */
860 HPI_FILTER_TYPE_HIGHPASS = 5, /**< standard high pass */
861 HPI_FILTER_TYPE_BANDPASS = 6, /**< standard band pass */
862 HPI_FILTER_TYPE_BANDSTOP = 7 /**< standard band stop/notch */
863};
864
865/** Async Event sources
866\ingroup async
867*/
868enum ASYNC_EVENT_SOURCES {
869 HPI_ASYNC_EVENT_GPIO = 1, /**< GPIO event. */
870 HPI_ASYNC_EVENT_SILENCE = 2, /**< silence event detected. */
871 HPI_ASYNC_EVENT_TONE = 3 /**< tone event detected. */
872};
873/*******************************************/
874/** HPI Error codes
875
876Almost all HPI functions return an error code
877A return value of zero means there was no error.
878Otherwise one of these error codes is returned.
879Error codes can be converted to a descriptive string using HPI_GetErrorText()
880
881\note When a new error code is added HPI_GetErrorText() MUST be updated.
882\note Codes 1-100 are reserved for driver use
883\ingroup utility
884*/
885enum HPI_ERROR_CODES {
886 /** Message type does not exist. */
887 HPI_ERROR_INVALID_TYPE = 100,
888 /** Object type does not exist. */
889 HPI_ERROR_INVALID_OBJ = 101,
890 /** Function does not exist. */
891 HPI_ERROR_INVALID_FUNC = 102,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300892 /** The specified object does not exist. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200893 HPI_ERROR_INVALID_OBJ_INDEX = 103,
894 /** Trying to access an object that has not been opened yet. */
895 HPI_ERROR_OBJ_NOT_OPEN = 104,
896 /** Trying to open an already open object. */
897 HPI_ERROR_OBJ_ALREADY_OPEN = 105,
898 /** PCI, ISA resource not valid. */
899 HPI_ERROR_INVALID_RESOURCE = 106,
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300900 /* HPI_ERROR_SUBSYSFINDADAPTERS_GETINFO= 107 */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200901 /** Default response was never updated with actual error code. */
902 HPI_ERROR_INVALID_RESPONSE = 108,
903 /** wSize field of response was not updated,
904 indicating that the message was not processed. */
905 HPI_ERROR_PROCESSING_MESSAGE = 109,
906 /** The network did not respond in a timely manner. */
907 HPI_ERROR_NETWORK_TIMEOUT = 110,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300908 /* An HPI handle is invalid (uninitialised?). */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200909 HPI_ERROR_INVALID_HANDLE = 111,
910 /** A function or attribute has not been implemented yet. */
911 HPI_ERROR_UNIMPLEMENTED = 112,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300912 /** There are too many clients attempting
913 to access a network resource. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200914 HPI_ERROR_NETWORK_TOO_MANY_CLIENTS = 113,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300915 /** Response buffer passed to HPI_Message
916 was smaller than returned response.
917 wSpecificError field of hpi response contains the required size.
918 */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200919 HPI_ERROR_RESPONSE_BUFFER_TOO_SMALL = 114,
920 /** The returned response did not match the sent message */
921 HPI_ERROR_RESPONSE_MISMATCH = 115,
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300922 /** A control setting that should have been cached was not. */
923 HPI_ERROR_CONTROL_CACHING = 116,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300924 /** A message buffer in the path to the adapter was smaller
925 than the message size.
926 wSpecificError field of hpi response contains the actual size.
927 */
928 HPI_ERROR_MESSAGE_BUFFER_TOO_SMALL = 117,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200929
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300930 /* HPI_ERROR_TOO_MANY_ADAPTERS= 200 */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200931 /** Bad adpater. */
932 HPI_ERROR_BAD_ADAPTER = 201,
933 /** Adapter number out of range or not set properly. */
934 HPI_ERROR_BAD_ADAPTER_NUMBER = 202,
935 /** 2 adapters with the same adapter number. */
Eliot Blennerhassetta287ca22011-02-10 17:26:17 +1300936 HPI_ERROR_DUPLICATE_ADAPTER_NUMBER = 203,
Eliot Blennerhassett812550e2011-12-22 13:38:46 +1300937 /** DSP code failed to bootload. Usually a DSP memory test failure. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200938 HPI_ERROR_DSP_BOOTLOAD = 204,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200939 /** Couldn't find or open the DSP code file. */
940 HPI_ERROR_DSP_FILE_NOT_FOUND = 206,
941 /** Internal DSP hardware error. */
942 HPI_ERROR_DSP_HARDWARE = 207,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200943 /** Could not allocate memory */
944 HPI_ERROR_MEMORY_ALLOC = 208,
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300945 /** Failed to correctly load/config PLD. (unused) */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200946 HPI_ERROR_PLD_LOAD = 209,
947 /** Unexpected end of file, block length too big etc. */
948 HPI_ERROR_DSP_FILE_FORMAT = 210,
949
950 /** Found but could not open DSP code file. */
951 HPI_ERROR_DSP_FILE_ACCESS_DENIED = 211,
952 /** First DSP code section header not found in DSP file. */
953 HPI_ERROR_DSP_FILE_NO_HEADER = 212,
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300954 /* HPI_ERROR_DSP_FILE_READ_ERROR= 213, */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200955 /** DSP code for adapter family not found. */
956 HPI_ERROR_DSP_SECTION_NOT_FOUND = 214,
957 /** Other OS specific error opening DSP file. */
958 HPI_ERROR_DSP_FILE_OTHER_ERROR = 215,
959 /** Sharing violation opening DSP code file. */
960 HPI_ERROR_DSP_FILE_SHARING_VIOLATION = 216,
961 /** DSP code section header had size == 0. */
962 HPI_ERROR_DSP_FILE_NULL_HEADER = 217,
963
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300964 /* HPI_ERROR_FLASH = 220, */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200965
966 /** Flash has bad checksum */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300967 HPI_ERROR_BAD_CHECKSUM = 221,
968 HPI_ERROR_BAD_SEQUENCE = 222,
969 HPI_ERROR_FLASH_ERASE = 223,
970 HPI_ERROR_FLASH_PROGRAM = 224,
971 HPI_ERROR_FLASH_VERIFY = 225,
972 HPI_ERROR_FLASH_TYPE = 226,
973 HPI_ERROR_FLASH_START = 227,
Eliot Blennerhassett812550e2011-12-22 13:38:46 +1300974 HPI_ERROR_FLASH_READ = 228,
975 HPI_ERROR_FLASH_READ_NO_FILE = 229,
976 HPI_ERROR_FLASH_SIZE = 230,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200977
978 /** Reserved for OEMs. */
979 HPI_ERROR_RESERVED_1 = 290,
980
Eliot Blennerhassett1d595d22011-02-10 17:26:08 +1300981 /* HPI_ERROR_INVALID_STREAM = 300 use HPI_ERROR_INVALID_OBJ_INDEX */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200982 /** Invalid compression format. */
983 HPI_ERROR_INVALID_FORMAT = 301,
984 /** Invalid format samplerate */
985 HPI_ERROR_INVALID_SAMPLERATE = 302,
986 /** Invalid format number of channels. */
987 HPI_ERROR_INVALID_CHANNELS = 303,
988 /** Invalid format bitrate. */
989 HPI_ERROR_INVALID_BITRATE = 304,
990 /** Invalid datasize used for stream read/write. */
991 HPI_ERROR_INVALID_DATASIZE = 305,
Eliot Blennerhassett1d595d22011-02-10 17:26:08 +1300992 /* HPI_ERROR_BUFFER_FULL = 306 use HPI_ERROR_INVALID_DATASIZE */
993 /* HPI_ERROR_BUFFER_EMPTY = 307 use HPI_ERROR_INVALID_DATASIZE */
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300994 /** Null data pointer used for stream read/write. */
995 HPI_ERROR_INVALID_DATA_POINTER = 308,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200996 /** Packet ordering error for stream read/write. */
997 HPI_ERROR_INVALID_PACKET_ORDER = 309,
998
999 /** Object can't do requested operation in its current
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001000 state, eg set format, change rec mux state while recording.*/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001001 HPI_ERROR_INVALID_OPERATION = 310,
1002
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001003 /** Where a SRG is shared amongst streams, an incompatible samplerate
1004 is one that is different to any currently active stream. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001005 HPI_ERROR_INCOMPATIBLE_SAMPLERATE = 311,
1006 /** Adapter mode is illegal.*/
1007 HPI_ERROR_BAD_ADAPTER_MODE = 312,
1008
1009 /** There have been too many attempts to set the adapter's
1010 capabilities (using bad keys), the card should be returned
1011 to ASI if further capabilities updates are required */
1012 HPI_ERROR_TOO_MANY_CAPABILITY_CHANGE_ATTEMPTS = 313,
1013 /** Streams on different adapters cannot be grouped. */
1014 HPI_ERROR_NO_INTERADAPTER_GROUPS = 314,
1015 /** Streams on different DSPs cannot be grouped. */
1016 HPI_ERROR_NO_INTERDSP_GROUPS = 315,
Eliot Blennerhassettbd33c1c2011-02-10 17:26:16 +13001017 /** Stream wait cancelled before threshold reached. */
1018 HPI_ERROR_WAIT_CANCELLED = 316,
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001019 /** A character string is invalid. */
1020 HPI_ERROR_INVALID_STRING = 317,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001021
1022 /** Invalid mixer node for this adapter. */
1023 HPI_ERROR_INVALID_NODE = 400,
1024 /** Invalid control. */
1025 HPI_ERROR_INVALID_CONTROL = 401,
1026 /** Invalid control value was passed. */
1027 HPI_ERROR_INVALID_CONTROL_VALUE = 402,
1028 /** Control attribute not supported by this control. */
1029 HPI_ERROR_INVALID_CONTROL_ATTRIBUTE = 403,
1030 /** Control is disabled. */
1031 HPI_ERROR_CONTROL_DISABLED = 404,
1032 /** I2C transaction failed due to a missing ACK. */
1033 HPI_ERROR_CONTROL_I2C_MISSING_ACK = 405,
Eliot Blennerhassett0a000442011-02-10 17:26:05 +13001034 HPI_ERROR_I2C_MISSING_ACK = 405,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001035 /** Control is busy, or coming out of
1036 reset and cannot be accessed at this time. */
1037 HPI_ERROR_CONTROL_NOT_READY = 407,
1038
1039 /** Non volatile memory */
1040 HPI_ERROR_NVMEM_BUSY = 450,
1041 HPI_ERROR_NVMEM_FULL = 451,
1042 HPI_ERROR_NVMEM_FAIL = 452,
1043
1044 /** I2C */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001045 HPI_ERROR_I2C_BAD_ADR = 460,
1046
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001047 /** Entity type did not match requested type */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001048 HPI_ERROR_ENTITY_TYPE_MISMATCH = 470,
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001049 /** Entity item count did not match requested count */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001050 HPI_ERROR_ENTITY_ITEM_COUNT = 471,
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001051 /** Entity type is not one of the valid types */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001052 HPI_ERROR_ENTITY_TYPE_INVALID = 472,
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001053 /** Entity role is not one of the valid roles */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001054 HPI_ERROR_ENTITY_ROLE_INVALID = 473,
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001055 /** Entity size doesn't match target size */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +13001056 HPI_ERROR_ENTITY_SIZE_MISMATCH = 474,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001057
1058 /* AES18 specific errors were 500..507 */
1059
1060 /** custom error to use for debugging */
1061 HPI_ERROR_CUSTOM = 600,
1062
1063 /** hpioct32.c can't obtain mutex */
1064 HPI_ERROR_MUTEX_TIMEOUT = 700,
1065
Eliot Blennerhassetta287ca22011-02-10 17:26:17 +13001066 /** Backend errors used to be greater than this.
1067 \deprecated Now, all backends return only errors defined here in hpi.h
1068 */
1069 HPI_ERROR_BACKEND_BASE = 900,
1070
1071 /** Communication with DSP failed */
1072 HPI_ERROR_DSP_COMMUNICATION = 900
1073 /* Note that the dsp communication error is set to this value so that
1074 it remains compatible with any software that expects such errors
1075 to be backend errors i.e. >= 900.
1076 Do not define any new error codes with values > 900.
1077 */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001078};
1079
1080/** \defgroup maximums HPI maximum values
1081\{
1082*/
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001083/** Maximum number of PCI HPI adapters */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001084#define HPI_MAX_ADAPTERS 20
1085/** Maximum number of in or out streams per adapter */
1086#define HPI_MAX_STREAMS 16
1087#define HPI_MAX_CHANNELS 2 /* per stream */
1088#define HPI_MAX_NODES 8 /* per mixer ? */
1089#define HPI_MAX_CONTROLS 4 /* per node ? */
1090/** maximum number of ancillary bytes per MPEG frame */
1091#define HPI_MAX_ANC_BYTES_PER_FRAME (64)
1092#define HPI_STRING_LEN 16
1093
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001094/** Networked adapters have index >= 100 */
1095#define HPI_MIN_NETWORK_ADAPTER_IDX 100
1096
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001097/** Velocity units */
1098#define HPI_OSTREAM_VELOCITY_UNITS 4096
1099/** OutStream timescale units */
1100#define HPI_OSTREAM_TIMESCALE_UNITS 10000
1101/** OutStream timescale passthrough - turns timescaling on in passthough mode */
1102#define HPI_OSTREAM_TIMESCALE_PASSTHROUGH 99999
1103
1104/**\}*/
1105
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001106/**************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001107/* STRUCTURES */
1108#ifndef DISABLE_PRAGMA_PACK1
1109#pragma pack(push, 1)
1110#endif
1111
1112/** Structure containing sample format information.
1113 See also HPI_FormatCreate().
1114 */
1115struct hpi_format {
1116 u32 sample_rate;
1117 /**< 11025, 32000, 44100 ... */
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001118 u32 bit_rate; /**< for MPEG */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001119 u32 attributes;
1120 /**< Stereo/JointStereo/Mono */
1121 u16 mode_legacy;
1122 /**< Legacy ancillary mode or idle bit */
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001123 u16 unused; /**< Unused */
1124 u16 channels; /**< 1,2..., (or ancillary mode or idle bit */
1125 u16 format; /**< HPI_FORMAT_PCM16, _MPEG etc. see #HPI_FORMATS. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001126};
1127
1128struct hpi_anc_frame {
1129 u32 valid_bits_in_this_frame;
1130 u8 b_data[HPI_MAX_ANC_BYTES_PER_FRAME];
1131};
1132
1133/** An object for containing a single async event.
1134*/
1135struct hpi_async_event {
1136 u16 event_type; /**< type of event. \sa async_event */
Eliot Blennerhassett1d595d22011-02-10 17:26:08 +13001137 u16 sequence; /**< Sequence number, allows lost event detection */
1138 u32 state; /**< New state */
1139 u32 h_object; /**< handle to the object returning the event. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001140 union {
1141 struct {
1142 u16 index; /**< GPIO bit index. */
1143 } gpio;
1144 struct {
1145 u16 node_index; /**< what node is the control on ? */
Eliot Blennerhassett1d595d22011-02-10 17:26:08 +13001146 u16 node_type; /**< what type of node is the control on ? */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001147 } control;
1148 } u;
1149};
1150
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001151#ifndef DISABLE_PRAGMA_PACK1
1152#pragma pack(pop)
1153#endif
1154
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001155/*****************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001156/* HPI FUNCTIONS */
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001157/*****************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001158
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001159/* Stream */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001160u16 hpi_stream_estimate_buffer_size(struct hpi_format *pF,
1161 u32 host_polling_rate_in_milli_seconds, u32 *recommended_buffer_size);
1162
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001163/*************/
1164/* SubSystem */
1165/*************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001166
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001167u16 hpi_subsys_get_version_ex(u32 *pversion_ex);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001168
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001169u16 hpi_subsys_get_num_adapters(int *pn_num_adapters);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001170
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001171u16 hpi_subsys_get_adapter(int iterator, u32 *padapter_index,
1172 u16 *pw_adapter_type);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001173
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001174/***********/
1175/* Adapter */
1176/***********/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001177
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001178u16 hpi_adapter_open(u16 adapter_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001179
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001180u16 hpi_adapter_close(u16 adapter_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001181
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001182u16 hpi_adapter_get_info(u16 adapter_index, u16 *pw_num_outstreams,
1183 u16 *pw_num_instreams, u16 *pw_version, u32 *pserial_number,
1184 u16 *pw_adapter_type);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001185
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001186u16 hpi_adapter_get_module_by_index(u16 adapter_index, u16 module_index,
1187 u16 *pw_num_outputs, u16 *pw_num_inputs, u16 *pw_version,
1188 u32 *pserial_number, u16 *pw_module_type, u32 *ph_module);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001189
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001190u16 hpi_adapter_set_mode(u16 adapter_index, u32 adapter_mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001191
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001192u16 hpi_adapter_set_mode_ex(u16 adapter_index, u32 adapter_mode,
1193 u16 query_or_set);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001194
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001195u16 hpi_adapter_get_mode(u16 adapter_index, u32 *padapter_mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001196
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001197u16 hpi_adapter_get_assert2(u16 adapter_index, u16 *p_assert_count,
1198 char *psz_assert, u32 *p_param1, u32 *p_param2,
1199 u32 *p_dsp_string_addr, u16 *p_processor_id);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001200
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001201u16 hpi_adapter_test_assert(u16 adapter_index, u16 assert_id);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001202
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001203u16 hpi_adapter_enable_capability(u16 adapter_index, u16 capability, u32 key);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001204
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001205u16 hpi_adapter_self_test(u16 adapter_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001206
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001207u16 hpi_adapter_debug_read(u16 adapter_index, u32 dsp_address, char *p_bytes,
1208 int *count_bytes);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001209
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001210u16 hpi_adapter_set_property(u16 adapter_index, u16 property, u16 paramter1,
1211 u16 paramter2);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001212
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001213u16 hpi_adapter_get_property(u16 adapter_index, u16 property,
1214 u16 *pw_paramter1, u16 *pw_paramter2);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001215
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001216u16 hpi_adapter_enumerate_property(u16 adapter_index, u16 index,
1217 u16 what_to_enumerate, u16 property_index, u32 *psetting);
1218/*************/
1219/* OutStream */
1220/*************/
1221u16 hpi_outstream_open(u16 adapter_index, u16 outstream_index,
1222 u32 *ph_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001223
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001224u16 hpi_outstream_close(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001225
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001226u16 hpi_outstream_get_info_ex(u32 h_outstream, u16 *pw_state,
1227 u32 *pbuffer_size, u32 *pdata_to_play, u32 *psamples_played,
1228 u32 *pauxiliary_data_to_play);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001229
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001230u16 hpi_outstream_write_buf(u32 h_outstream, const u8 *pb_write_buf,
1231 u32 bytes_to_write, const struct hpi_format *p_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001232
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001233u16 hpi_outstream_start(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001234
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001235u16 hpi_outstream_wait_start(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001236
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001237u16 hpi_outstream_stop(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001238
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001239u16 hpi_outstream_sinegen(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001240
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001241u16 hpi_outstream_reset(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001242
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001243u16 hpi_outstream_query_format(u32 h_outstream, struct hpi_format *p_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001244
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001245u16 hpi_outstream_set_format(u32 h_outstream, struct hpi_format *p_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001246
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001247u16 hpi_outstream_set_punch_in_out(u32 h_outstream, u32 punch_in_sample,
1248 u32 punch_out_sample);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001249
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001250u16 hpi_outstream_set_velocity(u32 h_outstream, short velocity);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001251
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001252u16 hpi_outstream_ancillary_reset(u32 h_outstream, u16 mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001253
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001254u16 hpi_outstream_ancillary_get_info(u32 h_outstream, u32 *pframes_available);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001255
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001256u16 hpi_outstream_ancillary_read(u32 h_outstream,
1257 struct hpi_anc_frame *p_anc_frame_buffer,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001258 u32 anc_frame_buffer_size_in_bytes,
1259 u32 number_of_ancillary_frames_to_read);
1260
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001261u16 hpi_outstream_set_time_scale(u32 h_outstream, u32 time_scaleX10000);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001262
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001263u16 hpi_outstream_host_buffer_allocate(u32 h_outstream, u32 size_in_bytes);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001264
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001265u16 hpi_outstream_host_buffer_free(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001266
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001267u16 hpi_outstream_group_add(u32 h_outstream, u32 h_stream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001268
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001269u16 hpi_outstream_group_get_map(u32 h_outstream, u32 *poutstream_map,
1270 u32 *pinstream_map);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001271
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001272u16 hpi_outstream_group_reset(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001273
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001274/************/
1275/* InStream */
1276/************/
1277u16 hpi_instream_open(u16 adapter_index, u16 instream_index,
1278 u32 *ph_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001279
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001280u16 hpi_instream_close(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001281
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001282u16 hpi_instream_query_format(u32 h_instream,
1283 const struct hpi_format *p_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001284
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001285u16 hpi_instream_set_format(u32 h_instream,
1286 const struct hpi_format *p_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001287
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001288u16 hpi_instream_read_buf(u32 h_instream, u8 *pb_read_buf, u32 bytes_to_read);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001289
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001290u16 hpi_instream_start(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001291
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001292u16 hpi_instream_wait_start(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001293
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001294u16 hpi_instream_stop(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001295
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001296u16 hpi_instream_reset(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001297
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001298u16 hpi_instream_get_info_ex(u32 h_instream, u16 *pw_state, u32 *pbuffer_size,
1299 u32 *pdata_recorded, u32 *psamples_recorded,
1300 u32 *pauxiliary_data_recorded);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001301
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001302u16 hpi_instream_ancillary_reset(u32 h_instream, u16 bytes_per_frame,
1303 u16 mode, u16 alignment, u16 idle_bit);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001304
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001305u16 hpi_instream_ancillary_get_info(u32 h_instream, u32 *pframe_space);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001306
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001307u16 hpi_instream_ancillary_write(u32 h_instream,
1308 const struct hpi_anc_frame *p_anc_frame_buffer,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001309 u32 anc_frame_buffer_size_in_bytes,
1310 u32 number_of_ancillary_frames_to_write);
1311
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001312u16 hpi_instream_host_buffer_allocate(u32 h_instream, u32 size_in_bytes);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001313
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001314u16 hpi_instream_host_buffer_free(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001315
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001316u16 hpi_instream_group_add(u32 h_instream, u32 h_stream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001317
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001318u16 hpi_instream_group_get_map(u32 h_instream, u32 *poutstream_map,
1319 u32 *pinstream_map);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001320
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001321u16 hpi_instream_group_reset(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001322
1323/*********/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001324/* Mixer */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001325/*********/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001326u16 hpi_mixer_open(u16 adapter_index, u32 *ph_mixer);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001327
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001328u16 hpi_mixer_close(u32 h_mixer);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001329
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001330u16 hpi_mixer_get_control(u32 h_mixer, u16 src_node_type,
1331 u16 src_node_type_index, u16 dst_node_type, u16 dst_node_type_index,
1332 u16 control_type, u32 *ph_control);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001333
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001334u16 hpi_mixer_get_control_by_index(u32 h_mixer, u16 control_index,
1335 u16 *pw_src_node_type, u16 *pw_src_node_index, u16 *pw_dst_node_type,
1336 u16 *pw_dst_node_index, u16 *pw_control_type, u32 *ph_control);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001337
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001338u16 hpi_mixer_store(u32 h_mixer, enum HPI_MIXER_STORE_COMMAND command,
1339 u16 index);
1340/************/
1341/* Controls */
1342/************/
1343/******************/
1344/* Volume control */
1345/******************/
1346u16 hpi_volume_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001347 );
1348
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001349u16 hpi_volume_get_gain(u32 h_control,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001350 short an_gain0_01dB_out[HPI_MAX_CHANNELS]
1351 );
1352
Eliot Blennerhassettfc3a3992011-02-10 17:26:11 +13001353u16 hpi_volume_set_mute(u32 h_control, u32 mute);
1354
1355u16 hpi_volume_get_mute(u32 h_control, u32 *mute);
1356
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001357#define hpi_volume_get_range hpi_volume_query_range
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001358u16 hpi_volume_query_range(u32 h_control, short *min_gain_01dB,
1359 short *max_gain_01dB, short *step_gain_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001360
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001361u16 hpi_volume_query_channels(const u32 h_control, u32 *p_channels);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001362
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001363u16 hpi_volume_auto_fade(u32 h_control,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001364 short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms);
1365
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001366u16 hpi_volume_auto_fade_profile(u32 h_control,
1367 short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms,
1368 u16 profile);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001369
Eliot Blennerhassett862e1412011-12-22 13:38:45 +13001370u16 hpi_volume_query_auto_fade_profile(const u32 h_control, const u32 i,
1371 u16 *profile);
1372
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001373/*****************/
1374/* Level control */
1375/*****************/
1376u16 hpi_level_query_range(u32 h_control, short *min_gain_01dB,
1377 short *max_gain_01dB, short *step_gain_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001378
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001379u16 hpi_level_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001380 );
1381
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001382u16 hpi_level_get_gain(u32 h_control,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001383 short an_gain0_01dB_out[HPI_MAX_CHANNELS]
1384 );
1385
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001386/*****************/
1387/* Meter control */
1388/*****************/
1389u16 hpi_meter_query_channels(const u32 h_meter, u32 *p_channels);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001390
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001391u16 hpi_meter_get_peak(u32 h_control,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001392 short an_peak0_01dB_out[HPI_MAX_CHANNELS]
1393 );
1394
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001395u16 hpi_meter_get_rms(u32 h_control, short an_peak0_01dB_out[HPI_MAX_CHANNELS]
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001396 );
1397
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001398u16 hpi_meter_set_peak_ballistics(u32 h_control, u16 attack, u16 decay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001399
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001400u16 hpi_meter_set_rms_ballistics(u32 h_control, u16 attack, u16 decay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001401
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001402u16 hpi_meter_get_peak_ballistics(u32 h_control, u16 *attack, u16 *decay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001403
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001404u16 hpi_meter_get_rms_ballistics(u32 h_control, u16 *attack, u16 *decay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001405
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001406/************************/
1407/* ChannelMode control */
1408/************************/
1409u16 hpi_channel_mode_query_mode(const u32 h_mode, const u32 index,
1410 u16 *pw_mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001411
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001412u16 hpi_channel_mode_set(u32 h_control, u16 mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001413
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001414u16 hpi_channel_mode_get(u32 h_control, u16 *mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001415
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001416/*****************/
1417/* Tuner control */
1418/*****************/
1419u16 hpi_tuner_query_band(const u32 h_tuner, const u32 index, u16 *pw_band);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001420
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001421u16 hpi_tuner_set_band(u32 h_control, u16 band);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001422
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001423u16 hpi_tuner_get_band(u32 h_control, u16 *pw_band);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001424
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001425u16 hpi_tuner_query_frequency(const u32 h_tuner, const u32 index,
1426 const u16 band, u32 *pfreq);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001427
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001428u16 hpi_tuner_set_frequency(u32 h_control, u32 freq_ink_hz);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001429
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001430u16 hpi_tuner_get_frequency(u32 h_control, u32 *pw_freq_ink_hz);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001431
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001432u16 hpi_tuner_get_rf_level(u32 h_control, short *pw_level);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001433
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001434u16 hpi_tuner_get_raw_rf_level(u32 h_control, short *pw_level);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001435
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001436u16 hpi_tuner_query_gain(const u32 h_tuner, const u32 index, u16 *pw_gain);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001437
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001438u16 hpi_tuner_set_gain(u32 h_control, short gain);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001439
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001440u16 hpi_tuner_get_gain(u32 h_control, short *pn_gain);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001441
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001442u16 hpi_tuner_get_status(u32 h_control, u16 *pw_status_mask, u16 *pw_status);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001443
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001444u16 hpi_tuner_set_mode(u32 h_control, u32 mode, u32 value);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001445
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001446u16 hpi_tuner_get_mode(u32 h_control, u32 mode, u32 *pn_value);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001447
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001448u16 hpi_tuner_get_rds(u32 h_control, char *p_rds_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001449
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001450u16 hpi_tuner_query_deemphasis(const u32 h_tuner, const u32 index,
1451 const u16 band, u32 *pdeemphasis);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001452
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001453u16 hpi_tuner_set_deemphasis(u32 h_control, u32 deemphasis);
1454u16 hpi_tuner_get_deemphasis(u32 h_control, u32 *pdeemphasis);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001455
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001456u16 hpi_tuner_query_program(const u32 h_tuner, u32 *pbitmap_program);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001457
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001458u16 hpi_tuner_set_program(u32 h_control, u32 program);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001459
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001460u16 hpi_tuner_get_program(u32 h_control, u32 *pprogram);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001461
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001462u16 hpi_tuner_get_hd_radio_dsp_version(u32 h_control, char *psz_dsp_version,
1463 const u32 string_size);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001464
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001465u16 hpi_tuner_get_hd_radio_sdk_version(u32 h_control, char *psz_sdk_version,
1466 const u32 string_size);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001467
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001468u16 hpi_tuner_get_hd_radio_signal_quality(u32 h_control, u32 *pquality);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001469
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001470u16 hpi_tuner_get_hd_radio_signal_blend(u32 h_control, u32 *pblend);
Eliot Blennerhassett5a498ef2010-05-27 17:53:52 +12001471
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001472u16 hpi_tuner_set_hd_radio_signal_blend(u32 h_control, const u32 blend);
Eliot Blennerhassett5a498ef2010-05-27 17:53:52 +12001473
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001474/***************/
1475/* PAD control */
1476/***************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001477
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001478u16 hpi_pad_get_channel_name(u32 h_control, char *psz_string,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001479 const u32 string_length);
1480
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001481u16 hpi_pad_get_artist(u32 h_control, char *psz_string,
1482 const u32 string_length);
1483
1484u16 hpi_pad_get_title(u32 h_control, char *psz_string,
1485 const u32 string_length);
1486
1487u16 hpi_pad_get_comment(u32 h_control, char *psz_string,
1488 const u32 string_length);
1489
1490u16 hpi_pad_get_program_type(u32 h_control, u32 *ppTY);
1491
1492u16 hpi_pad_get_rdsPI(u32 h_control, u32 *ppI);
1493
1494u16 hpi_pad_get_program_type_string(u32 h_control, const u32 data_type,
1495 const u32 pTY, char *psz_string, const u32 string_length);
1496
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001497/****************************/
1498/* AES/EBU Receiver control */
1499/****************************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001500u16 hpi_aesebu_receiver_query_format(const u32 h_aes_rx, const u32 index,
1501 u16 *pw_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001502
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001503u16 hpi_aesebu_receiver_set_format(u32 h_control, u16 source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001504
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001505u16 hpi_aesebu_receiver_get_format(u32 h_control, u16 *pw_source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001506
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001507u16 hpi_aesebu_receiver_get_sample_rate(u32 h_control, u32 *psample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001508
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001509u16 hpi_aesebu_receiver_get_user_data(u32 h_control, u16 index, u16 *pw_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001510
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001511u16 hpi_aesebu_receiver_get_channel_status(u32 h_control, u16 index,
1512 u16 *pw_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001513
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001514u16 hpi_aesebu_receiver_get_error_status(u32 h_control, u16 *pw_error_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001515
1516/*******************************/
1517/* AES/EBU Transmitter control */
1518/*******************************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001519u16 hpi_aesebu_transmitter_set_sample_rate(u32 h_control, u32 sample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001520
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001521u16 hpi_aesebu_transmitter_set_user_data(u32 h_control, u16 index, u16 data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001522
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001523u16 hpi_aesebu_transmitter_set_channel_status(u32 h_control, u16 index,
1524 u16 data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001525
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001526u16 hpi_aesebu_transmitter_get_channel_status(u32 h_control, u16 index,
1527 u16 *pw_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001528
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001529u16 hpi_aesebu_transmitter_query_format(const u32 h_aes_tx, const u32 index,
1530 u16 *pw_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001531
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001532u16 hpi_aesebu_transmitter_set_format(u32 h_control, u16 output_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001533
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001534u16 hpi_aesebu_transmitter_get_format(u32 h_control, u16 *pw_output_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001535
1536/***********************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001537/* Multiplexer control */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001538/***********************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001539u16 hpi_multiplexer_set_source(u32 h_control, u16 source_node_type,
1540 u16 source_node_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001541
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001542u16 hpi_multiplexer_get_source(u32 h_control, u16 *source_node_type,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001543 u16 *source_node_index);
1544
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001545u16 hpi_multiplexer_query_source(u32 h_control, u16 index,
1546 u16 *source_node_type, u16 *source_node_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001547
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001548/***************/
1549/* Vox control */
1550/***************/
1551u16 hpi_vox_set_threshold(u32 h_control, short an_gain0_01dB);
1552
1553u16 hpi_vox_get_threshold(u32 h_control, short *an_gain0_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001554
1555/*********************/
1556/* Bitstream control */
1557/*********************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001558u16 hpi_bitstream_set_clock_edge(u32 h_control, u16 edge_type);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001559
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001560u16 hpi_bitstream_set_data_polarity(u32 h_control, u16 polarity);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001561
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001562u16 hpi_bitstream_get_activity(u32 h_control, u16 *pw_clk_activity,
1563 u16 *pw_data_activity);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001564
1565/***********************/
1566/* SampleClock control */
1567/***********************/
1568
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001569u16 hpi_sample_clock_query_source(const u32 h_clock, const u32 index,
1570 u16 *pw_source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001571
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001572u16 hpi_sample_clock_set_source(u32 h_control, u16 source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001573
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001574u16 hpi_sample_clock_get_source(u32 h_control, u16 *pw_source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001575
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001576u16 hpi_sample_clock_query_source_index(const u32 h_clock, const u32 index,
1577 const u32 source, u16 *pw_source_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001578
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001579u16 hpi_sample_clock_set_source_index(u32 h_control, u16 source_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001580
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001581u16 hpi_sample_clock_get_source_index(u32 h_control, u16 *pw_source_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001582
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001583u16 hpi_sample_clock_get_sample_rate(u32 h_control, u32 *psample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001584
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001585u16 hpi_sample_clock_query_local_rate(const u32 h_clock, const u32 index,
1586 u32 *psource);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001587
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001588u16 hpi_sample_clock_set_local_rate(u32 h_control, u32 sample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001589
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001590u16 hpi_sample_clock_get_local_rate(u32 h_control, u32 *psample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001591
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001592u16 hpi_sample_clock_set_auto(u32 h_control, u32 enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001593
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001594u16 hpi_sample_clock_get_auto(u32 h_control, u32 *penable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001595
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001596u16 hpi_sample_clock_set_local_rate_lock(u32 h_control, u32 lock);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001597
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001598u16 hpi_sample_clock_get_local_rate_lock(u32 h_control, u32 *plock);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001599
1600/***********************/
1601/* Microphone control */
1602/***********************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001603u16 hpi_microphone_set_phantom_power(u32 h_control, u16 on_off);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001604
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001605u16 hpi_microphone_get_phantom_power(u32 h_control, u16 *pw_on_off);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001606
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001607/********************************/
1608/* Parametric Equalizer control */
1609/********************************/
1610u16 hpi_parametric_eq_get_info(u32 h_control, u16 *pw_number_of_bands,
1611 u16 *pw_enabled);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001612
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001613u16 hpi_parametric_eq_set_state(u32 h_control, u16 on_off);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001614
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001615u16 hpi_parametric_eq_set_band(u32 h_control, u16 index, u16 type,
1616 u32 frequency_hz, short q100, short gain0_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001617
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001618u16 hpi_parametric_eq_get_band(u32 h_control, u16 index, u16 *pn_type,
1619 u32 *pfrequency_hz, short *pnQ100, short *pn_gain0_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001620
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001621u16 hpi_parametric_eq_get_coeffs(u32 h_control, u16 index, short coeffs[5]
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001622 );
1623
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001624/*******************************/
1625/* Compressor Expander control */
1626/*******************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001627
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001628u16 hpi_compander_set_enable(u32 h_control, u32 on);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001629
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001630u16 hpi_compander_get_enable(u32 h_control, u32 *pon);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001631
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001632u16 hpi_compander_set_makeup_gain(u32 h_control, short makeup_gain0_01dB);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001633
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001634u16 hpi_compander_get_makeup_gain(u32 h_control, short *pn_makeup_gain0_01dB);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001635
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001636u16 hpi_compander_set_attack_time_constant(u32 h_control, u32 index,
1637 u32 attack);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001638
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001639u16 hpi_compander_get_attack_time_constant(u32 h_control, u32 index,
1640 u32 *pw_attack);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001641
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001642u16 hpi_compander_set_decay_time_constant(u32 h_control, u32 index,
1643 u32 decay);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001644
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001645u16 hpi_compander_get_decay_time_constant(u32 h_control, u32 index,
1646 u32 *pw_decay);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001647
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001648u16 hpi_compander_set_threshold(u32 h_control, u32 index,
1649 short threshold0_01dB);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001650
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001651u16 hpi_compander_get_threshold(u32 h_control, u32 index,
1652 short *pn_threshold0_01dB);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001653
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001654u16 hpi_compander_set_ratio(u32 h_control, u32 index, u32 ratio100);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001655
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001656u16 hpi_compander_get_ratio(u32 h_control, u32 index, u32 *pw_ratio100);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001657
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001658/********************/
1659/* Cobranet control */
1660/********************/
1661u16 hpi_cobranet_hmi_write(u32 h_control, u32 hmi_address, u32 byte_count,
1662 u8 *pb_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001663
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001664u16 hpi_cobranet_hmi_read(u32 h_control, u32 hmi_address, u32 max_byte_count,
1665 u32 *pbyte_count, u8 *pb_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001666
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001667u16 hpi_cobranet_hmi_get_status(u32 h_control, u32 *pstatus,
1668 u32 *preadable_size, u32 *pwriteable_size);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001669
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001670u16 hpi_cobranet_get_ip_address(u32 h_control, u32 *pdw_ip_address);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001671
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001672u16 hpi_cobranet_set_ip_address(u32 h_control, u32 dw_ip_address);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001673
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001674u16 hpi_cobranet_get_static_ip_address(u32 h_control, u32 *pdw_ip_address);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001675
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001676u16 hpi_cobranet_set_static_ip_address(u32 h_control, u32 dw_ip_address);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001677
Eliot Blennerhassett1d595d22011-02-10 17:26:08 +13001678u16 hpi_cobranet_get_macaddress(u32 h_control, u32 *p_mac_msbs,
1679 u32 *p_mac_lsbs);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001680
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001681/*************************/
1682/* Tone Detector control */
1683/*************************/
1684u16 hpi_tone_detector_get_state(u32 hC, u32 *state);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001685
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001686u16 hpi_tone_detector_set_enable(u32 hC, u32 enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001687
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001688u16 hpi_tone_detector_get_enable(u32 hC, u32 *enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001689
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001690u16 hpi_tone_detector_set_event_enable(u32 hC, u32 event_enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001691
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001692u16 hpi_tone_detector_get_event_enable(u32 hC, u32 *event_enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001693
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001694u16 hpi_tone_detector_set_threshold(u32 hC, int threshold);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001695
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001696u16 hpi_tone_detector_get_threshold(u32 hC, int *threshold);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001697
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001698u16 hpi_tone_detector_get_frequency(u32 hC, u32 index, u32 *frequency);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001699
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001700/****************************/
1701/* Silence Detector control */
1702/****************************/
1703u16 hpi_silence_detector_get_state(u32 hC, u32 *state);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001704
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001705u16 hpi_silence_detector_set_enable(u32 hC, u32 enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001706
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001707u16 hpi_silence_detector_get_enable(u32 hC, u32 *enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001708
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001709u16 hpi_silence_detector_set_event_enable(u32 hC, u32 event_enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001710
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001711u16 hpi_silence_detector_get_event_enable(u32 hC, u32 *event_enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001712
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001713u16 hpi_silence_detector_set_delay(u32 hC, u32 delay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001714
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001715u16 hpi_silence_detector_get_delay(u32 hC, u32 *delay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001716
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001717u16 hpi_silence_detector_set_threshold(u32 hC, int threshold);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001718
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001719u16 hpi_silence_detector_get_threshold(u32 hC, int *threshold);
1720/*********************/
1721/* Utility functions */
1722/*********************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001723
1724u16 hpi_format_create(struct hpi_format *p_format, u16 channels, u16 format,
1725 u32 sample_rate, u32 bit_rate, u32 attributes);
1726
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001727#endif /*_HPI_H_ */