blob: 9538f1297578a1a88b689e70034080c2a578e520 [file] [log] [blame]
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001/******************************************************************************
2
3 AudioScience HPI driver
4 Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of version 2 of the GNU General Public License as
8 published by the Free Software Foundation;
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19*/
20/** \file hpi.h
21
22 AudioScience Hardware Programming Interface (HPI)
23 public API definition.
24
25 The HPI is a low-level hardware abstraction layer to all
26 AudioScience digital audio adapters
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_
33/* HPI Version
34If HPI_VER_MINOR is odd then its a development release not intended for the
35public. If HPI_VER_MINOR is even then is a release version
36i.e 3.05.02 is a development version
37*/
38#define HPI_VERSION_CONSTRUCTOR(maj, min, rel) \
39 ((maj << 16) + (min << 8) + rel)
40
41#define HPI_VER_MAJOR(v) ((int)(v >> 16))
42#define HPI_VER_MINOR(v) ((int)((v >> 8) & 0xFF))
43#define HPI_VER_RELEASE(v) ((int)(v & 0xFF))
44
45/* Use single digits for versions less that 10 to avoid octal. */
Eliot Blennerhassett88b27fd2011-02-10 17:26:21 +130046#define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 6, 0)
47#define HPI_VER_STRING "4.06.00"
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +020048
49/* Library version as documented in hpi-api-versions.txt */
50#define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(9, 0, 0)
51
52#include <linux/types.h>
Eliot Blennerhassetta287ca22011-02-10 17:26:17 +130053#define HPI_BUILD_EXCLUDE_DEPRECATED
54#define HPI_BUILD_KERNEL_MODE
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +020055
56/******************************************************************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +020057/******** HPI API DEFINITIONS *****/
58/******************************************************************************/
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +130059
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +020060/*******************************************/
61/** Audio format types
62\ingroup stream
63*/
64enum HPI_FORMATS {
65/** Used internally on adapter. */
66 HPI_FORMAT_MIXER_NATIVE = 0,
67/** 8-bit unsigned PCM. Windows equivalent is WAVE_FORMAT_PCM. */
68 HPI_FORMAT_PCM8_UNSIGNED = 1,
69/** 16-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM. */
70 HPI_FORMAT_PCM16_SIGNED = 2,
71/** MPEG-1 Layer-1. */
72 HPI_FORMAT_MPEG_L1 = 3,
73/** MPEG-1 Layer-2.
74
75Windows equivalent is WAVE_FORMAT_MPEG.
76
77The following table shows what combinations of mode and bitrate are possible:
78
79<table border=1 cellspacing=0 cellpadding=5>
80<tr>
81<td><p><b>Bitrate (kbs)</b></p>
82<td><p><b>Mono</b></p>
83<td><p><b>Stereo,<br>Joint Stereo or<br>Dual Channel</b></p>
84
85<tr><td>32<td>X<td>_
86<tr><td>40<td>_<td>_
87<tr><td>48<td>X<td>_
88<tr><td>56<td>X<td>_
89<tr><td>64<td>X<td>X
90<tr><td>80<td>X<td>_
91<tr><td>96<td>X<td>X
92<tr><td>112<td>X<td>X
93<tr><td>128<td>X<td>X
94<tr><td>160<td>X<td>X
95<tr><td>192<td>X<td>X
96<tr><td>224<td>_<td>X
97<tr><td>256<td>-<td>X
98<tr><td>320<td>-<td>X
99<tr><td>384<td>_<td>X
100</table>
101*/
102 HPI_FORMAT_MPEG_L2 = 4,
103/** MPEG-1 Layer-3.
104Windows equivalent is WAVE_FORMAT_MPEG.
105
106The following table shows what combinations of mode and bitrate are possible:
107
108<table border=1 cellspacing=0 cellpadding=5>
109<tr>
110<td><p><b>Bitrate (kbs)</b></p>
111<td><p><b>Mono<br>Stereo @ 8,<br>11.025 and<br>12kHz*</b></p>
112<td><p><b>Mono<br>Stereo @ 16,<br>22.050 and<br>24kHz*</b></p>
113<td><p><b>Mono<br>Stereo @ 32,<br>44.1 and<br>48kHz</b></p>
114
115<tr><td>16<td>X<td>X<td>_
116<tr><td>24<td>X<td>X<td>_
117<tr><td>32<td>X<td>X<td>X
118<tr><td>40<td>X<td>X<td>X
119<tr><td>48<td>X<td>X<td>X
120<tr><td>56<td>X<td>X<td>X
121<tr><td>64<td>X<td>X<td>X
122<tr><td>80<td>_<td>X<td>X
123<tr><td>96<td>_<td>X<td>X
124<tr><td>112<td>_<td>X<td>X
125<tr><td>128<td>_<td>X<td>X
126<tr><td>144<td>_<td>X<td>_
127<tr><td>160<td>_<td>X<td>X
128<tr><td>192<td>_<td>_<td>X
129<tr><td>224<td>_<td>_<td>X
130<tr><td>256<td>-<td>_<td>X
131<tr><td>320<td>-<td>_<td>X
132</table>
133\b * Available on the ASI6000 series only
134*/
135 HPI_FORMAT_MPEG_L3 = 5,
136/** Dolby AC-2. */
137 HPI_FORMAT_DOLBY_AC2 = 6,
138/** Dolbt AC-3. */
139 HPI_FORMAT_DOLBY_AC3 = 7,
140/** 16-bit PCM big-endian. */
141 HPI_FORMAT_PCM16_BIGENDIAN = 8,
142/** TAGIT-1 algorithm - hits. */
143 HPI_FORMAT_AA_TAGIT1_HITS = 9,
144/** TAGIT-1 algorithm - inserts. */
145 HPI_FORMAT_AA_TAGIT1_INSERTS = 10,
146/** 32-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM.
147Each sample is a 32bit word. The most significant 24 bits contain a 24-bit
148sample and the least significant 8 bits are set to 0.
149*/
150 HPI_FORMAT_PCM32_SIGNED = 11,
151/** Raw bitstream - unknown format. */
152 HPI_FORMAT_RAW_BITSTREAM = 12,
153/** TAGIT-1 algorithm hits - extended. */
154 HPI_FORMAT_AA_TAGIT1_HITS_EX1 = 13,
155/** 32-bit PCM as an IEEE float. Windows equivalent is WAVE_FORMAT_IEEE_FLOAT.
156Each sample is a 32bit word in IEEE754 floating point format.
157The range is +1.0 to -1.0, which corresponds to digital fullscale.
158*/
159 HPI_FORMAT_PCM32_FLOAT = 14,
160/** 24-bit PCM signed. Windows equivalent is WAVE_FORMAT_PCM. */
161 HPI_FORMAT_PCM24_SIGNED = 15,
162/** OEM format 1 - private. */
163 HPI_FORMAT_OEM1 = 16,
164/** OEM format 2 - private. */
165 HPI_FORMAT_OEM2 = 17,
166/** Undefined format. */
167 HPI_FORMAT_UNDEFINED = 0xffff
168};
169
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200170/*******************************************/
171/** Stream States
172\ingroup stream
173*/
174enum HPI_STREAM_STATES {
175 /** State stopped - stream is stopped. */
176 HPI_STATE_STOPPED = 1,
177 /** State playing - stream is playing audio. */
178 HPI_STATE_PLAYING = 2,
179 /** State recording - stream is recording. */
180 HPI_STATE_RECORDING = 3,
181 /** State drained - playing stream ran out of data to play. */
182 HPI_STATE_DRAINED = 4,
183 /** State generate sine - to be implemented. */
184 HPI_STATE_SINEGEN = 5,
185 /** State wait - used for inter-card sync to mean waiting for all
186 cards to be ready. */
187 HPI_STATE_WAIT = 6
188};
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300189/*******************************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200190/** Source node types
191\ingroup mixer
192*/
193enum HPI_SOURCENODES {
194 /** This define can be used instead of 0 to indicate
195 that there is no valid source node. A control that
196 exists on a destination node can be searched for using a source
197 node value of either 0, or HPI_SOURCENODE_NONE */
198 HPI_SOURCENODE_NONE = 100,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200199 /** Out Stream (Play) node. */
200 HPI_SOURCENODE_OSTREAM = 101,
201 /** Line in node - could be analog, AES/EBU or network. */
202 HPI_SOURCENODE_LINEIN = 102,
203 HPI_SOURCENODE_AESEBU_IN = 103, /**< AES/EBU input node. */
204 HPI_SOURCENODE_TUNER = 104, /**< tuner node. */
205 HPI_SOURCENODE_RF = 105, /**< RF input node. */
206 HPI_SOURCENODE_CLOCK_SOURCE = 106, /**< clock source node. */
207 HPI_SOURCENODE_RAW_BITSTREAM = 107, /**< raw bitstream node. */
208 HPI_SOURCENODE_MICROPHONE = 108, /**< microphone node. */
209 /** Cobranet input node -
210 Audio samples come from the Cobranet network and into the device. */
211 HPI_SOURCENODE_COBRANET = 109,
212 HPI_SOURCENODE_ANALOG = 110, /**< analog input node. */
213 HPI_SOURCENODE_ADAPTER = 111, /**< adapter node. */
Eliot Blennerhassettb7f12482011-07-22 15:52:55 +1200214 /** RTP stream input node - This node is a destination for
215 packets of RTP audio samples from other devices. */
216 HPI_SOURCENODE_RTP_DESTINATION = 112,
217 HPI_SOURCENODE_GP_IN = 113, /**< general purpose input. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200218 /* !!!Update this AND hpidebug.h if you add a new sourcenode type!!! */
Eliot Blennerhassettb7f12482011-07-22 15:52:55 +1200219 HPI_SOURCENODE_LAST_INDEX = 113 /**< largest ID */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200220 /* AX6 max sourcenode types = 15 */
221};
222
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300223/*******************************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200224/** Destination node types
225\ingroup mixer
226*/
227enum HPI_DESTNODES {
228 /** This define can be used instead of 0 to indicate
229 that there is no valid destination node. A control that
230 exists on a source node can be searched for using a destination
231 node value of either 0, or HPI_DESTNODE_NONE */
232 HPI_DESTNODE_NONE = 200,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200233 /** In Stream (Record) node. */
234 HPI_DESTNODE_ISTREAM = 201,
Eliot Blennerhassettb7f12482011-07-22 15:52:55 +1200235 HPI_DESTNODE_LINEOUT = 202, /**< line out node. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200236 HPI_DESTNODE_AESEBU_OUT = 203, /**< AES/EBU output node. */
237 HPI_DESTNODE_RF = 204, /**< RF output node. */
238 HPI_DESTNODE_SPEAKER = 205, /**< speaker output node. */
239 /** Cobranet output node -
240 Audio samples from the device are sent out on the Cobranet network.*/
241 HPI_DESTNODE_COBRANET = 206,
242 HPI_DESTNODE_ANALOG = 207, /**< analog output node. */
Eliot Blennerhassettb7f12482011-07-22 15:52:55 +1200243 /** RTP stream output node - This node is a source for
244 packets of RTP audio samples that are sent to other devices. */
245 HPI_DESTNODE_RTP_SOURCE = 208,
246 HPI_DESTNODE_GP_OUT = 209, /**< general purpose output node. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200247 /* !!!Update this AND hpidebug.h if you add a new destnode type!!! */
Eliot Blennerhassettb7f12482011-07-22 15:52:55 +1200248 HPI_DESTNODE_LAST_INDEX = 209 /**< largest ID */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200249 /* AX6 max destnode types = 15 */
250};
251
252/*******************************************/
253/** Mixer control types
254\ingroup mixer
255*/
256enum HPI_CONTROLS {
257 HPI_CONTROL_GENERIC = 0, /**< generic control. */
258 HPI_CONTROL_CONNECTION = 1, /**< A connection between nodes. */
259 HPI_CONTROL_VOLUME = 2, /**< volume control - works in dB_fs. */
260 HPI_CONTROL_METER = 3, /**< peak meter control. */
261 HPI_CONTROL_MUTE = 4, /*mute control - not used at present. */
262 HPI_CONTROL_MULTIPLEXER = 5, /**< multiplexer control. */
263
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300264 HPI_CONTROL_AESEBU_TRANSMITTER = 6, /**< AES/EBU transmitter control */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300265 HPI_CONTROL_AESEBUTX = 6, /* HPI_CONTROL_AESEBU_TRANSMITTER */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200266
267 HPI_CONTROL_AESEBU_RECEIVER = 7, /**< AES/EBU receiver control. */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300268 HPI_CONTROL_AESEBURX = 7, /* HPI_CONTROL_AESEBU_RECEIVER */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200269
270 HPI_CONTROL_LEVEL = 8, /**< level/trim control - works in d_bu. */
271 HPI_CONTROL_TUNER = 9, /**< tuner control. */
272/* HPI_CONTROL_ONOFFSWITCH = 10 */
273 HPI_CONTROL_VOX = 11, /**< vox control. */
274/* HPI_CONTROL_AES18_TRANSMITTER = 12 */
275/* HPI_CONTROL_AES18_RECEIVER = 13 */
276/* HPI_CONTROL_AES18_BLOCKGENERATOR = 14 */
277 HPI_CONTROL_CHANNEL_MODE = 15, /**< channel mode control. */
278
279 HPI_CONTROL_BITSTREAM = 16, /**< bitstream control. */
280 HPI_CONTROL_SAMPLECLOCK = 17, /**< sample clock control. */
281 HPI_CONTROL_MICROPHONE = 18, /**< microphone control. */
282 HPI_CONTROL_PARAMETRIC_EQ = 19, /**< parametric EQ control. */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300283 HPI_CONTROL_EQUALIZER = 19, /*HPI_CONTROL_PARAMETRIC_EQ */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200284
285 HPI_CONTROL_COMPANDER = 20, /**< compander control. */
286 HPI_CONTROL_COBRANET = 21, /**< cobranet control. */
287 HPI_CONTROL_TONEDETECTOR = 22, /**< tone detector control. */
288 HPI_CONTROL_SILENCEDETECTOR = 23, /**< silence detector control. */
289 HPI_CONTROL_PAD = 24, /**< tuner PAD control. */
290 HPI_CONTROL_SRC = 25, /**< samplerate converter control. */
291 HPI_CONTROL_UNIVERSAL = 26, /**< universal control. */
292
293/* !!! Update this AND hpidebug.h if you add a new control type!!!*/
294 HPI_CONTROL_LAST_INDEX = 26 /**<highest control type ID */
295/* WARNING types 256 or greater impact bit packing in all AX6 DSP code */
296};
297
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300298/*******************************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200299/** Adapter properties
300These are used in HPI_AdapterSetProperty() and HPI_AdapterGetProperty()
301\ingroup adapter
302*/
303enum HPI_ADAPTER_PROPERTIES {
304/** \internal Used in dwProperty field of HPI_AdapterSetProperty() and
305HPI_AdapterGetProperty(). This errata applies to all ASI6000 cards with both
306analog and digital outputs. The CS4224 A/D+D/A has a one sample delay between
307left and right channels on both its input (ADC) and output (DAC).
308More details are available in Cirrus Logic errata ER284B2.
309PDF available from www.cirrus.com, released by Cirrus in 2001.
310*/
311 HPI_ADAPTER_PROPERTY_ERRATA_1 = 1,
312
313/** Adapter grouping property
314Indicates whether the adapter supports the grouping API (for ASIO and SSX2)
315*/
316 HPI_ADAPTER_PROPERTY_GROUPING = 2,
317
318/** Driver SSX2 property
319Tells the kernel driver to turn on SSX2 stream mapping.
320This feature is not used by the DSP. In fact the call is completely processed
321by the driver and is not passed on to the DSP at all.
322*/
323 HPI_ADAPTER_PROPERTY_ENABLE_SSX2 = 3,
324
325/** Adapter SSX2 property
326Indicates the state of the adapter's SSX2 setting. This setting is stored in
327non-volatile memory on the adapter. A typical call sequence would be to use
328HPI_ADAPTER_PROPERTY_SSX2_SETTING to set SSX2 on the adapter and then to reload
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300329the driver. The driver would query HPI_ADAPTER_PROPERTY_SSX2_SETTING during
330startup and if SSX2 is set, it would then call HPI_ADAPTER_PROPERTY_ENABLE_SSX2
331to enable SSX2 stream mapping within the kernel level of the driver.
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200332*/
333 HPI_ADAPTER_PROPERTY_SSX2_SETTING = 4,
334
Eliot Blennerhassettbd33c1c2011-02-10 17:26:16 +1300335/** Enables/disables PCI(e) IRQ.
336A setting of 0 indicates that no interrupts are being generated. A DSP boot
337this property is set to 0. Setting to a non-zero value specifies the number
338of frames of audio that should be processed between interrupts. This property
339should be set to multiple of the mixer interval as read back from the
340HPI_ADAPTER_PROPERTY_INTERVAL property.
341*/
342 HPI_ADAPTER_PROPERTY_IRQ_RATE = 5,
343
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200344/** Base number for readonly properties */
345 HPI_ADAPTER_PROPERTY_READONLYBASE = 256,
346
347/** Readonly adapter latency property.
348This property returns in the input and output latency in samples.
349Property 1 is the estimated input latency
350in samples, while Property 2 is that output latency in samples.
351*/
352 HPI_ADAPTER_PROPERTY_LATENCY = 256,
353
354/** Readonly adapter granularity property.
355The granulariy is the smallest size chunk of stereo samples that is processed by
356the adapter.
357This property returns the record granularity in samples in Property 1.
358Property 2 returns the play granularity.
359*/
360 HPI_ADAPTER_PROPERTY_GRANULARITY = 257,
361
362/** Readonly adapter number of current channels property.
363Property 1 is the number of record channels per record device.
364Property 2 is the number of play channels per playback device.*/
365 HPI_ADAPTER_PROPERTY_CURCHANNELS = 258,
366
367/** Readonly adapter software version.
368The SOFTWARE_VERSION property returns the version of the software running
369on the adapter as Major.Minor.Release.
370Property 1 contains Major in bits 15..8 and Minor in bits 7..0.
371Property 2 contains Release in bits 7..0. */
372 HPI_ADAPTER_PROPERTY_SOFTWARE_VERSION = 259,
373
374/** Readonly adapter MAC address MSBs.
375The MAC_ADDRESS_MSB property returns
376the most significant 32 bits of the MAC address.
377Property 1 contains bits 47..32 of the MAC address.
378Property 2 contains bits 31..16 of the MAC address. */
379 HPI_ADAPTER_PROPERTY_MAC_ADDRESS_MSB = 260,
380
381/** Readonly adapter MAC address LSBs
382The MAC_ADDRESS_LSB property returns
383the least significant 16 bits of the MAC address.
384Property 1 contains bits 15..0 of the MAC address. */
385 HPI_ADAPTER_PROPERTY_MAC_ADDRESS_LSB = 261,
386
387/** Readonly extended adapter type number
388The EXTENDED_ADAPTER_TYPE property returns the 4 digits of an extended
389adapter type, i.e ASI8920-0022, 0022 is the extended type.
390The digits are returned as ASCII characters rather than the hex digits that
391are returned for the main type
392Property 1 returns the 1st two (left most) digits, i.e "00"
393in the example above, the upper byte being the left most digit.
394Property 2 returns the 2nd two digits, i.e "22" in the example above*/
395 HPI_ADAPTER_PROPERTY_EXTENDED_ADAPTER_TYPE = 262,
396
397/** Readonly debug log buffer information */
398 HPI_ADAPTER_PROPERTY_LOGTABLEN = 263,
399 HPI_ADAPTER_PROPERTY_LOGTABBEG = 264,
400
401/** Readonly adapter IP address
402For 192.168.1.101
403Property 1 returns the 1st two (left most) digits, i.e 192*256 + 168
404in the example above, the upper byte being the left most digit.
405Property 2 returns the 2nd two digits, i.e 1*256 + 101 in the example above, */
406 HPI_ADAPTER_PROPERTY_IP_ADDRESS = 265,
407
408/** Readonly adapter buffer processed count. Returns a buffer processed count
409that is incremented every time all buffers for all streams are updated. This
410is useful for checking completion of all stream operations across the adapter
411when using grouped streams.
412*/
413 HPI_ADAPTER_PROPERTY_BUFFER_UPDATE_COUNT = 266,
414
415/** Readonly mixer and stream intervals
416
417These intervals are measured in mixer frames.
418To convert to time, divide by the adapter samplerate.
419
420The mixer interval is the number of frames processed in one mixer iteration.
421The stream update interval is the interval at which streams check for and
422process data, and BBM host buffer counters are updated.
423
424Property 1 is the mixer interval in mixer frames.
425Property 2 is the stream update interval in mixer frames.
426*/
427 HPI_ADAPTER_PROPERTY_INTERVAL = 267,
428/** Adapter capabilities 1
429Property 1 - adapter can do multichannel (SSX1)
430Property 2 - adapter can do stream grouping (supports SSX2)
431*/
432 HPI_ADAPTER_PROPERTY_CAPS1 = 268,
433/** Adapter capabilities 2
434Property 1 - adapter can do samplerate conversion (MRX)
435Property 2 - adapter can do timestretch (TSX)
436*/
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +1200437 HPI_ADAPTER_PROPERTY_CAPS2 = 269,
438
439/** Readonly adapter sync header connection count.
440*/
441 HPI_ADAPTER_PROPERTY_SYNC_HEADER_CONNECTIONS = 270,
442/** Readonly supports SSX2 property.
443Indicates the adapter supports SSX2 in some mode setting. The
444return value is true (1) or false (0). If the current adapter
445mode is MONO SSX2 is disabled, even though this property will
446return true.
447*/
Eliot Blennerhassettbd33c1c2011-02-10 17:26:16 +1300448 HPI_ADAPTER_PROPERTY_SUPPORTS_SSX2 = 271,
449/** Readonly supports PCI(e) IRQ.
450Indicates that the adapter in it's current mode supports interrupts
451across the host bus. Note, this does not imply that interrupts are
452enabled. Instead it indicates that they can be enabled.
453*/
454 HPI_ADAPTER_PROPERTY_SUPPORTS_IRQ = 272
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200455};
456
457/** Adapter mode commands
458
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300459Used in wQueryOrSet parameter of HPI_AdapterSetModeEx().
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200460\ingroup adapter
461*/
462enum HPI_ADAPTER_MODE_CMDS {
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300463 /** Set the mode to the given parameter */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200464 HPI_ADAPTER_MODE_SET = 0,
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300465 /** Return 0 or error depending whether mode is valid,
466 but don't set the mode */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200467 HPI_ADAPTER_MODE_QUERY = 1
468};
469
470/** Adapter Modes
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300471 These are used by HPI_AdapterSetModeEx()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200472
473\warning - more than 16 possible modes breaks
474a bitmask in the Windows WAVE DLL
475\ingroup adapter
476*/
477enum HPI_ADAPTER_MODES {
478/** 4 outstream mode.
479- ASI6114: 1 instream
480- ASI6044: 4 instreams
481- ASI6012: 1 instream
482- ASI6102: no instreams
483- ASI6022, ASI6122: 2 instreams
484- ASI5111, ASI5101: 2 instreams
485- ASI652x, ASI662x: 2 instreams
486- ASI654x, ASI664x: 4 instreams
487*/
488 HPI_ADAPTER_MODE_4OSTREAM = 1,
489
490/** 6 outstream mode.
491- ASI6012: 1 instream,
492- ASI6022, ASI6122: 2 instreams
493- ASI652x, ASI662x: 4 instreams
494*/
495 HPI_ADAPTER_MODE_6OSTREAM = 2,
496
497/** 8 outstream mode.
498- ASI6114: 8 instreams
499- ASI6118: 8 instreams
500- ASI6585: 8 instreams
501*/
502 HPI_ADAPTER_MODE_8OSTREAM = 3,
503
504/** 16 outstream mode.
505- ASI6416 16 instreams
506- ASI6518, ASI6618 16 instreams
507- ASI6118 16 mono out and in streams
508*/
509 HPI_ADAPTER_MODE_16OSTREAM = 4,
510
511/** one outstream mode.
512- ASI5111 1 outstream, 1 instream
513*/
514 HPI_ADAPTER_MODE_1OSTREAM = 5,
515
516/** ASI504X mode 1. 12 outstream, 4 instream 0 to 48kHz sample rates
517 (see ASI504X datasheet for more info).
518*/
519 HPI_ADAPTER_MODE_1 = 6,
520
521/** ASI504X mode 2. 4 outstreams, 4 instreams at 0 to 192kHz sample rates
522 (see ASI504X datasheet for more info).
523*/
524 HPI_ADAPTER_MODE_2 = 7,
525
526/** ASI504X mode 3. 4 outstreams, 4 instreams at 0 to 192kHz sample rates
527 (see ASI504X datasheet for more info).
528*/
529 HPI_ADAPTER_MODE_3 = 8,
530
531/** ASI504X multichannel mode.
532 2 outstreams -> 4 line outs = 1 to 8 channel streams),
533 4 lineins -> 1 instream (1 to 8 channel streams) at 0-48kHz.
534 For more info see the SSX Specification.
535*/
536 HPI_ADAPTER_MODE_MULTICHANNEL = 9,
537
538/** 12 outstream mode.
539- ASI6514, ASI6614: 2 instreams
540- ASI6540,ASI6544: 8 instreams
541- ASI6640,ASI6644: 8 instreams
542*/
543 HPI_ADAPTER_MODE_12OSTREAM = 10,
544
545/** 9 outstream mode.
546- ASI6044: 8 instreams
547*/
548 HPI_ADAPTER_MODE_9OSTREAM = 11,
549
550/** mono mode.
551- ASI6416: 16 outstreams/instreams
552- ASI5402: 2 outstreams/instreams
553*/
554 HPI_ADAPTER_MODE_MONO = 12,
555
556/** Low latency mode.
557- ASI6416/ASI6316: 1 16 channel outstream and instream
558*/
559 HPI_ADAPTER_MODE_LOW_LATENCY = 13
560};
561
562/* Note, adapters can have more than one capability -
563encoding as bitfield is recommended. */
564#define HPI_CAPABILITY_NONE (0)
565#define HPI_CAPABILITY_MPEG_LAYER3 (1)
566
567/* Set this equal to maximum capability index,
568Must not be greater than 32 - see axnvdef.h */
569#define HPI_CAPABILITY_MAX 1
570/* #define HPI_CAPABILITY_AAC 2 */
571
572/******************************************* STREAM ATTRIBUTES ****/
573
574/** MPEG Ancillary Data modes
575
576The mode for the ancillary data insertion or extraction to operate in.
577\ingroup stream
578*/
579enum HPI_MPEG_ANC_MODES {
580 /** the MPEG frames have energy information stored in them (5 bytes per stereo frame, 3 per mono) */
581 HPI_MPEG_ANC_HASENERGY = 0,
582 /** the entire ancillary data field is taken up by data from the Anc data buffer
583 On encode, the encoder will insert the energy bytes before filling the remainder
584 of the ancillary data space with data from the ancillary data buffer.
585 */
586 HPI_MPEG_ANC_RAW = 1
587};
588
589/** Ancillary Data Alignment
590\ingroup instream
591*/
592enum HPI_ISTREAM_MPEG_ANC_ALIGNS {
593 /** data is packed against the end of data, then padded to the end of frame */
594 HPI_MPEG_ANC_ALIGN_LEFT = 0,
595 /** data is packed against the end of the frame */
596 HPI_MPEG_ANC_ALIGN_RIGHT = 1
597};
598
599/** MPEG modes
600MPEG modes - can be used optionally for HPI_FormatCreate()
601parameter dwAttributes.
602
603Using any mode setting other than HPI_MPEG_MODE_DEFAULT
604with single channel format will return an error.
605\ingroup stream
606*/
607enum HPI_MPEG_MODES {
608/** Causes the MPEG-1 Layer II bitstream to be recorded
609in single_channel mode when the number of channels is 1 and in stereo when the
610number of channels is 2. */
611 HPI_MPEG_MODE_DEFAULT = 0,
612 /** Standard stereo without joint-stereo compression */
613 HPI_MPEG_MODE_STEREO = 1,
614 /** Joint stereo */
615 HPI_MPEG_MODE_JOINTSTEREO = 2,
616 /** Left and Right channels are completely independent */
617 HPI_MPEG_MODE_DUALCHANNEL = 3
618};
619/******************************************* MIXER ATTRIBUTES ****/
620
621/* \defgroup mixer_flags Mixer flags for HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES
622{
623*/
624#define HPI_MIXER_GET_CONTROL_MULTIPLE_CHANGED (0)
625#define HPI_MIXER_GET_CONTROL_MULTIPLE_RESET (1)
626/*}*/
627
628/** Commands used by HPI_MixerStore()
629\ingroup mixer
630*/
631enum HPI_MIXER_STORE_COMMAND {
632/** Save all mixer control settings. */
633 HPI_MIXER_STORE_SAVE = 1,
634/** Restore all controls from saved. */
635 HPI_MIXER_STORE_RESTORE = 2,
636/** Delete saved control settings. */
637 HPI_MIXER_STORE_DELETE = 3,
638/** Enable auto storage of some control settings. */
639 HPI_MIXER_STORE_ENABLE = 4,
640/** Disable auto storage of some control settings. */
641 HPI_MIXER_STORE_DISABLE = 5,
642/** Save the attributes of a single control. */
643 HPI_MIXER_STORE_SAVE_SINGLE = 6
644};
645
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300646/****************************/
647/* CONTROL ATTRIBUTE VALUES */
648/****************************/
649
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200650/** Used by mixer plugin enable functions
651
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300652E.g. HPI_ParametricEq_SetState()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200653\ingroup mixer
654*/
655enum HPI_SWITCH_STATES {
656 HPI_SWITCH_OFF = 0, /**< turn the mixer plugin on. */
657 HPI_SWITCH_ON = 1 /**< turn the mixer plugin off. */
658};
659
660/* Volume control special gain values */
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300661
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200662/** volumes units are 100ths of a dB
663\ingroup volume
664*/
665#define HPI_UNITS_PER_dB 100
666/** turns volume control OFF or MUTE
667\ingroup volume
668*/
669#define HPI_GAIN_OFF (-100 * HPI_UNITS_PER_dB)
670
Eliot Blennerhassettfc3a3992011-02-10 17:26:11 +1300671/** channel mask specifying all channels
672\ingroup volume
673*/
674#define HPI_BITMASK_ALL_CHANNELS (0xFFFFFFFF)
675
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200676/** value returned for no signal
677\ingroup meter
678*/
679#define HPI_METER_MINIMUM (-150 * HPI_UNITS_PER_dB)
680
681/** autofade profiles
682\ingroup volume
683*/
684enum HPI_VOLUME_AUTOFADES {
685/** log fade - dB attenuation changes linearly over time */
686 HPI_VOLUME_AUTOFADE_LOG = 2,
687/** linear fade - amplitude changes linearly */
688 HPI_VOLUME_AUTOFADE_LINEAR = 3
689};
690
691/** The physical encoding format of the AESEBU I/O.
692
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300693Used in HPI_Aesebu_Transmitter_SetFormat(), HPI_Aesebu_Receiver_SetFormat()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200694along with related Get and Query functions
695\ingroup aestx
696*/
697enum HPI_AESEBU_FORMATS {
698/** AES/EBU physical format - AES/EBU balanced "professional" */
699 HPI_AESEBU_FORMAT_AESEBU = 1,
700/** AES/EBU physical format - S/PDIF unbalanced "consumer" */
701 HPI_AESEBU_FORMAT_SPDIF = 2
702};
703
704/** AES/EBU error status bits
705
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300706Returned by HPI_Aesebu_Receiver_GetErrorStatus()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200707\ingroup aesrx
708*/
709enum HPI_AESEBU_ERRORS {
710/** bit0: 1 when PLL is not locked */
711 HPI_AESEBU_ERROR_NOT_LOCKED = 0x01,
712/** bit1: 1 when signal quality is poor */
713 HPI_AESEBU_ERROR_POOR_QUALITY = 0x02,
714/** bit2: 1 when there is a parity error */
715 HPI_AESEBU_ERROR_PARITY_ERROR = 0x04,
716/** bit3: 1 when there is a bi-phase coding violation */
717 HPI_AESEBU_ERROR_BIPHASE_VIOLATION = 0x08,
718/** bit4: 1 when the validity bit is high */
719 HPI_AESEBU_ERROR_VALIDITY = 0x10,
720/** bit5: 1 when the CRC error bit is high */
721 HPI_AESEBU_ERROR_CRC = 0x20
722};
723
724/** \addtogroup pad
725\{
726*/
727/** The text string containing the station/channel combination. */
728#define HPI_PAD_CHANNEL_NAME_LEN 16
729/** The text string containing the artist. */
730#define HPI_PAD_ARTIST_LEN 64
731/** The text string containing the title. */
732#define HPI_PAD_TITLE_LEN 64
733/** The text string containing the comment. */
734#define HPI_PAD_COMMENT_LEN 256
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300735/** The PTY when the tuner has not received any PTY. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200736#define HPI_PAD_PROGRAM_TYPE_INVALID 0xffff
737/** \} */
738
739/** Data types for PTY string translation.
740\ingroup rds
741*/
742enum eHPI_RDS_type {
743 HPI_RDS_DATATYPE_RDS = 0, /**< RDS bitstream.*/
744 HPI_RDS_DATATYPE_RBDS = 1 /**< RBDS bitstream.*/
745};
746
747/** Tuner bands
748
749Used for HPI_Tuner_SetBand(),HPI_Tuner_GetBand()
750\ingroup tuner
751*/
752enum HPI_TUNER_BAND {
753 HPI_TUNER_BAND_AM = 1, /**< AM band */
754 HPI_TUNER_BAND_FM = 2, /**< FM band (mono) */
755 HPI_TUNER_BAND_TV_NTSC_M = 3, /**< NTSC-M TV band*/
756 HPI_TUNER_BAND_TV = 3, /* use TV_NTSC_M */
757 HPI_TUNER_BAND_FM_STEREO = 4, /**< FM band (stereo) */
758 HPI_TUNER_BAND_AUX = 5, /**< auxiliary input */
759 HPI_TUNER_BAND_TV_PAL_BG = 6, /**< PAL-B/G TV band*/
760 HPI_TUNER_BAND_TV_PAL_I = 7, /**< PAL-I TV band*/
761 HPI_TUNER_BAND_TV_PAL_DK = 8, /**< PAL-D/K TV band*/
762 HPI_TUNER_BAND_TV_SECAM_L = 9, /**< SECAM-L TV band*/
763 HPI_TUNER_BAND_LAST = 9 /**< the index of the last tuner band. */
764};
765
766/** Tuner mode attributes
767
768Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
769\ingroup tuner
770
771*/
772enum HPI_TUNER_MODES {
773 HPI_TUNER_MODE_RSS = 1, /**< control RSS */
774 HPI_TUNER_MODE_RDS = 2 /**< control RBDS/RDS */
775};
776
777/** Tuner mode attribute values
778
779Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
780\ingroup tuner
781*/
782enum HPI_TUNER_MODE_VALUES {
783/* RSS attribute values */
784 HPI_TUNER_MODE_RSS_DISABLE = 0, /**< RSS disable */
785 HPI_TUNER_MODE_RSS_ENABLE = 1, /**< RSS enable */
786
787/* RDS mode attributes */
788 HPI_TUNER_MODE_RDS_DISABLE = 0, /**< RDS - disabled */
789 HPI_TUNER_MODE_RDS_RDS = 1, /**< RDS - RDS mode */
790 HPI_TUNER_MODE_RDS_RBDS = 2 /**< RDS - RBDS mode */
791};
792
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200793/** Tuner Status Bits
794
795These bitfield values are returned by a call to HPI_Tuner_GetStatus().
796Multiple fields are returned from a single call.
797\ingroup tuner
798*/
799enum HPI_TUNER_STATUS_BITS {
800 HPI_TUNER_VIDEO_COLOR_PRESENT = 0x0001, /**< video color is present. */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300801 HPI_TUNER_VIDEO_IS_60HZ = 0x0020, /**< 60 hz video detected. */
802 HPI_TUNER_VIDEO_HORZ_SYNC_MISSING = 0x0040, /**< video HSYNC is missing. */
803 HPI_TUNER_VIDEO_STATUS_VALID = 0x0100, /**< video status is valid. */
804 HPI_TUNER_DIGITAL = 0x0200, /**< tuner reports digital programming. */
805 HPI_TUNER_MULTIPROGRAM = 0x0400, /**< tuner reports multiple programs. */
806 HPI_TUNER_PLL_LOCKED = 0x1000, /**< the tuner's PLL is locked. */
807 HPI_TUNER_FM_STEREO = 0x2000 /**< tuner reports back FM stereo. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200808};
809
810/** Channel Modes
811Used for HPI_ChannelModeSet/Get()
812\ingroup channelmode
813*/
814enum HPI_CHANNEL_MODES {
815/** Left channel out = left channel in, Right channel out = right channel in. */
816 HPI_CHANNEL_MODE_NORMAL = 1,
817/** Left channel out = right channel in, Right channel out = left channel in. */
818 HPI_CHANNEL_MODE_SWAP = 2,
819/** Left channel out = left channel in, Right channel out = left channel in. */
820 HPI_CHANNEL_MODE_LEFT_TO_STEREO = 3,
821/** Left channel out = right channel in, Right channel out = right channel in.*/
822 HPI_CHANNEL_MODE_RIGHT_TO_STEREO = 4,
823/** Left channel out = (left channel in + right channel in)/2,
824 Right channel out = mute. */
825 HPI_CHANNEL_MODE_STEREO_TO_LEFT = 5,
826/** Left channel out = mute,
827 Right channel out = (right channel in + left channel in)/2. */
828 HPI_CHANNEL_MODE_STEREO_TO_RIGHT = 6,
829 HPI_CHANNEL_MODE_LAST = 6
830};
831
832/** SampleClock source values
833\ingroup sampleclock
834*/
835enum HPI_SAMPLECLOCK_SOURCES {
836/** The sampleclock output is derived from its local samplerate generator.
837 The local samplerate may be set using HPI_SampleClock_SetLocalRate(). */
838 HPI_SAMPLECLOCK_SOURCE_LOCAL = 1,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200839/** The adapter is clocked from a dedicated AES/EBU SampleClock input.*/
840 HPI_SAMPLECLOCK_SOURCE_AESEBU_SYNC = 2,
841/** From external wordclock connector */
842 HPI_SAMPLECLOCK_SOURCE_WORD = 3,
843/** Board-to-board header */
844 HPI_SAMPLECLOCK_SOURCE_WORD_HEADER = 4,
845/** FUTURE - SMPTE clock. */
846 HPI_SAMPLECLOCK_SOURCE_SMPTE = 5,
847/** One of the aesebu inputs */
848 HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT = 6,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200849/** From a network interface e.g. Cobranet or Livewire at either 48 or 96kHz */
850 HPI_SAMPLECLOCK_SOURCE_NETWORK = 8,
851/** From previous adjacent module (ASI2416 only)*/
852 HPI_SAMPLECLOCK_SOURCE_PREV_MODULE = 10,
853/*! Update this if you add a new clock source.*/
854 HPI_SAMPLECLOCK_SOURCE_LAST = 10
855};
856
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300857/** Equalizer filter types. Used by HPI_ParametricEq_SetBand()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200858\ingroup parmeq
859*/
860enum HPI_FILTER_TYPE {
861 HPI_FILTER_TYPE_BYPASS = 0, /**< filter is turned off */
862
863 HPI_FILTER_TYPE_LOWSHELF = 1, /**< EQ low shelf */
864 HPI_FILTER_TYPE_HIGHSHELF = 2, /**< EQ high shelf */
865 HPI_FILTER_TYPE_EQ_BAND = 3, /**< EQ gain */
866
867 HPI_FILTER_TYPE_LOWPASS = 4, /**< standard low pass */
868 HPI_FILTER_TYPE_HIGHPASS = 5, /**< standard high pass */
869 HPI_FILTER_TYPE_BANDPASS = 6, /**< standard band pass */
870 HPI_FILTER_TYPE_BANDSTOP = 7 /**< standard band stop/notch */
871};
872
873/** Async Event sources
874\ingroup async
875*/
876enum ASYNC_EVENT_SOURCES {
877 HPI_ASYNC_EVENT_GPIO = 1, /**< GPIO event. */
878 HPI_ASYNC_EVENT_SILENCE = 2, /**< silence event detected. */
879 HPI_ASYNC_EVENT_TONE = 3 /**< tone event detected. */
880};
881/*******************************************/
882/** HPI Error codes
883
884Almost all HPI functions return an error code
885A return value of zero means there was no error.
886Otherwise one of these error codes is returned.
887Error codes can be converted to a descriptive string using HPI_GetErrorText()
888
889\note When a new error code is added HPI_GetErrorText() MUST be updated.
890\note Codes 1-100 are reserved for driver use
891\ingroup utility
892*/
893enum HPI_ERROR_CODES {
894 /** Message type does not exist. */
895 HPI_ERROR_INVALID_TYPE = 100,
896 /** Object type does not exist. */
897 HPI_ERROR_INVALID_OBJ = 101,
898 /** Function does not exist. */
899 HPI_ERROR_INVALID_FUNC = 102,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300900 /** The specified object does not exist. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200901 HPI_ERROR_INVALID_OBJ_INDEX = 103,
902 /** Trying to access an object that has not been opened yet. */
903 HPI_ERROR_OBJ_NOT_OPEN = 104,
904 /** Trying to open an already open object. */
905 HPI_ERROR_OBJ_ALREADY_OPEN = 105,
906 /** PCI, ISA resource not valid. */
907 HPI_ERROR_INVALID_RESOURCE = 106,
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300908 /* HPI_ERROR_SUBSYSFINDADAPTERS_GETINFO= 107 */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200909 /** Default response was never updated with actual error code. */
910 HPI_ERROR_INVALID_RESPONSE = 108,
911 /** wSize field of response was not updated,
912 indicating that the message was not processed. */
913 HPI_ERROR_PROCESSING_MESSAGE = 109,
914 /** The network did not respond in a timely manner. */
915 HPI_ERROR_NETWORK_TIMEOUT = 110,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300916 /* An HPI handle is invalid (uninitialised?). */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200917 HPI_ERROR_INVALID_HANDLE = 111,
918 /** A function or attribute has not been implemented yet. */
919 HPI_ERROR_UNIMPLEMENTED = 112,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300920 /** There are too many clients attempting
921 to access a network resource. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200922 HPI_ERROR_NETWORK_TOO_MANY_CLIENTS = 113,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300923 /** Response buffer passed to HPI_Message
924 was smaller than returned response.
925 wSpecificError field of hpi response contains the required size.
926 */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200927 HPI_ERROR_RESPONSE_BUFFER_TOO_SMALL = 114,
928 /** The returned response did not match the sent message */
929 HPI_ERROR_RESPONSE_MISMATCH = 115,
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300930 /** A control setting that should have been cached was not. */
931 HPI_ERROR_CONTROL_CACHING = 116,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300932 /** A message buffer in the path to the adapter was smaller
933 than the message size.
934 wSpecificError field of hpi response contains the actual size.
935 */
936 HPI_ERROR_MESSAGE_BUFFER_TOO_SMALL = 117,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200937
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300938 /* HPI_ERROR_TOO_MANY_ADAPTERS= 200 */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200939 /** Bad adpater. */
940 HPI_ERROR_BAD_ADAPTER = 201,
941 /** Adapter number out of range or not set properly. */
942 HPI_ERROR_BAD_ADAPTER_NUMBER = 202,
943 /** 2 adapters with the same adapter number. */
Eliot Blennerhassetta287ca22011-02-10 17:26:17 +1300944 HPI_ERROR_DUPLICATE_ADAPTER_NUMBER = 203,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300945 /** DSP code failed to bootload. (unused?) */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200946 HPI_ERROR_DSP_BOOTLOAD = 204,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200947 /** Couldn't find or open the DSP code file. */
948 HPI_ERROR_DSP_FILE_NOT_FOUND = 206,
949 /** Internal DSP hardware error. */
950 HPI_ERROR_DSP_HARDWARE = 207,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200951 /** Could not allocate memory */
952 HPI_ERROR_MEMORY_ALLOC = 208,
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300953 /** Failed to correctly load/config PLD. (unused) */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200954 HPI_ERROR_PLD_LOAD = 209,
955 /** Unexpected end of file, block length too big etc. */
956 HPI_ERROR_DSP_FILE_FORMAT = 210,
957
958 /** Found but could not open DSP code file. */
959 HPI_ERROR_DSP_FILE_ACCESS_DENIED = 211,
960 /** First DSP code section header not found in DSP file. */
961 HPI_ERROR_DSP_FILE_NO_HEADER = 212,
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300962 /* HPI_ERROR_DSP_FILE_READ_ERROR= 213, */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200963 /** DSP code for adapter family not found. */
964 HPI_ERROR_DSP_SECTION_NOT_FOUND = 214,
965 /** Other OS specific error opening DSP file. */
966 HPI_ERROR_DSP_FILE_OTHER_ERROR = 215,
967 /** Sharing violation opening DSP code file. */
968 HPI_ERROR_DSP_FILE_SHARING_VIOLATION = 216,
969 /** DSP code section header had size == 0. */
970 HPI_ERROR_DSP_FILE_NULL_HEADER = 217,
971
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300972 /* HPI_ERROR_FLASH = 220, */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200973
974 /** Flash has bad checksum */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300975 HPI_ERROR_BAD_CHECKSUM = 221,
976 HPI_ERROR_BAD_SEQUENCE = 222,
977 HPI_ERROR_FLASH_ERASE = 223,
978 HPI_ERROR_FLASH_PROGRAM = 224,
979 HPI_ERROR_FLASH_VERIFY = 225,
980 HPI_ERROR_FLASH_TYPE = 226,
981 HPI_ERROR_FLASH_START = 227,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200982
983 /** Reserved for OEMs. */
984 HPI_ERROR_RESERVED_1 = 290,
985
Eliot Blennerhassett1d595d22011-02-10 17:26:08 +1300986 /* HPI_ERROR_INVALID_STREAM = 300 use HPI_ERROR_INVALID_OBJ_INDEX */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200987 /** Invalid compression format. */
988 HPI_ERROR_INVALID_FORMAT = 301,
989 /** Invalid format samplerate */
990 HPI_ERROR_INVALID_SAMPLERATE = 302,
991 /** Invalid format number of channels. */
992 HPI_ERROR_INVALID_CHANNELS = 303,
993 /** Invalid format bitrate. */
994 HPI_ERROR_INVALID_BITRATE = 304,
995 /** Invalid datasize used for stream read/write. */
996 HPI_ERROR_INVALID_DATASIZE = 305,
Eliot Blennerhassett1d595d22011-02-10 17:26:08 +1300997 /* HPI_ERROR_BUFFER_FULL = 306 use HPI_ERROR_INVALID_DATASIZE */
998 /* HPI_ERROR_BUFFER_EMPTY = 307 use HPI_ERROR_INVALID_DATASIZE */
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300999 /** Null data pointer used for stream read/write. */
1000 HPI_ERROR_INVALID_DATA_POINTER = 308,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001001 /** Packet ordering error for stream read/write. */
1002 HPI_ERROR_INVALID_PACKET_ORDER = 309,
1003
1004 /** Object can't do requested operation in its current
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001005 state, eg set format, change rec mux state while recording.*/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001006 HPI_ERROR_INVALID_OPERATION = 310,
1007
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001008 /** Where a SRG is shared amongst streams, an incompatible samplerate
1009 is one that is different to any currently active stream. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001010 HPI_ERROR_INCOMPATIBLE_SAMPLERATE = 311,
1011 /** Adapter mode is illegal.*/
1012 HPI_ERROR_BAD_ADAPTER_MODE = 312,
1013
1014 /** There have been too many attempts to set the adapter's
1015 capabilities (using bad keys), the card should be returned
1016 to ASI if further capabilities updates are required */
1017 HPI_ERROR_TOO_MANY_CAPABILITY_CHANGE_ATTEMPTS = 313,
1018 /** Streams on different adapters cannot be grouped. */
1019 HPI_ERROR_NO_INTERADAPTER_GROUPS = 314,
1020 /** Streams on different DSPs cannot be grouped. */
1021 HPI_ERROR_NO_INTERDSP_GROUPS = 315,
Eliot Blennerhassettbd33c1c2011-02-10 17:26:16 +13001022 /** Stream wait cancelled before threshold reached. */
1023 HPI_ERROR_WAIT_CANCELLED = 316,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001024
1025 /** Invalid mixer node for this adapter. */
1026 HPI_ERROR_INVALID_NODE = 400,
1027 /** Invalid control. */
1028 HPI_ERROR_INVALID_CONTROL = 401,
1029 /** Invalid control value was passed. */
1030 HPI_ERROR_INVALID_CONTROL_VALUE = 402,
1031 /** Control attribute not supported by this control. */
1032 HPI_ERROR_INVALID_CONTROL_ATTRIBUTE = 403,
1033 /** Control is disabled. */
1034 HPI_ERROR_CONTROL_DISABLED = 404,
1035 /** I2C transaction failed due to a missing ACK. */
1036 HPI_ERROR_CONTROL_I2C_MISSING_ACK = 405,
Eliot Blennerhassett0a000442011-02-10 17:26:05 +13001037 HPI_ERROR_I2C_MISSING_ACK = 405,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001038 /** Control is busy, or coming out of
1039 reset and cannot be accessed at this time. */
1040 HPI_ERROR_CONTROL_NOT_READY = 407,
1041
1042 /** Non volatile memory */
1043 HPI_ERROR_NVMEM_BUSY = 450,
1044 HPI_ERROR_NVMEM_FULL = 451,
1045 HPI_ERROR_NVMEM_FAIL = 452,
1046
1047 /** I2C */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001048 HPI_ERROR_I2C_BAD_ADR = 460,
1049
1050 /** Entity errors */
1051 HPI_ERROR_ENTITY_TYPE_MISMATCH = 470,
1052 HPI_ERROR_ENTITY_ITEM_COUNT = 471,
1053 HPI_ERROR_ENTITY_TYPE_INVALID = 472,
1054 HPI_ERROR_ENTITY_ROLE_INVALID = 473,
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +13001055 HPI_ERROR_ENTITY_SIZE_MISMATCH = 474,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001056
1057 /* AES18 specific errors were 500..507 */
1058
1059 /** custom error to use for debugging */
1060 HPI_ERROR_CUSTOM = 600,
1061
1062 /** hpioct32.c can't obtain mutex */
1063 HPI_ERROR_MUTEX_TIMEOUT = 700,
1064
Eliot Blennerhassetta287ca22011-02-10 17:26:17 +13001065 /** Backend errors used to be greater than this.
1066 \deprecated Now, all backends return only errors defined here in hpi.h
1067 */
1068 HPI_ERROR_BACKEND_BASE = 900,
1069
1070 /** Communication with DSP failed */
1071 HPI_ERROR_DSP_COMMUNICATION = 900
1072 /* Note that the dsp communication error is set to this value so that
1073 it remains compatible with any software that expects such errors
1074 to be backend errors i.e. >= 900.
1075 Do not define any new error codes with values > 900.
1076 */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001077};
1078
1079/** \defgroup maximums HPI maximum values
1080\{
1081*/
1082/** Maximum number of adapters per HPI sub-system
1083 WARNING: modifying this value changes the response structure size.*/
1084#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
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
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001103/**************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001104/* 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 */
1112struct 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 */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +13001120 u16 unused; /**< Unused */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001121 u16 channels; /**< 1,2..., (or ancillary mode or idle bit */
1122 u16 format; /**< HPI_FORMAT_PCM16, _MPEG etc. see #HPI_FORMATS. */
1123};
1124
1125struct 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*/
1132struct hpi_async_event {
1133 u16 event_type; /**< type of event. \sa async_event */
Eliot Blennerhassett1d595d22011-02-10 17:26:08 +13001134 u16 sequence; /**< Sequence number, allows lost event detection */
1135 u32 state; /**< New state */
1136 u32 h_object; /**< handle to the object returning the event. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001137 union {
1138 struct {
1139 u16 index; /**< GPIO bit index. */
1140 } gpio;
1141 struct {
1142 u16 node_index; /**< what node is the control on ? */
Eliot Blennerhassett1d595d22011-02-10 17:26:08 +13001143 u16 node_type; /**< what type of node is the control on ? */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001144 } control;
1145 } u;
1146};
1147
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001148/* skip host side function declarations for
1149 DSP compile and documentation extraction */
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 Blennerhassettba944552011-02-10 17:26:04 +13001361u16 hpi_volume_query_channels(const u32 h_volume, 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 Blennerhassettba944552011-02-10 17:26:04 +13001370/*****************/
1371/* Level control */
1372/*****************/
1373u16 hpi_level_query_range(u32 h_control, short *min_gain_01dB,
1374 short *max_gain_01dB, short *step_gain_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001375
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001376u16 hpi_level_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001377 );
1378
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001379u16 hpi_level_get_gain(u32 h_control,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001380 short an_gain0_01dB_out[HPI_MAX_CHANNELS]
1381 );
1382
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001383/*****************/
1384/* Meter control */
1385/*****************/
1386u16 hpi_meter_query_channels(const u32 h_meter, u32 *p_channels);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001387
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001388u16 hpi_meter_get_peak(u32 h_control,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001389 short an_peak0_01dB_out[HPI_MAX_CHANNELS]
1390 );
1391
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001392u16 hpi_meter_get_rms(u32 h_control, short an_peak0_01dB_out[HPI_MAX_CHANNELS]
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001393 );
1394
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001395u16 hpi_meter_set_peak_ballistics(u32 h_control, u16 attack, u16 decay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001396
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001397u16 hpi_meter_set_rms_ballistics(u32 h_control, u16 attack, u16 decay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001398
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001399u16 hpi_meter_get_peak_ballistics(u32 h_control, u16 *attack, u16 *decay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001400
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001401u16 hpi_meter_get_rms_ballistics(u32 h_control, u16 *attack, u16 *decay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001402
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001403/************************/
1404/* ChannelMode control */
1405/************************/
1406u16 hpi_channel_mode_query_mode(const u32 h_mode, const u32 index,
1407 u16 *pw_mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001408
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001409u16 hpi_channel_mode_set(u32 h_control, u16 mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001410
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001411u16 hpi_channel_mode_get(u32 h_control, u16 *mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001412
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001413/*****************/
1414/* Tuner control */
1415/*****************/
1416u16 hpi_tuner_query_band(const u32 h_tuner, const u32 index, u16 *pw_band);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001417
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001418u16 hpi_tuner_set_band(u32 h_control, u16 band);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001419
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001420u16 hpi_tuner_get_band(u32 h_control, u16 *pw_band);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001421
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001422u16 hpi_tuner_query_frequency(const u32 h_tuner, const u32 index,
1423 const u16 band, u32 *pfreq);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001424
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001425u16 hpi_tuner_set_frequency(u32 h_control, u32 freq_ink_hz);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001426
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001427u16 hpi_tuner_get_frequency(u32 h_control, u32 *pw_freq_ink_hz);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001428
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001429u16 hpi_tuner_get_rf_level(u32 h_control, short *pw_level);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001430
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001431u16 hpi_tuner_get_raw_rf_level(u32 h_control, short *pw_level);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001432
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001433u16 hpi_tuner_query_gain(const u32 h_tuner, const u32 index, u16 *pw_gain);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001434
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001435u16 hpi_tuner_set_gain(u32 h_control, short gain);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001436
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001437u16 hpi_tuner_get_gain(u32 h_control, short *pn_gain);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001438
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001439u16 hpi_tuner_get_status(u32 h_control, u16 *pw_status_mask, u16 *pw_status);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001440
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001441u16 hpi_tuner_set_mode(u32 h_control, u32 mode, u32 value);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001442
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001443u16 hpi_tuner_get_mode(u32 h_control, u32 mode, u32 *pn_value);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001444
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001445u16 hpi_tuner_get_rds(u32 h_control, char *p_rds_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001446
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001447u16 hpi_tuner_query_deemphasis(const u32 h_tuner, const u32 index,
1448 const u16 band, u32 *pdeemphasis);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001449
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001450u16 hpi_tuner_set_deemphasis(u32 h_control, u32 deemphasis);
1451u16 hpi_tuner_get_deemphasis(u32 h_control, u32 *pdeemphasis);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001452
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001453u16 hpi_tuner_query_program(const u32 h_tuner, u32 *pbitmap_program);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001454
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001455u16 hpi_tuner_set_program(u32 h_control, u32 program);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001456
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001457u16 hpi_tuner_get_program(u32 h_control, u32 *pprogram);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001458
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001459u16 hpi_tuner_get_hd_radio_dsp_version(u32 h_control, char *psz_dsp_version,
1460 const u32 string_size);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001461
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001462u16 hpi_tuner_get_hd_radio_sdk_version(u32 h_control, char *psz_sdk_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_signal_quality(u32 h_control, u32 *pquality);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001466
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001467u16 hpi_tuner_get_hd_radio_signal_blend(u32 h_control, u32 *pblend);
Eliot Blennerhassett5a498ef2010-05-27 17:53:52 +12001468
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001469u16 hpi_tuner_set_hd_radio_signal_blend(u32 h_control, const u32 blend);
Eliot Blennerhassett5a498ef2010-05-27 17:53:52 +12001470
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001471/***************/
1472/* PAD control */
1473/***************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001474
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001475u16 hpi_pad_get_channel_name(u32 h_control, char *psz_string,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001476 const u32 string_length);
1477
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001478u16 hpi_pad_get_artist(u32 h_control, char *psz_string,
1479 const u32 string_length);
1480
1481u16 hpi_pad_get_title(u32 h_control, char *psz_string,
1482 const u32 string_length);
1483
1484u16 hpi_pad_get_comment(u32 h_control, char *psz_string,
1485 const u32 string_length);
1486
1487u16 hpi_pad_get_program_type(u32 h_control, u32 *ppTY);
1488
1489u16 hpi_pad_get_rdsPI(u32 h_control, u32 *ppI);
1490
1491u16 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
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001494/****************************/
1495/* AES/EBU Receiver control */
1496/****************************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001497u16 hpi_aesebu_receiver_query_format(const u32 h_aes_rx, const u32 index,
1498 u16 *pw_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001499
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001500u16 hpi_aesebu_receiver_set_format(u32 h_control, u16 source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001501
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001502u16 hpi_aesebu_receiver_get_format(u32 h_control, u16 *pw_source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001503
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001504u16 hpi_aesebu_receiver_get_sample_rate(u32 h_control, u32 *psample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001505
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001506u16 hpi_aesebu_receiver_get_user_data(u32 h_control, u16 index, u16 *pw_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001507
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001508u16 hpi_aesebu_receiver_get_channel_status(u32 h_control, u16 index,
1509 u16 *pw_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001510
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001511u16 hpi_aesebu_receiver_get_error_status(u32 h_control, u16 *pw_error_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001512
1513/*******************************/
1514/* AES/EBU Transmitter control */
1515/*******************************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001516u16 hpi_aesebu_transmitter_set_sample_rate(u32 h_control, u32 sample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001517
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001518u16 hpi_aesebu_transmitter_set_user_data(u32 h_control, u16 index, u16 data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001519
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001520u16 hpi_aesebu_transmitter_set_channel_status(u32 h_control, u16 index,
1521 u16 data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001522
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001523u16 hpi_aesebu_transmitter_get_channel_status(u32 h_control, u16 index,
1524 u16 *pw_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001525
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001526u16 hpi_aesebu_transmitter_query_format(const u32 h_aes_tx, const u32 index,
1527 u16 *pw_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001528
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001529u16 hpi_aesebu_transmitter_set_format(u32 h_control, u16 output_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001530
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001531u16 hpi_aesebu_transmitter_get_format(u32 h_control, u16 *pw_output_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001532
1533/***********************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001534/* Multiplexer control */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001535/***********************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001536u16 hpi_multiplexer_set_source(u32 h_control, u16 source_node_type,
1537 u16 source_node_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001538
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001539u16 hpi_multiplexer_get_source(u32 h_control, u16 *source_node_type,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001540 u16 *source_node_index);
1541
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001542u16 hpi_multiplexer_query_source(u32 h_control, u16 index,
1543 u16 *source_node_type, u16 *source_node_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001544
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001545/***************/
1546/* Vox control */
1547/***************/
1548u16 hpi_vox_set_threshold(u32 h_control, short an_gain0_01dB);
1549
1550u16 hpi_vox_get_threshold(u32 h_control, short *an_gain0_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001551
1552/*********************/
1553/* Bitstream control */
1554/*********************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001555u16 hpi_bitstream_set_clock_edge(u32 h_control, u16 edge_type);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001556
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001557u16 hpi_bitstream_set_data_polarity(u32 h_control, u16 polarity);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001558
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001559u16 hpi_bitstream_get_activity(u32 h_control, u16 *pw_clk_activity,
1560 u16 *pw_data_activity);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001561
1562/***********************/
1563/* SampleClock control */
1564/***********************/
1565
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001566u16 hpi_sample_clock_query_source(const u32 h_clock, const u32 index,
1567 u16 *pw_source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001568
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001569u16 hpi_sample_clock_set_source(u32 h_control, u16 source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001570
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001571u16 hpi_sample_clock_get_source(u32 h_control, u16 *pw_source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001572
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001573u16 hpi_sample_clock_query_source_index(const u32 h_clock, const u32 index,
1574 const u32 source, u16 *pw_source_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001575
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001576u16 hpi_sample_clock_set_source_index(u32 h_control, u16 source_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001577
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001578u16 hpi_sample_clock_get_source_index(u32 h_control, u16 *pw_source_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001579
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001580u16 hpi_sample_clock_get_sample_rate(u32 h_control, u32 *psample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001581
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001582u16 hpi_sample_clock_query_local_rate(const u32 h_clock, const u32 index,
1583 u32 *psource);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001584
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001585u16 hpi_sample_clock_set_local_rate(u32 h_control, u32 sample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001586
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001587u16 hpi_sample_clock_get_local_rate(u32 h_control, u32 *psample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001588
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001589u16 hpi_sample_clock_set_auto(u32 h_control, u32 enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001590
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001591u16 hpi_sample_clock_get_auto(u32 h_control, u32 *penable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001592
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001593u16 hpi_sample_clock_set_local_rate_lock(u32 h_control, u32 lock);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001594
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001595u16 hpi_sample_clock_get_local_rate_lock(u32 h_control, u32 *plock);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001596
1597/***********************/
1598/* Microphone control */
1599/***********************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001600u16 hpi_microphone_set_phantom_power(u32 h_control, u16 on_off);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001601
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001602u16 hpi_microphone_get_phantom_power(u32 h_control, u16 *pw_on_off);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001603
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001604/********************************/
1605/* Parametric Equalizer control */
1606/********************************/
1607u16 hpi_parametric_eq_get_info(u32 h_control, u16 *pw_number_of_bands,
1608 u16 *pw_enabled);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001609
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001610u16 hpi_parametric_eq_set_state(u32 h_control, u16 on_off);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001611
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001612u16 hpi_parametric_eq_set_band(u32 h_control, u16 index, u16 type,
1613 u32 frequency_hz, short q100, short gain0_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001614
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001615u16 hpi_parametric_eq_get_band(u32 h_control, u16 index, u16 *pn_type,
1616 u32 *pfrequency_hz, short *pnQ100, short *pn_gain0_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001617
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001618u16 hpi_parametric_eq_get_coeffs(u32 h_control, u16 index, short coeffs[5]
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001619 );
1620
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001621/*******************************/
1622/* Compressor Expander control */
1623/*******************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001624
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001625u16 hpi_compander_set_enable(u32 h_control, u32 on);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001626
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001627u16 hpi_compander_get_enable(u32 h_control, u32 *pon);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001628
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001629u16 hpi_compander_set_makeup_gain(u32 h_control, short makeup_gain0_01dB);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001630
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001631u16 hpi_compander_get_makeup_gain(u32 h_control, short *pn_makeup_gain0_01dB);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001632
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001633u16 hpi_compander_set_attack_time_constant(u32 h_control, u32 index,
1634 u32 attack);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001635
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001636u16 hpi_compander_get_attack_time_constant(u32 h_control, u32 index,
1637 u32 *pw_attack);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001638
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001639u16 hpi_compander_set_decay_time_constant(u32 h_control, u32 index,
1640 u32 decay);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001641
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001642u16 hpi_compander_get_decay_time_constant(u32 h_control, u32 index,
1643 u32 *pw_decay);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001644
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001645u16 hpi_compander_set_threshold(u32 h_control, u32 index,
1646 short threshold0_01dB);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001647
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001648u16 hpi_compander_get_threshold(u32 h_control, u32 index,
1649 short *pn_threshold0_01dB);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001650
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001651u16 hpi_compander_set_ratio(u32 h_control, u32 index, u32 ratio100);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001652
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001653u16 hpi_compander_get_ratio(u32 h_control, u32 index, u32 *pw_ratio100);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001654
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001655/********************/
1656/* Cobranet control */
1657/********************/
1658u16 hpi_cobranet_hmi_write(u32 h_control, u32 hmi_address, u32 byte_count,
1659 u8 *pb_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001660
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001661u16 hpi_cobranet_hmi_read(u32 h_control, u32 hmi_address, u32 max_byte_count,
1662 u32 *pbyte_count, u8 *pb_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001663
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001664u16 hpi_cobranet_hmi_get_status(u32 h_control, u32 *pstatus,
1665 u32 *preadable_size, u32 *pwriteable_size);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001666
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001667u16 hpi_cobranet_get_ip_address(u32 h_control, u32 *pdw_ip_address);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001668
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001669u16 hpi_cobranet_set_ip_address(u32 h_control, u32 dw_ip_address);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001670
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001671u16 hpi_cobranet_get_static_ip_address(u32 h_control, u32 *pdw_ip_address);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001672
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001673u16 hpi_cobranet_set_static_ip_address(u32 h_control, u32 dw_ip_address);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001674
Eliot Blennerhassett1d595d22011-02-10 17:26:08 +13001675u16 hpi_cobranet_get_macaddress(u32 h_control, u32 *p_mac_msbs,
1676 u32 *p_mac_lsbs);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001677
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001678/*************************/
1679/* Tone Detector control */
1680/*************************/
1681u16 hpi_tone_detector_get_state(u32 hC, u32 *state);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001682
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001683u16 hpi_tone_detector_set_enable(u32 hC, u32 enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001684
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001685u16 hpi_tone_detector_get_enable(u32 hC, u32 *enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001686
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001687u16 hpi_tone_detector_set_event_enable(u32 hC, u32 event_enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001688
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001689u16 hpi_tone_detector_get_event_enable(u32 hC, u32 *event_enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001690
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001691u16 hpi_tone_detector_set_threshold(u32 hC, int threshold);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001692
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001693u16 hpi_tone_detector_get_threshold(u32 hC, int *threshold);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001694
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001695u16 hpi_tone_detector_get_frequency(u32 hC, u32 index, u32 *frequency);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001696
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001697/****************************/
1698/* Silence Detector control */
1699/****************************/
1700u16 hpi_silence_detector_get_state(u32 hC, u32 *state);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001701
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001702u16 hpi_silence_detector_set_enable(u32 hC, u32 enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001703
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001704u16 hpi_silence_detector_get_enable(u32 hC, u32 *enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001705
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001706u16 hpi_silence_detector_set_event_enable(u32 hC, u32 event_enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001707
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001708u16 hpi_silence_detector_get_event_enable(u32 hC, u32 *event_enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001709
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001710u16 hpi_silence_detector_set_delay(u32 hC, u32 delay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001711
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001712u16 hpi_silence_detector_get_delay(u32 hC, u32 *delay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001713
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001714u16 hpi_silence_detector_set_threshold(u32 hC, int threshold);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001715
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001716u16 hpi_silence_detector_get_threshold(u32 hC, int *threshold);
1717/*********************/
1718/* Utility functions */
1719/*********************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001720
1721u16 hpi_format_create(struct hpi_format *p_format, u16 channels, u16 format,
1722 u32 sample_rate, u32 bit_rate, u32 attributes);
1723
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001724#endif /*_HPI_H_ */