blob: 4466bd2c5272136d705fb8e29e0cead83f63c091 [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 Blennerhassett3872f192014-11-20 16:22:49 +1300199 HPI_SOURCENODE_AVB = 114, /**< AVB input stream */
200 HPI_SOURCENODE_BLULINK = 115, /**< BLU-link input channel */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200201 /* !!!Update this AND hpidebug.h if you add a new sourcenode type!!! */
Eliot Blennerhassett3872f192014-11-20 16:22:49 +1300202 HPI_SOURCENODE_LAST_INDEX = 115 /**< largest ID */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200203 /* AX6 max sourcenode types = 15 */
204};
205
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300206/*******************************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200207/** Destination node types
208\ingroup mixer
209*/
210enum HPI_DESTNODES {
211 /** This define can be used instead of 0 to indicate
212 that there is no valid destination node. A control that
213 exists on a source node can be searched for using a destination
214 node value of either 0, or HPI_DESTNODE_NONE */
215 HPI_DESTNODE_NONE = 200,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200216 /** In Stream (Record) node. */
217 HPI_DESTNODE_ISTREAM = 201,
Eliot Blennerhassettb7f12482011-07-22 15:52:55 +1200218 HPI_DESTNODE_LINEOUT = 202, /**< line out node. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200219 HPI_DESTNODE_AESEBU_OUT = 203, /**< AES/EBU output node. */
220 HPI_DESTNODE_RF = 204, /**< RF output node. */
221 HPI_DESTNODE_SPEAKER = 205, /**< speaker output node. */
222 /** Cobranet output node -
223 Audio samples from the device are sent out on the Cobranet network.*/
224 HPI_DESTNODE_COBRANET = 206,
225 HPI_DESTNODE_ANALOG = 207, /**< analog output node. */
Eliot Blennerhassettb7f12482011-07-22 15:52:55 +1200226 /** RTP stream output node - This node is a source for
227 packets of RTP audio samples that are sent to other devices. */
228 HPI_DESTNODE_RTP_SOURCE = 208,
Eliot Blennerhassett3872f192014-11-20 16:22:49 +1300229 HPI_DESTNODE_AVB = 209, /**< AVB output stream */
230 HPI_DESTNODE_INTERNAL = 210, /**< node internal to the device. */
231 HPI_DESTNODE_BLULINK = 211, /**< BLU-link output channel. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200232 /* !!!Update this AND hpidebug.h if you add a new destnode type!!! */
Eliot Blennerhassett3872f192014-11-20 16:22:49 +1300233 HPI_DESTNODE_LAST_INDEX = 211 /**< largest ID */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200234 /* AX6 max destnode types = 15 */
235};
236
237/*******************************************/
238/** Mixer control types
239\ingroup mixer
240*/
241enum HPI_CONTROLS {
242 HPI_CONTROL_GENERIC = 0, /**< generic control. */
243 HPI_CONTROL_CONNECTION = 1, /**< A connection between nodes. */
244 HPI_CONTROL_VOLUME = 2, /**< volume control - works in dB_fs. */
245 HPI_CONTROL_METER = 3, /**< peak meter control. */
246 HPI_CONTROL_MUTE = 4, /*mute control - not used at present. */
247 HPI_CONTROL_MULTIPLEXER = 5, /**< multiplexer control. */
248
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300249 HPI_CONTROL_AESEBU_TRANSMITTER = 6, /**< AES/EBU transmitter control */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300250 HPI_CONTROL_AESEBUTX = 6, /* HPI_CONTROL_AESEBU_TRANSMITTER */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200251
252 HPI_CONTROL_AESEBU_RECEIVER = 7, /**< AES/EBU receiver control. */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300253 HPI_CONTROL_AESEBURX = 7, /* HPI_CONTROL_AESEBU_RECEIVER */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200254
255 HPI_CONTROL_LEVEL = 8, /**< level/trim control - works in d_bu. */
256 HPI_CONTROL_TUNER = 9, /**< tuner control. */
257/* HPI_CONTROL_ONOFFSWITCH = 10 */
258 HPI_CONTROL_VOX = 11, /**< vox control. */
259/* HPI_CONTROL_AES18_TRANSMITTER = 12 */
260/* HPI_CONTROL_AES18_RECEIVER = 13 */
261/* HPI_CONTROL_AES18_BLOCKGENERATOR = 14 */
262 HPI_CONTROL_CHANNEL_MODE = 15, /**< channel mode control. */
263
264 HPI_CONTROL_BITSTREAM = 16, /**< bitstream control. */
265 HPI_CONTROL_SAMPLECLOCK = 17, /**< sample clock control. */
266 HPI_CONTROL_MICROPHONE = 18, /**< microphone control. */
267 HPI_CONTROL_PARAMETRIC_EQ = 19, /**< parametric EQ control. */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300268 HPI_CONTROL_EQUALIZER = 19, /*HPI_CONTROL_PARAMETRIC_EQ */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200269
270 HPI_CONTROL_COMPANDER = 20, /**< compander control. */
271 HPI_CONTROL_COBRANET = 21, /**< cobranet control. */
272 HPI_CONTROL_TONEDETECTOR = 22, /**< tone detector control. */
273 HPI_CONTROL_SILENCEDETECTOR = 23, /**< silence detector control. */
274 HPI_CONTROL_PAD = 24, /**< tuner PAD control. */
275 HPI_CONTROL_SRC = 25, /**< samplerate converter control. */
276 HPI_CONTROL_UNIVERSAL = 26, /**< universal control. */
277
278/* !!! Update this AND hpidebug.h if you add a new control type!!!*/
279 HPI_CONTROL_LAST_INDEX = 26 /**<highest control type ID */
280/* WARNING types 256 or greater impact bit packing in all AX6 DSP code */
281};
282
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300283/*******************************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200284/** Adapter properties
285These are used in HPI_AdapterSetProperty() and HPI_AdapterGetProperty()
286\ingroup adapter
287*/
288enum HPI_ADAPTER_PROPERTIES {
289/** \internal Used in dwProperty field of HPI_AdapterSetProperty() and
290HPI_AdapterGetProperty(). This errata applies to all ASI6000 cards with both
291analog and digital outputs. The CS4224 A/D+D/A has a one sample delay between
292left and right channels on both its input (ADC) and output (DAC).
293More details are available in Cirrus Logic errata ER284B2.
294PDF available from www.cirrus.com, released by Cirrus in 2001.
295*/
296 HPI_ADAPTER_PROPERTY_ERRATA_1 = 1,
297
298/** Adapter grouping property
299Indicates whether the adapter supports the grouping API (for ASIO and SSX2)
300*/
301 HPI_ADAPTER_PROPERTY_GROUPING = 2,
302
303/** Driver SSX2 property
304Tells the kernel driver to turn on SSX2 stream mapping.
305This feature is not used by the DSP. In fact the call is completely processed
306by the driver and is not passed on to the DSP at all.
307*/
308 HPI_ADAPTER_PROPERTY_ENABLE_SSX2 = 3,
309
310/** Adapter SSX2 property
311Indicates the state of the adapter's SSX2 setting. This setting is stored in
312non-volatile memory on the adapter. A typical call sequence would be to use
313HPI_ADAPTER_PROPERTY_SSX2_SETTING to set SSX2 on the adapter and then to reload
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300314the driver. The driver would query HPI_ADAPTER_PROPERTY_SSX2_SETTING during
315startup and if SSX2 is set, it would then call HPI_ADAPTER_PROPERTY_ENABLE_SSX2
316to enable SSX2 stream mapping within the kernel level of the driver.
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200317*/
318 HPI_ADAPTER_PROPERTY_SSX2_SETTING = 4,
319
Eliot Blennerhassettbd33c1c2011-02-10 17:26:16 +1300320/** Enables/disables PCI(e) IRQ.
321A setting of 0 indicates that no interrupts are being generated. A DSP boot
322this property is set to 0. Setting to a non-zero value specifies the number
323of frames of audio that should be processed between interrupts. This property
324should be set to multiple of the mixer interval as read back from the
325HPI_ADAPTER_PROPERTY_INTERVAL property.
326*/
327 HPI_ADAPTER_PROPERTY_IRQ_RATE = 5,
328
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200329/** Base number for readonly properties */
330 HPI_ADAPTER_PROPERTY_READONLYBASE = 256,
331
332/** Readonly adapter latency property.
333This property returns in the input and output latency in samples.
334Property 1 is the estimated input latency
335in samples, while Property 2 is that output latency in samples.
336*/
337 HPI_ADAPTER_PROPERTY_LATENCY = 256,
338
339/** Readonly adapter granularity property.
340The granulariy is the smallest size chunk of stereo samples that is processed by
341the adapter.
342This property returns the record granularity in samples in Property 1.
343Property 2 returns the play granularity.
344*/
345 HPI_ADAPTER_PROPERTY_GRANULARITY = 257,
346
347/** Readonly adapter number of current channels property.
348Property 1 is the number of record channels per record device.
349Property 2 is the number of play channels per playback device.*/
350 HPI_ADAPTER_PROPERTY_CURCHANNELS = 258,
351
352/** Readonly adapter software version.
353The SOFTWARE_VERSION property returns the version of the software running
354on the adapter as Major.Minor.Release.
355Property 1 contains Major in bits 15..8 and Minor in bits 7..0.
356Property 2 contains Release in bits 7..0. */
357 HPI_ADAPTER_PROPERTY_SOFTWARE_VERSION = 259,
358
359/** Readonly adapter MAC address MSBs.
360The MAC_ADDRESS_MSB property returns
361the most significant 32 bits of the MAC address.
362Property 1 contains bits 47..32 of the MAC address.
363Property 2 contains bits 31..16 of the MAC address. */
364 HPI_ADAPTER_PROPERTY_MAC_ADDRESS_MSB = 260,
365
366/** Readonly adapter MAC address LSBs
367The MAC_ADDRESS_LSB property returns
368the least significant 16 bits of the MAC address.
369Property 1 contains bits 15..0 of the MAC address. */
370 HPI_ADAPTER_PROPERTY_MAC_ADDRESS_LSB = 261,
371
372/** Readonly extended adapter type number
373The EXTENDED_ADAPTER_TYPE property returns the 4 digits of an extended
374adapter type, i.e ASI8920-0022, 0022 is the extended type.
375The digits are returned as ASCII characters rather than the hex digits that
376are returned for the main type
377Property 1 returns the 1st two (left most) digits, i.e "00"
378in the example above, the upper byte being the left most digit.
379Property 2 returns the 2nd two digits, i.e "22" in the example above*/
380 HPI_ADAPTER_PROPERTY_EXTENDED_ADAPTER_TYPE = 262,
381
382/** Readonly debug log buffer information */
383 HPI_ADAPTER_PROPERTY_LOGTABLEN = 263,
384 HPI_ADAPTER_PROPERTY_LOGTABBEG = 264,
385
386/** Readonly adapter IP address
387For 192.168.1.101
388Property 1 returns the 1st two (left most) digits, i.e 192*256 + 168
389in the example above, the upper byte being the left most digit.
390Property 2 returns the 2nd two digits, i.e 1*256 + 101 in the example above, */
391 HPI_ADAPTER_PROPERTY_IP_ADDRESS = 265,
392
393/** Readonly adapter buffer processed count. Returns a buffer processed count
394that is incremented every time all buffers for all streams are updated. This
395is useful for checking completion of all stream operations across the adapter
396when using grouped streams.
397*/
398 HPI_ADAPTER_PROPERTY_BUFFER_UPDATE_COUNT = 266,
399
400/** Readonly mixer and stream intervals
401
402These intervals are measured in mixer frames.
403To convert to time, divide by the adapter samplerate.
404
405The mixer interval is the number of frames processed in one mixer iteration.
406The stream update interval is the interval at which streams check for and
407process data, and BBM host buffer counters are updated.
408
409Property 1 is the mixer interval in mixer frames.
410Property 2 is the stream update interval in mixer frames.
411*/
412 HPI_ADAPTER_PROPERTY_INTERVAL = 267,
413/** Adapter capabilities 1
414Property 1 - adapter can do multichannel (SSX1)
415Property 2 - adapter can do stream grouping (supports SSX2)
416*/
417 HPI_ADAPTER_PROPERTY_CAPS1 = 268,
418/** Adapter capabilities 2
419Property 1 - adapter can do samplerate conversion (MRX)
420Property 2 - adapter can do timestretch (TSX)
421*/
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +1200422 HPI_ADAPTER_PROPERTY_CAPS2 = 269,
423
424/** Readonly adapter sync header connection count.
425*/
426 HPI_ADAPTER_PROPERTY_SYNC_HEADER_CONNECTIONS = 270,
427/** Readonly supports SSX2 property.
428Indicates the adapter supports SSX2 in some mode setting. The
429return value is true (1) or false (0). If the current adapter
430mode is MONO SSX2 is disabled, even though this property will
431return true.
432*/
Eliot Blennerhassettbd33c1c2011-02-10 17:26:16 +1300433 HPI_ADAPTER_PROPERTY_SUPPORTS_SSX2 = 271,
434/** Readonly supports PCI(e) IRQ.
435Indicates that the adapter in it's current mode supports interrupts
436across the host bus. Note, this does not imply that interrupts are
437enabled. Instead it indicates that they can be enabled.
438*/
Eliot Blennerhassett812550e2011-12-22 13:38:46 +1300439 HPI_ADAPTER_PROPERTY_SUPPORTS_IRQ = 272,
440/** Readonly supports firmware updating.
441Indicates that the adapter implements an interface to update firmware
442on the adapter.
443*/
444 HPI_ADAPTER_PROPERTY_SUPPORTS_FW_UPDATE = 273,
445/** Readonly Firmware IDs
446Identifiy firmware independent of individual adapter type.
447May be used as a filter for firmware update images.
448Property 1 = Bootloader ID
449Property 2 = Main program ID
450*/
451 HPI_ADAPTER_PROPERTY_FIRMWARE_ID = 274
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200452};
453
454/** Adapter mode commands
455
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300456Used in wQueryOrSet parameter of HPI_AdapterSetModeEx().
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200457\ingroup adapter
458*/
459enum HPI_ADAPTER_MODE_CMDS {
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300460 /** Set the mode to the given parameter */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200461 HPI_ADAPTER_MODE_SET = 0,
Eliot Blennerhassett0a000442011-02-10 17:26:05 +1300462 /** Return 0 or error depending whether mode is valid,
463 but don't set the mode */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200464 HPI_ADAPTER_MODE_QUERY = 1
465};
466
467/** Adapter Modes
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300468 These are used by HPI_AdapterSetModeEx()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200469
470\warning - more than 16 possible modes breaks
471a bitmask in the Windows WAVE DLL
472\ingroup adapter
473*/
474enum HPI_ADAPTER_MODES {
475/** 4 outstream mode.
476- ASI6114: 1 instream
477- ASI6044: 4 instreams
478- ASI6012: 1 instream
479- ASI6102: no instreams
480- ASI6022, ASI6122: 2 instreams
481- ASI5111, ASI5101: 2 instreams
482- ASI652x, ASI662x: 2 instreams
483- ASI654x, ASI664x: 4 instreams
484*/
485 HPI_ADAPTER_MODE_4OSTREAM = 1,
486
487/** 6 outstream mode.
488- ASI6012: 1 instream,
489- ASI6022, ASI6122: 2 instreams
490- ASI652x, ASI662x: 4 instreams
491*/
492 HPI_ADAPTER_MODE_6OSTREAM = 2,
493
494/** 8 outstream mode.
495- ASI6114: 8 instreams
496- ASI6118: 8 instreams
497- ASI6585: 8 instreams
498*/
499 HPI_ADAPTER_MODE_8OSTREAM = 3,
500
501/** 16 outstream mode.
502- ASI6416 16 instreams
503- ASI6518, ASI6618 16 instreams
504- ASI6118 16 mono out and in streams
505*/
506 HPI_ADAPTER_MODE_16OSTREAM = 4,
507
508/** one outstream mode.
509- ASI5111 1 outstream, 1 instream
510*/
511 HPI_ADAPTER_MODE_1OSTREAM = 5,
512
513/** ASI504X mode 1. 12 outstream, 4 instream 0 to 48kHz sample rates
514 (see ASI504X datasheet for more info).
515*/
516 HPI_ADAPTER_MODE_1 = 6,
517
518/** ASI504X mode 2. 4 outstreams, 4 instreams at 0 to 192kHz sample rates
519 (see ASI504X datasheet for more info).
520*/
521 HPI_ADAPTER_MODE_2 = 7,
522
523/** ASI504X mode 3. 4 outstreams, 4 instreams at 0 to 192kHz sample rates
524 (see ASI504X datasheet for more info).
525*/
526 HPI_ADAPTER_MODE_3 = 8,
527
528/** ASI504X multichannel mode.
529 2 outstreams -> 4 line outs = 1 to 8 channel streams),
530 4 lineins -> 1 instream (1 to 8 channel streams) at 0-48kHz.
531 For more info see the SSX Specification.
532*/
533 HPI_ADAPTER_MODE_MULTICHANNEL = 9,
534
535/** 12 outstream mode.
536- ASI6514, ASI6614: 2 instreams
537- ASI6540,ASI6544: 8 instreams
538- ASI6640,ASI6644: 8 instreams
539*/
540 HPI_ADAPTER_MODE_12OSTREAM = 10,
541
542/** 9 outstream mode.
543- ASI6044: 8 instreams
544*/
545 HPI_ADAPTER_MODE_9OSTREAM = 11,
546
547/** mono mode.
548- ASI6416: 16 outstreams/instreams
549- ASI5402: 2 outstreams/instreams
550*/
551 HPI_ADAPTER_MODE_MONO = 12,
552
553/** Low latency mode.
554- ASI6416/ASI6316: 1 16 channel outstream and instream
555*/
556 HPI_ADAPTER_MODE_LOW_LATENCY = 13
557};
558
559/* Note, adapters can have more than one capability -
560encoding as bitfield is recommended. */
561#define HPI_CAPABILITY_NONE (0)
562#define HPI_CAPABILITY_MPEG_LAYER3 (1)
563
564/* Set this equal to maximum capability index,
565Must not be greater than 32 - see axnvdef.h */
566#define HPI_CAPABILITY_MAX 1
567/* #define HPI_CAPABILITY_AAC 2 */
568
569/******************************************* STREAM ATTRIBUTES ****/
570
571/** MPEG Ancillary Data modes
572
573The mode for the ancillary data insertion or extraction to operate in.
574\ingroup stream
575*/
576enum HPI_MPEG_ANC_MODES {
577 /** the MPEG frames have energy information stored in them (5 bytes per stereo frame, 3 per mono) */
578 HPI_MPEG_ANC_HASENERGY = 0,
579 /** the entire ancillary data field is taken up by data from the Anc data buffer
580 On encode, the encoder will insert the energy bytes before filling the remainder
581 of the ancillary data space with data from the ancillary data buffer.
582 */
583 HPI_MPEG_ANC_RAW = 1
584};
585
586/** Ancillary Data Alignment
587\ingroup instream
588*/
589enum HPI_ISTREAM_MPEG_ANC_ALIGNS {
590 /** data is packed against the end of data, then padded to the end of frame */
591 HPI_MPEG_ANC_ALIGN_LEFT = 0,
592 /** data is packed against the end of the frame */
593 HPI_MPEG_ANC_ALIGN_RIGHT = 1
594};
595
596/** MPEG modes
597MPEG modes - can be used optionally for HPI_FormatCreate()
598parameter dwAttributes.
599
600Using any mode setting other than HPI_MPEG_MODE_DEFAULT
601with single channel format will return an error.
602\ingroup stream
603*/
604enum HPI_MPEG_MODES {
605/** Causes the MPEG-1 Layer II bitstream to be recorded
606in single_channel mode when the number of channels is 1 and in stereo when the
607number of channels is 2. */
608 HPI_MPEG_MODE_DEFAULT = 0,
609 /** Standard stereo without joint-stereo compression */
610 HPI_MPEG_MODE_STEREO = 1,
611 /** Joint stereo */
612 HPI_MPEG_MODE_JOINTSTEREO = 2,
613 /** Left and Right channels are completely independent */
614 HPI_MPEG_MODE_DUALCHANNEL = 3
615};
616/******************************************* MIXER ATTRIBUTES ****/
617
618/* \defgroup mixer_flags Mixer flags for HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES
619{
620*/
621#define HPI_MIXER_GET_CONTROL_MULTIPLE_CHANGED (0)
622#define HPI_MIXER_GET_CONTROL_MULTIPLE_RESET (1)
623/*}*/
624
625/** Commands used by HPI_MixerStore()
626\ingroup mixer
627*/
628enum HPI_MIXER_STORE_COMMAND {
629/** Save all mixer control settings. */
630 HPI_MIXER_STORE_SAVE = 1,
631/** Restore all controls from saved. */
632 HPI_MIXER_STORE_RESTORE = 2,
633/** Delete saved control settings. */
634 HPI_MIXER_STORE_DELETE = 3,
635/** Enable auto storage of some control settings. */
636 HPI_MIXER_STORE_ENABLE = 4,
637/** Disable auto storage of some control settings. */
638 HPI_MIXER_STORE_DISABLE = 5,
Eliot Blennerhassett812550e2011-12-22 13:38:46 +1300639/** Unimplemented - save the attributes of a single control. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200640 HPI_MIXER_STORE_SAVE_SINGLE = 6
641};
642
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300643/****************************/
644/* CONTROL ATTRIBUTE VALUES */
645/****************************/
646
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200647/** Used by mixer plugin enable functions
648
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300649E.g. HPI_ParametricEq_SetState()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200650\ingroup mixer
651*/
652enum HPI_SWITCH_STATES {
653 HPI_SWITCH_OFF = 0, /**< turn the mixer plugin on. */
654 HPI_SWITCH_ON = 1 /**< turn the mixer plugin off. */
655};
656
657/* Volume control special gain values */
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300658
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200659/** volumes units are 100ths of a dB
660\ingroup volume
661*/
662#define HPI_UNITS_PER_dB 100
663/** turns volume control OFF or MUTE
664\ingroup volume
665*/
666#define HPI_GAIN_OFF (-100 * HPI_UNITS_PER_dB)
667
Eliot Blennerhassettfc3a3992011-02-10 17:26:11 +1300668/** channel mask specifying all channels
669\ingroup volume
670*/
671#define HPI_BITMASK_ALL_CHANNELS (0xFFFFFFFF)
672
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200673/** value returned for no signal
674\ingroup meter
675*/
676#define HPI_METER_MINIMUM (-150 * HPI_UNITS_PER_dB)
677
678/** autofade profiles
679\ingroup volume
680*/
681enum HPI_VOLUME_AUTOFADES {
682/** log fade - dB attenuation changes linearly over time */
683 HPI_VOLUME_AUTOFADE_LOG = 2,
684/** linear fade - amplitude changes linearly */
685 HPI_VOLUME_AUTOFADE_LINEAR = 3
686};
687
688/** The physical encoding format of the AESEBU I/O.
689
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300690Used in HPI_Aesebu_Transmitter_SetFormat(), HPI_Aesebu_Receiver_SetFormat()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200691along with related Get and Query functions
692\ingroup aestx
693*/
694enum HPI_AESEBU_FORMATS {
695/** AES/EBU physical format - AES/EBU balanced "professional" */
696 HPI_AESEBU_FORMAT_AESEBU = 1,
697/** AES/EBU physical format - S/PDIF unbalanced "consumer" */
698 HPI_AESEBU_FORMAT_SPDIF = 2
699};
700
701/** AES/EBU error status bits
702
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300703Returned by HPI_Aesebu_Receiver_GetErrorStatus()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200704\ingroup aesrx
705*/
706enum HPI_AESEBU_ERRORS {
707/** bit0: 1 when PLL is not locked */
708 HPI_AESEBU_ERROR_NOT_LOCKED = 0x01,
709/** bit1: 1 when signal quality is poor */
710 HPI_AESEBU_ERROR_POOR_QUALITY = 0x02,
711/** bit2: 1 when there is a parity error */
712 HPI_AESEBU_ERROR_PARITY_ERROR = 0x04,
713/** bit3: 1 when there is a bi-phase coding violation */
714 HPI_AESEBU_ERROR_BIPHASE_VIOLATION = 0x08,
715/** bit4: 1 when the validity bit is high */
716 HPI_AESEBU_ERROR_VALIDITY = 0x10,
717/** bit5: 1 when the CRC error bit is high */
718 HPI_AESEBU_ERROR_CRC = 0x20
719};
720
721/** \addtogroup pad
722\{
723*/
724/** The text string containing the station/channel combination. */
725#define HPI_PAD_CHANNEL_NAME_LEN 16
726/** The text string containing the artist. */
727#define HPI_PAD_ARTIST_LEN 64
728/** The text string containing the title. */
729#define HPI_PAD_TITLE_LEN 64
730/** The text string containing the comment. */
731#define HPI_PAD_COMMENT_LEN 256
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300732/** The PTY when the tuner has not received any PTY. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200733#define HPI_PAD_PROGRAM_TYPE_INVALID 0xffff
734/** \} */
735
736/** Data types for PTY string translation.
737\ingroup rds
738*/
739enum eHPI_RDS_type {
740 HPI_RDS_DATATYPE_RDS = 0, /**< RDS bitstream.*/
741 HPI_RDS_DATATYPE_RBDS = 1 /**< RBDS bitstream.*/
742};
743
744/** Tuner bands
745
746Used for HPI_Tuner_SetBand(),HPI_Tuner_GetBand()
747\ingroup tuner
748*/
749enum HPI_TUNER_BAND {
750 HPI_TUNER_BAND_AM = 1, /**< AM band */
751 HPI_TUNER_BAND_FM = 2, /**< FM band (mono) */
752 HPI_TUNER_BAND_TV_NTSC_M = 3, /**< NTSC-M TV band*/
753 HPI_TUNER_BAND_TV = 3, /* use TV_NTSC_M */
754 HPI_TUNER_BAND_FM_STEREO = 4, /**< FM band (stereo) */
755 HPI_TUNER_BAND_AUX = 5, /**< auxiliary input */
756 HPI_TUNER_BAND_TV_PAL_BG = 6, /**< PAL-B/G TV band*/
757 HPI_TUNER_BAND_TV_PAL_I = 7, /**< PAL-I TV band*/
758 HPI_TUNER_BAND_TV_PAL_DK = 8, /**< PAL-D/K TV band*/
759 HPI_TUNER_BAND_TV_SECAM_L = 9, /**< SECAM-L TV band*/
Eliot Blennerhassett3872f192014-11-20 16:22:49 +1300760 HPI_TUNER_BAND_DAB = 10,
761 HPI_TUNER_BAND_LAST = 10 /**< the index of the last tuner band. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200762};
763
764/** Tuner mode attributes
765
766Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
767\ingroup tuner
768
769*/
770enum HPI_TUNER_MODES {
771 HPI_TUNER_MODE_RSS = 1, /**< control RSS */
772 HPI_TUNER_MODE_RDS = 2 /**< control RBDS/RDS */
773};
774
775/** Tuner mode attribute values
776
777Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
778\ingroup tuner
779*/
780enum HPI_TUNER_MODE_VALUES {
781/* RSS attribute values */
782 HPI_TUNER_MODE_RSS_DISABLE = 0, /**< RSS disable */
783 HPI_TUNER_MODE_RSS_ENABLE = 1, /**< RSS enable */
784
785/* RDS mode attributes */
786 HPI_TUNER_MODE_RDS_DISABLE = 0, /**< RDS - disabled */
787 HPI_TUNER_MODE_RDS_RDS = 1, /**< RDS - RDS mode */
788 HPI_TUNER_MODE_RDS_RBDS = 2 /**< RDS - RBDS mode */
789};
790
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200791/** Tuner Status Bits
792
793These bitfield values are returned by a call to HPI_Tuner_GetStatus().
794Multiple fields are returned from a single call.
795\ingroup tuner
796*/
797enum HPI_TUNER_STATUS_BITS {
798 HPI_TUNER_VIDEO_COLOR_PRESENT = 0x0001, /**< video color is present. */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300799 HPI_TUNER_VIDEO_IS_60HZ = 0x0020, /**< 60 hz video detected. */
800 HPI_TUNER_VIDEO_HORZ_SYNC_MISSING = 0x0040, /**< video HSYNC is missing. */
801 HPI_TUNER_VIDEO_STATUS_VALID = 0x0100, /**< video status is valid. */
802 HPI_TUNER_DIGITAL = 0x0200, /**< tuner reports digital programming. */
803 HPI_TUNER_MULTIPROGRAM = 0x0400, /**< tuner reports multiple programs. */
804 HPI_TUNER_PLL_LOCKED = 0x1000, /**< the tuner's PLL is locked. */
805 HPI_TUNER_FM_STEREO = 0x2000 /**< tuner reports back FM stereo. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200806};
807
808/** Channel Modes
809Used for HPI_ChannelModeSet/Get()
810\ingroup channelmode
811*/
812enum HPI_CHANNEL_MODES {
813/** Left channel out = left channel in, Right channel out = right channel in. */
814 HPI_CHANNEL_MODE_NORMAL = 1,
815/** Left channel out = right channel in, Right channel out = left channel in. */
816 HPI_CHANNEL_MODE_SWAP = 2,
817/** Left channel out = left channel in, Right channel out = left channel in. */
818 HPI_CHANNEL_MODE_LEFT_TO_STEREO = 3,
819/** Left channel out = right channel in, Right channel out = right channel in.*/
820 HPI_CHANNEL_MODE_RIGHT_TO_STEREO = 4,
821/** Left channel out = (left channel in + right channel in)/2,
822 Right channel out = mute. */
823 HPI_CHANNEL_MODE_STEREO_TO_LEFT = 5,
824/** Left channel out = mute,
825 Right channel out = (right channel in + left channel in)/2. */
826 HPI_CHANNEL_MODE_STEREO_TO_RIGHT = 6,
827 HPI_CHANNEL_MODE_LAST = 6
828};
829
830/** SampleClock source values
831\ingroup sampleclock
832*/
833enum HPI_SAMPLECLOCK_SOURCES {
834/** The sampleclock output is derived from its local samplerate generator.
835 The local samplerate may be set using HPI_SampleClock_SetLocalRate(). */
836 HPI_SAMPLECLOCK_SOURCE_LOCAL = 1,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200837/** The adapter is clocked from a dedicated AES/EBU SampleClock input.*/
838 HPI_SAMPLECLOCK_SOURCE_AESEBU_SYNC = 2,
839/** From external wordclock connector */
840 HPI_SAMPLECLOCK_SOURCE_WORD = 3,
841/** Board-to-board header */
842 HPI_SAMPLECLOCK_SOURCE_WORD_HEADER = 4,
843/** FUTURE - SMPTE clock. */
844 HPI_SAMPLECLOCK_SOURCE_SMPTE = 5,
845/** One of the aesebu inputs */
846 HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT = 6,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200847/** From a network interface e.g. Cobranet or Livewire at either 48 or 96kHz */
848 HPI_SAMPLECLOCK_SOURCE_NETWORK = 8,
849/** From previous adjacent module (ASI2416 only)*/
850 HPI_SAMPLECLOCK_SOURCE_PREV_MODULE = 10,
Eliot Blennerhassett3872f192014-11-20 16:22:49 +1300851/** Blu link sample clock*/
852 HPI_SAMPLECLOCK_SOURCE_BLULINK = 11,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200853/*! Update this if you add a new clock source.*/
Eliot Blennerhassett3872f192014-11-20 16:22:49 +1300854 HPI_SAMPLECLOCK_SOURCE_LAST = 11
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200855};
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 Blennerhassett812550e2011-12-22 13:38:46 +1300945 /** DSP code failed to bootload. Usually a DSP memory test failure. */
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 Blennerhassett812550e2011-12-22 13:38:46 +1300982 HPI_ERROR_FLASH_READ = 228,
983 HPI_ERROR_FLASH_READ_NO_FILE = 229,
984 HPI_ERROR_FLASH_SIZE = 230,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200985
986 /** Reserved for OEMs. */
987 HPI_ERROR_RESERVED_1 = 290,
988
Eliot Blennerhassett1d595d22011-02-10 17:26:08 +1300989 /* HPI_ERROR_INVALID_STREAM = 300 use HPI_ERROR_INVALID_OBJ_INDEX */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200990 /** Invalid compression format. */
991 HPI_ERROR_INVALID_FORMAT = 301,
992 /** Invalid format samplerate */
993 HPI_ERROR_INVALID_SAMPLERATE = 302,
994 /** Invalid format number of channels. */
995 HPI_ERROR_INVALID_CHANNELS = 303,
996 /** Invalid format bitrate. */
997 HPI_ERROR_INVALID_BITRATE = 304,
998 /** Invalid datasize used for stream read/write. */
999 HPI_ERROR_INVALID_DATASIZE = 305,
Eliot Blennerhassett1d595d22011-02-10 17:26:08 +13001000 /* HPI_ERROR_BUFFER_FULL = 306 use HPI_ERROR_INVALID_DATASIZE */
1001 /* HPI_ERROR_BUFFER_EMPTY = 307 use HPI_ERROR_INVALID_DATASIZE */
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001002 /** Null data pointer used for stream read/write. */
1003 HPI_ERROR_INVALID_DATA_POINTER = 308,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001004 /** Packet ordering error for stream read/write. */
1005 HPI_ERROR_INVALID_PACKET_ORDER = 309,
1006
1007 /** Object can't do requested operation in its current
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001008 state, eg set format, change rec mux state while recording.*/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001009 HPI_ERROR_INVALID_OPERATION = 310,
1010
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001011 /** Where a SRG is shared amongst streams, an incompatible samplerate
1012 is one that is different to any currently active stream. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001013 HPI_ERROR_INCOMPATIBLE_SAMPLERATE = 311,
1014 /** Adapter mode is illegal.*/
1015 HPI_ERROR_BAD_ADAPTER_MODE = 312,
1016
1017 /** There have been too many attempts to set the adapter's
1018 capabilities (using bad keys), the card should be returned
1019 to ASI if further capabilities updates are required */
1020 HPI_ERROR_TOO_MANY_CAPABILITY_CHANGE_ATTEMPTS = 313,
1021 /** Streams on different adapters cannot be grouped. */
1022 HPI_ERROR_NO_INTERADAPTER_GROUPS = 314,
1023 /** Streams on different DSPs cannot be grouped. */
1024 HPI_ERROR_NO_INTERDSP_GROUPS = 315,
Eliot Blennerhassettbd33c1c2011-02-10 17:26:16 +13001025 /** Stream wait cancelled before threshold reached. */
1026 HPI_ERROR_WAIT_CANCELLED = 316,
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001027 /** A character string is invalid. */
1028 HPI_ERROR_INVALID_STRING = 317,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001029
1030 /** Invalid mixer node for this adapter. */
1031 HPI_ERROR_INVALID_NODE = 400,
1032 /** Invalid control. */
1033 HPI_ERROR_INVALID_CONTROL = 401,
1034 /** Invalid control value was passed. */
1035 HPI_ERROR_INVALID_CONTROL_VALUE = 402,
1036 /** Control attribute not supported by this control. */
1037 HPI_ERROR_INVALID_CONTROL_ATTRIBUTE = 403,
1038 /** Control is disabled. */
1039 HPI_ERROR_CONTROL_DISABLED = 404,
1040 /** I2C transaction failed due to a missing ACK. */
1041 HPI_ERROR_CONTROL_I2C_MISSING_ACK = 405,
Eliot Blennerhassett0a000442011-02-10 17:26:05 +13001042 HPI_ERROR_I2C_MISSING_ACK = 405,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001043 /** Control is busy, or coming out of
1044 reset and cannot be accessed at this time. */
1045 HPI_ERROR_CONTROL_NOT_READY = 407,
1046
1047 /** Non volatile memory */
1048 HPI_ERROR_NVMEM_BUSY = 450,
1049 HPI_ERROR_NVMEM_FULL = 451,
1050 HPI_ERROR_NVMEM_FAIL = 452,
1051
1052 /** I2C */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001053 HPI_ERROR_I2C_BAD_ADR = 460,
1054
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001055 /** Entity type did not match requested type */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001056 HPI_ERROR_ENTITY_TYPE_MISMATCH = 470,
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001057 /** Entity item count did not match requested count */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001058 HPI_ERROR_ENTITY_ITEM_COUNT = 471,
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001059 /** Entity type is not one of the valid types */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001060 HPI_ERROR_ENTITY_TYPE_INVALID = 472,
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001061 /** Entity role is not one of the valid roles */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001062 HPI_ERROR_ENTITY_ROLE_INVALID = 473,
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001063 /** Entity size doesn't match target size */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +13001064 HPI_ERROR_ENTITY_SIZE_MISMATCH = 474,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001065
1066 /* AES18 specific errors were 500..507 */
1067
1068 /** custom error to use for debugging */
1069 HPI_ERROR_CUSTOM = 600,
1070
1071 /** hpioct32.c can't obtain mutex */
1072 HPI_ERROR_MUTEX_TIMEOUT = 700,
1073
Eliot Blennerhassetta287ca22011-02-10 17:26:17 +13001074 /** Backend errors used to be greater than this.
1075 \deprecated Now, all backends return only errors defined here in hpi.h
1076 */
1077 HPI_ERROR_BACKEND_BASE = 900,
1078
1079 /** Communication with DSP failed */
1080 HPI_ERROR_DSP_COMMUNICATION = 900
1081 /* Note that the dsp communication error is set to this value so that
1082 it remains compatible with any software that expects such errors
1083 to be backend errors i.e. >= 900.
1084 Do not define any new error codes with values > 900.
1085 */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001086};
1087
1088/** \defgroup maximums HPI maximum values
1089\{
1090*/
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001091/** Maximum number of PCI HPI adapters */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001092#define HPI_MAX_ADAPTERS 20
1093/** Maximum number of in or out streams per adapter */
1094#define HPI_MAX_STREAMS 16
1095#define HPI_MAX_CHANNELS 2 /* per stream */
1096#define HPI_MAX_NODES 8 /* per mixer ? */
1097#define HPI_MAX_CONTROLS 4 /* per node ? */
1098/** maximum number of ancillary bytes per MPEG frame */
1099#define HPI_MAX_ANC_BYTES_PER_FRAME (64)
1100#define HPI_STRING_LEN 16
1101
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001102/** Networked adapters have index >= 100 */
1103#define HPI_MIN_NETWORK_ADAPTER_IDX 100
1104
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001105/** Velocity units */
1106#define HPI_OSTREAM_VELOCITY_UNITS 4096
1107/** OutStream timescale units */
1108#define HPI_OSTREAM_TIMESCALE_UNITS 10000
1109/** OutStream timescale passthrough - turns timescaling on in passthough mode */
1110#define HPI_OSTREAM_TIMESCALE_PASSTHROUGH 99999
1111
1112/**\}*/
1113
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001114/**************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001115/* STRUCTURES */
1116#ifndef DISABLE_PRAGMA_PACK1
1117#pragma pack(push, 1)
1118#endif
1119
1120/** Structure containing sample format information.
1121 See also HPI_FormatCreate().
1122 */
1123struct hpi_format {
1124 u32 sample_rate;
1125 /**< 11025, 32000, 44100 ... */
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001126 u32 bit_rate; /**< for MPEG */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001127 u32 attributes;
1128 /**< Stereo/JointStereo/Mono */
1129 u16 mode_legacy;
1130 /**< Legacy ancillary mode or idle bit */
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001131 u16 unused; /**< Unused */
1132 u16 channels; /**< 1,2..., (or ancillary mode or idle bit */
1133 u16 format; /**< HPI_FORMAT_PCM16, _MPEG etc. see #HPI_FORMATS. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001134};
1135
1136struct hpi_anc_frame {
1137 u32 valid_bits_in_this_frame;
1138 u8 b_data[HPI_MAX_ANC_BYTES_PER_FRAME];
1139};
1140
1141/** An object for containing a single async event.
1142*/
1143struct hpi_async_event {
1144 u16 event_type; /**< type of event. \sa async_event */
Eliot Blennerhassett1d595d22011-02-10 17:26:08 +13001145 u16 sequence; /**< Sequence number, allows lost event detection */
1146 u32 state; /**< New state */
1147 u32 h_object; /**< handle to the object returning the event. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001148 union {
1149 struct {
1150 u16 index; /**< GPIO bit index. */
1151 } gpio;
1152 struct {
1153 u16 node_index; /**< what node is the control on ? */
Eliot Blennerhassett1d595d22011-02-10 17:26:08 +13001154 u16 node_type; /**< what type of node is the control on ? */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001155 } control;
1156 } u;
1157};
1158
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001159#ifndef DISABLE_PRAGMA_PACK1
1160#pragma pack(pop)
1161#endif
1162
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001163/*****************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001164/* HPI FUNCTIONS */
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001165/*****************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001166
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001167/* Stream */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001168u16 hpi_stream_estimate_buffer_size(struct hpi_format *pF,
1169 u32 host_polling_rate_in_milli_seconds, u32 *recommended_buffer_size);
1170
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001171/*************/
1172/* SubSystem */
1173/*************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001174
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001175u16 hpi_subsys_get_version_ex(u32 *pversion_ex);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001176
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001177u16 hpi_subsys_get_num_adapters(int *pn_num_adapters);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001178
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001179u16 hpi_subsys_get_adapter(int iterator, u32 *padapter_index,
1180 u16 *pw_adapter_type);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001181
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001182/***********/
1183/* Adapter */
1184/***********/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001185
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001186u16 hpi_adapter_open(u16 adapter_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001187
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001188u16 hpi_adapter_close(u16 adapter_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001189
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001190u16 hpi_adapter_get_info(u16 adapter_index, u16 *pw_num_outstreams,
1191 u16 *pw_num_instreams, u16 *pw_version, u32 *pserial_number,
1192 u16 *pw_adapter_type);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001193
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001194u16 hpi_adapter_get_module_by_index(u16 adapter_index, u16 module_index,
1195 u16 *pw_num_outputs, u16 *pw_num_inputs, u16 *pw_version,
1196 u32 *pserial_number, u16 *pw_module_type, u32 *ph_module);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001197
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001198u16 hpi_adapter_set_mode(u16 adapter_index, u32 adapter_mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001199
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001200u16 hpi_adapter_set_mode_ex(u16 adapter_index, u32 adapter_mode,
1201 u16 query_or_set);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001202
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001203u16 hpi_adapter_get_mode(u16 adapter_index, u32 *padapter_mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001204
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001205u16 hpi_adapter_get_assert2(u16 adapter_index, u16 *p_assert_count,
1206 char *psz_assert, u32 *p_param1, u32 *p_param2,
1207 u32 *p_dsp_string_addr, u16 *p_processor_id);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001208
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001209u16 hpi_adapter_test_assert(u16 adapter_index, u16 assert_id);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001210
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001211u16 hpi_adapter_enable_capability(u16 adapter_index, u16 capability, u32 key);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001212
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001213u16 hpi_adapter_self_test(u16 adapter_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001214
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001215u16 hpi_adapter_debug_read(u16 adapter_index, u32 dsp_address, char *p_bytes,
1216 int *count_bytes);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001217
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001218u16 hpi_adapter_set_property(u16 adapter_index, u16 property, u16 paramter1,
1219 u16 paramter2);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001220
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001221u16 hpi_adapter_get_property(u16 adapter_index, u16 property,
1222 u16 *pw_paramter1, u16 *pw_paramter2);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001223
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001224u16 hpi_adapter_enumerate_property(u16 adapter_index, u16 index,
1225 u16 what_to_enumerate, u16 property_index, u32 *psetting);
1226/*************/
1227/* OutStream */
1228/*************/
1229u16 hpi_outstream_open(u16 adapter_index, u16 outstream_index,
1230 u32 *ph_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001231
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001232u16 hpi_outstream_close(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001233
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001234u16 hpi_outstream_get_info_ex(u32 h_outstream, u16 *pw_state,
1235 u32 *pbuffer_size, u32 *pdata_to_play, u32 *psamples_played,
1236 u32 *pauxiliary_data_to_play);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001237
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001238u16 hpi_outstream_write_buf(u32 h_outstream, const u8 *pb_write_buf,
1239 u32 bytes_to_write, const struct hpi_format *p_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001240
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001241u16 hpi_outstream_start(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001242
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001243u16 hpi_outstream_wait_start(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001244
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001245u16 hpi_outstream_stop(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001246
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001247u16 hpi_outstream_sinegen(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001248
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001249u16 hpi_outstream_reset(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001250
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001251u16 hpi_outstream_query_format(u32 h_outstream, struct hpi_format *p_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001252
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001253u16 hpi_outstream_set_format(u32 h_outstream, struct hpi_format *p_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001254
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001255u16 hpi_outstream_set_punch_in_out(u32 h_outstream, u32 punch_in_sample,
1256 u32 punch_out_sample);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001257
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001258u16 hpi_outstream_set_velocity(u32 h_outstream, short velocity);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001259
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001260u16 hpi_outstream_ancillary_reset(u32 h_outstream, u16 mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001261
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001262u16 hpi_outstream_ancillary_get_info(u32 h_outstream, u32 *pframes_available);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001263
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001264u16 hpi_outstream_ancillary_read(u32 h_outstream,
1265 struct hpi_anc_frame *p_anc_frame_buffer,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001266 u32 anc_frame_buffer_size_in_bytes,
1267 u32 number_of_ancillary_frames_to_read);
1268
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001269u16 hpi_outstream_set_time_scale(u32 h_outstream, u32 time_scaleX10000);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001270
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001271u16 hpi_outstream_host_buffer_allocate(u32 h_outstream, u32 size_in_bytes);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001272
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001273u16 hpi_outstream_host_buffer_free(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001274
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001275u16 hpi_outstream_group_add(u32 h_outstream, u32 h_stream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001276
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001277u16 hpi_outstream_group_get_map(u32 h_outstream, u32 *poutstream_map,
1278 u32 *pinstream_map);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001279
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001280u16 hpi_outstream_group_reset(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001281
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001282/************/
1283/* InStream */
1284/************/
1285u16 hpi_instream_open(u16 adapter_index, u16 instream_index,
1286 u32 *ph_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001287
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001288u16 hpi_instream_close(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001289
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001290u16 hpi_instream_query_format(u32 h_instream,
1291 const struct hpi_format *p_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001292
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001293u16 hpi_instream_set_format(u32 h_instream,
1294 const struct hpi_format *p_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001295
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001296u16 hpi_instream_read_buf(u32 h_instream, u8 *pb_read_buf, u32 bytes_to_read);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001297
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001298u16 hpi_instream_start(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001299
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001300u16 hpi_instream_wait_start(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001301
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001302u16 hpi_instream_stop(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001303
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001304u16 hpi_instream_reset(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001305
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001306u16 hpi_instream_get_info_ex(u32 h_instream, u16 *pw_state, u32 *pbuffer_size,
1307 u32 *pdata_recorded, u32 *psamples_recorded,
1308 u32 *pauxiliary_data_recorded);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001309
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001310u16 hpi_instream_ancillary_reset(u32 h_instream, u16 bytes_per_frame,
1311 u16 mode, u16 alignment, u16 idle_bit);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001312
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001313u16 hpi_instream_ancillary_get_info(u32 h_instream, u32 *pframe_space);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001314
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001315u16 hpi_instream_ancillary_write(u32 h_instream,
1316 const struct hpi_anc_frame *p_anc_frame_buffer,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001317 u32 anc_frame_buffer_size_in_bytes,
1318 u32 number_of_ancillary_frames_to_write);
1319
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001320u16 hpi_instream_host_buffer_allocate(u32 h_instream, u32 size_in_bytes);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001321
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001322u16 hpi_instream_host_buffer_free(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001323
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001324u16 hpi_instream_group_add(u32 h_instream, u32 h_stream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001325
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001326u16 hpi_instream_group_get_map(u32 h_instream, u32 *poutstream_map,
1327 u32 *pinstream_map);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001328
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001329u16 hpi_instream_group_reset(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001330
1331/*********/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001332/* Mixer */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001333/*********/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001334u16 hpi_mixer_open(u16 adapter_index, u32 *ph_mixer);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001335
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001336u16 hpi_mixer_close(u32 h_mixer);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001337
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001338u16 hpi_mixer_get_control(u32 h_mixer, u16 src_node_type,
1339 u16 src_node_type_index, u16 dst_node_type, u16 dst_node_type_index,
1340 u16 control_type, u32 *ph_control);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001341
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001342u16 hpi_mixer_get_control_by_index(u32 h_mixer, u16 control_index,
1343 u16 *pw_src_node_type, u16 *pw_src_node_index, u16 *pw_dst_node_type,
1344 u16 *pw_dst_node_index, u16 *pw_control_type, u32 *ph_control);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001345
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001346u16 hpi_mixer_store(u32 h_mixer, enum HPI_MIXER_STORE_COMMAND command,
1347 u16 index);
1348/************/
1349/* Controls */
1350/************/
1351/******************/
1352/* Volume control */
1353/******************/
1354u16 hpi_volume_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001355 );
1356
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001357u16 hpi_volume_get_gain(u32 h_control,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001358 short an_gain0_01dB_out[HPI_MAX_CHANNELS]
1359 );
1360
Eliot Blennerhassettfc3a3992011-02-10 17:26:11 +13001361u16 hpi_volume_set_mute(u32 h_control, u32 mute);
1362
1363u16 hpi_volume_get_mute(u32 h_control, u32 *mute);
1364
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001365#define hpi_volume_get_range hpi_volume_query_range
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001366u16 hpi_volume_query_range(u32 h_control, short *min_gain_01dB,
1367 short *max_gain_01dB, short *step_gain_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001368
Eliot Blennerhassett812550e2011-12-22 13:38:46 +13001369u16 hpi_volume_query_channels(const u32 h_control, u32 *p_channels);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001370
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001371u16 hpi_volume_auto_fade(u32 h_control,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001372 short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms);
1373
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001374u16 hpi_volume_auto_fade_profile(u32 h_control,
1375 short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms,
1376 u16 profile);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001377
Eliot Blennerhassett862e1412011-12-22 13:38:45 +13001378u16 hpi_volume_query_auto_fade_profile(const u32 h_control, const u32 i,
1379 u16 *profile);
1380
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001381/*****************/
1382/* Level control */
1383/*****************/
1384u16 hpi_level_query_range(u32 h_control, short *min_gain_01dB,
1385 short *max_gain_01dB, short *step_gain_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001386
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001387u16 hpi_level_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001388 );
1389
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001390u16 hpi_level_get_gain(u32 h_control,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001391 short an_gain0_01dB_out[HPI_MAX_CHANNELS]
1392 );
1393
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001394/*****************/
1395/* Meter control */
1396/*****************/
1397u16 hpi_meter_query_channels(const u32 h_meter, u32 *p_channels);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001398
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001399u16 hpi_meter_get_peak(u32 h_control,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001400 short an_peak0_01dB_out[HPI_MAX_CHANNELS]
1401 );
1402
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001403u16 hpi_meter_get_rms(u32 h_control, short an_peak0_01dB_out[HPI_MAX_CHANNELS]
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001404 );
1405
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001406u16 hpi_meter_set_peak_ballistics(u32 h_control, u16 attack, u16 decay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001407
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001408u16 hpi_meter_set_rms_ballistics(u32 h_control, u16 attack, u16 decay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001409
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001410u16 hpi_meter_get_peak_ballistics(u32 h_control, u16 *attack, u16 *decay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001411
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001412u16 hpi_meter_get_rms_ballistics(u32 h_control, u16 *attack, u16 *decay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001413
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001414/************************/
1415/* ChannelMode control */
1416/************************/
1417u16 hpi_channel_mode_query_mode(const u32 h_mode, const u32 index,
1418 u16 *pw_mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001419
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001420u16 hpi_channel_mode_set(u32 h_control, u16 mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001421
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001422u16 hpi_channel_mode_get(u32 h_control, u16 *mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001423
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001424/*****************/
1425/* Tuner control */
1426/*****************/
1427u16 hpi_tuner_query_band(const u32 h_tuner, const u32 index, u16 *pw_band);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001428
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001429u16 hpi_tuner_set_band(u32 h_control, u16 band);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001430
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001431u16 hpi_tuner_get_band(u32 h_control, u16 *pw_band);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001432
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001433u16 hpi_tuner_query_frequency(const u32 h_tuner, const u32 index,
1434 const u16 band, u32 *pfreq);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001435
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001436u16 hpi_tuner_set_frequency(u32 h_control, u32 freq_ink_hz);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001437
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001438u16 hpi_tuner_get_frequency(u32 h_control, u32 *pw_freq_ink_hz);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001439
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001440u16 hpi_tuner_get_rf_level(u32 h_control, short *pw_level);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001441
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001442u16 hpi_tuner_get_raw_rf_level(u32 h_control, short *pw_level);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001443
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001444u16 hpi_tuner_query_gain(const u32 h_tuner, const u32 index, u16 *pw_gain);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001445
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001446u16 hpi_tuner_set_gain(u32 h_control, short gain);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001447
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001448u16 hpi_tuner_get_gain(u32 h_control, short *pn_gain);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001449
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001450u16 hpi_tuner_get_status(u32 h_control, u16 *pw_status_mask, u16 *pw_status);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001451
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001452u16 hpi_tuner_set_mode(u32 h_control, u32 mode, u32 value);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001453
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001454u16 hpi_tuner_get_mode(u32 h_control, u32 mode, u32 *pn_value);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001455
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001456u16 hpi_tuner_get_rds(u32 h_control, char *p_rds_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001457
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001458u16 hpi_tuner_query_deemphasis(const u32 h_tuner, const u32 index,
1459 const u16 band, u32 *pdeemphasis);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001460
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001461u16 hpi_tuner_set_deemphasis(u32 h_control, u32 deemphasis);
1462u16 hpi_tuner_get_deemphasis(u32 h_control, u32 *pdeemphasis);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001463
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001464u16 hpi_tuner_query_program(const u32 h_tuner, u32 *pbitmap_program);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001465
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001466u16 hpi_tuner_set_program(u32 h_control, u32 program);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001467
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001468u16 hpi_tuner_get_program(u32 h_control, u32 *pprogram);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001469
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001470u16 hpi_tuner_get_hd_radio_dsp_version(u32 h_control, char *psz_dsp_version,
1471 const u32 string_size);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001472
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001473u16 hpi_tuner_get_hd_radio_sdk_version(u32 h_control, char *psz_sdk_version,
1474 const u32 string_size);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001475
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001476u16 hpi_tuner_get_hd_radio_signal_quality(u32 h_control, u32 *pquality);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001477
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001478u16 hpi_tuner_get_hd_radio_signal_blend(u32 h_control, u32 *pblend);
Eliot Blennerhassett5a498ef2010-05-27 17:53:52 +12001479
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001480u16 hpi_tuner_set_hd_radio_signal_blend(u32 h_control, const u32 blend);
Eliot Blennerhassett5a498ef2010-05-27 17:53:52 +12001481
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001482/***************/
1483/* PAD control */
1484/***************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001485
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001486u16 hpi_pad_get_channel_name(u32 h_control, char *psz_string,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001487 const u32 string_length);
1488
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001489u16 hpi_pad_get_artist(u32 h_control, char *psz_string,
1490 const u32 string_length);
1491
1492u16 hpi_pad_get_title(u32 h_control, char *psz_string,
1493 const u32 string_length);
1494
1495u16 hpi_pad_get_comment(u32 h_control, char *psz_string,
1496 const u32 string_length);
1497
1498u16 hpi_pad_get_program_type(u32 h_control, u32 *ppTY);
1499
1500u16 hpi_pad_get_rdsPI(u32 h_control, u32 *ppI);
1501
1502u16 hpi_pad_get_program_type_string(u32 h_control, const u32 data_type,
1503 const u32 pTY, char *psz_string, const u32 string_length);
1504
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001505/****************************/
1506/* AES/EBU Receiver control */
1507/****************************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001508u16 hpi_aesebu_receiver_query_format(const u32 h_aes_rx, const u32 index,
1509 u16 *pw_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001510
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001511u16 hpi_aesebu_receiver_set_format(u32 h_control, u16 source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001512
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001513u16 hpi_aesebu_receiver_get_format(u32 h_control, u16 *pw_source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001514
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001515u16 hpi_aesebu_receiver_get_sample_rate(u32 h_control, u32 *psample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001516
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001517u16 hpi_aesebu_receiver_get_user_data(u32 h_control, u16 index, u16 *pw_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001518
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001519u16 hpi_aesebu_receiver_get_channel_status(u32 h_control, u16 index,
1520 u16 *pw_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001521
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001522u16 hpi_aesebu_receiver_get_error_status(u32 h_control, u16 *pw_error_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001523
1524/*******************************/
1525/* AES/EBU Transmitter control */
1526/*******************************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001527u16 hpi_aesebu_transmitter_set_sample_rate(u32 h_control, u32 sample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001528
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001529u16 hpi_aesebu_transmitter_set_user_data(u32 h_control, u16 index, u16 data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001530
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001531u16 hpi_aesebu_transmitter_set_channel_status(u32 h_control, u16 index,
1532 u16 data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001533
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001534u16 hpi_aesebu_transmitter_get_channel_status(u32 h_control, u16 index,
1535 u16 *pw_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001536
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001537u16 hpi_aesebu_transmitter_query_format(const u32 h_aes_tx, const u32 index,
1538 u16 *pw_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001539
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001540u16 hpi_aesebu_transmitter_set_format(u32 h_control, u16 output_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001541
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001542u16 hpi_aesebu_transmitter_get_format(u32 h_control, u16 *pw_output_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001543
1544/***********************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001545/* Multiplexer control */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001546/***********************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001547u16 hpi_multiplexer_set_source(u32 h_control, u16 source_node_type,
1548 u16 source_node_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001549
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001550u16 hpi_multiplexer_get_source(u32 h_control, u16 *source_node_type,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001551 u16 *source_node_index);
1552
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001553u16 hpi_multiplexer_query_source(u32 h_control, u16 index,
1554 u16 *source_node_type, u16 *source_node_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001555
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001556/***************/
1557/* Vox control */
1558/***************/
1559u16 hpi_vox_set_threshold(u32 h_control, short an_gain0_01dB);
1560
1561u16 hpi_vox_get_threshold(u32 h_control, short *an_gain0_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001562
1563/*********************/
1564/* Bitstream control */
1565/*********************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001566u16 hpi_bitstream_set_clock_edge(u32 h_control, u16 edge_type);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001567
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001568u16 hpi_bitstream_set_data_polarity(u32 h_control, u16 polarity);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001569
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001570u16 hpi_bitstream_get_activity(u32 h_control, u16 *pw_clk_activity,
1571 u16 *pw_data_activity);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001572
1573/***********************/
1574/* SampleClock control */
1575/***********************/
1576
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001577u16 hpi_sample_clock_query_source(const u32 h_clock, const u32 index,
1578 u16 *pw_source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001579
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001580u16 hpi_sample_clock_set_source(u32 h_control, u16 source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001581
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001582u16 hpi_sample_clock_get_source(u32 h_control, u16 *pw_source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001583
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001584u16 hpi_sample_clock_query_source_index(const u32 h_clock, const u32 index,
1585 const u32 source, u16 *pw_source_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001586
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001587u16 hpi_sample_clock_set_source_index(u32 h_control, u16 source_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001588
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001589u16 hpi_sample_clock_get_source_index(u32 h_control, u16 *pw_source_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001590
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001591u16 hpi_sample_clock_get_sample_rate(u32 h_control, u32 *psample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001592
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001593u16 hpi_sample_clock_query_local_rate(const u32 h_clock, const u32 index,
1594 u32 *psource);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001595
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001596u16 hpi_sample_clock_set_local_rate(u32 h_control, u32 sample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001597
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001598u16 hpi_sample_clock_get_local_rate(u32 h_control, u32 *psample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001599
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001600u16 hpi_sample_clock_set_auto(u32 h_control, u32 enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001601
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001602u16 hpi_sample_clock_get_auto(u32 h_control, u32 *penable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001603
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001604u16 hpi_sample_clock_set_local_rate_lock(u32 h_control, u32 lock);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001605
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001606u16 hpi_sample_clock_get_local_rate_lock(u32 h_control, u32 *plock);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001607
1608/***********************/
1609/* Microphone control */
1610/***********************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001611u16 hpi_microphone_set_phantom_power(u32 h_control, u16 on_off);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001612
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001613u16 hpi_microphone_get_phantom_power(u32 h_control, u16 *pw_on_off);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001614
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001615/********************************/
1616/* Parametric Equalizer control */
1617/********************************/
1618u16 hpi_parametric_eq_get_info(u32 h_control, u16 *pw_number_of_bands,
1619 u16 *pw_enabled);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001620
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001621u16 hpi_parametric_eq_set_state(u32 h_control, u16 on_off);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001622
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001623u16 hpi_parametric_eq_set_band(u32 h_control, u16 index, u16 type,
1624 u32 frequency_hz, short q100, short gain0_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001625
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001626u16 hpi_parametric_eq_get_band(u32 h_control, u16 index, u16 *pn_type,
1627 u32 *pfrequency_hz, short *pnQ100, short *pn_gain0_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001628
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001629u16 hpi_parametric_eq_get_coeffs(u32 h_control, u16 index, short coeffs[5]
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001630 );
1631
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001632/*******************************/
1633/* Compressor Expander control */
1634/*******************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001635
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001636u16 hpi_compander_set_enable(u32 h_control, u32 on);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001637
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001638u16 hpi_compander_get_enable(u32 h_control, u32 *pon);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001639
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001640u16 hpi_compander_set_makeup_gain(u32 h_control, short makeup_gain0_01dB);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001641
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001642u16 hpi_compander_get_makeup_gain(u32 h_control, short *pn_makeup_gain0_01dB);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001643
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001644u16 hpi_compander_set_attack_time_constant(u32 h_control, u32 index,
1645 u32 attack);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001646
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001647u16 hpi_compander_get_attack_time_constant(u32 h_control, u32 index,
1648 u32 *pw_attack);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001649
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001650u16 hpi_compander_set_decay_time_constant(u32 h_control, u32 index,
1651 u32 decay);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001652
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001653u16 hpi_compander_get_decay_time_constant(u32 h_control, u32 index,
1654 u32 *pw_decay);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001655
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001656u16 hpi_compander_set_threshold(u32 h_control, u32 index,
1657 short threshold0_01dB);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001658
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001659u16 hpi_compander_get_threshold(u32 h_control, u32 index,
1660 short *pn_threshold0_01dB);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001661
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001662u16 hpi_compander_set_ratio(u32 h_control, u32 index, u32 ratio100);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001663
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001664u16 hpi_compander_get_ratio(u32 h_control, u32 index, u32 *pw_ratio100);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001665
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001666/********************/
1667/* Cobranet control */
1668/********************/
1669u16 hpi_cobranet_hmi_write(u32 h_control, u32 hmi_address, u32 byte_count,
1670 u8 *pb_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001671
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001672u16 hpi_cobranet_hmi_read(u32 h_control, u32 hmi_address, u32 max_byte_count,
1673 u32 *pbyte_count, u8 *pb_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001674
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001675u16 hpi_cobranet_hmi_get_status(u32 h_control, u32 *pstatus,
1676 u32 *preadable_size, u32 *pwriteable_size);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001677
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001678u16 hpi_cobranet_get_ip_address(u32 h_control, u32 *pdw_ip_address);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001679
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001680u16 hpi_cobranet_set_ip_address(u32 h_control, u32 dw_ip_address);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001681
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001682u16 hpi_cobranet_get_static_ip_address(u32 h_control, u32 *pdw_ip_address);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001683
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001684u16 hpi_cobranet_set_static_ip_address(u32 h_control, u32 dw_ip_address);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001685
Eliot Blennerhassett1d595d22011-02-10 17:26:08 +13001686u16 hpi_cobranet_get_macaddress(u32 h_control, u32 *p_mac_msbs,
1687 u32 *p_mac_lsbs);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001688
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001689/*************************/
1690/* Tone Detector control */
1691/*************************/
1692u16 hpi_tone_detector_get_state(u32 hC, u32 *state);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001693
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001694u16 hpi_tone_detector_set_enable(u32 hC, u32 enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001695
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001696u16 hpi_tone_detector_get_enable(u32 hC, u32 *enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001697
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001698u16 hpi_tone_detector_set_event_enable(u32 hC, u32 event_enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001699
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001700u16 hpi_tone_detector_get_event_enable(u32 hC, u32 *event_enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001701
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001702u16 hpi_tone_detector_set_threshold(u32 hC, int threshold);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001703
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001704u16 hpi_tone_detector_get_threshold(u32 hC, int *threshold);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001705
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001706u16 hpi_tone_detector_get_frequency(u32 hC, u32 index, u32 *frequency);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001707
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001708/****************************/
1709/* Silence Detector control */
1710/****************************/
1711u16 hpi_silence_detector_get_state(u32 hC, u32 *state);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001712
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001713u16 hpi_silence_detector_set_enable(u32 hC, u32 enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001714
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001715u16 hpi_silence_detector_get_enable(u32 hC, u32 *enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001716
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001717u16 hpi_silence_detector_set_event_enable(u32 hC, u32 event_enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001718
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001719u16 hpi_silence_detector_get_event_enable(u32 hC, u32 *event_enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001720
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001721u16 hpi_silence_detector_set_delay(u32 hC, u32 delay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001722
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001723u16 hpi_silence_detector_get_delay(u32 hC, u32 *delay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001724
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001725u16 hpi_silence_detector_set_threshold(u32 hC, int threshold);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001726
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001727u16 hpi_silence_detector_get_threshold(u32 hC, int *threshold);
1728/*********************/
1729/* Utility functions */
1730/*********************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001731
1732u16 hpi_format_create(struct hpi_format *p_format, u16 channels, u16 format,
1733 u32 sample_rate, u32 bit_rate, u32 attributes);
1734
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001735#endif /*_HPI_H_ */