/******************************************************************************12AudioScience HPI driver3Copyright (C) 1997-2010 AudioScience Inc. <[email protected]>45This program is free software; you can redistribute it and/or modify6it under the terms of version 2 of the GNU General Public License as7published by the Free Software Foundation;89This program is distributed in the hope that it will be useful,10but WITHOUT ANY WARRANTY; without even the implied warranty of11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12GNU General Public License for more details.1314You should have received a copy of the GNU General Public License15along with this program; if not, write to the Free Software16Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1718*/19/** \file hpi.h2021AudioScience Hardware Programming Interface (HPI)22public API definition.2324The HPI is a low-level hardware abstraction layer to all25AudioScience digital audio adapters2627(C) Copyright AudioScience Inc. 1998-201028*/2930#ifndef _HPI_H_31#define _HPI_H_32/* HPI Version33If HPI_VER_MINOR is odd then its a development release not intended for the34public. If HPI_VER_MINOR is even then is a release version35i.e 3.05.02 is a development version36*/37#define HPI_VERSION_CONSTRUCTOR(maj, min, rel) \38((maj << 16) + (min << 8) + rel)3940#define HPI_VER_MAJOR(v) ((int)(v >> 16))41#define HPI_VER_MINOR(v) ((int)((v >> 8) & 0xFF))42#define HPI_VER_RELEASE(v) ((int)(v & 0xFF))4344/* Use single digits for versions less that 10 to avoid octal. */45#define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 6, 0)46#define HPI_VER_STRING "4.06.00"4748/* Library version as documented in hpi-api-versions.txt */49#define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(9, 0, 0)5051#include <linux/types.h>52#define HPI_BUILD_EXCLUDE_DEPRECATED53#define HPI_BUILD_KERNEL_MODE5455/******************************************************************************/56/******** HPI API DEFINITIONS *****/57/******************************************************************************/5859/*******************************************/60/** Audio format types61\ingroup stream62*/63enum HPI_FORMATS {64/** Used internally on adapter. */65HPI_FORMAT_MIXER_NATIVE = 0,66/** 8-bit unsigned PCM. Windows equivalent is WAVE_FORMAT_PCM. */67HPI_FORMAT_PCM8_UNSIGNED = 1,68/** 16-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM. */69HPI_FORMAT_PCM16_SIGNED = 2,70/** MPEG-1 Layer-1. */71HPI_FORMAT_MPEG_L1 = 3,72/** MPEG-1 Layer-2.7374Windows equivalent is WAVE_FORMAT_MPEG.7576The following table shows what combinations of mode and bitrate are possible:7778<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>8384<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>X89<tr><td>80<td>X<td>_90<tr><td>96<td>X<td>X91<tr><td>112<td>X<td>X92<tr><td>128<td>X<td>X93<tr><td>160<td>X<td>X94<tr><td>192<td>X<td>X95<tr><td>224<td>_<td>X96<tr><td>256<td>-<td>X97<tr><td>320<td>-<td>X98<tr><td>384<td>_<td>X99</table>100*/101HPI_FORMAT_MPEG_L2 = 4,102/** MPEG-1 Layer-3.103Windows equivalent is WAVE_FORMAT_MPEG.104105The following table shows what combinations of mode and bitrate are possible:106107<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>113114<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>X117<tr><td>40<td>X<td>X<td>X118<tr><td>48<td>X<td>X<td>X119<tr><td>56<td>X<td>X<td>X120<tr><td>64<td>X<td>X<td>X121<tr><td>80<td>_<td>X<td>X122<tr><td>96<td>_<td>X<td>X123<tr><td>112<td>_<td>X<td>X124<tr><td>128<td>_<td>X<td>X125<tr><td>144<td>_<td>X<td>_126<tr><td>160<td>_<td>X<td>X127<tr><td>192<td>_<td>_<td>X128<tr><td>224<td>_<td>_<td>X129<tr><td>256<td>-<td>_<td>X130<tr><td>320<td>-<td>_<td>X131</table>132\b * Available on the ASI6000 series only133*/134HPI_FORMAT_MPEG_L3 = 5,135/** Dolby AC-2. */136HPI_FORMAT_DOLBY_AC2 = 6,137/** Dolbt AC-3. */138HPI_FORMAT_DOLBY_AC3 = 7,139/** 16-bit PCM big-endian. */140HPI_FORMAT_PCM16_BIGENDIAN = 8,141/** TAGIT-1 algorithm - hits. */142HPI_FORMAT_AA_TAGIT1_HITS = 9,143/** TAGIT-1 algorithm - inserts. */144HPI_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-bit147sample and the least significant 8 bits are set to 0.148*/149HPI_FORMAT_PCM32_SIGNED = 11,150/** Raw bitstream - unknown format. */151HPI_FORMAT_RAW_BITSTREAM = 12,152/** TAGIT-1 algorithm hits - extended. */153HPI_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*/158HPI_FORMAT_PCM32_FLOAT = 14,159/** 24-bit PCM signed. Windows equivalent is WAVE_FORMAT_PCM. */160HPI_FORMAT_PCM24_SIGNED = 15,161/** OEM format 1 - private. */162HPI_FORMAT_OEM1 = 16,163/** OEM format 2 - private. */164HPI_FORMAT_OEM2 = 17,165/** Undefined format. */166HPI_FORMAT_UNDEFINED = 0xffff167};168169/*******************************************/170/** Stream States171\ingroup stream172*/173enum HPI_STREAM_STATES {174/** State stopped - stream is stopped. */175HPI_STATE_STOPPED = 1,176/** State playing - stream is playing audio. */177HPI_STATE_PLAYING = 2,178/** State recording - stream is recording. */179HPI_STATE_RECORDING = 3,180/** State drained - playing stream ran out of data to play. */181HPI_STATE_DRAINED = 4,182/** State generate sine - to be implemented. */183HPI_STATE_SINEGEN = 5,184/** State wait - used for inter-card sync to mean waiting for all185cards to be ready. */186HPI_STATE_WAIT = 6187};188/*******************************************/189/** Source node types190\ingroup mixer191*/192enum HPI_SOURCENODES {193/** This define can be used instead of 0 to indicate194that there is no valid source node. A control that195exists on a destination node can be searched for using a source196node value of either 0, or HPI_SOURCENODE_NONE */197HPI_SOURCENODE_NONE = 100,198/** Out Stream (Play) node. */199HPI_SOURCENODE_OSTREAM = 101,200/** Line in node - could be analog, AES/EBU or network. */201HPI_SOURCENODE_LINEIN = 102,202HPI_SOURCENODE_AESEBU_IN = 103, /**< AES/EBU input node. */203HPI_SOURCENODE_TUNER = 104, /**< tuner node. */204HPI_SOURCENODE_RF = 105, /**< RF input node. */205HPI_SOURCENODE_CLOCK_SOURCE = 106, /**< clock source node. */206HPI_SOURCENODE_RAW_BITSTREAM = 107, /**< raw bitstream node. */207HPI_SOURCENODE_MICROPHONE = 108, /**< microphone node. */208/** Cobranet input node -209Audio samples come from the Cobranet network and into the device. */210HPI_SOURCENODE_COBRANET = 109,211HPI_SOURCENODE_ANALOG = 110, /**< analog input node. */212HPI_SOURCENODE_ADAPTER = 111, /**< adapter node. */213/* !!!Update this AND hpidebug.h if you add a new sourcenode type!!! */214HPI_SOURCENODE_LAST_INDEX = 111 /**< largest ID */215/* AX6 max sourcenode types = 15 */216};217218/*******************************************/219/** Destination node types220\ingroup mixer221*/222enum HPI_DESTNODES {223/** This define can be used instead of 0 to indicate224that there is no valid destination node. A control that225exists on a source node can be searched for using a destination226node value of either 0, or HPI_DESTNODE_NONE */227HPI_DESTNODE_NONE = 200,228/** In Stream (Record) node. */229HPI_DESTNODE_ISTREAM = 201,230HPI_DESTNODE_LINEOUT = 202, /**< line out node. */231HPI_DESTNODE_AESEBU_OUT = 203, /**< AES/EBU output node. */232HPI_DESTNODE_RF = 204, /**< RF output node. */233HPI_DESTNODE_SPEAKER = 205, /**< speaker output node. */234/** Cobranet output node -235Audio samples from the device are sent out on the Cobranet network.*/236HPI_DESTNODE_COBRANET = 206,237HPI_DESTNODE_ANALOG = 207, /**< analog output node. */238239/* !!!Update this AND hpidebug.h if you add a new destnode type!!! */240HPI_DESTNODE_LAST_INDEX = 207 /**< largest ID */241/* AX6 max destnode types = 15 */242};243244/*******************************************/245/** Mixer control types246\ingroup mixer247*/248enum HPI_CONTROLS {249HPI_CONTROL_GENERIC = 0, /**< generic control. */250HPI_CONTROL_CONNECTION = 1, /**< A connection between nodes. */251HPI_CONTROL_VOLUME = 2, /**< volume control - works in dB_fs. */252HPI_CONTROL_METER = 3, /**< peak meter control. */253HPI_CONTROL_MUTE = 4, /*mute control - not used at present. */254HPI_CONTROL_MULTIPLEXER = 5, /**< multiplexer control. */255256HPI_CONTROL_AESEBU_TRANSMITTER = 6, /**< AES/EBU transmitter control */257HPI_CONTROL_AESEBUTX = 6, /* HPI_CONTROL_AESEBU_TRANSMITTER */258259HPI_CONTROL_AESEBU_RECEIVER = 7, /**< AES/EBU receiver control. */260HPI_CONTROL_AESEBURX = 7, /* HPI_CONTROL_AESEBU_RECEIVER */261262HPI_CONTROL_LEVEL = 8, /**< level/trim control - works in d_bu. */263HPI_CONTROL_TUNER = 9, /**< tuner control. */264/* HPI_CONTROL_ONOFFSWITCH = 10 */265HPI_CONTROL_VOX = 11, /**< vox control. */266/* HPI_CONTROL_AES18_TRANSMITTER = 12 */267/* HPI_CONTROL_AES18_RECEIVER = 13 */268/* HPI_CONTROL_AES18_BLOCKGENERATOR = 14 */269HPI_CONTROL_CHANNEL_MODE = 15, /**< channel mode control. */270271HPI_CONTROL_BITSTREAM = 16, /**< bitstream control. */272HPI_CONTROL_SAMPLECLOCK = 17, /**< sample clock control. */273HPI_CONTROL_MICROPHONE = 18, /**< microphone control. */274HPI_CONTROL_PARAMETRIC_EQ = 19, /**< parametric EQ control. */275HPI_CONTROL_EQUALIZER = 19, /*HPI_CONTROL_PARAMETRIC_EQ */276277HPI_CONTROL_COMPANDER = 20, /**< compander control. */278HPI_CONTROL_COBRANET = 21, /**< cobranet control. */279HPI_CONTROL_TONEDETECTOR = 22, /**< tone detector control. */280HPI_CONTROL_SILENCEDETECTOR = 23, /**< silence detector control. */281HPI_CONTROL_PAD = 24, /**< tuner PAD control. */282HPI_CONTROL_SRC = 25, /**< samplerate converter control. */283HPI_CONTROL_UNIVERSAL = 26, /**< universal control. */284285/* !!! Update this AND hpidebug.h if you add a new control type!!!*/286HPI_CONTROL_LAST_INDEX = 26 /**<highest control type ID */287/* WARNING types 256 or greater impact bit packing in all AX6 DSP code */288};289290/*******************************************/291/** Adapter properties292These are used in HPI_AdapterSetProperty() and HPI_AdapterGetProperty()293\ingroup adapter294*/295enum HPI_ADAPTER_PROPERTIES {296/** \internal Used in dwProperty field of HPI_AdapterSetProperty() and297HPI_AdapterGetProperty(). This errata applies to all ASI6000 cards with both298analog and digital outputs. The CS4224 A/D+D/A has a one sample delay between299left 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*/303HPI_ADAPTER_PROPERTY_ERRATA_1 = 1,304305/** Adapter grouping property306Indicates whether the adapter supports the grouping API (for ASIO and SSX2)307*/308HPI_ADAPTER_PROPERTY_GROUPING = 2,309310/** Driver SSX2 property311Tells the kernel driver to turn on SSX2 stream mapping.312This feature is not used by the DSP. In fact the call is completely processed313by the driver and is not passed on to the DSP at all.314*/315HPI_ADAPTER_PROPERTY_ENABLE_SSX2 = 3,316317/** Adapter SSX2 property318Indicates the state of the adapter's SSX2 setting. This setting is stored in319non-volatile memory on the adapter. A typical call sequence would be to use320HPI_ADAPTER_PROPERTY_SSX2_SETTING to set SSX2 on the adapter and then to reload321the driver. The driver would query HPI_ADAPTER_PROPERTY_SSX2_SETTING during322startup and if SSX2 is set, it would then call HPI_ADAPTER_PROPERTY_ENABLE_SSX2323to enable SSX2 stream mapping within the kernel level of the driver.324*/325HPI_ADAPTER_PROPERTY_SSX2_SETTING = 4,326327/** Enables/disables PCI(e) IRQ.328A setting of 0 indicates that no interrupts are being generated. A DSP boot329this property is set to 0. Setting to a non-zero value specifies the number330of frames of audio that should be processed between interrupts. This property331should be set to multiple of the mixer interval as read back from the332HPI_ADAPTER_PROPERTY_INTERVAL property.333*/334HPI_ADAPTER_PROPERTY_IRQ_RATE = 5,335336/** Base number for readonly properties */337HPI_ADAPTER_PROPERTY_READONLYBASE = 256,338339/** Readonly adapter latency property.340This property returns in the input and output latency in samples.341Property 1 is the estimated input latency342in samples, while Property 2 is that output latency in samples.343*/344HPI_ADAPTER_PROPERTY_LATENCY = 256,345346/** Readonly adapter granularity property.347The granulariy is the smallest size chunk of stereo samples that is processed by348the adapter.349This property returns the record granularity in samples in Property 1.350Property 2 returns the play granularity.351*/352HPI_ADAPTER_PROPERTY_GRANULARITY = 257,353354/** Readonly adapter number of current channels property.355Property 1 is the number of record channels per record device.356Property 2 is the number of play channels per playback device.*/357HPI_ADAPTER_PROPERTY_CURCHANNELS = 258,358359/** Readonly adapter software version.360The SOFTWARE_VERSION property returns the version of the software running361on the adapter as Major.Minor.Release.362Property 1 contains Major in bits 15..8 and Minor in bits 7..0.363Property 2 contains Release in bits 7..0. */364HPI_ADAPTER_PROPERTY_SOFTWARE_VERSION = 259,365366/** Readonly adapter MAC address MSBs.367The MAC_ADDRESS_MSB property returns368the most significant 32 bits of the MAC address.369Property 1 contains bits 47..32 of the MAC address.370Property 2 contains bits 31..16 of the MAC address. */371HPI_ADAPTER_PROPERTY_MAC_ADDRESS_MSB = 260,372373/** Readonly adapter MAC address LSBs374The MAC_ADDRESS_LSB property returns375the least significant 16 bits of the MAC address.376Property 1 contains bits 15..0 of the MAC address. */377HPI_ADAPTER_PROPERTY_MAC_ADDRESS_LSB = 261,378379/** Readonly extended adapter type number380The EXTENDED_ADAPTER_TYPE property returns the 4 digits of an extended381adapter type, i.e ASI8920-0022, 0022 is the extended type.382The digits are returned as ASCII characters rather than the hex digits that383are returned for the main type384Property 1 returns the 1st two (left most) digits, i.e "00"385in the example above, the upper byte being the left most digit.386Property 2 returns the 2nd two digits, i.e "22" in the example above*/387HPI_ADAPTER_PROPERTY_EXTENDED_ADAPTER_TYPE = 262,388389/** Readonly debug log buffer information */390HPI_ADAPTER_PROPERTY_LOGTABLEN = 263,391HPI_ADAPTER_PROPERTY_LOGTABBEG = 264,392393/** Readonly adapter IP address394For 192.168.1.101395Property 1 returns the 1st two (left most) digits, i.e 192*256 + 168396in the example above, the upper byte being the left most digit.397Property 2 returns the 2nd two digits, i.e 1*256 + 101 in the example above, */398HPI_ADAPTER_PROPERTY_IP_ADDRESS = 265,399400/** Readonly adapter buffer processed count. Returns a buffer processed count401that is incremented every time all buffers for all streams are updated. This402is useful for checking completion of all stream operations across the adapter403when using grouped streams.404*/405HPI_ADAPTER_PROPERTY_BUFFER_UPDATE_COUNT = 266,406407/** Readonly mixer and stream intervals408409These intervals are measured in mixer frames.410To convert to time, divide by the adapter samplerate.411412The mixer interval is the number of frames processed in one mixer iteration.413The stream update interval is the interval at which streams check for and414process data, and BBM host buffer counters are updated.415416Property 1 is the mixer interval in mixer frames.417Property 2 is the stream update interval in mixer frames.418*/419HPI_ADAPTER_PROPERTY_INTERVAL = 267,420/** Adapter capabilities 1421Property 1 - adapter can do multichannel (SSX1)422Property 2 - adapter can do stream grouping (supports SSX2)423*/424HPI_ADAPTER_PROPERTY_CAPS1 = 268,425/** Adapter capabilities 2426Property 1 - adapter can do samplerate conversion (MRX)427Property 2 - adapter can do timestretch (TSX)428*/429HPI_ADAPTER_PROPERTY_CAPS2 = 269,430431/** Readonly adapter sync header connection count.432*/433HPI_ADAPTER_PROPERTY_SYNC_HEADER_CONNECTIONS = 270,434/** Readonly supports SSX2 property.435Indicates the adapter supports SSX2 in some mode setting. The436return value is true (1) or false (0). If the current adapter437mode is MONO SSX2 is disabled, even though this property will438return true.439*/440HPI_ADAPTER_PROPERTY_SUPPORTS_SSX2 = 271,441/** Readonly supports PCI(e) IRQ.442Indicates that the adapter in it's current mode supports interrupts443across the host bus. Note, this does not imply that interrupts are444enabled. Instead it indicates that they can be enabled.445*/446HPI_ADAPTER_PROPERTY_SUPPORTS_IRQ = 272447};448449/** Adapter mode commands450451Used in wQueryOrSet parameter of HPI_AdapterSetModeEx().452\ingroup adapter453*/454enum HPI_ADAPTER_MODE_CMDS {455/** Set the mode to the given parameter */456HPI_ADAPTER_MODE_SET = 0,457/** Return 0 or error depending whether mode is valid,458but don't set the mode */459HPI_ADAPTER_MODE_QUERY = 1460};461462/** Adapter Modes463These are used by HPI_AdapterSetModeEx()464465\warning - more than 16 possible modes breaks466a bitmask in the Windows WAVE DLL467\ingroup adapter468*/469enum HPI_ADAPTER_MODES {470/** 4 outstream mode.471- ASI6114: 1 instream472- ASI6044: 4 instreams473- ASI6012: 1 instream474- ASI6102: no instreams475- ASI6022, ASI6122: 2 instreams476- ASI5111, ASI5101: 2 instreams477- ASI652x, ASI662x: 2 instreams478- ASI654x, ASI664x: 4 instreams479*/480HPI_ADAPTER_MODE_4OSTREAM = 1,481482/** 6 outstream mode.483- ASI6012: 1 instream,484- ASI6022, ASI6122: 2 instreams485- ASI652x, ASI662x: 4 instreams486*/487HPI_ADAPTER_MODE_6OSTREAM = 2,488489/** 8 outstream mode.490- ASI6114: 8 instreams491- ASI6118: 8 instreams492- ASI6585: 8 instreams493*/494HPI_ADAPTER_MODE_8OSTREAM = 3,495496/** 16 outstream mode.497- ASI6416 16 instreams498- ASI6518, ASI6618 16 instreams499- ASI6118 16 mono out and in streams500*/501HPI_ADAPTER_MODE_16OSTREAM = 4,502503/** one outstream mode.504- ASI5111 1 outstream, 1 instream505*/506HPI_ADAPTER_MODE_1OSTREAM = 5,507508/** ASI504X mode 1. 12 outstream, 4 instream 0 to 48kHz sample rates509(see ASI504X datasheet for more info).510*/511HPI_ADAPTER_MODE_1 = 6,512513/** ASI504X mode 2. 4 outstreams, 4 instreams at 0 to 192kHz sample rates514(see ASI504X datasheet for more info).515*/516HPI_ADAPTER_MODE_2 = 7,517518/** ASI504X mode 3. 4 outstreams, 4 instreams at 0 to 192kHz sample rates519(see ASI504X datasheet for more info).520*/521HPI_ADAPTER_MODE_3 = 8,522523/** ASI504X multichannel mode.5242 outstreams -> 4 line outs = 1 to 8 channel streams),5254 lineins -> 1 instream (1 to 8 channel streams) at 0-48kHz.526For more info see the SSX Specification.527*/528HPI_ADAPTER_MODE_MULTICHANNEL = 9,529530/** 12 outstream mode.531- ASI6514, ASI6614: 2 instreams532- ASI6540,ASI6544: 8 instreams533- ASI6640,ASI6644: 8 instreams534*/535HPI_ADAPTER_MODE_12OSTREAM = 10,536537/** 9 outstream mode.538- ASI6044: 8 instreams539*/540HPI_ADAPTER_MODE_9OSTREAM = 11,541542/** mono mode.543- ASI6416: 16 outstreams/instreams544- ASI5402: 2 outstreams/instreams545*/546HPI_ADAPTER_MODE_MONO = 12,547548/** Low latency mode.549- ASI6416/ASI6316: 1 16 channel outstream and instream550*/551HPI_ADAPTER_MODE_LOW_LATENCY = 13552};553554/* Note, adapters can have more than one capability -555encoding as bitfield is recommended. */556#define HPI_CAPABILITY_NONE (0)557#define HPI_CAPABILITY_MPEG_LAYER3 (1)558559/* Set this equal to maximum capability index,560Must not be greater than 32 - see axnvdef.h */561#define HPI_CAPABILITY_MAX 1562/* #define HPI_CAPABILITY_AAC 2 */563564/******************************************* STREAM ATTRIBUTES ****/565566/** MPEG Ancillary Data modes567568The mode for the ancillary data insertion or extraction to operate in.569\ingroup stream570*/571enum HPI_MPEG_ANC_MODES {572/** the MPEG frames have energy information stored in them (5 bytes per stereo frame, 3 per mono) */573HPI_MPEG_ANC_HASENERGY = 0,574/** the entire ancillary data field is taken up by data from the Anc data buffer575On encode, the encoder will insert the energy bytes before filling the remainder576of the ancillary data space with data from the ancillary data buffer.577*/578HPI_MPEG_ANC_RAW = 1579};580581/** Ancillary Data Alignment582\ingroup instream583*/584enum HPI_ISTREAM_MPEG_ANC_ALIGNS {585/** data is packed against the end of data, then padded to the end of frame */586HPI_MPEG_ANC_ALIGN_LEFT = 0,587/** data is packed against the end of the frame */588HPI_MPEG_ANC_ALIGN_RIGHT = 1589};590591/** MPEG modes592MPEG modes - can be used optionally for HPI_FormatCreate()593parameter dwAttributes.594595Using any mode setting other than HPI_MPEG_MODE_DEFAULT596with single channel format will return an error.597\ingroup stream598*/599enum HPI_MPEG_MODES {600/** Causes the MPEG-1 Layer II bitstream to be recorded601in single_channel mode when the number of channels is 1 and in stereo when the602number of channels is 2. */603HPI_MPEG_MODE_DEFAULT = 0,604/** Standard stereo without joint-stereo compression */605HPI_MPEG_MODE_STEREO = 1,606/** Joint stereo */607HPI_MPEG_MODE_JOINTSTEREO = 2,608/** Left and Right channels are completely independent */609HPI_MPEG_MODE_DUALCHANNEL = 3610};611/******************************************* MIXER ATTRIBUTES ****/612613/* \defgroup mixer_flags Mixer flags for HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES614{615*/616#define HPI_MIXER_GET_CONTROL_MULTIPLE_CHANGED (0)617#define HPI_MIXER_GET_CONTROL_MULTIPLE_RESET (1)618/*}*/619620/** Commands used by HPI_MixerStore()621\ingroup mixer622*/623enum HPI_MIXER_STORE_COMMAND {624/** Save all mixer control settings. */625HPI_MIXER_STORE_SAVE = 1,626/** Restore all controls from saved. */627HPI_MIXER_STORE_RESTORE = 2,628/** Delete saved control settings. */629HPI_MIXER_STORE_DELETE = 3,630/** Enable auto storage of some control settings. */631HPI_MIXER_STORE_ENABLE = 4,632/** Disable auto storage of some control settings. */633HPI_MIXER_STORE_DISABLE = 5,634/** Save the attributes of a single control. */635HPI_MIXER_STORE_SAVE_SINGLE = 6636};637638/****************************/639/* CONTROL ATTRIBUTE VALUES */640/****************************/641642/** Used by mixer plugin enable functions643644E.g. HPI_ParametricEq_SetState()645\ingroup mixer646*/647enum HPI_SWITCH_STATES {648HPI_SWITCH_OFF = 0, /**< turn the mixer plugin on. */649HPI_SWITCH_ON = 1 /**< turn the mixer plugin off. */650};651652/* Volume control special gain values */653654/** volumes units are 100ths of a dB655\ingroup volume656*/657#define HPI_UNITS_PER_dB 100658/** turns volume control OFF or MUTE659\ingroup volume660*/661#define HPI_GAIN_OFF (-100 * HPI_UNITS_PER_dB)662663/** channel mask specifying all channels664\ingroup volume665*/666#define HPI_BITMASK_ALL_CHANNELS (0xFFFFFFFF)667668/** value returned for no signal669\ingroup meter670*/671#define HPI_METER_MINIMUM (-150 * HPI_UNITS_PER_dB)672673/** autofade profiles674\ingroup volume675*/676enum HPI_VOLUME_AUTOFADES {677/** log fade - dB attenuation changes linearly over time */678HPI_VOLUME_AUTOFADE_LOG = 2,679/** linear fade - amplitude changes linearly */680HPI_VOLUME_AUTOFADE_LINEAR = 3681};682683/** The physical encoding format of the AESEBU I/O.684685Used in HPI_Aesebu_Transmitter_SetFormat(), HPI_Aesebu_Receiver_SetFormat()686along with related Get and Query functions687\ingroup aestx688*/689enum HPI_AESEBU_FORMATS {690/** AES/EBU physical format - AES/EBU balanced "professional" */691HPI_AESEBU_FORMAT_AESEBU = 1,692/** AES/EBU physical format - S/PDIF unbalanced "consumer" */693HPI_AESEBU_FORMAT_SPDIF = 2694};695696/** AES/EBU error status bits697698Returned by HPI_Aesebu_Receiver_GetErrorStatus()699\ingroup aesrx700*/701enum HPI_AESEBU_ERRORS {702/** bit0: 1 when PLL is not locked */703HPI_AESEBU_ERROR_NOT_LOCKED = 0x01,704/** bit1: 1 when signal quality is poor */705HPI_AESEBU_ERROR_POOR_QUALITY = 0x02,706/** bit2: 1 when there is a parity error */707HPI_AESEBU_ERROR_PARITY_ERROR = 0x04,708/** bit3: 1 when there is a bi-phase coding violation */709HPI_AESEBU_ERROR_BIPHASE_VIOLATION = 0x08,710/** bit4: 1 when the validity bit is high */711HPI_AESEBU_ERROR_VALIDITY = 0x10,712/** bit5: 1 when the CRC error bit is high */713HPI_AESEBU_ERROR_CRC = 0x20714};715716/** \addtogroup pad717\{718*/719/** The text string containing the station/channel combination. */720#define HPI_PAD_CHANNEL_NAME_LEN 16721/** The text string containing the artist. */722#define HPI_PAD_ARTIST_LEN 64723/** The text string containing the title. */724#define HPI_PAD_TITLE_LEN 64725/** The text string containing the comment. */726#define HPI_PAD_COMMENT_LEN 256727/** The PTY when the tuner has not received any PTY. */728#define HPI_PAD_PROGRAM_TYPE_INVALID 0xffff729/** \} */730731/** Data types for PTY string translation.732\ingroup rds733*/734enum eHPI_RDS_type {735HPI_RDS_DATATYPE_RDS = 0, /**< RDS bitstream.*/736HPI_RDS_DATATYPE_RBDS = 1 /**< RBDS bitstream.*/737};738739/** Tuner bands740741Used for HPI_Tuner_SetBand(),HPI_Tuner_GetBand()742\ingroup tuner743*/744enum HPI_TUNER_BAND {745HPI_TUNER_BAND_AM = 1, /**< AM band */746HPI_TUNER_BAND_FM = 2, /**< FM band (mono) */747HPI_TUNER_BAND_TV_NTSC_M = 3, /**< NTSC-M TV band*/748HPI_TUNER_BAND_TV = 3, /* use TV_NTSC_M */749HPI_TUNER_BAND_FM_STEREO = 4, /**< FM band (stereo) */750HPI_TUNER_BAND_AUX = 5, /**< auxiliary input */751HPI_TUNER_BAND_TV_PAL_BG = 6, /**< PAL-B/G TV band*/752HPI_TUNER_BAND_TV_PAL_I = 7, /**< PAL-I TV band*/753HPI_TUNER_BAND_TV_PAL_DK = 8, /**< PAL-D/K TV band*/754HPI_TUNER_BAND_TV_SECAM_L = 9, /**< SECAM-L TV band*/755HPI_TUNER_BAND_LAST = 9 /**< the index of the last tuner band. */756};757758/** Tuner mode attributes759760Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()761\ingroup tuner762763*/764enum HPI_TUNER_MODES {765HPI_TUNER_MODE_RSS = 1, /**< control RSS */766HPI_TUNER_MODE_RDS = 2 /**< control RBDS/RDS */767};768769/** Tuner mode attribute values770771Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()772\ingroup tuner773*/774enum HPI_TUNER_MODE_VALUES {775/* RSS attribute values */776HPI_TUNER_MODE_RSS_DISABLE = 0, /**< RSS disable */777HPI_TUNER_MODE_RSS_ENABLE = 1, /**< RSS enable */778779/* RDS mode attributes */780HPI_TUNER_MODE_RDS_DISABLE = 0, /**< RDS - disabled */781HPI_TUNER_MODE_RDS_RDS = 1, /**< RDS - RDS mode */782HPI_TUNER_MODE_RDS_RBDS = 2 /**< RDS - RBDS mode */783};784785/** Tuner Status Bits786787These bitfield values are returned by a call to HPI_Tuner_GetStatus().788Multiple fields are returned from a single call.789\ingroup tuner790*/791enum HPI_TUNER_STATUS_BITS {792HPI_TUNER_VIDEO_COLOR_PRESENT = 0x0001, /**< video color is present. */793HPI_TUNER_VIDEO_IS_60HZ = 0x0020, /**< 60 hz video detected. */794HPI_TUNER_VIDEO_HORZ_SYNC_MISSING = 0x0040, /**< video HSYNC is missing. */795HPI_TUNER_VIDEO_STATUS_VALID = 0x0100, /**< video status is valid. */796HPI_TUNER_DIGITAL = 0x0200, /**< tuner reports digital programming. */797HPI_TUNER_MULTIPROGRAM = 0x0400, /**< tuner reports multiple programs. */798HPI_TUNER_PLL_LOCKED = 0x1000, /**< the tuner's PLL is locked. */799HPI_TUNER_FM_STEREO = 0x2000 /**< tuner reports back FM stereo. */800};801802/** Channel Modes803Used for HPI_ChannelModeSet/Get()804\ingroup channelmode805*/806enum HPI_CHANNEL_MODES {807/** Left channel out = left channel in, Right channel out = right channel in. */808HPI_CHANNEL_MODE_NORMAL = 1,809/** Left channel out = right channel in, Right channel out = left channel in. */810HPI_CHANNEL_MODE_SWAP = 2,811/** Left channel out = left channel in, Right channel out = left channel in. */812HPI_CHANNEL_MODE_LEFT_TO_STEREO = 3,813/** Left channel out = right channel in, Right channel out = right channel in.*/814HPI_CHANNEL_MODE_RIGHT_TO_STEREO = 4,815/** Left channel out = (left channel in + right channel in)/2,816Right channel out = mute. */817HPI_CHANNEL_MODE_STEREO_TO_LEFT = 5,818/** Left channel out = mute,819Right channel out = (right channel in + left channel in)/2. */820HPI_CHANNEL_MODE_STEREO_TO_RIGHT = 6,821HPI_CHANNEL_MODE_LAST = 6822};823824/** SampleClock source values825\ingroup sampleclock826*/827enum HPI_SAMPLECLOCK_SOURCES {828/** The sampleclock output is derived from its local samplerate generator.829The local samplerate may be set using HPI_SampleClock_SetLocalRate(). */830HPI_SAMPLECLOCK_SOURCE_LOCAL = 1,831/** The adapter is clocked from a dedicated AES/EBU SampleClock input.*/832HPI_SAMPLECLOCK_SOURCE_AESEBU_SYNC = 2,833/** From external wordclock connector */834HPI_SAMPLECLOCK_SOURCE_WORD = 3,835/** Board-to-board header */836HPI_SAMPLECLOCK_SOURCE_WORD_HEADER = 4,837/** FUTURE - SMPTE clock. */838HPI_SAMPLECLOCK_SOURCE_SMPTE = 5,839/** One of the aesebu inputs */840HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT = 6,841/** From a network interface e.g. Cobranet or Livewire at either 48 or 96kHz */842HPI_SAMPLECLOCK_SOURCE_NETWORK = 8,843/** From previous adjacent module (ASI2416 only)*/844HPI_SAMPLECLOCK_SOURCE_PREV_MODULE = 10,845/*! Update this if you add a new clock source.*/846HPI_SAMPLECLOCK_SOURCE_LAST = 10847};848849/** Equalizer filter types. Used by HPI_ParametricEq_SetBand()850\ingroup parmeq851*/852enum HPI_FILTER_TYPE {853HPI_FILTER_TYPE_BYPASS = 0, /**< filter is turned off */854855HPI_FILTER_TYPE_LOWSHELF = 1, /**< EQ low shelf */856HPI_FILTER_TYPE_HIGHSHELF = 2, /**< EQ high shelf */857HPI_FILTER_TYPE_EQ_BAND = 3, /**< EQ gain */858859HPI_FILTER_TYPE_LOWPASS = 4, /**< standard low pass */860HPI_FILTER_TYPE_HIGHPASS = 5, /**< standard high pass */861HPI_FILTER_TYPE_BANDPASS = 6, /**< standard band pass */862HPI_FILTER_TYPE_BANDSTOP = 7 /**< standard band stop/notch */863};864865/** Async Event sources866\ingroup async867*/868enum ASYNC_EVENT_SOURCES {869HPI_ASYNC_EVENT_GPIO = 1, /**< GPIO event. */870HPI_ASYNC_EVENT_SILENCE = 2, /**< silence event detected. */871HPI_ASYNC_EVENT_TONE = 3 /**< tone event detected. */872};873/*******************************************/874/** HPI Error codes875876Almost all HPI functions return an error code877A return value of zero means there was no error.878Otherwise one of these error codes is returned.879Error codes can be converted to a descriptive string using HPI_GetErrorText()880881\note When a new error code is added HPI_GetErrorText() MUST be updated.882\note Codes 1-100 are reserved for driver use883\ingroup utility884*/885enum HPI_ERROR_CODES {886/** Message type does not exist. */887HPI_ERROR_INVALID_TYPE = 100,888/** Object type does not exist. */889HPI_ERROR_INVALID_OBJ = 101,890/** Function does not exist. */891HPI_ERROR_INVALID_FUNC = 102,892/** The specified object does not exist. */893HPI_ERROR_INVALID_OBJ_INDEX = 103,894/** Trying to access an object that has not been opened yet. */895HPI_ERROR_OBJ_NOT_OPEN = 104,896/** Trying to open an already open object. */897HPI_ERROR_OBJ_ALREADY_OPEN = 105,898/** PCI, ISA resource not valid. */899HPI_ERROR_INVALID_RESOURCE = 106,900/* HPI_ERROR_SUBSYSFINDADAPTERS_GETINFO= 107 */901/** Default response was never updated with actual error code. */902HPI_ERROR_INVALID_RESPONSE = 108,903/** wSize field of response was not updated,904indicating that the message was not processed. */905HPI_ERROR_PROCESSING_MESSAGE = 109,906/** The network did not respond in a timely manner. */907HPI_ERROR_NETWORK_TIMEOUT = 110,908/* An HPI handle is invalid (uninitialised?). */909HPI_ERROR_INVALID_HANDLE = 111,910/** A function or attribute has not been implemented yet. */911HPI_ERROR_UNIMPLEMENTED = 112,912/** There are too many clients attempting913to access a network resource. */914HPI_ERROR_NETWORK_TOO_MANY_CLIENTS = 113,915/** Response buffer passed to HPI_Message916was smaller than returned response.917wSpecificError field of hpi response contains the required size.918*/919HPI_ERROR_RESPONSE_BUFFER_TOO_SMALL = 114,920/** The returned response did not match the sent message */921HPI_ERROR_RESPONSE_MISMATCH = 115,922/** A control setting that should have been cached was not. */923HPI_ERROR_CONTROL_CACHING = 116,924/** A message buffer in the path to the adapter was smaller925than the message size.926wSpecificError field of hpi response contains the actual size.927*/928HPI_ERROR_MESSAGE_BUFFER_TOO_SMALL = 117,929930/* HPI_ERROR_TOO_MANY_ADAPTERS= 200 */931/** Bad adpater. */932HPI_ERROR_BAD_ADAPTER = 201,933/** Adapter number out of range or not set properly. */934HPI_ERROR_BAD_ADAPTER_NUMBER = 202,935/** 2 adapters with the same adapter number. */936HPI_ERROR_DUPLICATE_ADAPTER_NUMBER = 203,937/** DSP code failed to bootload. (unused?) */938HPI_ERROR_DSP_BOOTLOAD = 204,939/** Couldn't find or open the DSP code file. */940HPI_ERROR_DSP_FILE_NOT_FOUND = 206,941/** Internal DSP hardware error. */942HPI_ERROR_DSP_HARDWARE = 207,943/** Could not allocate memory */944HPI_ERROR_MEMORY_ALLOC = 208,945/** Failed to correctly load/config PLD. (unused) */946HPI_ERROR_PLD_LOAD = 209,947/** Unexpected end of file, block length too big etc. */948HPI_ERROR_DSP_FILE_FORMAT = 210,949950/** Found but could not open DSP code file. */951HPI_ERROR_DSP_FILE_ACCESS_DENIED = 211,952/** First DSP code section header not found in DSP file. */953HPI_ERROR_DSP_FILE_NO_HEADER = 212,954/* HPI_ERROR_DSP_FILE_READ_ERROR= 213, */955/** DSP code for adapter family not found. */956HPI_ERROR_DSP_SECTION_NOT_FOUND = 214,957/** Other OS specific error opening DSP file. */958HPI_ERROR_DSP_FILE_OTHER_ERROR = 215,959/** Sharing violation opening DSP code file. */960HPI_ERROR_DSP_FILE_SHARING_VIOLATION = 216,961/** DSP code section header had size == 0. */962HPI_ERROR_DSP_FILE_NULL_HEADER = 217,963964/* HPI_ERROR_FLASH = 220, */965966/** Flash has bad checksum */967HPI_ERROR_BAD_CHECKSUM = 221,968HPI_ERROR_BAD_SEQUENCE = 222,969HPI_ERROR_FLASH_ERASE = 223,970HPI_ERROR_FLASH_PROGRAM = 224,971HPI_ERROR_FLASH_VERIFY = 225,972HPI_ERROR_FLASH_TYPE = 226,973HPI_ERROR_FLASH_START = 227,974975/** Reserved for OEMs. */976HPI_ERROR_RESERVED_1 = 290,977978/* HPI_ERROR_INVALID_STREAM = 300 use HPI_ERROR_INVALID_OBJ_INDEX */979/** Invalid compression format. */980HPI_ERROR_INVALID_FORMAT = 301,981/** Invalid format samplerate */982HPI_ERROR_INVALID_SAMPLERATE = 302,983/** Invalid format number of channels. */984HPI_ERROR_INVALID_CHANNELS = 303,985/** Invalid format bitrate. */986HPI_ERROR_INVALID_BITRATE = 304,987/** Invalid datasize used for stream read/write. */988HPI_ERROR_INVALID_DATASIZE = 305,989/* HPI_ERROR_BUFFER_FULL = 306 use HPI_ERROR_INVALID_DATASIZE */990/* HPI_ERROR_BUFFER_EMPTY = 307 use HPI_ERROR_INVALID_DATASIZE */991/** Null data pointer used for stream read/write. */992HPI_ERROR_INVALID_DATA_POINTER = 308,993/** Packet ordering error for stream read/write. */994HPI_ERROR_INVALID_PACKET_ORDER = 309,995996/** Object can't do requested operation in its current997state, eg set format, change rec mux state while recording.*/998HPI_ERROR_INVALID_OPERATION = 310,9991000/** Where a SRG is shared amongst streams, an incompatible samplerate1001is one that is different to any currently active stream. */1002HPI_ERROR_INCOMPATIBLE_SAMPLERATE = 311,1003/** Adapter mode is illegal.*/1004HPI_ERROR_BAD_ADAPTER_MODE = 312,10051006/** There have been too many attempts to set the adapter's1007capabilities (using bad keys), the card should be returned1008to ASI if further capabilities updates are required */1009HPI_ERROR_TOO_MANY_CAPABILITY_CHANGE_ATTEMPTS = 313,1010/** Streams on different adapters cannot be grouped. */1011HPI_ERROR_NO_INTERADAPTER_GROUPS = 314,1012/** Streams on different DSPs cannot be grouped. */1013HPI_ERROR_NO_INTERDSP_GROUPS = 315,1014/** Stream wait cancelled before threshold reached. */1015HPI_ERROR_WAIT_CANCELLED = 316,10161017/** Invalid mixer node for this adapter. */1018HPI_ERROR_INVALID_NODE = 400,1019/** Invalid control. */1020HPI_ERROR_INVALID_CONTROL = 401,1021/** Invalid control value was passed. */1022HPI_ERROR_INVALID_CONTROL_VALUE = 402,1023/** Control attribute not supported by this control. */1024HPI_ERROR_INVALID_CONTROL_ATTRIBUTE = 403,1025/** Control is disabled. */1026HPI_ERROR_CONTROL_DISABLED = 404,1027/** I2C transaction failed due to a missing ACK. */1028HPI_ERROR_CONTROL_I2C_MISSING_ACK = 405,1029HPI_ERROR_I2C_MISSING_ACK = 405,1030/** Control is busy, or coming out of1031reset and cannot be accessed at this time. */1032HPI_ERROR_CONTROL_NOT_READY = 407,10331034/** Non volatile memory */1035HPI_ERROR_NVMEM_BUSY = 450,1036HPI_ERROR_NVMEM_FULL = 451,1037HPI_ERROR_NVMEM_FAIL = 452,10381039/** I2C */1040HPI_ERROR_I2C_BAD_ADR = 460,10411042/** Entity errors */1043HPI_ERROR_ENTITY_TYPE_MISMATCH = 470,1044HPI_ERROR_ENTITY_ITEM_COUNT = 471,1045HPI_ERROR_ENTITY_TYPE_INVALID = 472,1046HPI_ERROR_ENTITY_ROLE_INVALID = 473,1047HPI_ERROR_ENTITY_SIZE_MISMATCH = 474,10481049/* AES18 specific errors were 500..507 */10501051/** custom error to use for debugging */1052HPI_ERROR_CUSTOM = 600,10531054/** hpioct32.c can't obtain mutex */1055HPI_ERROR_MUTEX_TIMEOUT = 700,10561057/** Backend errors used to be greater than this.1058\deprecated Now, all backends return only errors defined here in hpi.h1059*/1060HPI_ERROR_BACKEND_BASE = 900,10611062/** Communication with DSP failed */1063HPI_ERROR_DSP_COMMUNICATION = 9001064/* Note that the dsp communication error is set to this value so that1065it remains compatible with any software that expects such errors1066to be backend errors i.e. >= 900.1067Do not define any new error codes with values > 900.1068*/1069};10701071/** \defgroup maximums HPI maximum values1072\{1073*/1074/** Maximum number of adapters per HPI sub-system1075WARNING: modifying this value changes the response structure size.*/1076#define HPI_MAX_ADAPTERS 201077/** Maximum number of in or out streams per adapter */1078#define HPI_MAX_STREAMS 161079#define HPI_MAX_CHANNELS 2 /* per stream */1080#define HPI_MAX_NODES 8 /* per mixer ? */1081#define HPI_MAX_CONTROLS 4 /* per node ? */1082/** maximum number of ancillary bytes per MPEG frame */1083#define HPI_MAX_ANC_BYTES_PER_FRAME (64)1084#define HPI_STRING_LEN 1610851086/** Velocity units */1087#define HPI_OSTREAM_VELOCITY_UNITS 40961088/** OutStream timescale units */1089#define HPI_OSTREAM_TIMESCALE_UNITS 100001090/** OutStream timescale passthrough - turns timescaling on in passthough mode */1091#define HPI_OSTREAM_TIMESCALE_PASSTHROUGH 9999910921093/**\}*/10941095/**************/1096/* STRUCTURES */1097#ifndef DISABLE_PRAGMA_PACK11098#pragma pack(push, 1)1099#endif11001101/** Structure containing sample format information.1102See also HPI_FormatCreate().1103*/1104struct hpi_format {1105u32 sample_rate;1106/**< 11025, 32000, 44100 ... */1107u32 bit_rate; /**< for MPEG */1108u32 attributes;1109/**< Stereo/JointStereo/Mono */1110u16 mode_legacy;1111/**< Legacy ancillary mode or idle bit */1112u16 unused; /**< Unused */1113u16 channels; /**< 1,2..., (or ancillary mode or idle bit */1114u16 format; /**< HPI_FORMAT_PCM16, _MPEG etc. see #HPI_FORMATS. */1115};11161117struct hpi_anc_frame {1118u32 valid_bits_in_this_frame;1119u8 b_data[HPI_MAX_ANC_BYTES_PER_FRAME];1120};11211122/** An object for containing a single async event.1123*/1124struct hpi_async_event {1125u16 event_type; /**< type of event. \sa async_event */1126u16 sequence; /**< Sequence number, allows lost event detection */1127u32 state; /**< New state */1128u32 h_object; /**< handle to the object returning the event. */1129union {1130struct {1131u16 index; /**< GPIO bit index. */1132} gpio;1133struct {1134u16 node_index; /**< what node is the control on ? */1135u16 node_type; /**< what type of node is the control on ? */1136} control;1137} u;1138};11391140/* skip host side function declarations for1141DSP compile and documentation extraction */11421143#ifndef DISABLE_PRAGMA_PACK11144#pragma pack(pop)1145#endif11461147/*****************/1148/* HPI FUNCTIONS */1149/*****************/11501151/* Stream */1152u16 hpi_stream_estimate_buffer_size(struct hpi_format *pF,1153u32 host_polling_rate_in_milli_seconds, u32 *recommended_buffer_size);11541155/*************/1156/* SubSystem */1157/*************/11581159u16 hpi_subsys_get_version_ex(u32 *pversion_ex);11601161u16 hpi_subsys_get_num_adapters(int *pn_num_adapters);11621163u16 hpi_subsys_get_adapter(int iterator, u32 *padapter_index,1164u16 *pw_adapter_type);11651166/***********/1167/* Adapter */1168/***********/11691170u16 hpi_adapter_open(u16 adapter_index);11711172u16 hpi_adapter_close(u16 adapter_index);11731174u16 hpi_adapter_get_info(u16 adapter_index, u16 *pw_num_outstreams,1175u16 *pw_num_instreams, u16 *pw_version, u32 *pserial_number,1176u16 *pw_adapter_type);11771178u16 hpi_adapter_get_module_by_index(u16 adapter_index, u16 module_index,1179u16 *pw_num_outputs, u16 *pw_num_inputs, u16 *pw_version,1180u32 *pserial_number, u16 *pw_module_type, u32 *ph_module);11811182u16 hpi_adapter_set_mode(u16 adapter_index, u32 adapter_mode);11831184u16 hpi_adapter_set_mode_ex(u16 adapter_index, u32 adapter_mode,1185u16 query_or_set);11861187u16 hpi_adapter_get_mode(u16 adapter_index, u32 *padapter_mode);11881189u16 hpi_adapter_get_assert2(u16 adapter_index, u16 *p_assert_count,1190char *psz_assert, u32 *p_param1, u32 *p_param2,1191u32 *p_dsp_string_addr, u16 *p_processor_id);11921193u16 hpi_adapter_test_assert(u16 adapter_index, u16 assert_id);11941195u16 hpi_adapter_enable_capability(u16 adapter_index, u16 capability, u32 key);11961197u16 hpi_adapter_self_test(u16 adapter_index);11981199u16 hpi_adapter_debug_read(u16 adapter_index, u32 dsp_address, char *p_bytes,1200int *count_bytes);12011202u16 hpi_adapter_set_property(u16 adapter_index, u16 property, u16 paramter1,1203u16 paramter2);12041205u16 hpi_adapter_get_property(u16 adapter_index, u16 property,1206u16 *pw_paramter1, u16 *pw_paramter2);12071208u16 hpi_adapter_enumerate_property(u16 adapter_index, u16 index,1209u16 what_to_enumerate, u16 property_index, u32 *psetting);1210/*************/1211/* OutStream */1212/*************/1213u16 hpi_outstream_open(u16 adapter_index, u16 outstream_index,1214u32 *ph_outstream);12151216u16 hpi_outstream_close(u32 h_outstream);12171218u16 hpi_outstream_get_info_ex(u32 h_outstream, u16 *pw_state,1219u32 *pbuffer_size, u32 *pdata_to_play, u32 *psamples_played,1220u32 *pauxiliary_data_to_play);12211222u16 hpi_outstream_write_buf(u32 h_outstream, const u8 *pb_write_buf,1223u32 bytes_to_write, const struct hpi_format *p_format);12241225u16 hpi_outstream_start(u32 h_outstream);12261227u16 hpi_outstream_wait_start(u32 h_outstream);12281229u16 hpi_outstream_stop(u32 h_outstream);12301231u16 hpi_outstream_sinegen(u32 h_outstream);12321233u16 hpi_outstream_reset(u32 h_outstream);12341235u16 hpi_outstream_query_format(u32 h_outstream, struct hpi_format *p_format);12361237u16 hpi_outstream_set_format(u32 h_outstream, struct hpi_format *p_format);12381239u16 hpi_outstream_set_punch_in_out(u32 h_outstream, u32 punch_in_sample,1240u32 punch_out_sample);12411242u16 hpi_outstream_set_velocity(u32 h_outstream, short velocity);12431244u16 hpi_outstream_ancillary_reset(u32 h_outstream, u16 mode);12451246u16 hpi_outstream_ancillary_get_info(u32 h_outstream, u32 *pframes_available);12471248u16 hpi_outstream_ancillary_read(u32 h_outstream,1249struct hpi_anc_frame *p_anc_frame_buffer,1250u32 anc_frame_buffer_size_in_bytes,1251u32 number_of_ancillary_frames_to_read);12521253u16 hpi_outstream_set_time_scale(u32 h_outstream, u32 time_scaleX10000);12541255u16 hpi_outstream_host_buffer_allocate(u32 h_outstream, u32 size_in_bytes);12561257u16 hpi_outstream_host_buffer_free(u32 h_outstream);12581259u16 hpi_outstream_group_add(u32 h_outstream, u32 h_stream);12601261u16 hpi_outstream_group_get_map(u32 h_outstream, u32 *poutstream_map,1262u32 *pinstream_map);12631264u16 hpi_outstream_group_reset(u32 h_outstream);12651266/************/1267/* InStream */1268/************/1269u16 hpi_instream_open(u16 adapter_index, u16 instream_index,1270u32 *ph_instream);12711272u16 hpi_instream_close(u32 h_instream);12731274u16 hpi_instream_query_format(u32 h_instream,1275const struct hpi_format *p_format);12761277u16 hpi_instream_set_format(u32 h_instream,1278const struct hpi_format *p_format);12791280u16 hpi_instream_read_buf(u32 h_instream, u8 *pb_read_buf, u32 bytes_to_read);12811282u16 hpi_instream_start(u32 h_instream);12831284u16 hpi_instream_wait_start(u32 h_instream);12851286u16 hpi_instream_stop(u32 h_instream);12871288u16 hpi_instream_reset(u32 h_instream);12891290u16 hpi_instream_get_info_ex(u32 h_instream, u16 *pw_state, u32 *pbuffer_size,1291u32 *pdata_recorded, u32 *psamples_recorded,1292u32 *pauxiliary_data_recorded);12931294u16 hpi_instream_ancillary_reset(u32 h_instream, u16 bytes_per_frame,1295u16 mode, u16 alignment, u16 idle_bit);12961297u16 hpi_instream_ancillary_get_info(u32 h_instream, u32 *pframe_space);12981299u16 hpi_instream_ancillary_write(u32 h_instream,1300const struct hpi_anc_frame *p_anc_frame_buffer,1301u32 anc_frame_buffer_size_in_bytes,1302u32 number_of_ancillary_frames_to_write);13031304u16 hpi_instream_host_buffer_allocate(u32 h_instream, u32 size_in_bytes);13051306u16 hpi_instream_host_buffer_free(u32 h_instream);13071308u16 hpi_instream_group_add(u32 h_instream, u32 h_stream);13091310u16 hpi_instream_group_get_map(u32 h_instream, u32 *poutstream_map,1311u32 *pinstream_map);13121313u16 hpi_instream_group_reset(u32 h_instream);13141315/*********/1316/* Mixer */1317/*********/1318u16 hpi_mixer_open(u16 adapter_index, u32 *ph_mixer);13191320u16 hpi_mixer_close(u32 h_mixer);13211322u16 hpi_mixer_get_control(u32 h_mixer, u16 src_node_type,1323u16 src_node_type_index, u16 dst_node_type, u16 dst_node_type_index,1324u16 control_type, u32 *ph_control);13251326u16 hpi_mixer_get_control_by_index(u32 h_mixer, u16 control_index,1327u16 *pw_src_node_type, u16 *pw_src_node_index, u16 *pw_dst_node_type,1328u16 *pw_dst_node_index, u16 *pw_control_type, u32 *ph_control);13291330u16 hpi_mixer_store(u32 h_mixer, enum HPI_MIXER_STORE_COMMAND command,1331u16 index);1332/************/1333/* Controls */1334/************/1335/******************/1336/* Volume control */1337/******************/1338u16 hpi_volume_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]1339);13401341u16 hpi_volume_get_gain(u32 h_control,1342short an_gain0_01dB_out[HPI_MAX_CHANNELS]1343);13441345u16 hpi_volume_set_mute(u32 h_control, u32 mute);13461347u16 hpi_volume_get_mute(u32 h_control, u32 *mute);13481349#define hpi_volume_get_range hpi_volume_query_range1350u16 hpi_volume_query_range(u32 h_control, short *min_gain_01dB,1351short *max_gain_01dB, short *step_gain_01dB);13521353u16 hpi_volume_query_channels(const u32 h_volume, u32 *p_channels);13541355u16 hpi_volume_auto_fade(u32 h_control,1356short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms);13571358u16 hpi_volume_auto_fade_profile(u32 h_control,1359short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms,1360u16 profile);13611362/*****************/1363/* Level control */1364/*****************/1365u16 hpi_level_query_range(u32 h_control, short *min_gain_01dB,1366short *max_gain_01dB, short *step_gain_01dB);13671368u16 hpi_level_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]1369);13701371u16 hpi_level_get_gain(u32 h_control,1372short an_gain0_01dB_out[HPI_MAX_CHANNELS]1373);13741375/*****************/1376/* Meter control */1377/*****************/1378u16 hpi_meter_query_channels(const u32 h_meter, u32 *p_channels);13791380u16 hpi_meter_get_peak(u32 h_control,1381short an_peak0_01dB_out[HPI_MAX_CHANNELS]1382);13831384u16 hpi_meter_get_rms(u32 h_control, short an_peak0_01dB_out[HPI_MAX_CHANNELS]1385);13861387u16 hpi_meter_set_peak_ballistics(u32 h_control, u16 attack, u16 decay);13881389u16 hpi_meter_set_rms_ballistics(u32 h_control, u16 attack, u16 decay);13901391u16 hpi_meter_get_peak_ballistics(u32 h_control, u16 *attack, u16 *decay);13921393u16 hpi_meter_get_rms_ballistics(u32 h_control, u16 *attack, u16 *decay);13941395/************************/1396/* ChannelMode control */1397/************************/1398u16 hpi_channel_mode_query_mode(const u32 h_mode, const u32 index,1399u16 *pw_mode);14001401u16 hpi_channel_mode_set(u32 h_control, u16 mode);14021403u16 hpi_channel_mode_get(u32 h_control, u16 *mode);14041405/*****************/1406/* Tuner control */1407/*****************/1408u16 hpi_tuner_query_band(const u32 h_tuner, const u32 index, u16 *pw_band);14091410u16 hpi_tuner_set_band(u32 h_control, u16 band);14111412u16 hpi_tuner_get_band(u32 h_control, u16 *pw_band);14131414u16 hpi_tuner_query_frequency(const u32 h_tuner, const u32 index,1415const u16 band, u32 *pfreq);14161417u16 hpi_tuner_set_frequency(u32 h_control, u32 freq_ink_hz);14181419u16 hpi_tuner_get_frequency(u32 h_control, u32 *pw_freq_ink_hz);14201421u16 hpi_tuner_get_rf_level(u32 h_control, short *pw_level);14221423u16 hpi_tuner_get_raw_rf_level(u32 h_control, short *pw_level);14241425u16 hpi_tuner_query_gain(const u32 h_tuner, const u32 index, u16 *pw_gain);14261427u16 hpi_tuner_set_gain(u32 h_control, short gain);14281429u16 hpi_tuner_get_gain(u32 h_control, short *pn_gain);14301431u16 hpi_tuner_get_status(u32 h_control, u16 *pw_status_mask, u16 *pw_status);14321433u16 hpi_tuner_set_mode(u32 h_control, u32 mode, u32 value);14341435u16 hpi_tuner_get_mode(u32 h_control, u32 mode, u32 *pn_value);14361437u16 hpi_tuner_get_rds(u32 h_control, char *p_rds_data);14381439u16 hpi_tuner_query_deemphasis(const u32 h_tuner, const u32 index,1440const u16 band, u32 *pdeemphasis);14411442u16 hpi_tuner_set_deemphasis(u32 h_control, u32 deemphasis);1443u16 hpi_tuner_get_deemphasis(u32 h_control, u32 *pdeemphasis);14441445u16 hpi_tuner_query_program(const u32 h_tuner, u32 *pbitmap_program);14461447u16 hpi_tuner_set_program(u32 h_control, u32 program);14481449u16 hpi_tuner_get_program(u32 h_control, u32 *pprogram);14501451u16 hpi_tuner_get_hd_radio_dsp_version(u32 h_control, char *psz_dsp_version,1452const u32 string_size);14531454u16 hpi_tuner_get_hd_radio_sdk_version(u32 h_control, char *psz_sdk_version,1455const u32 string_size);14561457u16 hpi_tuner_get_hd_radio_signal_quality(u32 h_control, u32 *pquality);14581459u16 hpi_tuner_get_hd_radio_signal_blend(u32 h_control, u32 *pblend);14601461u16 hpi_tuner_set_hd_radio_signal_blend(u32 h_control, const u32 blend);14621463/***************/1464/* PAD control */1465/***************/14661467u16 hpi_pad_get_channel_name(u32 h_control, char *psz_string,1468const u32 string_length);14691470u16 hpi_pad_get_artist(u32 h_control, char *psz_string,1471const u32 string_length);14721473u16 hpi_pad_get_title(u32 h_control, char *psz_string,1474const u32 string_length);14751476u16 hpi_pad_get_comment(u32 h_control, char *psz_string,1477const u32 string_length);14781479u16 hpi_pad_get_program_type(u32 h_control, u32 *ppTY);14801481u16 hpi_pad_get_rdsPI(u32 h_control, u32 *ppI);14821483u16 hpi_pad_get_program_type_string(u32 h_control, const u32 data_type,1484const u32 pTY, char *psz_string, const u32 string_length);14851486/****************************/1487/* AES/EBU Receiver control */1488/****************************/1489u16 hpi_aesebu_receiver_query_format(const u32 h_aes_rx, const u32 index,1490u16 *pw_format);14911492u16 hpi_aesebu_receiver_set_format(u32 h_control, u16 source);14931494u16 hpi_aesebu_receiver_get_format(u32 h_control, u16 *pw_source);14951496u16 hpi_aesebu_receiver_get_sample_rate(u32 h_control, u32 *psample_rate);14971498u16 hpi_aesebu_receiver_get_user_data(u32 h_control, u16 index, u16 *pw_data);14991500u16 hpi_aesebu_receiver_get_channel_status(u32 h_control, u16 index,1501u16 *pw_data);15021503u16 hpi_aesebu_receiver_get_error_status(u32 h_control, u16 *pw_error_data);15041505/*******************************/1506/* AES/EBU Transmitter control */1507/*******************************/1508u16 hpi_aesebu_transmitter_set_sample_rate(u32 h_control, u32 sample_rate);15091510u16 hpi_aesebu_transmitter_set_user_data(u32 h_control, u16 index, u16 data);15111512u16 hpi_aesebu_transmitter_set_channel_status(u32 h_control, u16 index,1513u16 data);15141515u16 hpi_aesebu_transmitter_get_channel_status(u32 h_control, u16 index,1516u16 *pw_data);15171518u16 hpi_aesebu_transmitter_query_format(const u32 h_aes_tx, const u32 index,1519u16 *pw_format);15201521u16 hpi_aesebu_transmitter_set_format(u32 h_control, u16 output_format);15221523u16 hpi_aesebu_transmitter_get_format(u32 h_control, u16 *pw_output_format);15241525/***********************/1526/* Multiplexer control */1527/***********************/1528u16 hpi_multiplexer_set_source(u32 h_control, u16 source_node_type,1529u16 source_node_index);15301531u16 hpi_multiplexer_get_source(u32 h_control, u16 *source_node_type,1532u16 *source_node_index);15331534u16 hpi_multiplexer_query_source(u32 h_control, u16 index,1535u16 *source_node_type, u16 *source_node_index);15361537/***************/1538/* Vox control */1539/***************/1540u16 hpi_vox_set_threshold(u32 h_control, short an_gain0_01dB);15411542u16 hpi_vox_get_threshold(u32 h_control, short *an_gain0_01dB);15431544/*********************/1545/* Bitstream control */1546/*********************/1547u16 hpi_bitstream_set_clock_edge(u32 h_control, u16 edge_type);15481549u16 hpi_bitstream_set_data_polarity(u32 h_control, u16 polarity);15501551u16 hpi_bitstream_get_activity(u32 h_control, u16 *pw_clk_activity,1552u16 *pw_data_activity);15531554/***********************/1555/* SampleClock control */1556/***********************/15571558u16 hpi_sample_clock_query_source(const u32 h_clock, const u32 index,1559u16 *pw_source);15601561u16 hpi_sample_clock_set_source(u32 h_control, u16 source);15621563u16 hpi_sample_clock_get_source(u32 h_control, u16 *pw_source);15641565u16 hpi_sample_clock_query_source_index(const u32 h_clock, const u32 index,1566const u32 source, u16 *pw_source_index);15671568u16 hpi_sample_clock_set_source_index(u32 h_control, u16 source_index);15691570u16 hpi_sample_clock_get_source_index(u32 h_control, u16 *pw_source_index);15711572u16 hpi_sample_clock_get_sample_rate(u32 h_control, u32 *psample_rate);15731574u16 hpi_sample_clock_query_local_rate(const u32 h_clock, const u32 index,1575u32 *psource);15761577u16 hpi_sample_clock_set_local_rate(u32 h_control, u32 sample_rate);15781579u16 hpi_sample_clock_get_local_rate(u32 h_control, u32 *psample_rate);15801581u16 hpi_sample_clock_set_auto(u32 h_control, u32 enable);15821583u16 hpi_sample_clock_get_auto(u32 h_control, u32 *penable);15841585u16 hpi_sample_clock_set_local_rate_lock(u32 h_control, u32 lock);15861587u16 hpi_sample_clock_get_local_rate_lock(u32 h_control, u32 *plock);15881589/***********************/1590/* Microphone control */1591/***********************/1592u16 hpi_microphone_set_phantom_power(u32 h_control, u16 on_off);15931594u16 hpi_microphone_get_phantom_power(u32 h_control, u16 *pw_on_off);15951596/********************************/1597/* Parametric Equalizer control */1598/********************************/1599u16 hpi_parametric_eq_get_info(u32 h_control, u16 *pw_number_of_bands,1600u16 *pw_enabled);16011602u16 hpi_parametric_eq_set_state(u32 h_control, u16 on_off);16031604u16 hpi_parametric_eq_set_band(u32 h_control, u16 index, u16 type,1605u32 frequency_hz, short q100, short gain0_01dB);16061607u16 hpi_parametric_eq_get_band(u32 h_control, u16 index, u16 *pn_type,1608u32 *pfrequency_hz, short *pnQ100, short *pn_gain0_01dB);16091610u16 hpi_parametric_eq_get_coeffs(u32 h_control, u16 index, short coeffs[5]1611);16121613/*******************************/1614/* Compressor Expander control */1615/*******************************/16161617u16 hpi_compander_set_enable(u32 h_control, u32 on);16181619u16 hpi_compander_get_enable(u32 h_control, u32 *pon);16201621u16 hpi_compander_set_makeup_gain(u32 h_control, short makeup_gain0_01dB);16221623u16 hpi_compander_get_makeup_gain(u32 h_control, short *pn_makeup_gain0_01dB);16241625u16 hpi_compander_set_attack_time_constant(u32 h_control, u32 index,1626u32 attack);16271628u16 hpi_compander_get_attack_time_constant(u32 h_control, u32 index,1629u32 *pw_attack);16301631u16 hpi_compander_set_decay_time_constant(u32 h_control, u32 index,1632u32 decay);16331634u16 hpi_compander_get_decay_time_constant(u32 h_control, u32 index,1635u32 *pw_decay);16361637u16 hpi_compander_set_threshold(u32 h_control, u32 index,1638short threshold0_01dB);16391640u16 hpi_compander_get_threshold(u32 h_control, u32 index,1641short *pn_threshold0_01dB);16421643u16 hpi_compander_set_ratio(u32 h_control, u32 index, u32 ratio100);16441645u16 hpi_compander_get_ratio(u32 h_control, u32 index, u32 *pw_ratio100);16461647/********************/1648/* Cobranet control */1649/********************/1650u16 hpi_cobranet_hmi_write(u32 h_control, u32 hmi_address, u32 byte_count,1651u8 *pb_data);16521653u16 hpi_cobranet_hmi_read(u32 h_control, u32 hmi_address, u32 max_byte_count,1654u32 *pbyte_count, u8 *pb_data);16551656u16 hpi_cobranet_hmi_get_status(u32 h_control, u32 *pstatus,1657u32 *preadable_size, u32 *pwriteable_size);16581659u16 hpi_cobranet_get_ip_address(u32 h_control, u32 *pdw_ip_address);16601661u16 hpi_cobranet_set_ip_address(u32 h_control, u32 dw_ip_address);16621663u16 hpi_cobranet_get_static_ip_address(u32 h_control, u32 *pdw_ip_address);16641665u16 hpi_cobranet_set_static_ip_address(u32 h_control, u32 dw_ip_address);16661667u16 hpi_cobranet_get_macaddress(u32 h_control, u32 *p_mac_msbs,1668u32 *p_mac_lsbs);16691670/*************************/1671/* Tone Detector control */1672/*************************/1673u16 hpi_tone_detector_get_state(u32 hC, u32 *state);16741675u16 hpi_tone_detector_set_enable(u32 hC, u32 enable);16761677u16 hpi_tone_detector_get_enable(u32 hC, u32 *enable);16781679u16 hpi_tone_detector_set_event_enable(u32 hC, u32 event_enable);16801681u16 hpi_tone_detector_get_event_enable(u32 hC, u32 *event_enable);16821683u16 hpi_tone_detector_set_threshold(u32 hC, int threshold);16841685u16 hpi_tone_detector_get_threshold(u32 hC, int *threshold);16861687u16 hpi_tone_detector_get_frequency(u32 hC, u32 index, u32 *frequency);16881689/****************************/1690/* Silence Detector control */1691/****************************/1692u16 hpi_silence_detector_get_state(u32 hC, u32 *state);16931694u16 hpi_silence_detector_set_enable(u32 hC, u32 enable);16951696u16 hpi_silence_detector_get_enable(u32 hC, u32 *enable);16971698u16 hpi_silence_detector_set_event_enable(u32 hC, u32 event_enable);16991700u16 hpi_silence_detector_get_event_enable(u32 hC, u32 *event_enable);17011702u16 hpi_silence_detector_set_delay(u32 hC, u32 delay);17031704u16 hpi_silence_detector_get_delay(u32 hC, u32 *delay);17051706u16 hpi_silence_detector_set_threshold(u32 hC, int threshold);17071708u16 hpi_silence_detector_get_threshold(u32 hC, int *threshold);1709/*********************/1710/* Utility functions */1711/*********************/17121713u16 hpi_format_create(struct hpi_format *p_format, u16 channels, u16 format,1714u32 sample_rate, u32 bit_rate, u32 attributes);17151716#endif /*_HPI_H_ */171717181719