blob: efed0c166bf348d25f57c3a9fa154accb0202681 [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 Blennerhassettba944552011-02-10 17:26:04 +130046#define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 5, 17)
47#define HPI_VER_STRING "4.05.17"
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>
53#define HPI_EXCLUDE_DEPRECATED
54
55/******************************************************************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +020056/******** HPI API DEFINITIONS *****/
57/******************************************************************************/
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +130058
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +020059/*******************************************/
60/** Audio format types
61\ingroup stream
62*/
63enum HPI_FORMATS {
64/** Used internally on adapter. */
65 HPI_FORMAT_MIXER_NATIVE = 0,
66/** 8-bit unsigned PCM. Windows equivalent is WAVE_FORMAT_PCM. */
67 HPI_FORMAT_PCM8_UNSIGNED = 1,
68/** 16-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM. */
69 HPI_FORMAT_PCM16_SIGNED = 2,
70/** MPEG-1 Layer-1. */
71 HPI_FORMAT_MPEG_L1 = 3,
72/** MPEG-1 Layer-2.
73
74Windows equivalent is WAVE_FORMAT_MPEG.
75
76The following table shows what combinations of mode and bitrate are possible:
77
78<table border=1 cellspacing=0 cellpadding=5>
79<tr>
80<td><p><b>Bitrate (kbs)</b></p>
81<td><p><b>Mono</b></p>
82<td><p><b>Stereo,<br>Joint Stereo or<br>Dual Channel</b></p>
83
84<tr><td>32<td>X<td>_
85<tr><td>40<td>_<td>_
86<tr><td>48<td>X<td>_
87<tr><td>56<td>X<td>_
88<tr><td>64<td>X<td>X
89<tr><td>80<td>X<td>_
90<tr><td>96<td>X<td>X
91<tr><td>112<td>X<td>X
92<tr><td>128<td>X<td>X
93<tr><td>160<td>X<td>X
94<tr><td>192<td>X<td>X
95<tr><td>224<td>_<td>X
96<tr><td>256<td>-<td>X
97<tr><td>320<td>-<td>X
98<tr><td>384<td>_<td>X
99</table>
100*/
101 HPI_FORMAT_MPEG_L2 = 4,
102/** MPEG-1 Layer-3.
103Windows equivalent is WAVE_FORMAT_MPEG.
104
105The following table shows what combinations of mode and bitrate are possible:
106
107<table border=1 cellspacing=0 cellpadding=5>
108<tr>
109<td><p><b>Bitrate (kbs)</b></p>
110<td><p><b>Mono<br>Stereo @ 8,<br>11.025 and<br>12kHz*</b></p>
111<td><p><b>Mono<br>Stereo @ 16,<br>22.050 and<br>24kHz*</b></p>
112<td><p><b>Mono<br>Stereo @ 32,<br>44.1 and<br>48kHz</b></p>
113
114<tr><td>16<td>X<td>X<td>_
115<tr><td>24<td>X<td>X<td>_
116<tr><td>32<td>X<td>X<td>X
117<tr><td>40<td>X<td>X<td>X
118<tr><td>48<td>X<td>X<td>X
119<tr><td>56<td>X<td>X<td>X
120<tr><td>64<td>X<td>X<td>X
121<tr><td>80<td>_<td>X<td>X
122<tr><td>96<td>_<td>X<td>X
123<tr><td>112<td>_<td>X<td>X
124<tr><td>128<td>_<td>X<td>X
125<tr><td>144<td>_<td>X<td>_
126<tr><td>160<td>_<td>X<td>X
127<tr><td>192<td>_<td>_<td>X
128<tr><td>224<td>_<td>_<td>X
129<tr><td>256<td>-<td>_<td>X
130<tr><td>320<td>-<td>_<td>X
131</table>
132\b * Available on the ASI6000 series only
133*/
134 HPI_FORMAT_MPEG_L3 = 5,
135/** Dolby AC-2. */
136 HPI_FORMAT_DOLBY_AC2 = 6,
137/** Dolbt AC-3. */
138 HPI_FORMAT_DOLBY_AC3 = 7,
139/** 16-bit PCM big-endian. */
140 HPI_FORMAT_PCM16_BIGENDIAN = 8,
141/** TAGIT-1 algorithm - hits. */
142 HPI_FORMAT_AA_TAGIT1_HITS = 9,
143/** TAGIT-1 algorithm - inserts. */
144 HPI_FORMAT_AA_TAGIT1_INSERTS = 10,
145/** 32-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM.
146Each sample is a 32bit word. The most significant 24 bits contain a 24-bit
147sample and the least significant 8 bits are set to 0.
148*/
149 HPI_FORMAT_PCM32_SIGNED = 11,
150/** Raw bitstream - unknown format. */
151 HPI_FORMAT_RAW_BITSTREAM = 12,
152/** TAGIT-1 algorithm hits - extended. */
153 HPI_FORMAT_AA_TAGIT1_HITS_EX1 = 13,
154/** 32-bit PCM as an IEEE float. Windows equivalent is WAVE_FORMAT_IEEE_FLOAT.
155Each sample is a 32bit word in IEEE754 floating point format.
156The range is +1.0 to -1.0, which corresponds to digital fullscale.
157*/
158 HPI_FORMAT_PCM32_FLOAT = 14,
159/** 24-bit PCM signed. Windows equivalent is WAVE_FORMAT_PCM. */
160 HPI_FORMAT_PCM24_SIGNED = 15,
161/** OEM format 1 - private. */
162 HPI_FORMAT_OEM1 = 16,
163/** OEM format 2 - private. */
164 HPI_FORMAT_OEM2 = 17,
165/** Undefined format. */
166 HPI_FORMAT_UNDEFINED = 0xffff
167};
168
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200169/*******************************************/
170/** Stream States
171\ingroup stream
172*/
173enum HPI_STREAM_STATES {
174 /** State stopped - stream is stopped. */
175 HPI_STATE_STOPPED = 1,
176 /** State playing - stream is playing audio. */
177 HPI_STATE_PLAYING = 2,
178 /** State recording - stream is recording. */
179 HPI_STATE_RECORDING = 3,
180 /** State drained - playing stream ran out of data to play. */
181 HPI_STATE_DRAINED = 4,
182 /** State generate sine - to be implemented. */
183 HPI_STATE_SINEGEN = 5,
184 /** State wait - used for inter-card sync to mean waiting for all
185 cards to be ready. */
186 HPI_STATE_WAIT = 6
187};
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300188/*******************************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200189/** Source node types
190\ingroup mixer
191*/
192enum HPI_SOURCENODES {
193 /** This define can be used instead of 0 to indicate
194 that there is no valid source node. A control that
195 exists on a destination node can be searched for using a source
196 node value of either 0, or HPI_SOURCENODE_NONE */
197 HPI_SOURCENODE_NONE = 100,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200198 /** Out Stream (Play) node. */
199 HPI_SOURCENODE_OSTREAM = 101,
200 /** Line in node - could be analog, AES/EBU or network. */
201 HPI_SOURCENODE_LINEIN = 102,
202 HPI_SOURCENODE_AESEBU_IN = 103, /**< AES/EBU input node. */
203 HPI_SOURCENODE_TUNER = 104, /**< tuner node. */
204 HPI_SOURCENODE_RF = 105, /**< RF input node. */
205 HPI_SOURCENODE_CLOCK_SOURCE = 106, /**< clock source node. */
206 HPI_SOURCENODE_RAW_BITSTREAM = 107, /**< raw bitstream node. */
207 HPI_SOURCENODE_MICROPHONE = 108, /**< microphone node. */
208 /** Cobranet input node -
209 Audio samples come from the Cobranet network and into the device. */
210 HPI_SOURCENODE_COBRANET = 109,
211 HPI_SOURCENODE_ANALOG = 110, /**< analog input node. */
212 HPI_SOURCENODE_ADAPTER = 111, /**< adapter node. */
213 /* !!!Update this AND hpidebug.h if you add a new sourcenode type!!! */
214 HPI_SOURCENODE_LAST_INDEX = 111 /**< largest ID */
215 /* AX6 max sourcenode types = 15 */
216};
217
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300218/*******************************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200219/** Destination node types
220\ingroup mixer
221*/
222enum HPI_DESTNODES {
223 /** This define can be used instead of 0 to indicate
224 that there is no valid destination node. A control that
225 exists on a source node can be searched for using a destination
226 node value of either 0, or HPI_DESTNODE_NONE */
227 HPI_DESTNODE_NONE = 200,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200228 /** In Stream (Record) node. */
229 HPI_DESTNODE_ISTREAM = 201,
230 HPI_DESTNODE_LINEOUT = 202, /**< line out node. */
231 HPI_DESTNODE_AESEBU_OUT = 203, /**< AES/EBU output node. */
232 HPI_DESTNODE_RF = 204, /**< RF output node. */
233 HPI_DESTNODE_SPEAKER = 205, /**< speaker output node. */
234 /** Cobranet output node -
235 Audio samples from the device are sent out on the Cobranet network.*/
236 HPI_DESTNODE_COBRANET = 206,
237 HPI_DESTNODE_ANALOG = 207, /**< analog output node. */
238
239 /* !!!Update this AND hpidebug.h if you add a new destnode type!!! */
240 HPI_DESTNODE_LAST_INDEX = 207 /**< largest ID */
241 /* AX6 max destnode types = 15 */
242};
243
244/*******************************************/
245/** Mixer control types
246\ingroup mixer
247*/
248enum HPI_CONTROLS {
249 HPI_CONTROL_GENERIC = 0, /**< generic control. */
250 HPI_CONTROL_CONNECTION = 1, /**< A connection between nodes. */
251 HPI_CONTROL_VOLUME = 2, /**< volume control - works in dB_fs. */
252 HPI_CONTROL_METER = 3, /**< peak meter control. */
253 HPI_CONTROL_MUTE = 4, /*mute control - not used at present. */
254 HPI_CONTROL_MULTIPLEXER = 5, /**< multiplexer control. */
255
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300256 HPI_CONTROL_AESEBU_TRANSMITTER = 6, /**< AES/EBU transmitter control */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300257 HPI_CONTROL_AESEBUTX = 6, /* HPI_CONTROL_AESEBU_TRANSMITTER */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200258
259 HPI_CONTROL_AESEBU_RECEIVER = 7, /**< AES/EBU receiver control. */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300260 HPI_CONTROL_AESEBURX = 7, /* HPI_CONTROL_AESEBU_RECEIVER */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200261
262 HPI_CONTROL_LEVEL = 8, /**< level/trim control - works in d_bu. */
263 HPI_CONTROL_TUNER = 9, /**< tuner control. */
264/* HPI_CONTROL_ONOFFSWITCH = 10 */
265 HPI_CONTROL_VOX = 11, /**< vox control. */
266/* HPI_CONTROL_AES18_TRANSMITTER = 12 */
267/* HPI_CONTROL_AES18_RECEIVER = 13 */
268/* HPI_CONTROL_AES18_BLOCKGENERATOR = 14 */
269 HPI_CONTROL_CHANNEL_MODE = 15, /**< channel mode control. */
270
271 HPI_CONTROL_BITSTREAM = 16, /**< bitstream control. */
272 HPI_CONTROL_SAMPLECLOCK = 17, /**< sample clock control. */
273 HPI_CONTROL_MICROPHONE = 18, /**< microphone control. */
274 HPI_CONTROL_PARAMETRIC_EQ = 19, /**< parametric EQ control. */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300275 HPI_CONTROL_EQUALIZER = 19, /*HPI_CONTROL_PARAMETRIC_EQ */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200276
277 HPI_CONTROL_COMPANDER = 20, /**< compander control. */
278 HPI_CONTROL_COBRANET = 21, /**< cobranet control. */
279 HPI_CONTROL_TONEDETECTOR = 22, /**< tone detector control. */
280 HPI_CONTROL_SILENCEDETECTOR = 23, /**< silence detector control. */
281 HPI_CONTROL_PAD = 24, /**< tuner PAD control. */
282 HPI_CONTROL_SRC = 25, /**< samplerate converter control. */
283 HPI_CONTROL_UNIVERSAL = 26, /**< universal control. */
284
285/* !!! Update this AND hpidebug.h if you add a new control type!!!*/
286 HPI_CONTROL_LAST_INDEX = 26 /**<highest control type ID */
287/* WARNING types 256 or greater impact bit packing in all AX6 DSP code */
288};
289
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300290/*******************************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200291/** Adapter properties
292These are used in HPI_AdapterSetProperty() and HPI_AdapterGetProperty()
293\ingroup adapter
294*/
295enum HPI_ADAPTER_PROPERTIES {
296/** \internal Used in dwProperty field of HPI_AdapterSetProperty() and
297HPI_AdapterGetProperty(). This errata applies to all ASI6000 cards with both
298analog and digital outputs. The CS4224 A/D+D/A has a one sample delay between
299left and right channels on both its input (ADC) and output (DAC).
300More details are available in Cirrus Logic errata ER284B2.
301PDF available from www.cirrus.com, released by Cirrus in 2001.
302*/
303 HPI_ADAPTER_PROPERTY_ERRATA_1 = 1,
304
305/** Adapter grouping property
306Indicates whether the adapter supports the grouping API (for ASIO and SSX2)
307*/
308 HPI_ADAPTER_PROPERTY_GROUPING = 2,
309
310/** Driver SSX2 property
311Tells the kernel driver to turn on SSX2 stream mapping.
312This feature is not used by the DSP. In fact the call is completely processed
313by the driver and is not passed on to the DSP at all.
314*/
315 HPI_ADAPTER_PROPERTY_ENABLE_SSX2 = 3,
316
317/** Adapter SSX2 property
318Indicates the state of the adapter's SSX2 setting. This setting is stored in
319non-volatile memory on the adapter. A typical call sequence would be to use
320HPI_ADAPTER_PROPERTY_SSX2_SETTING to set SSX2 on the adapter and then to reload
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300321the driver. The driver would query HPI_ADAPTER_PROPERTY_SSX2_SETTING during
322startup and if SSX2 is set, it would then call HPI_ADAPTER_PROPERTY_ENABLE_SSX2
323to enable SSX2 stream mapping within the kernel level of the driver.
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200324*/
325 HPI_ADAPTER_PROPERTY_SSX2_SETTING = 4,
326
327/** Base number for readonly properties */
328 HPI_ADAPTER_PROPERTY_READONLYBASE = 256,
329
330/** Readonly adapter latency property.
331This property returns in the input and output latency in samples.
332Property 1 is the estimated input latency
333in samples, while Property 2 is that output latency in samples.
334*/
335 HPI_ADAPTER_PROPERTY_LATENCY = 256,
336
337/** Readonly adapter granularity property.
338The granulariy is the smallest size chunk of stereo samples that is processed by
339the adapter.
340This property returns the record granularity in samples in Property 1.
341Property 2 returns the play granularity.
342*/
343 HPI_ADAPTER_PROPERTY_GRANULARITY = 257,
344
345/** Readonly adapter number of current channels property.
346Property 1 is the number of record channels per record device.
347Property 2 is the number of play channels per playback device.*/
348 HPI_ADAPTER_PROPERTY_CURCHANNELS = 258,
349
350/** Readonly adapter software version.
351The SOFTWARE_VERSION property returns the version of the software running
352on the adapter as Major.Minor.Release.
353Property 1 contains Major in bits 15..8 and Minor in bits 7..0.
354Property 2 contains Release in bits 7..0. */
355 HPI_ADAPTER_PROPERTY_SOFTWARE_VERSION = 259,
356
357/** Readonly adapter MAC address MSBs.
358The MAC_ADDRESS_MSB property returns
359the most significant 32 bits of the MAC address.
360Property 1 contains bits 47..32 of the MAC address.
361Property 2 contains bits 31..16 of the MAC address. */
362 HPI_ADAPTER_PROPERTY_MAC_ADDRESS_MSB = 260,
363
364/** Readonly adapter MAC address LSBs
365The MAC_ADDRESS_LSB property returns
366the least significant 16 bits of the MAC address.
367Property 1 contains bits 15..0 of the MAC address. */
368 HPI_ADAPTER_PROPERTY_MAC_ADDRESS_LSB = 261,
369
370/** Readonly extended adapter type number
371The EXTENDED_ADAPTER_TYPE property returns the 4 digits of an extended
372adapter type, i.e ASI8920-0022, 0022 is the extended type.
373The digits are returned as ASCII characters rather than the hex digits that
374are returned for the main type
375Property 1 returns the 1st two (left most) digits, i.e "00"
376in the example above, the upper byte being the left most digit.
377Property 2 returns the 2nd two digits, i.e "22" in the example above*/
378 HPI_ADAPTER_PROPERTY_EXTENDED_ADAPTER_TYPE = 262,
379
380/** Readonly debug log buffer information */
381 HPI_ADAPTER_PROPERTY_LOGTABLEN = 263,
382 HPI_ADAPTER_PROPERTY_LOGTABBEG = 264,
383
384/** Readonly adapter IP address
385For 192.168.1.101
386Property 1 returns the 1st two (left most) digits, i.e 192*256 + 168
387in the example above, the upper byte being the left most digit.
388Property 2 returns the 2nd two digits, i.e 1*256 + 101 in the example above, */
389 HPI_ADAPTER_PROPERTY_IP_ADDRESS = 265,
390
391/** Readonly adapter buffer processed count. Returns a buffer processed count
392that is incremented every time all buffers for all streams are updated. This
393is useful for checking completion of all stream operations across the adapter
394when using grouped streams.
395*/
396 HPI_ADAPTER_PROPERTY_BUFFER_UPDATE_COUNT = 266,
397
398/** Readonly mixer and stream intervals
399
400These intervals are measured in mixer frames.
401To convert to time, divide by the adapter samplerate.
402
403The mixer interval is the number of frames processed in one mixer iteration.
404The stream update interval is the interval at which streams check for and
405process data, and BBM host buffer counters are updated.
406
407Property 1 is the mixer interval in mixer frames.
408Property 2 is the stream update interval in mixer frames.
409*/
410 HPI_ADAPTER_PROPERTY_INTERVAL = 267,
411/** Adapter capabilities 1
412Property 1 - adapter can do multichannel (SSX1)
413Property 2 - adapter can do stream grouping (supports SSX2)
414*/
415 HPI_ADAPTER_PROPERTY_CAPS1 = 268,
416/** Adapter capabilities 2
417Property 1 - adapter can do samplerate conversion (MRX)
418Property 2 - adapter can do timestretch (TSX)
419*/
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +1200420 HPI_ADAPTER_PROPERTY_CAPS2 = 269,
421
422/** Readonly adapter sync header connection count.
423*/
424 HPI_ADAPTER_PROPERTY_SYNC_HEADER_CONNECTIONS = 270,
425/** Readonly supports SSX2 property.
426Indicates the adapter supports SSX2 in some mode setting. The
427return value is true (1) or false (0). If the current adapter
428mode is MONO SSX2 is disabled, even though this property will
429return true.
430*/
431 HPI_ADAPTER_PROPERTY_SUPPORTS_SSX2 = 271
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200432};
433
434/** Adapter mode commands
435
436Used in wQueryOrSet field of HPI_AdapterSetModeEx().
437\ingroup adapter
438*/
439enum HPI_ADAPTER_MODE_CMDS {
440 HPI_ADAPTER_MODE_SET = 0,
441 HPI_ADAPTER_MODE_QUERY = 1
442};
443
444/** Adapter Modes
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300445 These are used by HPI_AdapterSetModeEx()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200446
447\warning - more than 16 possible modes breaks
448a bitmask in the Windows WAVE DLL
449\ingroup adapter
450*/
451enum HPI_ADAPTER_MODES {
452/** 4 outstream mode.
453- ASI6114: 1 instream
454- ASI6044: 4 instreams
455- ASI6012: 1 instream
456- ASI6102: no instreams
457- ASI6022, ASI6122: 2 instreams
458- ASI5111, ASI5101: 2 instreams
459- ASI652x, ASI662x: 2 instreams
460- ASI654x, ASI664x: 4 instreams
461*/
462 HPI_ADAPTER_MODE_4OSTREAM = 1,
463
464/** 6 outstream mode.
465- ASI6012: 1 instream,
466- ASI6022, ASI6122: 2 instreams
467- ASI652x, ASI662x: 4 instreams
468*/
469 HPI_ADAPTER_MODE_6OSTREAM = 2,
470
471/** 8 outstream mode.
472- ASI6114: 8 instreams
473- ASI6118: 8 instreams
474- ASI6585: 8 instreams
475*/
476 HPI_ADAPTER_MODE_8OSTREAM = 3,
477
478/** 16 outstream mode.
479- ASI6416 16 instreams
480- ASI6518, ASI6618 16 instreams
481- ASI6118 16 mono out and in streams
482*/
483 HPI_ADAPTER_MODE_16OSTREAM = 4,
484
485/** one outstream mode.
486- ASI5111 1 outstream, 1 instream
487*/
488 HPI_ADAPTER_MODE_1OSTREAM = 5,
489
490/** ASI504X mode 1. 12 outstream, 4 instream 0 to 48kHz sample rates
491 (see ASI504X datasheet for more info).
492*/
493 HPI_ADAPTER_MODE_1 = 6,
494
495/** ASI504X mode 2. 4 outstreams, 4 instreams at 0 to 192kHz sample rates
496 (see ASI504X datasheet for more info).
497*/
498 HPI_ADAPTER_MODE_2 = 7,
499
500/** ASI504X mode 3. 4 outstreams, 4 instreams at 0 to 192kHz sample rates
501 (see ASI504X datasheet for more info).
502*/
503 HPI_ADAPTER_MODE_3 = 8,
504
505/** ASI504X multichannel mode.
506 2 outstreams -> 4 line outs = 1 to 8 channel streams),
507 4 lineins -> 1 instream (1 to 8 channel streams) at 0-48kHz.
508 For more info see the SSX Specification.
509*/
510 HPI_ADAPTER_MODE_MULTICHANNEL = 9,
511
512/** 12 outstream mode.
513- ASI6514, ASI6614: 2 instreams
514- ASI6540,ASI6544: 8 instreams
515- ASI6640,ASI6644: 8 instreams
516*/
517 HPI_ADAPTER_MODE_12OSTREAM = 10,
518
519/** 9 outstream mode.
520- ASI6044: 8 instreams
521*/
522 HPI_ADAPTER_MODE_9OSTREAM = 11,
523
524/** mono mode.
525- ASI6416: 16 outstreams/instreams
526- ASI5402: 2 outstreams/instreams
527*/
528 HPI_ADAPTER_MODE_MONO = 12,
529
530/** Low latency mode.
531- ASI6416/ASI6316: 1 16 channel outstream and instream
532*/
533 HPI_ADAPTER_MODE_LOW_LATENCY = 13
534};
535
536/* Note, adapters can have more than one capability -
537encoding as bitfield is recommended. */
538#define HPI_CAPABILITY_NONE (0)
539#define HPI_CAPABILITY_MPEG_LAYER3 (1)
540
541/* Set this equal to maximum capability index,
542Must not be greater than 32 - see axnvdef.h */
543#define HPI_CAPABILITY_MAX 1
544/* #define HPI_CAPABILITY_AAC 2 */
545
546/******************************************* STREAM ATTRIBUTES ****/
547
548/** MPEG Ancillary Data modes
549
550The mode for the ancillary data insertion or extraction to operate in.
551\ingroup stream
552*/
553enum HPI_MPEG_ANC_MODES {
554 /** the MPEG frames have energy information stored in them (5 bytes per stereo frame, 3 per mono) */
555 HPI_MPEG_ANC_HASENERGY = 0,
556 /** the entire ancillary data field is taken up by data from the Anc data buffer
557 On encode, the encoder will insert the energy bytes before filling the remainder
558 of the ancillary data space with data from the ancillary data buffer.
559 */
560 HPI_MPEG_ANC_RAW = 1
561};
562
563/** Ancillary Data Alignment
564\ingroup instream
565*/
566enum HPI_ISTREAM_MPEG_ANC_ALIGNS {
567 /** data is packed against the end of data, then padded to the end of frame */
568 HPI_MPEG_ANC_ALIGN_LEFT = 0,
569 /** data is packed against the end of the frame */
570 HPI_MPEG_ANC_ALIGN_RIGHT = 1
571};
572
573/** MPEG modes
574MPEG modes - can be used optionally for HPI_FormatCreate()
575parameter dwAttributes.
576
577Using any mode setting other than HPI_MPEG_MODE_DEFAULT
578with single channel format will return an error.
579\ingroup stream
580*/
581enum HPI_MPEG_MODES {
582/** Causes the MPEG-1 Layer II bitstream to be recorded
583in single_channel mode when the number of channels is 1 and in stereo when the
584number of channels is 2. */
585 HPI_MPEG_MODE_DEFAULT = 0,
586 /** Standard stereo without joint-stereo compression */
587 HPI_MPEG_MODE_STEREO = 1,
588 /** Joint stereo */
589 HPI_MPEG_MODE_JOINTSTEREO = 2,
590 /** Left and Right channels are completely independent */
591 HPI_MPEG_MODE_DUALCHANNEL = 3
592};
593/******************************************* MIXER ATTRIBUTES ****/
594
595/* \defgroup mixer_flags Mixer flags for HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES
596{
597*/
598#define HPI_MIXER_GET_CONTROL_MULTIPLE_CHANGED (0)
599#define HPI_MIXER_GET_CONTROL_MULTIPLE_RESET (1)
600/*}*/
601
602/** Commands used by HPI_MixerStore()
603\ingroup mixer
604*/
605enum HPI_MIXER_STORE_COMMAND {
606/** Save all mixer control settings. */
607 HPI_MIXER_STORE_SAVE = 1,
608/** Restore all controls from saved. */
609 HPI_MIXER_STORE_RESTORE = 2,
610/** Delete saved control settings. */
611 HPI_MIXER_STORE_DELETE = 3,
612/** Enable auto storage of some control settings. */
613 HPI_MIXER_STORE_ENABLE = 4,
614/** Disable auto storage of some control settings. */
615 HPI_MIXER_STORE_DISABLE = 5,
616/** Save the attributes of a single control. */
617 HPI_MIXER_STORE_SAVE_SINGLE = 6
618};
619
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300620/****************************/
621/* CONTROL ATTRIBUTE VALUES */
622/****************************/
623
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200624/** Used by mixer plugin enable functions
625
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300626E.g. HPI_ParametricEq_SetState()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200627\ingroup mixer
628*/
629enum HPI_SWITCH_STATES {
630 HPI_SWITCH_OFF = 0, /**< turn the mixer plugin on. */
631 HPI_SWITCH_ON = 1 /**< turn the mixer plugin off. */
632};
633
634/* Volume control special gain values */
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300635
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200636/** volumes units are 100ths of a dB
637\ingroup volume
638*/
639#define HPI_UNITS_PER_dB 100
640/** turns volume control OFF or MUTE
641\ingroup volume
642*/
643#define HPI_GAIN_OFF (-100 * HPI_UNITS_PER_dB)
644
645/** value returned for no signal
646\ingroup meter
647*/
648#define HPI_METER_MINIMUM (-150 * HPI_UNITS_PER_dB)
649
650/** autofade profiles
651\ingroup volume
652*/
653enum HPI_VOLUME_AUTOFADES {
654/** log fade - dB attenuation changes linearly over time */
655 HPI_VOLUME_AUTOFADE_LOG = 2,
656/** linear fade - amplitude changes linearly */
657 HPI_VOLUME_AUTOFADE_LINEAR = 3
658};
659
660/** The physical encoding format of the AESEBU I/O.
661
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300662Used in HPI_Aesebu_Transmitter_SetFormat(), HPI_Aesebu_Receiver_SetFormat()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200663along with related Get and Query functions
664\ingroup aestx
665*/
666enum HPI_AESEBU_FORMATS {
667/** AES/EBU physical format - AES/EBU balanced "professional" */
668 HPI_AESEBU_FORMAT_AESEBU = 1,
669/** AES/EBU physical format - S/PDIF unbalanced "consumer" */
670 HPI_AESEBU_FORMAT_SPDIF = 2
671};
672
673/** AES/EBU error status bits
674
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300675Returned by HPI_Aesebu_Receiver_GetErrorStatus()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200676\ingroup aesrx
677*/
678enum HPI_AESEBU_ERRORS {
679/** bit0: 1 when PLL is not locked */
680 HPI_AESEBU_ERROR_NOT_LOCKED = 0x01,
681/** bit1: 1 when signal quality is poor */
682 HPI_AESEBU_ERROR_POOR_QUALITY = 0x02,
683/** bit2: 1 when there is a parity error */
684 HPI_AESEBU_ERROR_PARITY_ERROR = 0x04,
685/** bit3: 1 when there is a bi-phase coding violation */
686 HPI_AESEBU_ERROR_BIPHASE_VIOLATION = 0x08,
687/** bit4: 1 when the validity bit is high */
688 HPI_AESEBU_ERROR_VALIDITY = 0x10,
689/** bit5: 1 when the CRC error bit is high */
690 HPI_AESEBU_ERROR_CRC = 0x20
691};
692
693/** \addtogroup pad
694\{
695*/
696/** The text string containing the station/channel combination. */
697#define HPI_PAD_CHANNEL_NAME_LEN 16
698/** The text string containing the artist. */
699#define HPI_PAD_ARTIST_LEN 64
700/** The text string containing the title. */
701#define HPI_PAD_TITLE_LEN 64
702/** The text string containing the comment. */
703#define HPI_PAD_COMMENT_LEN 256
704/** The PTY when the tuner has not recieved any PTY. */
705#define HPI_PAD_PROGRAM_TYPE_INVALID 0xffff
706/** \} */
707
708/** Data types for PTY string translation.
709\ingroup rds
710*/
711enum eHPI_RDS_type {
712 HPI_RDS_DATATYPE_RDS = 0, /**< RDS bitstream.*/
713 HPI_RDS_DATATYPE_RBDS = 1 /**< RBDS bitstream.*/
714};
715
716/** Tuner bands
717
718Used for HPI_Tuner_SetBand(),HPI_Tuner_GetBand()
719\ingroup tuner
720*/
721enum HPI_TUNER_BAND {
722 HPI_TUNER_BAND_AM = 1, /**< AM band */
723 HPI_TUNER_BAND_FM = 2, /**< FM band (mono) */
724 HPI_TUNER_BAND_TV_NTSC_M = 3, /**< NTSC-M TV band*/
725 HPI_TUNER_BAND_TV = 3, /* use TV_NTSC_M */
726 HPI_TUNER_BAND_FM_STEREO = 4, /**< FM band (stereo) */
727 HPI_TUNER_BAND_AUX = 5, /**< auxiliary input */
728 HPI_TUNER_BAND_TV_PAL_BG = 6, /**< PAL-B/G TV band*/
729 HPI_TUNER_BAND_TV_PAL_I = 7, /**< PAL-I TV band*/
730 HPI_TUNER_BAND_TV_PAL_DK = 8, /**< PAL-D/K TV band*/
731 HPI_TUNER_BAND_TV_SECAM_L = 9, /**< SECAM-L TV band*/
732 HPI_TUNER_BAND_LAST = 9 /**< the index of the last tuner band. */
733};
734
735/** Tuner mode attributes
736
737Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
738\ingroup tuner
739
740*/
741enum HPI_TUNER_MODES {
742 HPI_TUNER_MODE_RSS = 1, /**< control RSS */
743 HPI_TUNER_MODE_RDS = 2 /**< control RBDS/RDS */
744};
745
746/** Tuner mode attribute values
747
748Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
749\ingroup tuner
750*/
751enum HPI_TUNER_MODE_VALUES {
752/* RSS attribute values */
753 HPI_TUNER_MODE_RSS_DISABLE = 0, /**< RSS disable */
754 HPI_TUNER_MODE_RSS_ENABLE = 1, /**< RSS enable */
755
756/* RDS mode attributes */
757 HPI_TUNER_MODE_RDS_DISABLE = 0, /**< RDS - disabled */
758 HPI_TUNER_MODE_RDS_RDS = 1, /**< RDS - RDS mode */
759 HPI_TUNER_MODE_RDS_RBDS = 2 /**< RDS - RBDS mode */
760};
761
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200762/** Tuner Status Bits
763
764These bitfield values are returned by a call to HPI_Tuner_GetStatus().
765Multiple fields are returned from a single call.
766\ingroup tuner
767*/
768enum HPI_TUNER_STATUS_BITS {
769 HPI_TUNER_VIDEO_COLOR_PRESENT = 0x0001, /**< video color is present. */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300770 HPI_TUNER_VIDEO_IS_60HZ = 0x0020, /**< 60 hz video detected. */
771 HPI_TUNER_VIDEO_HORZ_SYNC_MISSING = 0x0040, /**< video HSYNC is missing. */
772 HPI_TUNER_VIDEO_STATUS_VALID = 0x0100, /**< video status is valid. */
773 HPI_TUNER_DIGITAL = 0x0200, /**< tuner reports digital programming. */
774 HPI_TUNER_MULTIPROGRAM = 0x0400, /**< tuner reports multiple programs. */
775 HPI_TUNER_PLL_LOCKED = 0x1000, /**< the tuner's PLL is locked. */
776 HPI_TUNER_FM_STEREO = 0x2000 /**< tuner reports back FM stereo. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200777};
778
779/** Channel Modes
780Used for HPI_ChannelModeSet/Get()
781\ingroup channelmode
782*/
783enum HPI_CHANNEL_MODES {
784/** Left channel out = left channel in, Right channel out = right channel in. */
785 HPI_CHANNEL_MODE_NORMAL = 1,
786/** Left channel out = right channel in, Right channel out = left channel in. */
787 HPI_CHANNEL_MODE_SWAP = 2,
788/** Left channel out = left channel in, Right channel out = left channel in. */
789 HPI_CHANNEL_MODE_LEFT_TO_STEREO = 3,
790/** Left channel out = right channel in, Right channel out = right channel in.*/
791 HPI_CHANNEL_MODE_RIGHT_TO_STEREO = 4,
792/** Left channel out = (left channel in + right channel in)/2,
793 Right channel out = mute. */
794 HPI_CHANNEL_MODE_STEREO_TO_LEFT = 5,
795/** Left channel out = mute,
796 Right channel out = (right channel in + left channel in)/2. */
797 HPI_CHANNEL_MODE_STEREO_TO_RIGHT = 6,
798 HPI_CHANNEL_MODE_LAST = 6
799};
800
801/** SampleClock source values
802\ingroup sampleclock
803*/
804enum HPI_SAMPLECLOCK_SOURCES {
805/** The sampleclock output is derived from its local samplerate generator.
806 The local samplerate may be set using HPI_SampleClock_SetLocalRate(). */
807 HPI_SAMPLECLOCK_SOURCE_LOCAL = 1,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200808/** The adapter is clocked from a dedicated AES/EBU SampleClock input.*/
809 HPI_SAMPLECLOCK_SOURCE_AESEBU_SYNC = 2,
810/** From external wordclock connector */
811 HPI_SAMPLECLOCK_SOURCE_WORD = 3,
812/** Board-to-board header */
813 HPI_SAMPLECLOCK_SOURCE_WORD_HEADER = 4,
814/** FUTURE - SMPTE clock. */
815 HPI_SAMPLECLOCK_SOURCE_SMPTE = 5,
816/** One of the aesebu inputs */
817 HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT = 6,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200818/** From a network interface e.g. Cobranet or Livewire at either 48 or 96kHz */
819 HPI_SAMPLECLOCK_SOURCE_NETWORK = 8,
820/** From previous adjacent module (ASI2416 only)*/
821 HPI_SAMPLECLOCK_SOURCE_PREV_MODULE = 10,
822/*! Update this if you add a new clock source.*/
823 HPI_SAMPLECLOCK_SOURCE_LAST = 10
824};
825
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300826/** Equalizer filter types. Used by HPI_ParametricEq_SetBand()
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200827\ingroup parmeq
828*/
829enum HPI_FILTER_TYPE {
830 HPI_FILTER_TYPE_BYPASS = 0, /**< filter is turned off */
831
832 HPI_FILTER_TYPE_LOWSHELF = 1, /**< EQ low shelf */
833 HPI_FILTER_TYPE_HIGHSHELF = 2, /**< EQ high shelf */
834 HPI_FILTER_TYPE_EQ_BAND = 3, /**< EQ gain */
835
836 HPI_FILTER_TYPE_LOWPASS = 4, /**< standard low pass */
837 HPI_FILTER_TYPE_HIGHPASS = 5, /**< standard high pass */
838 HPI_FILTER_TYPE_BANDPASS = 6, /**< standard band pass */
839 HPI_FILTER_TYPE_BANDSTOP = 7 /**< standard band stop/notch */
840};
841
842/** Async Event sources
843\ingroup async
844*/
845enum ASYNC_EVENT_SOURCES {
846 HPI_ASYNC_EVENT_GPIO = 1, /**< GPIO event. */
847 HPI_ASYNC_EVENT_SILENCE = 2, /**< silence event detected. */
848 HPI_ASYNC_EVENT_TONE = 3 /**< tone event detected. */
849};
850/*******************************************/
851/** HPI Error codes
852
853Almost all HPI functions return an error code
854A return value of zero means there was no error.
855Otherwise one of these error codes is returned.
856Error codes can be converted to a descriptive string using HPI_GetErrorText()
857
858\note When a new error code is added HPI_GetErrorText() MUST be updated.
859\note Codes 1-100 are reserved for driver use
860\ingroup utility
861*/
862enum HPI_ERROR_CODES {
863 /** Message type does not exist. */
864 HPI_ERROR_INVALID_TYPE = 100,
865 /** Object type does not exist. */
866 HPI_ERROR_INVALID_OBJ = 101,
867 /** Function does not exist. */
868 HPI_ERROR_INVALID_FUNC = 102,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300869 /** The specified object does not exist. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200870 HPI_ERROR_INVALID_OBJ_INDEX = 103,
871 /** Trying to access an object that has not been opened yet. */
872 HPI_ERROR_OBJ_NOT_OPEN = 104,
873 /** Trying to open an already open object. */
874 HPI_ERROR_OBJ_ALREADY_OPEN = 105,
875 /** PCI, ISA resource not valid. */
876 HPI_ERROR_INVALID_RESOURCE = 106,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300877 /* GetInfo call from SubSysFindAdapters failed. */
878 /*HPI_ERROR_SUBSYSFINDADAPTERS_GETINFO= 107, */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200879 /** Default response was never updated with actual error code. */
880 HPI_ERROR_INVALID_RESPONSE = 108,
881 /** wSize field of response was not updated,
882 indicating that the message was not processed. */
883 HPI_ERROR_PROCESSING_MESSAGE = 109,
884 /** The network did not respond in a timely manner. */
885 HPI_ERROR_NETWORK_TIMEOUT = 110,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300886 /* An HPI handle is invalid (uninitialised?). */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200887 HPI_ERROR_INVALID_HANDLE = 111,
888 /** A function or attribute has not been implemented yet. */
889 HPI_ERROR_UNIMPLEMENTED = 112,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300890 /** There are too many clients attempting
891 to access a network resource. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200892 HPI_ERROR_NETWORK_TOO_MANY_CLIENTS = 113,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300893 /** Response buffer passed to HPI_Message
894 was smaller than returned response.
895 wSpecificError field of hpi response contains the required size.
896 */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200897 HPI_ERROR_RESPONSE_BUFFER_TOO_SMALL = 114,
898 /** The returned response did not match the sent message */
899 HPI_ERROR_RESPONSE_MISMATCH = 115,
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300900 /** A control setting that should have been cached was not. */
901 HPI_ERROR_CONTROL_CACHING = 116,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300902 /** A message buffer in the path to the adapter was smaller
903 than the message size.
904 wSpecificError field of hpi response contains the actual size.
905 */
906 HPI_ERROR_MESSAGE_BUFFER_TOO_SMALL = 117,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200907
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300908 /* Too many adapters. */
909 /* HPI_ERROR_TOO_MANY_ADAPTERS= 200, */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200910 /** Bad adpater. */
911 HPI_ERROR_BAD_ADAPTER = 201,
912 /** Adapter number out of range or not set properly. */
913 HPI_ERROR_BAD_ADAPTER_NUMBER = 202,
914 /** 2 adapters with the same adapter number. */
915 HPI_DUPLICATE_ADAPTER_NUMBER = 203,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300916 /** DSP code failed to bootload. (unused?) */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200917 HPI_ERROR_DSP_BOOTLOAD = 204,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300918 /** Adapter failed DSP code self test. (unused?) */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200919 HPI_ERROR_DSP_SELFTEST = 205,
920 /** Couldn't find or open the DSP code file. */
921 HPI_ERROR_DSP_FILE_NOT_FOUND = 206,
922 /** Internal DSP hardware error. */
923 HPI_ERROR_DSP_HARDWARE = 207,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200924 /** Could not allocate memory */
925 HPI_ERROR_MEMORY_ALLOC = 208,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300926 /** Failed to correctly load/config PLD. (unused?) */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200927 HPI_ERROR_PLD_LOAD = 209,
928 /** Unexpected end of file, block length too big etc. */
929 HPI_ERROR_DSP_FILE_FORMAT = 210,
930
931 /** Found but could not open DSP code file. */
932 HPI_ERROR_DSP_FILE_ACCESS_DENIED = 211,
933 /** First DSP code section header not found in DSP file. */
934 HPI_ERROR_DSP_FILE_NO_HEADER = 212,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300935 /* File read operation on DSP code file failed. */
936 /*HPI_ERROR_DSP_FILE_READ_ERROR= 213, */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200937 /** DSP code for adapter family not found. */
938 HPI_ERROR_DSP_SECTION_NOT_FOUND = 214,
939 /** Other OS specific error opening DSP file. */
940 HPI_ERROR_DSP_FILE_OTHER_ERROR = 215,
941 /** Sharing violation opening DSP code file. */
942 HPI_ERROR_DSP_FILE_SHARING_VIOLATION = 216,
943 /** DSP code section header had size == 0. */
944 HPI_ERROR_DSP_FILE_NULL_HEADER = 217,
945
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300946 /* Base number for flash errors. */
947 /* HPI_ERROR_FLASH = 220, */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200948
949 /** Flash has bad checksum */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +1300950 HPI_ERROR_BAD_CHECKSUM = 221,
951 HPI_ERROR_BAD_SEQUENCE = 222,
952 HPI_ERROR_FLASH_ERASE = 223,
953 HPI_ERROR_FLASH_PROGRAM = 224,
954 HPI_ERROR_FLASH_VERIFY = 225,
955 HPI_ERROR_FLASH_TYPE = 226,
956 HPI_ERROR_FLASH_START = 227,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200957
958 /** Reserved for OEMs. */
959 HPI_ERROR_RESERVED_1 = 290,
960
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300961 /* Stream does not exist. */
962 /*HPI_ERROR_INVALID_STREAM= 300, // use HPI_ERROR_INVALID_OBJ_INDEX */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200963 /** Invalid compression format. */
964 HPI_ERROR_INVALID_FORMAT = 301,
965 /** Invalid format samplerate */
966 HPI_ERROR_INVALID_SAMPLERATE = 302,
967 /** Invalid format number of channels. */
968 HPI_ERROR_INVALID_CHANNELS = 303,
969 /** Invalid format bitrate. */
970 HPI_ERROR_INVALID_BITRATE = 304,
971 /** Invalid datasize used for stream read/write. */
972 HPI_ERROR_INVALID_DATASIZE = 305,
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300973 /* Stream buffer is full during stream write. */
974 /*HPI_ERROR_BUFFER_FULL = 306, // USE HPI_ERROR_INVALID_DATASIZE */
975 /* Stream buffer is empty during stream read. */
976 /*HPI_ERROR_BUFFER_EMPTY = 307, // USE HPI_ERROR_INVALID_DATASIZE */
977 /** Null data pointer used for stream read/write. */
978 HPI_ERROR_INVALID_DATA_POINTER = 308,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200979 /** Packet ordering error for stream read/write. */
980 HPI_ERROR_INVALID_PACKET_ORDER = 309,
981
982 /** Object can't do requested operation in its current
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300983 state, eg set format, change rec mux state while recording.*/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200984 HPI_ERROR_INVALID_OPERATION = 310,
985
Eliot Blennerhassettba944552011-02-10 17:26:04 +1300986 /** Where a SRG is shared amongst streams, an incompatible samplerate
987 is one that is different to any currently active stream. */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +0200988 HPI_ERROR_INCOMPATIBLE_SAMPLERATE = 311,
989 /** Adapter mode is illegal.*/
990 HPI_ERROR_BAD_ADAPTER_MODE = 312,
991
992 /** There have been too many attempts to set the adapter's
993 capabilities (using bad keys), the card should be returned
994 to ASI if further capabilities updates are required */
995 HPI_ERROR_TOO_MANY_CAPABILITY_CHANGE_ATTEMPTS = 313,
996 /** Streams on different adapters cannot be grouped. */
997 HPI_ERROR_NO_INTERADAPTER_GROUPS = 314,
998 /** Streams on different DSPs cannot be grouped. */
999 HPI_ERROR_NO_INTERDSP_GROUPS = 315,
1000
1001 /** Invalid mixer node for this adapter. */
1002 HPI_ERROR_INVALID_NODE = 400,
1003 /** Invalid control. */
1004 HPI_ERROR_INVALID_CONTROL = 401,
1005 /** Invalid control value was passed. */
1006 HPI_ERROR_INVALID_CONTROL_VALUE = 402,
1007 /** Control attribute not supported by this control. */
1008 HPI_ERROR_INVALID_CONTROL_ATTRIBUTE = 403,
1009 /** Control is disabled. */
1010 HPI_ERROR_CONTROL_DISABLED = 404,
1011 /** I2C transaction failed due to a missing ACK. */
1012 HPI_ERROR_CONTROL_I2C_MISSING_ACK = 405,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001013 /** Control is busy, or coming out of
1014 reset and cannot be accessed at this time. */
1015 HPI_ERROR_CONTROL_NOT_READY = 407,
1016
1017 /** Non volatile memory */
1018 HPI_ERROR_NVMEM_BUSY = 450,
1019 HPI_ERROR_NVMEM_FULL = 451,
1020 HPI_ERROR_NVMEM_FAIL = 452,
1021
1022 /** I2C */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +13001023 HPI_ERROR_I2C_MISSING_ACK = 405, /*HPI_ERROR_CONTROL_I2C_MISSING_ACK */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001024 HPI_ERROR_I2C_BAD_ADR = 460,
1025
1026 /** Entity errors */
1027 HPI_ERROR_ENTITY_TYPE_MISMATCH = 470,
1028 HPI_ERROR_ENTITY_ITEM_COUNT = 471,
1029 HPI_ERROR_ENTITY_TYPE_INVALID = 472,
1030 HPI_ERROR_ENTITY_ROLE_INVALID = 473,
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +13001031 HPI_ERROR_ENTITY_SIZE_MISMATCH = 474,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001032
1033 /* AES18 specific errors were 500..507 */
1034
1035 /** custom error to use for debugging */
1036 HPI_ERROR_CUSTOM = 600,
1037
1038 /** hpioct32.c can't obtain mutex */
1039 HPI_ERROR_MUTEX_TIMEOUT = 700,
1040
1041 /** errors from HPI backends have values >= this */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +13001042 HPI_ERROR_BACKEND_BASE = 900
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001043};
1044
1045/** \defgroup maximums HPI maximum values
1046\{
1047*/
1048/** Maximum number of adapters per HPI sub-system
1049 WARNING: modifying this value changes the response structure size.*/
1050#define HPI_MAX_ADAPTERS 20
1051/** Maximum number of in or out streams per adapter */
1052#define HPI_MAX_STREAMS 16
1053#define HPI_MAX_CHANNELS 2 /* per stream */
1054#define HPI_MAX_NODES 8 /* per mixer ? */
1055#define HPI_MAX_CONTROLS 4 /* per node ? */
1056/** maximum number of ancillary bytes per MPEG frame */
1057#define HPI_MAX_ANC_BYTES_PER_FRAME (64)
1058#define HPI_STRING_LEN 16
1059
1060/** Velocity units */
1061#define HPI_OSTREAM_VELOCITY_UNITS 4096
1062/** OutStream timescale units */
1063#define HPI_OSTREAM_TIMESCALE_UNITS 10000
1064/** OutStream timescale passthrough - turns timescaling on in passthough mode */
1065#define HPI_OSTREAM_TIMESCALE_PASSTHROUGH 99999
1066
1067/**\}*/
1068
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001069/**************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001070/* STRUCTURES */
1071#ifndef DISABLE_PRAGMA_PACK1
1072#pragma pack(push, 1)
1073#endif
1074
1075/** Structure containing sample format information.
1076 See also HPI_FormatCreate().
1077 */
1078struct hpi_format {
1079 u32 sample_rate;
1080 /**< 11025, 32000, 44100 ... */
1081 u32 bit_rate; /**< for MPEG */
1082 u32 attributes;
1083 /**< Stereo/JointStereo/Mono */
1084 u16 mode_legacy;
1085 /**< Legacy ancillary mode or idle bit */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +13001086 u16 unused; /**< Unused */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001087 u16 channels; /**< 1,2..., (or ancillary mode or idle bit */
1088 u16 format; /**< HPI_FORMAT_PCM16, _MPEG etc. see #HPI_FORMATS. */
1089};
1090
1091struct hpi_anc_frame {
1092 u32 valid_bits_in_this_frame;
1093 u8 b_data[HPI_MAX_ANC_BYTES_PER_FRAME];
1094};
1095
1096/** An object for containing a single async event.
1097*/
1098struct hpi_async_event {
1099 u16 event_type; /**< type of event. \sa async_event */
Eliot Blennerhassettad210ad2011-02-10 17:25:57 +13001100 u16 sequence; /**< Sequence number, allows lost event detection */
1101 u32 state; /**< New state */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001102 u32 h_object; /**< handle to the object returning the event. */
1103 union {
1104 struct {
1105 u16 index; /**< GPIO bit index. */
1106 } gpio;
1107 struct {
1108 u16 node_index; /**< what node is the control on ? */
1109 u16 node_type; /**< what type of node is the control on ? */
1110 } control;
1111 } u;
1112};
1113
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001114/* skip host side function declarations for
1115 DSP compile and documentation extraction */
1116
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001117#ifndef DISABLE_PRAGMA_PACK1
1118#pragma pack(pop)
1119#endif
1120
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001121/*****************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001122/* HPI FUNCTIONS */
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001123/*****************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001124
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001125/* Stream */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001126u16 hpi_stream_estimate_buffer_size(struct hpi_format *pF,
1127 u32 host_polling_rate_in_milli_seconds, u32 *recommended_buffer_size);
1128
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001129/*************/
1130/* SubSystem */
1131/*************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001132
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001133u16 hpi_subsys_get_version_ex(u32 *pversion_ex);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001134
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001135u16 hpi_subsys_get_num_adapters(int *pn_num_adapters);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001136
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001137u16 hpi_subsys_get_adapter(int iterator, u32 *padapter_index,
1138 u16 *pw_adapter_type);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001139
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001140/***********/
1141/* Adapter */
1142/***********/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001143
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001144u16 hpi_adapter_open(u16 adapter_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001145
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001146u16 hpi_adapter_close(u16 adapter_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001147
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001148u16 hpi_adapter_get_info(u16 adapter_index, u16 *pw_num_outstreams,
1149 u16 *pw_num_instreams, u16 *pw_version, u32 *pserial_number,
1150 u16 *pw_adapter_type);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001151
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001152u16 hpi_adapter_get_module_by_index(u16 adapter_index, u16 module_index,
1153 u16 *pw_num_outputs, u16 *pw_num_inputs, u16 *pw_version,
1154 u32 *pserial_number, u16 *pw_module_type, u32 *ph_module);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001155
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001156u16 hpi_adapter_set_mode(u16 adapter_index, u32 adapter_mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001157
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001158u16 hpi_adapter_set_mode_ex(u16 adapter_index, u32 adapter_mode,
1159 u16 query_or_set);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001160
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001161u16 hpi_adapter_get_mode(u16 adapter_index, u32 *padapter_mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001162
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001163u16 hpi_adapter_get_assert2(u16 adapter_index, u16 *p_assert_count,
1164 char *psz_assert, u32 *p_param1, u32 *p_param2,
1165 u32 *p_dsp_string_addr, u16 *p_processor_id);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001166
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001167u16 hpi_adapter_test_assert(u16 adapter_index, u16 assert_id);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001168
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001169u16 hpi_adapter_enable_capability(u16 adapter_index, u16 capability, u32 key);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001170
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001171u16 hpi_adapter_self_test(u16 adapter_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001172
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001173u16 hpi_adapter_debug_read(u16 adapter_index, u32 dsp_address, char *p_bytes,
1174 int *count_bytes);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001175
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001176u16 hpi_adapter_set_property(u16 adapter_index, u16 property, u16 paramter1,
1177 u16 paramter2);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001178
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001179u16 hpi_adapter_get_property(u16 adapter_index, u16 property,
1180 u16 *pw_paramter1, u16 *pw_paramter2);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001181
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001182u16 hpi_adapter_enumerate_property(u16 adapter_index, u16 index,
1183 u16 what_to_enumerate, u16 property_index, u32 *psetting);
1184/*************/
1185/* OutStream */
1186/*************/
1187u16 hpi_outstream_open(u16 adapter_index, u16 outstream_index,
1188 u32 *ph_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001189
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001190u16 hpi_outstream_close(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001191
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001192u16 hpi_outstream_get_info_ex(u32 h_outstream, u16 *pw_state,
1193 u32 *pbuffer_size, u32 *pdata_to_play, u32 *psamples_played,
1194 u32 *pauxiliary_data_to_play);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001195
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001196u16 hpi_outstream_write_buf(u32 h_outstream, const u8 *pb_write_buf,
1197 u32 bytes_to_write, const struct hpi_format *p_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001198
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001199u16 hpi_outstream_start(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001200
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001201u16 hpi_outstream_wait_start(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001202
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001203u16 hpi_outstream_stop(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001204
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001205u16 hpi_outstream_sinegen(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001206
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001207u16 hpi_outstream_reset(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001208
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001209u16 hpi_outstream_query_format(u32 h_outstream, struct hpi_format *p_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001210
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001211u16 hpi_outstream_set_format(u32 h_outstream, struct hpi_format *p_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001212
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001213u16 hpi_outstream_set_punch_in_out(u32 h_outstream, u32 punch_in_sample,
1214 u32 punch_out_sample);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001215
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001216u16 hpi_outstream_set_velocity(u32 h_outstream, short velocity);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001217
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001218u16 hpi_outstream_ancillary_reset(u32 h_outstream, u16 mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001219
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001220u16 hpi_outstream_ancillary_get_info(u32 h_outstream, u32 *pframes_available);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001221
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001222u16 hpi_outstream_ancillary_read(u32 h_outstream,
1223 struct hpi_anc_frame *p_anc_frame_buffer,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001224 u32 anc_frame_buffer_size_in_bytes,
1225 u32 number_of_ancillary_frames_to_read);
1226
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001227u16 hpi_outstream_set_time_scale(u32 h_outstream, u32 time_scaleX10000);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001228
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001229u16 hpi_outstream_host_buffer_allocate(u32 h_outstream, u32 size_in_bytes);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001230
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001231u16 hpi_outstream_host_buffer_free(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001232
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001233u16 hpi_outstream_group_add(u32 h_outstream, u32 h_stream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001234
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001235u16 hpi_outstream_group_get_map(u32 h_outstream, u32 *poutstream_map,
1236 u32 *pinstream_map);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001237
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001238u16 hpi_outstream_group_reset(u32 h_outstream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001239
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001240/************/
1241/* InStream */
1242/************/
1243u16 hpi_instream_open(u16 adapter_index, u16 instream_index,
1244 u32 *ph_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001245
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001246u16 hpi_instream_close(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001247
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001248u16 hpi_instream_query_format(u32 h_instream,
1249 const struct hpi_format *p_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001250
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001251u16 hpi_instream_set_format(u32 h_instream,
1252 const struct hpi_format *p_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001253
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001254u16 hpi_instream_read_buf(u32 h_instream, u8 *pb_read_buf, u32 bytes_to_read);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001255
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001256u16 hpi_instream_start(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001257
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001258u16 hpi_instream_wait_start(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001259
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001260u16 hpi_instream_stop(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001261
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001262u16 hpi_instream_reset(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001263
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001264u16 hpi_instream_get_info_ex(u32 h_instream, u16 *pw_state, u32 *pbuffer_size,
1265 u32 *pdata_recorded, u32 *psamples_recorded,
1266 u32 *pauxiliary_data_recorded);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001267
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001268u16 hpi_instream_ancillary_reset(u32 h_instream, u16 bytes_per_frame,
1269 u16 mode, u16 alignment, u16 idle_bit);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001270
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001271u16 hpi_instream_ancillary_get_info(u32 h_instream, u32 *pframe_space);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001272
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001273u16 hpi_instream_ancillary_write(u32 h_instream,
1274 const struct hpi_anc_frame *p_anc_frame_buffer,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001275 u32 anc_frame_buffer_size_in_bytes,
1276 u32 number_of_ancillary_frames_to_write);
1277
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001278u16 hpi_instream_host_buffer_allocate(u32 h_instream, u32 size_in_bytes);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001279
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001280u16 hpi_instream_host_buffer_free(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001281
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001282u16 hpi_instream_group_add(u32 h_instream, u32 h_stream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001283
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001284u16 hpi_instream_group_get_map(u32 h_instream, u32 *poutstream_map,
1285 u32 *pinstream_map);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001286
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001287u16 hpi_instream_group_reset(u32 h_instream);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001288
1289/*********/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001290/* Mixer */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001291/*********/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001292u16 hpi_mixer_open(u16 adapter_index, u32 *ph_mixer);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001293
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001294u16 hpi_mixer_close(u32 h_mixer);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001295
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001296u16 hpi_mixer_get_control(u32 h_mixer, u16 src_node_type,
1297 u16 src_node_type_index, u16 dst_node_type, u16 dst_node_type_index,
1298 u16 control_type, u32 *ph_control);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001299
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001300u16 hpi_mixer_get_control_by_index(u32 h_mixer, u16 control_index,
1301 u16 *pw_src_node_type, u16 *pw_src_node_index, u16 *pw_dst_node_type,
1302 u16 *pw_dst_node_index, u16 *pw_control_type, u32 *ph_control);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001303
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001304u16 hpi_mixer_store(u32 h_mixer, enum HPI_MIXER_STORE_COMMAND command,
1305 u16 index);
1306/************/
1307/* Controls */
1308/************/
1309/******************/
1310/* Volume control */
1311/******************/
1312u16 hpi_volume_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001313 );
1314
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001315u16 hpi_volume_get_gain(u32 h_control,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001316 short an_gain0_01dB_out[HPI_MAX_CHANNELS]
1317 );
1318
1319#define hpi_volume_get_range hpi_volume_query_range
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001320u16 hpi_volume_query_range(u32 h_control, short *min_gain_01dB,
1321 short *max_gain_01dB, short *step_gain_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001322
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001323u16 hpi_volume_query_channels(const u32 h_volume, u32 *p_channels);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001324
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001325u16 hpi_volume_auto_fade(u32 h_control,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001326 short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms);
1327
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001328u16 hpi_volume_auto_fade_profile(u32 h_control,
1329 short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms,
1330 u16 profile);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001331
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001332/*****************/
1333/* Level control */
1334/*****************/
1335u16 hpi_level_query_range(u32 h_control, short *min_gain_01dB,
1336 short *max_gain_01dB, short *step_gain_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001337
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001338u16 hpi_level_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001339 );
1340
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001341u16 hpi_level_get_gain(u32 h_control,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001342 short an_gain0_01dB_out[HPI_MAX_CHANNELS]
1343 );
1344
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001345/*****************/
1346/* Meter control */
1347/*****************/
1348u16 hpi_meter_query_channels(const u32 h_meter, u32 *p_channels);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001349
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001350u16 hpi_meter_get_peak(u32 h_control,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001351 short an_peak0_01dB_out[HPI_MAX_CHANNELS]
1352 );
1353
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001354u16 hpi_meter_get_rms(u32 h_control, short an_peak0_01dB_out[HPI_MAX_CHANNELS]
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001355 );
1356
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001357u16 hpi_meter_set_peak_ballistics(u32 h_control, u16 attack, u16 decay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001358
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001359u16 hpi_meter_set_rms_ballistics(u32 h_control, u16 attack, u16 decay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001360
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001361u16 hpi_meter_get_peak_ballistics(u32 h_control, u16 *attack, u16 *decay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001362
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001363u16 hpi_meter_get_rms_ballistics(u32 h_control, u16 *attack, u16 *decay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001364
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001365/************************/
1366/* ChannelMode control */
1367/************************/
1368u16 hpi_channel_mode_query_mode(const u32 h_mode, const u32 index,
1369 u16 *pw_mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001370
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001371u16 hpi_channel_mode_set(u32 h_control, u16 mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001372
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001373u16 hpi_channel_mode_get(u32 h_control, u16 *mode);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001374
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001375/*****************/
1376/* Tuner control */
1377/*****************/
1378u16 hpi_tuner_query_band(const u32 h_tuner, const u32 index, u16 *pw_band);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001379
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001380u16 hpi_tuner_set_band(u32 h_control, u16 band);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001381
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001382u16 hpi_tuner_get_band(u32 h_control, u16 *pw_band);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001383
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001384u16 hpi_tuner_query_frequency(const u32 h_tuner, const u32 index,
1385 const u16 band, u32 *pfreq);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001386
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001387u16 hpi_tuner_set_frequency(u32 h_control, u32 freq_ink_hz);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001388
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001389u16 hpi_tuner_get_frequency(u32 h_control, u32 *pw_freq_ink_hz);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001390
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001391u16 hpi_tuner_get_rf_level(u32 h_control, short *pw_level);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001392
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001393u16 hpi_tuner_get_raw_rf_level(u32 h_control, short *pw_level);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001394
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001395u16 hpi_tuner_query_gain(const u32 h_tuner, const u32 index, u16 *pw_gain);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001396
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001397u16 hpi_tuner_set_gain(u32 h_control, short gain);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001398
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001399u16 hpi_tuner_get_gain(u32 h_control, short *pn_gain);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001400
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001401u16 hpi_tuner_get_status(u32 h_control, u16 *pw_status_mask, u16 *pw_status);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001402
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001403u16 hpi_tuner_set_mode(u32 h_control, u32 mode, u32 value);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001404
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001405u16 hpi_tuner_get_mode(u32 h_control, u32 mode, u32 *pn_value);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001406
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001407u16 hpi_tuner_get_rds(u32 h_control, char *p_rds_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001408
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001409u16 hpi_tuner_query_deemphasis(const u32 h_tuner, const u32 index,
1410 const u16 band, u32 *pdeemphasis);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001411
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001412u16 hpi_tuner_set_deemphasis(u32 h_control, u32 deemphasis);
1413u16 hpi_tuner_get_deemphasis(u32 h_control, u32 *pdeemphasis);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001414
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001415u16 hpi_tuner_query_program(const u32 h_tuner, u32 *pbitmap_program);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001416
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001417u16 hpi_tuner_set_program(u32 h_control, u32 program);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001418
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001419u16 hpi_tuner_get_program(u32 h_control, u32 *pprogram);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001420
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001421u16 hpi_tuner_get_hd_radio_dsp_version(u32 h_control, char *psz_dsp_version,
1422 const u32 string_size);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001423
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001424u16 hpi_tuner_get_hd_radio_sdk_version(u32 h_control, char *psz_sdk_version,
1425 const u32 string_size);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001426
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001427u16 hpi_tuner_get_hd_radio_signal_quality(u32 h_control, u32 *pquality);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001428
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001429u16 hpi_tuner_get_hd_radio_signal_blend(u32 h_control, u32 *pblend);
Eliot Blennerhassett5a498ef2010-05-27 17:53:52 +12001430
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001431u16 hpi_tuner_set_hd_radio_signal_blend(u32 h_control, const u32 blend);
Eliot Blennerhassett5a498ef2010-05-27 17:53:52 +12001432
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001433/***************/
1434/* PAD control */
1435/***************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001436
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001437u16 hpi_pad_get_channel_name(u32 h_control, char *psz_string,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001438 const u32 string_length);
1439
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001440u16 hpi_pad_get_artist(u32 h_control, char *psz_string,
1441 const u32 string_length);
1442
1443u16 hpi_pad_get_title(u32 h_control, char *psz_string,
1444 const u32 string_length);
1445
1446u16 hpi_pad_get_comment(u32 h_control, char *psz_string,
1447 const u32 string_length);
1448
1449u16 hpi_pad_get_program_type(u32 h_control, u32 *ppTY);
1450
1451u16 hpi_pad_get_rdsPI(u32 h_control, u32 *ppI);
1452
1453u16 hpi_pad_get_program_type_string(u32 h_control, const u32 data_type,
1454 const u32 pTY, char *psz_string, const u32 string_length);
1455
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001456/****************************/
1457/* AES/EBU Receiver control */
1458/****************************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001459u16 hpi_aesebu_receiver_query_format(const u32 h_aes_rx, const u32 index,
1460 u16 *pw_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001461
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001462u16 hpi_aesebu_receiver_set_format(u32 h_control, u16 source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001463
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001464u16 hpi_aesebu_receiver_get_format(u32 h_control, u16 *pw_source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001465
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001466u16 hpi_aesebu_receiver_get_sample_rate(u32 h_control, u32 *psample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001467
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001468u16 hpi_aesebu_receiver_get_user_data(u32 h_control, u16 index, u16 *pw_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001469
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001470u16 hpi_aesebu_receiver_get_channel_status(u32 h_control, u16 index,
1471 u16 *pw_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001472
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001473u16 hpi_aesebu_receiver_get_error_status(u32 h_control, u16 *pw_error_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001474
1475/*******************************/
1476/* AES/EBU Transmitter control */
1477/*******************************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001478u16 hpi_aesebu_transmitter_set_sample_rate(u32 h_control, u32 sample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001479
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001480u16 hpi_aesebu_transmitter_set_user_data(u32 h_control, u16 index, u16 data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001481
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001482u16 hpi_aesebu_transmitter_set_channel_status(u32 h_control, u16 index,
1483 u16 data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001484
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001485u16 hpi_aesebu_transmitter_get_channel_status(u32 h_control, u16 index,
1486 u16 *pw_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001487
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001488u16 hpi_aesebu_transmitter_query_format(const u32 h_aes_tx, const u32 index,
1489 u16 *pw_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001490
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001491u16 hpi_aesebu_transmitter_set_format(u32 h_control, u16 output_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001492
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001493u16 hpi_aesebu_transmitter_get_format(u32 h_control, u16 *pw_output_format);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001494
1495/***********************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001496/* Multiplexer control */
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001497/***********************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001498u16 hpi_multiplexer_set_source(u32 h_control, u16 source_node_type,
1499 u16 source_node_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001500
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001501u16 hpi_multiplexer_get_source(u32 h_control, u16 *source_node_type,
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001502 u16 *source_node_index);
1503
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001504u16 hpi_multiplexer_query_source(u32 h_control, u16 index,
1505 u16 *source_node_type, u16 *source_node_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001506
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001507/***************/
1508/* Vox control */
1509/***************/
1510u16 hpi_vox_set_threshold(u32 h_control, short an_gain0_01dB);
1511
1512u16 hpi_vox_get_threshold(u32 h_control, short *an_gain0_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001513
1514/*********************/
1515/* Bitstream control */
1516/*********************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001517u16 hpi_bitstream_set_clock_edge(u32 h_control, u16 edge_type);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001518
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001519u16 hpi_bitstream_set_data_polarity(u32 h_control, u16 polarity);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001520
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001521u16 hpi_bitstream_get_activity(u32 h_control, u16 *pw_clk_activity,
1522 u16 *pw_data_activity);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001523
1524/***********************/
1525/* SampleClock control */
1526/***********************/
1527
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001528u16 hpi_sample_clock_query_source(const u32 h_clock, const u32 index,
1529 u16 *pw_source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001530
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001531u16 hpi_sample_clock_set_source(u32 h_control, u16 source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001532
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001533u16 hpi_sample_clock_get_source(u32 h_control, u16 *pw_source);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001534
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001535u16 hpi_sample_clock_query_source_index(const u32 h_clock, const u32 index,
1536 const u32 source, u16 *pw_source_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001537
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001538u16 hpi_sample_clock_set_source_index(u32 h_control, u16 source_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001539
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001540u16 hpi_sample_clock_get_source_index(u32 h_control, u16 *pw_source_index);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001541
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001542u16 hpi_sample_clock_get_sample_rate(u32 h_control, u32 *psample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001543
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001544u16 hpi_sample_clock_query_local_rate(const u32 h_clock, const u32 index,
1545 u32 *psource);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001546
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001547u16 hpi_sample_clock_set_local_rate(u32 h_control, u32 sample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001548
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001549u16 hpi_sample_clock_get_local_rate(u32 h_control, u32 *psample_rate);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001550
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001551u16 hpi_sample_clock_set_auto(u32 h_control, u32 enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001552
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001553u16 hpi_sample_clock_get_auto(u32 h_control, u32 *penable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001554
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001555u16 hpi_sample_clock_set_local_rate_lock(u32 h_control, u32 lock);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001556
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001557u16 hpi_sample_clock_get_local_rate_lock(u32 h_control, u32 *plock);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001558
1559/***********************/
1560/* Microphone control */
1561/***********************/
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001562u16 hpi_microphone_set_phantom_power(u32 h_control, u16 on_off);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001563
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001564u16 hpi_microphone_get_phantom_power(u32 h_control, u16 *pw_on_off);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001565
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001566/********************************/
1567/* Parametric Equalizer control */
1568/********************************/
1569u16 hpi_parametric_eq_get_info(u32 h_control, u16 *pw_number_of_bands,
1570 u16 *pw_enabled);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001571
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001572u16 hpi_parametric_eq_set_state(u32 h_control, u16 on_off);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001573
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001574u16 hpi_parametric_eq_set_band(u32 h_control, u16 index, u16 type,
1575 u32 frequency_hz, short q100, short gain0_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001576
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001577u16 hpi_parametric_eq_get_band(u32 h_control, u16 index, u16 *pn_type,
1578 u32 *pfrequency_hz, short *pnQ100, short *pn_gain0_01dB);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001579
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001580u16 hpi_parametric_eq_get_coeffs(u32 h_control, u16 index, short coeffs[5]
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001581 );
1582
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001583/*******************************/
1584/* Compressor Expander control */
1585/*******************************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001586
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001587u16 hpi_compander_set_enable(u32 h_control, u32 on);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001588
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001589u16 hpi_compander_get_enable(u32 h_control, u32 *pon);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001590
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001591u16 hpi_compander_set_makeup_gain(u32 h_control, short makeup_gain0_01dB);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001592
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001593u16 hpi_compander_get_makeup_gain(u32 h_control, short *pn_makeup_gain0_01dB);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001594
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001595u16 hpi_compander_set_attack_time_constant(u32 h_control, u32 index,
1596 u32 attack);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001597
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001598u16 hpi_compander_get_attack_time_constant(u32 h_control, u32 index,
1599 u32 *pw_attack);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001600
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001601u16 hpi_compander_set_decay_time_constant(u32 h_control, u32 index,
1602 u32 decay);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001603
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001604u16 hpi_compander_get_decay_time_constant(u32 h_control, u32 index,
1605 u32 *pw_decay);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001606
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001607u16 hpi_compander_set_threshold(u32 h_control, u32 index,
1608 short threshold0_01dB);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001609
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001610u16 hpi_compander_get_threshold(u32 h_control, u32 index,
1611 short *pn_threshold0_01dB);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001612
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001613u16 hpi_compander_set_ratio(u32 h_control, u32 index, u32 ratio100);
Eliot Blennerhassett168f1b02010-07-06 08:37:06 +12001614
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001615u16 hpi_compander_get_ratio(u32 h_control, u32 index, u32 *pw_ratio100);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001616
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001617/********************/
1618/* Cobranet control */
1619/********************/
1620u16 hpi_cobranet_hmi_write(u32 h_control, u32 hmi_address, u32 byte_count,
1621 u8 *pb_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001622
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001623u16 hpi_cobranet_hmi_read(u32 h_control, u32 hmi_address, u32 max_byte_count,
1624 u32 *pbyte_count, u8 *pb_data);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001625
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001626u16 hpi_cobranet_hmi_get_status(u32 h_control, u32 *pstatus,
1627 u32 *preadable_size, u32 *pwriteable_size);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001628
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001629u16 hpi_cobranet_get_ip_address(u32 h_control, u32 *pdw_ip_address);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001630
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001631u16 hpi_cobranet_set_ip_address(u32 h_control, u32 dw_ip_address);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001632
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001633u16 hpi_cobranet_get_static_ip_address(u32 h_control, u32 *pdw_ip_address);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001634
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001635u16 hpi_cobranet_set_static_ip_address(u32 h_control, u32 dw_ip_address);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001636
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001637u16 hpi_cobranet_get_macaddress(u32 h_control, u32 *pmAC_MS_bs,
1638 u32 *pmAC_LS_bs);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001639
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001640/*************************/
1641/* Tone Detector control */
1642/*************************/
1643u16 hpi_tone_detector_get_state(u32 hC, u32 *state);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001644
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001645u16 hpi_tone_detector_set_enable(u32 hC, u32 enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001646
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001647u16 hpi_tone_detector_get_enable(u32 hC, u32 *enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001648
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001649u16 hpi_tone_detector_set_event_enable(u32 hC, u32 event_enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001650
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001651u16 hpi_tone_detector_get_event_enable(u32 hC, u32 *event_enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001652
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001653u16 hpi_tone_detector_set_threshold(u32 hC, int threshold);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001654
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001655u16 hpi_tone_detector_get_threshold(u32 hC, int *threshold);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001656
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001657u16 hpi_tone_detector_get_frequency(u32 hC, u32 index, u32 *frequency);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001658
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001659/****************************/
1660/* Silence Detector control */
1661/****************************/
1662u16 hpi_silence_detector_get_state(u32 hC, u32 *state);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001663
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001664u16 hpi_silence_detector_set_enable(u32 hC, u32 enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001665
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001666u16 hpi_silence_detector_get_enable(u32 hC, u32 *enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001667
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001668u16 hpi_silence_detector_set_event_enable(u32 hC, u32 event_enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001669
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001670u16 hpi_silence_detector_get_event_enable(u32 hC, u32 *event_enable);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001671
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001672u16 hpi_silence_detector_set_delay(u32 hC, u32 delay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001673
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001674u16 hpi_silence_detector_get_delay(u32 hC, u32 *delay);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001675
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001676u16 hpi_silence_detector_set_threshold(u32 hC, int threshold);
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001677
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001678u16 hpi_silence_detector_get_threshold(u32 hC, int *threshold);
1679/*********************/
1680/* Utility functions */
1681/*********************/
Eliot Blennerhassett719f82d2010-04-21 18:17:39 +02001682
1683u16 hpi_format_create(struct hpi_format *p_format, u16 channels, u16 format,
1684 u32 sample_rate, u32 bit_rate, u32 attributes);
1685
Eliot Blennerhassettba944552011-02-10 17:26:04 +13001686#endif /*_HPI_H_ */