/* SPDX-License-Identifier: GPL-2.0-only */1/******************************************************************************23AudioScience HPI driver4Copyright (C) 1997-2011 AudioScience Inc. <[email protected]>567*/8/** \file hpi.h910AudioScience Hardware Programming Interface (HPI)11public API definition.1213The HPI is a low-level hardware abstraction layer to all14AudioScience digital audio adapters1516(C) Copyright AudioScience Inc. 1998-201017*/1819#ifndef _HPI_H_20#define _HPI_H_2122#include <linux/types.h>23#define HPI_BUILD_KERNEL_MODE2425/******************************************************************************/26/******** HPI API DEFINITIONS *****/27/******************************************************************************/2829/*******************************************/30/** Audio format types31\ingroup stream32*/33enum HPI_FORMATS {34/** Used internally on adapter. */35HPI_FORMAT_MIXER_NATIVE = 0,36/** 8-bit unsigned PCM. Windows equivalent is WAVE_FORMAT_PCM. */37HPI_FORMAT_PCM8_UNSIGNED = 1,38/** 16-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM. */39HPI_FORMAT_PCM16_SIGNED = 2,40/** MPEG-1 Layer-1. */41HPI_FORMAT_MPEG_L1 = 3,42/** MPEG-1 Layer-2.4344Windows equivalent is WAVE_FORMAT_MPEG.4546The following table shows what combinations of mode and bitrate are possible:4748<table border=1 cellspacing=0 cellpadding=5>49<tr>50<td><p><b>Bitrate (kbs)</b></p>51<td><p><b>Mono</b></p>52<td><p><b>Stereo,<br>Joint Stereo or<br>Dual Channel</b></p>5354<tr><td>32<td>X<td>_55<tr><td>40<td>_<td>_56<tr><td>48<td>X<td>_57<tr><td>56<td>X<td>_58<tr><td>64<td>X<td>X59<tr><td>80<td>X<td>_60<tr><td>96<td>X<td>X61<tr><td>112<td>X<td>X62<tr><td>128<td>X<td>X63<tr><td>160<td>X<td>X64<tr><td>192<td>X<td>X65<tr><td>224<td>_<td>X66<tr><td>256<td>-<td>X67<tr><td>320<td>-<td>X68<tr><td>384<td>_<td>X69</table>70*/71HPI_FORMAT_MPEG_L2 = 4,72/** MPEG-1 Layer-3.73Windows equivalent is WAVE_FORMAT_MPEG.7475The following table shows what combinations of mode and bitrate are possible:7677<table border=1 cellspacing=0 cellpadding=5>78<tr>79<td><p><b>Bitrate (kbs)</b></p>80<td><p><b>Mono<br>Stereo @ 8,<br>11.025 and<br>12kHz*</b></p>81<td><p><b>Mono<br>Stereo @ 16,<br>22.050 and<br>24kHz*</b></p>82<td><p><b>Mono<br>Stereo @ 32,<br>44.1 and<br>48kHz</b></p>8384<tr><td>16<td>X<td>X<td>_85<tr><td>24<td>X<td>X<td>_86<tr><td>32<td>X<td>X<td>X87<tr><td>40<td>X<td>X<td>X88<tr><td>48<td>X<td>X<td>X89<tr><td>56<td>X<td>X<td>X90<tr><td>64<td>X<td>X<td>X91<tr><td>80<td>_<td>X<td>X92<tr><td>96<td>_<td>X<td>X93<tr><td>112<td>_<td>X<td>X94<tr><td>128<td>_<td>X<td>X95<tr><td>144<td>_<td>X<td>_96<tr><td>160<td>_<td>X<td>X97<tr><td>192<td>_<td>_<td>X98<tr><td>224<td>_<td>_<td>X99<tr><td>256<td>-<td>_<td>X100<tr><td>320<td>-<td>_<td>X101</table>102\b * Available on the ASI6000 series only103*/104HPI_FORMAT_MPEG_L3 = 5,105/** Dolby AC-2. */106HPI_FORMAT_DOLBY_AC2 = 6,107/** Dolbt AC-3. */108HPI_FORMAT_DOLBY_AC3 = 7,109/** 16-bit PCM big-endian. */110HPI_FORMAT_PCM16_BIGENDIAN = 8,111/** TAGIT-1 algorithm - hits. */112HPI_FORMAT_AA_TAGIT1_HITS = 9,113/** TAGIT-1 algorithm - inserts. */114HPI_FORMAT_AA_TAGIT1_INSERTS = 10,115/** 32-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM.116Each sample is a 32bit word. The most significant 24 bits contain a 24-bit117sample and the least significant 8 bits are set to 0.118*/119HPI_FORMAT_PCM32_SIGNED = 11,120/** Raw bitstream - unknown format. */121HPI_FORMAT_RAW_BITSTREAM = 12,122/** TAGIT-1 algorithm hits - extended. */123HPI_FORMAT_AA_TAGIT1_HITS_EX1 = 13,124/** 32-bit PCM as an IEEE float. Windows equivalent is WAVE_FORMAT_IEEE_FLOAT.125Each sample is a 32bit word in IEEE754 floating point format.126The range is +1.0 to -1.0, which corresponds to digital fullscale.127*/128HPI_FORMAT_PCM32_FLOAT = 14,129/** 24-bit PCM signed. Windows equivalent is WAVE_FORMAT_PCM. */130HPI_FORMAT_PCM24_SIGNED = 15,131/** OEM format 1 - private. */132HPI_FORMAT_OEM1 = 16,133/** OEM format 2 - private. */134HPI_FORMAT_OEM2 = 17,135/** Undefined format. */136HPI_FORMAT_UNDEFINED = 0xffff137};138139/*******************************************/140/** Stream States141\ingroup stream142*/143enum HPI_STREAM_STATES {144/** State stopped - stream is stopped. */145HPI_STATE_STOPPED = 1,146/** State playing - stream is playing audio. */147HPI_STATE_PLAYING = 2,148/** State recording - stream is recording. */149HPI_STATE_RECORDING = 3,150/** State drained - playing stream ran out of data to play. */151HPI_STATE_DRAINED = 4,152/** State generate sine - to be implemented. */153HPI_STATE_SINEGEN = 5,154/** State wait - used for inter-card sync to mean waiting for all155cards to be ready. */156HPI_STATE_WAIT = 6157};158/*******************************************/159/** Source node types160\ingroup mixer161*/162enum HPI_SOURCENODES {163/** This define can be used instead of 0 to indicate164that there is no valid source node. A control that165exists on a destination node can be searched for using a source166node value of either 0, or HPI_SOURCENODE_NONE */167HPI_SOURCENODE_NONE = 100,168/** Out Stream (Play) node. */169HPI_SOURCENODE_OSTREAM = 101,170/** Line in node - could be analog, AES/EBU or network. */171HPI_SOURCENODE_LINEIN = 102,172HPI_SOURCENODE_AESEBU_IN = 103, /**< AES/EBU input node. */173HPI_SOURCENODE_TUNER = 104, /**< tuner node. */174HPI_SOURCENODE_RF = 105, /**< RF input node. */175HPI_SOURCENODE_CLOCK_SOURCE = 106, /**< clock source node. */176HPI_SOURCENODE_RAW_BITSTREAM = 107, /**< raw bitstream node. */177HPI_SOURCENODE_MICROPHONE = 108, /**< microphone node. */178/** Cobranet input node -179Audio samples come from the Cobranet network and into the device. */180HPI_SOURCENODE_COBRANET = 109,181HPI_SOURCENODE_ANALOG = 110, /**< analog input node. */182HPI_SOURCENODE_ADAPTER = 111, /**< adapter node. */183/** RTP stream input node - This node is a destination for184packets of RTP audio samples from other devices. */185HPI_SOURCENODE_RTP_DESTINATION = 112,186HPI_SOURCENODE_INTERNAL = 113, /**< node internal to the device. */187HPI_SOURCENODE_AVB = 114, /**< AVB input stream */188HPI_SOURCENODE_BLULINK = 115, /**< BLU-link input channel */189/* !!!Update this AND hpidebug.h if you add a new sourcenode type!!! */190HPI_SOURCENODE_LAST_INDEX = 115 /**< largest ID */191/* AX6 max sourcenode types = 15 */192};193194/*******************************************/195/** Destination node types196\ingroup mixer197*/198enum HPI_DESTNODES {199/** This define can be used instead of 0 to indicate200that there is no valid destination node. A control that201exists on a source node can be searched for using a destination202node value of either 0, or HPI_DESTNODE_NONE */203HPI_DESTNODE_NONE = 200,204/** In Stream (Record) node. */205HPI_DESTNODE_ISTREAM = 201,206HPI_DESTNODE_LINEOUT = 202, /**< line out node. */207HPI_DESTNODE_AESEBU_OUT = 203, /**< AES/EBU output node. */208HPI_DESTNODE_RF = 204, /**< RF output node. */209HPI_DESTNODE_SPEAKER = 205, /**< speaker output node. */210/** Cobranet output node -211Audio samples from the device are sent out on the Cobranet network.*/212HPI_DESTNODE_COBRANET = 206,213HPI_DESTNODE_ANALOG = 207, /**< analog output node. */214/** RTP stream output node - This node is a source for215packets of RTP audio samples that are sent to other devices. */216HPI_DESTNODE_RTP_SOURCE = 208,217HPI_DESTNODE_AVB = 209, /**< AVB output stream */218HPI_DESTNODE_INTERNAL = 210, /**< node internal to the device. */219HPI_DESTNODE_BLULINK = 211, /**< BLU-link output channel. */220/* !!!Update this AND hpidebug.h if you add a new destnode type!!! */221HPI_DESTNODE_LAST_INDEX = 211 /**< largest ID */222/* AX6 max destnode types = 15 */223};224225/*******************************************/226/** Mixer control types227\ingroup mixer228*/229enum HPI_CONTROLS {230HPI_CONTROL_GENERIC = 0, /**< generic control. */231HPI_CONTROL_CONNECTION = 1, /**< A connection between nodes. */232HPI_CONTROL_VOLUME = 2, /**< volume control - works in dB_fs. */233HPI_CONTROL_METER = 3, /**< peak meter control. */234HPI_CONTROL_MUTE = 4, /*mute control - not used at present. */235HPI_CONTROL_MULTIPLEXER = 5, /**< multiplexer control. */236237HPI_CONTROL_AESEBU_TRANSMITTER = 6, /**< AES/EBU transmitter control */238HPI_CONTROL_AESEBUTX = 6, /* HPI_CONTROL_AESEBU_TRANSMITTER */239240HPI_CONTROL_AESEBU_RECEIVER = 7, /**< AES/EBU receiver control. */241HPI_CONTROL_AESEBURX = 7, /* HPI_CONTROL_AESEBU_RECEIVER */242243HPI_CONTROL_LEVEL = 8, /**< level/trim control - works in d_bu. */244HPI_CONTROL_TUNER = 9, /**< tuner control. */245/* HPI_CONTROL_ONOFFSWITCH = 10 */246HPI_CONTROL_VOX = 11, /**< vox control. */247/* HPI_CONTROL_AES18_TRANSMITTER = 12 */248/* HPI_CONTROL_AES18_RECEIVER = 13 */249/* HPI_CONTROL_AES18_BLOCKGENERATOR = 14 */250HPI_CONTROL_CHANNEL_MODE = 15, /**< channel mode control. */251252HPI_CONTROL_BITSTREAM = 16, /**< bitstream control. */253HPI_CONTROL_SAMPLECLOCK = 17, /**< sample clock control. */254HPI_CONTROL_MICROPHONE = 18, /**< microphone control. */255HPI_CONTROL_PARAMETRIC_EQ = 19, /**< parametric EQ control. */256HPI_CONTROL_EQUALIZER = 19, /*HPI_CONTROL_PARAMETRIC_EQ */257258HPI_CONTROL_COMPANDER = 20, /**< compander control. */259HPI_CONTROL_COBRANET = 21, /**< cobranet control. */260HPI_CONTROL_TONEDETECTOR = 22, /**< tone detector control. */261HPI_CONTROL_SILENCEDETECTOR = 23, /**< silence detector control. */262HPI_CONTROL_PAD = 24, /**< tuner PAD control. */263HPI_CONTROL_SRC = 25, /**< samplerate converter control. */264HPI_CONTROL_UNIVERSAL = 26, /**< universal control. */265266/* !!! Update this AND hpidebug.h if you add a new control type!!!*/267HPI_CONTROL_LAST_INDEX = 26 /**<highest control type ID */268/* WARNING types 256 or greater impact bit packing in all AX6 DSP code */269};270271/*******************************************/272/** Adapter properties273These are used in HPI_AdapterSetProperty() and HPI_AdapterGetProperty()274\ingroup adapter275*/276enum HPI_ADAPTER_PROPERTIES {277/** \internal Used in dwProperty field of HPI_AdapterSetProperty() and278HPI_AdapterGetProperty(). This errata applies to all ASI6000 cards with both279analog and digital outputs. The CS4224 A/D+D/A has a one sample delay between280left and right channels on both its input (ADC) and output (DAC).281More details are available in Cirrus Logic errata ER284B2.282PDF available from www.cirrus.com, released by Cirrus in 2001.283*/284HPI_ADAPTER_PROPERTY_ERRATA_1 = 1,285286/** Adapter grouping property287Indicates whether the adapter supports the grouping API (for ASIO and SSX2)288*/289HPI_ADAPTER_PROPERTY_GROUPING = 2,290291/** Driver SSX2 property292Tells the kernel driver to turn on SSX2 stream mapping.293This feature is not used by the DSP. In fact the call is completely processed294by the driver and is not passed on to the DSP at all.295*/296HPI_ADAPTER_PROPERTY_ENABLE_SSX2 = 3,297298/** Adapter SSX2 property299Indicates the state of the adapter's SSX2 setting. This setting is stored in300non-volatile memory on the adapter. A typical call sequence would be to use301HPI_ADAPTER_PROPERTY_SSX2_SETTING to set SSX2 on the adapter and then to reload302the driver. The driver would query HPI_ADAPTER_PROPERTY_SSX2_SETTING during303startup and if SSX2 is set, it would then call HPI_ADAPTER_PROPERTY_ENABLE_SSX2304to enable SSX2 stream mapping within the kernel level of the driver.305*/306HPI_ADAPTER_PROPERTY_SSX2_SETTING = 4,307308/** Enables/disables PCI(e) IRQ.309A setting of 0 indicates that no interrupts are being generated. A DSP boot310this property is set to 0. Setting to a non-zero value specifies the number311of frames of audio that should be processed between interrupts. This property312should be set to multiple of the mixer interval as read back from the313HPI_ADAPTER_PROPERTY_INTERVAL property.314*/315HPI_ADAPTER_PROPERTY_IRQ_RATE = 5,316317/** Base number for readonly properties */318HPI_ADAPTER_PROPERTY_READONLYBASE = 256,319320/** Readonly adapter latency property.321This property returns in the input and output latency in samples.322Property 1 is the estimated input latency323in samples, while Property 2 is that output latency in samples.324*/325HPI_ADAPTER_PROPERTY_LATENCY = 256,326327/** Readonly adapter granularity property.328The granulariy is the smallest size chunk of stereo samples that is processed by329the adapter.330This property returns the record granularity in samples in Property 1.331Property 2 returns the play granularity.332*/333HPI_ADAPTER_PROPERTY_GRANULARITY = 257,334335/** Readonly adapter number of current channels property.336Property 1 is the number of record channels per record device.337Property 2 is the number of play channels per playback device.*/338HPI_ADAPTER_PROPERTY_CURCHANNELS = 258,339340/** Readonly adapter software version.341The SOFTWARE_VERSION property returns the version of the software running342on the adapter as Major.Minor.Release.343Property 1 contains Major in bits 15..8 and Minor in bits 7..0.344Property 2 contains Release in bits 7..0. */345HPI_ADAPTER_PROPERTY_SOFTWARE_VERSION = 259,346347/** Readonly adapter MAC address MSBs.348The MAC_ADDRESS_MSB property returns349the most significant 32 bits of the MAC address.350Property 1 contains bits 47..32 of the MAC address.351Property 2 contains bits 31..16 of the MAC address. */352HPI_ADAPTER_PROPERTY_MAC_ADDRESS_MSB = 260,353354/** Readonly adapter MAC address LSBs355The MAC_ADDRESS_LSB property returns356the least significant 16 bits of the MAC address.357Property 1 contains bits 15..0 of the MAC address. */358HPI_ADAPTER_PROPERTY_MAC_ADDRESS_LSB = 261,359360/** Readonly extended adapter type number361The EXTENDED_ADAPTER_TYPE property returns the 4 digits of an extended362adapter type, i.e ASI8920-0022, 0022 is the extended type.363The digits are returned as ASCII characters rather than the hex digits that364are returned for the main type365Property 1 returns the 1st two (left most) digits, i.e "00"366in the example above, the upper byte being the left most digit.367Property 2 returns the 2nd two digits, i.e "22" in the example above*/368HPI_ADAPTER_PROPERTY_EXTENDED_ADAPTER_TYPE = 262,369370/** Readonly debug log buffer information */371HPI_ADAPTER_PROPERTY_LOGTABLEN = 263,372HPI_ADAPTER_PROPERTY_LOGTABBEG = 264,373374/** Readonly adapter IP address375For 192.168.1.101376Property 1 returns the 1st two (left most) digits, i.e 192*256 + 168377in the example above, the upper byte being the left most digit.378Property 2 returns the 2nd two digits, i.e 1*256 + 101 in the example above, */379HPI_ADAPTER_PROPERTY_IP_ADDRESS = 265,380381/** Readonly adapter buffer processed count. Returns a buffer processed count382that is incremented every time all buffers for all streams are updated. This383is useful for checking completion of all stream operations across the adapter384when using grouped streams.385*/386HPI_ADAPTER_PROPERTY_BUFFER_UPDATE_COUNT = 266,387388/** Readonly mixer and stream intervals389390These intervals are measured in mixer frames.391To convert to time, divide by the adapter samplerate.392393The mixer interval is the number of frames processed in one mixer iteration.394The stream update interval is the interval at which streams check for and395process data, and BBM host buffer counters are updated.396397Property 1 is the mixer interval in mixer frames.398Property 2 is the stream update interval in mixer frames.399*/400HPI_ADAPTER_PROPERTY_INTERVAL = 267,401/** Adapter capabilities 1402Property 1 - adapter can do multichannel (SSX1)403Property 2 - adapter can do stream grouping (supports SSX2)404*/405HPI_ADAPTER_PROPERTY_CAPS1 = 268,406/** Adapter capabilities 2407Property 1 - adapter can do samplerate conversion (MRX)408Property 2 - adapter can do timestretch (TSX)409*/410HPI_ADAPTER_PROPERTY_CAPS2 = 269,411412/** Readonly adapter sync header connection count.413*/414HPI_ADAPTER_PROPERTY_SYNC_HEADER_CONNECTIONS = 270,415/** Readonly supports SSX2 property.416Indicates the adapter supports SSX2 in some mode setting. The417return value is true (1) or false (0). If the current adapter418mode is MONO SSX2 is disabled, even though this property will419return true.420*/421HPI_ADAPTER_PROPERTY_SUPPORTS_SSX2 = 271,422/** Readonly supports PCI(e) IRQ.423Indicates that the adapter in it's current mode supports interrupts424across the host bus. Note, this does not imply that interrupts are425enabled. Instead it indicates that they can be enabled.426*/427HPI_ADAPTER_PROPERTY_SUPPORTS_IRQ = 272,428/** Readonly supports firmware updating.429Indicates that the adapter implements an interface to update firmware430on the adapter.431*/432HPI_ADAPTER_PROPERTY_SUPPORTS_FW_UPDATE = 273,433/** Readonly Firmware IDs434Identifiy firmware independent of individual adapter type.435May be used as a filter for firmware update images.436Property 1 = Bootloader ID437Property 2 = Main program ID438*/439HPI_ADAPTER_PROPERTY_FIRMWARE_ID = 274440};441442/** Adapter mode commands443444Used in wQueryOrSet parameter of HPI_AdapterSetModeEx().445\ingroup adapter446*/447enum HPI_ADAPTER_MODE_CMDS {448/** Set the mode to the given parameter */449HPI_ADAPTER_MODE_SET = 0,450/** Return 0 or error depending whether mode is valid,451but don't set the mode */452HPI_ADAPTER_MODE_QUERY = 1453};454455/** Adapter Modes456These are used by HPI_AdapterSetModeEx()457458\warning - more than 16 possible modes breaks459a bitmask in the Windows WAVE DLL460\ingroup adapter461*/462enum HPI_ADAPTER_MODES {463/** 4 outstream mode.464- ASI6114: 1 instream465- ASI6044: 4 instreams466- ASI6012: 1 instream467- ASI6102: no instreams468- ASI6022, ASI6122: 2 instreams469- ASI5111, ASI5101: 2 instreams470- ASI652x, ASI662x: 2 instreams471- ASI654x, ASI664x: 4 instreams472*/473HPI_ADAPTER_MODE_4OSTREAM = 1,474475/** 6 outstream mode.476- ASI6012: 1 instream,477- ASI6022, ASI6122: 2 instreams478- ASI652x, ASI662x: 4 instreams479*/480HPI_ADAPTER_MODE_6OSTREAM = 2,481482/** 8 outstream mode.483- ASI6114: 8 instreams484- ASI6118: 8 instreams485- ASI6585: 8 instreams486*/487HPI_ADAPTER_MODE_8OSTREAM = 3,488489/** 16 outstream mode.490- ASI6416 16 instreams491- ASI6518, ASI6618 16 instreams492- ASI6118 16 mono out and in streams493*/494HPI_ADAPTER_MODE_16OSTREAM = 4,495496/** one outstream mode.497- ASI5111 1 outstream, 1 instream498*/499HPI_ADAPTER_MODE_1OSTREAM = 5,500501/** ASI504X mode 1. 12 outstream, 4 instream 0 to 48kHz sample rates502(see ASI504X datasheet for more info).503*/504HPI_ADAPTER_MODE_1 = 6,505506/** ASI504X mode 2. 4 outstreams, 4 instreams at 0 to 192kHz sample rates507(see ASI504X datasheet for more info).508*/509HPI_ADAPTER_MODE_2 = 7,510511/** ASI504X mode 3. 4 outstreams, 4 instreams at 0 to 192kHz sample rates512(see ASI504X datasheet for more info).513*/514HPI_ADAPTER_MODE_3 = 8,515516/** ASI504X multichannel mode.5172 outstreams -> 4 line outs = 1 to 8 channel streams),5184 lineins -> 1 instream (1 to 8 channel streams) at 0-48kHz.519For more info see the SSX Specification.520*/521HPI_ADAPTER_MODE_MULTICHANNEL = 9,522523/** 12 outstream mode.524- ASI6514, ASI6614: 2 instreams525- ASI6540,ASI6544: 8 instreams526- ASI6640,ASI6644: 8 instreams527*/528HPI_ADAPTER_MODE_12OSTREAM = 10,529530/** 9 outstream mode.531- ASI6044: 8 instreams532*/533HPI_ADAPTER_MODE_9OSTREAM = 11,534535/** mono mode.536- ASI6416: 16 outstreams/instreams537- ASI5402: 2 outstreams/instreams538*/539HPI_ADAPTER_MODE_MONO = 12,540541/** Low latency mode.542- ASI6416/ASI6316: 1 16 channel outstream and instream543*/544HPI_ADAPTER_MODE_LOW_LATENCY = 13545};546547/* Note, adapters can have more than one capability -548encoding as bitfield is recommended. */549#define HPI_CAPABILITY_NONE (0)550#define HPI_CAPABILITY_MPEG_LAYER3 (1)551552/* Set this equal to maximum capability index,553Must not be greater than 32 - see axnvdef.h */554#define HPI_CAPABILITY_MAX 1555/* #define HPI_CAPABILITY_AAC 2 */556557/******************************************* STREAM ATTRIBUTES ****/558559/** MPEG Ancillary Data modes560561The mode for the ancillary data insertion or extraction to operate in.562\ingroup stream563*/564enum HPI_MPEG_ANC_MODES {565/** the MPEG frames have energy information stored in them (5 bytes per stereo frame, 3 per mono) */566HPI_MPEG_ANC_HASENERGY = 0,567/** the entire ancillary data field is taken up by data from the Anc data buffer568On encode, the encoder will insert the energy bytes before filling the remainder569of the ancillary data space with data from the ancillary data buffer.570*/571HPI_MPEG_ANC_RAW = 1572};573574/** Ancillary Data Alignment575\ingroup instream576*/577enum HPI_ISTREAM_MPEG_ANC_ALIGNS {578/** data is packed against the end of data, then padded to the end of frame */579HPI_MPEG_ANC_ALIGN_LEFT = 0,580/** data is packed against the end of the frame */581HPI_MPEG_ANC_ALIGN_RIGHT = 1582};583584/** MPEG modes585MPEG modes - can be used optionally for HPI_FormatCreate()586parameter dwAttributes.587588Using any mode setting other than HPI_MPEG_MODE_DEFAULT589with single channel format will return an error.590\ingroup stream591*/592enum HPI_MPEG_MODES {593/** Causes the MPEG-1 Layer II bitstream to be recorded594in single_channel mode when the number of channels is 1 and in stereo when the595number of channels is 2. */596HPI_MPEG_MODE_DEFAULT = 0,597/** Standard stereo without joint-stereo compression */598HPI_MPEG_MODE_STEREO = 1,599/** Joint stereo */600HPI_MPEG_MODE_JOINTSTEREO = 2,601/** Left and Right channels are completely independent */602HPI_MPEG_MODE_DUALCHANNEL = 3603};604/******************************************* MIXER ATTRIBUTES ****/605606/* \defgroup mixer_flags Mixer flags for HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES607{608*/609#define HPI_MIXER_GET_CONTROL_MULTIPLE_CHANGED (0)610#define HPI_MIXER_GET_CONTROL_MULTIPLE_RESET (1)611/*}*/612613/** Commands used by HPI_MixerStore()614\ingroup mixer615*/616enum HPI_MIXER_STORE_COMMAND {617/** Save all mixer control settings. */618HPI_MIXER_STORE_SAVE = 1,619/** Restore all controls from saved. */620HPI_MIXER_STORE_RESTORE = 2,621/** Delete saved control settings. */622HPI_MIXER_STORE_DELETE = 3,623/** Enable auto storage of some control settings. */624HPI_MIXER_STORE_ENABLE = 4,625/** Disable auto storage of some control settings. */626HPI_MIXER_STORE_DISABLE = 5,627/** Unimplemented - save the attributes of a single control. */628HPI_MIXER_STORE_SAVE_SINGLE = 6629};630631/****************************/632/* CONTROL ATTRIBUTE VALUES */633/****************************/634635/** Used by mixer plugin enable functions636637E.g. HPI_ParametricEq_SetState()638\ingroup mixer639*/640enum HPI_SWITCH_STATES {641HPI_SWITCH_OFF = 0, /**< turn the mixer plugin on. */642HPI_SWITCH_ON = 1 /**< turn the mixer plugin off. */643};644645/* Volume control special gain values */646647/** volumes units are 100ths of a dB648\ingroup volume649*/650#define HPI_UNITS_PER_dB 100651/** turns volume control OFF or MUTE652\ingroup volume653*/654#define HPI_GAIN_OFF (-100 * HPI_UNITS_PER_dB)655656/** channel mask specifying all channels657\ingroup volume658*/659#define HPI_BITMASK_ALL_CHANNELS (0xFFFFFFFF)660661/** value returned for no signal662\ingroup meter663*/664#define HPI_METER_MINIMUM (-150 * HPI_UNITS_PER_dB)665666/** autofade profiles667\ingroup volume668*/669enum HPI_VOLUME_AUTOFADES {670/** log fade - dB attenuation changes linearly over time */671HPI_VOLUME_AUTOFADE_LOG = 2,672/** linear fade - amplitude changes linearly */673HPI_VOLUME_AUTOFADE_LINEAR = 3674};675676/** The physical encoding format of the AESEBU I/O.677678Used in HPI_Aesebu_Transmitter_SetFormat(), HPI_Aesebu_Receiver_SetFormat()679along with related Get and Query functions680\ingroup aestx681*/682enum HPI_AESEBU_FORMATS {683/** AES/EBU physical format - AES/EBU balanced "professional" */684HPI_AESEBU_FORMAT_AESEBU = 1,685/** AES/EBU physical format - S/PDIF unbalanced "consumer" */686HPI_AESEBU_FORMAT_SPDIF = 2687};688689/** AES/EBU error status bits690691Returned by HPI_Aesebu_Receiver_GetErrorStatus()692\ingroup aesrx693*/694enum HPI_AESEBU_ERRORS {695/** bit0: 1 when PLL is not locked */696HPI_AESEBU_ERROR_NOT_LOCKED = 0x01,697/** bit1: 1 when signal quality is poor */698HPI_AESEBU_ERROR_POOR_QUALITY = 0x02,699/** bit2: 1 when there is a parity error */700HPI_AESEBU_ERROR_PARITY_ERROR = 0x04,701/** bit3: 1 when there is a bi-phase coding violation */702HPI_AESEBU_ERROR_BIPHASE_VIOLATION = 0x08,703/** bit4: 1 when the validity bit is high */704HPI_AESEBU_ERROR_VALIDITY = 0x10,705/** bit5: 1 when the CRC error bit is high */706HPI_AESEBU_ERROR_CRC = 0x20707};708709/** \addtogroup pad710\{711*/712/** The text string containing the station/channel combination. */713#define HPI_PAD_CHANNEL_NAME_LEN 16714/** The text string containing the artist. */715#define HPI_PAD_ARTIST_LEN 64716/** The text string containing the title. */717#define HPI_PAD_TITLE_LEN 64718/** The text string containing the comment. */719#define HPI_PAD_COMMENT_LEN 256720/** The PTY when the tuner has not received any PTY. */721#define HPI_PAD_PROGRAM_TYPE_INVALID 0xffff722/** \} */723724/** Data types for PTY string translation.725\ingroup rds726*/727enum eHPI_RDS_type {728HPI_RDS_DATATYPE_RDS = 0, /**< RDS bitstream.*/729HPI_RDS_DATATYPE_RBDS = 1 /**< RBDS bitstream.*/730};731732/** Tuner bands733734Used for HPI_Tuner_SetBand(),HPI_Tuner_GetBand()735\ingroup tuner736*/737enum HPI_TUNER_BAND {738HPI_TUNER_BAND_AM = 1, /**< AM band */739HPI_TUNER_BAND_FM = 2, /**< FM band (mono) */740HPI_TUNER_BAND_TV_NTSC_M = 3, /**< NTSC-M TV band*/741HPI_TUNER_BAND_TV = 3, /* use TV_NTSC_M */742HPI_TUNER_BAND_FM_STEREO = 4, /**< FM band (stereo) */743HPI_TUNER_BAND_AUX = 5, /**< auxiliary input */744HPI_TUNER_BAND_TV_PAL_BG = 6, /**< PAL-B/G TV band*/745HPI_TUNER_BAND_TV_PAL_I = 7, /**< PAL-I TV band*/746HPI_TUNER_BAND_TV_PAL_DK = 8, /**< PAL-D/K TV band*/747HPI_TUNER_BAND_TV_SECAM_L = 9, /**< SECAM-L TV band*/748HPI_TUNER_BAND_DAB = 10,749HPI_TUNER_BAND_LAST = 10 /**< the index of the last tuner band. */750};751752/** Tuner mode attributes753754Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()755\ingroup tuner756757*/758enum HPI_TUNER_MODES {759HPI_TUNER_MODE_RSS = 1, /**< control RSS */760HPI_TUNER_MODE_RDS = 2 /**< control RBDS/RDS */761};762763/** Tuner mode attribute values764765Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()766\ingroup tuner767*/768enum HPI_TUNER_MODE_VALUES {769/* RSS attribute values */770HPI_TUNER_MODE_RSS_DISABLE = 0, /**< RSS disable */771HPI_TUNER_MODE_RSS_ENABLE = 1, /**< RSS enable */772773/* RDS mode attributes */774HPI_TUNER_MODE_RDS_DISABLE = 0, /**< RDS - disabled */775HPI_TUNER_MODE_RDS_RDS = 1, /**< RDS - RDS mode */776HPI_TUNER_MODE_RDS_RBDS = 2 /**< RDS - RBDS mode */777};778779/** Tuner Status Bits780781These bitfield values are returned by a call to HPI_Tuner_GetStatus().782Multiple fields are returned from a single call.783\ingroup tuner784*/785enum HPI_TUNER_STATUS_BITS {786HPI_TUNER_VIDEO_COLOR_PRESENT = 0x0001, /**< video color is present. */787HPI_TUNER_VIDEO_IS_60HZ = 0x0020, /**< 60 hz video detected. */788HPI_TUNER_VIDEO_HORZ_SYNC_MISSING = 0x0040, /**< video HSYNC is missing. */789HPI_TUNER_VIDEO_STATUS_VALID = 0x0100, /**< video status is valid. */790HPI_TUNER_DIGITAL = 0x0200, /**< tuner reports digital programming. */791HPI_TUNER_MULTIPROGRAM = 0x0400, /**< tuner reports multiple programs. */792HPI_TUNER_PLL_LOCKED = 0x1000, /**< the tuner's PLL is locked. */793HPI_TUNER_FM_STEREO = 0x2000 /**< tuner reports back FM stereo. */794};795796/** Channel Modes797Used for HPI_ChannelModeSet/Get()798\ingroup channelmode799*/800enum HPI_CHANNEL_MODES {801/** Left channel out = left channel in, Right channel out = right channel in. */802HPI_CHANNEL_MODE_NORMAL = 1,803/** Left channel out = right channel in, Right channel out = left channel in. */804HPI_CHANNEL_MODE_SWAP = 2,805/** Left channel out = left channel in, Right channel out = left channel in. */806HPI_CHANNEL_MODE_LEFT_TO_STEREO = 3,807/** Left channel out = right channel in, Right channel out = right channel in.*/808HPI_CHANNEL_MODE_RIGHT_TO_STEREO = 4,809/** Left channel out = (left channel in + right channel in)/2,810Right channel out = mute. */811HPI_CHANNEL_MODE_STEREO_TO_LEFT = 5,812/** Left channel out = mute,813Right channel out = (right channel in + left channel in)/2. */814HPI_CHANNEL_MODE_STEREO_TO_RIGHT = 6,815HPI_CHANNEL_MODE_LAST = 6816};817818/** SampleClock source values819\ingroup sampleclock820*/821enum HPI_SAMPLECLOCK_SOURCES {822/** The sampleclock output is derived from its local samplerate generator.823The local samplerate may be set using HPI_SampleClock_SetLocalRate(). */824HPI_SAMPLECLOCK_SOURCE_LOCAL = 1,825/** The adapter is clocked from a dedicated AES/EBU SampleClock input.*/826HPI_SAMPLECLOCK_SOURCE_AESEBU_SYNC = 2,827/** From external wordclock connector */828HPI_SAMPLECLOCK_SOURCE_WORD = 3,829/** Board-to-board header */830HPI_SAMPLECLOCK_SOURCE_WORD_HEADER = 4,831/** FUTURE - SMPTE clock. */832HPI_SAMPLECLOCK_SOURCE_SMPTE = 5,833/** One of the aesebu inputs */834HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT = 6,835/** From a network interface e.g. Cobranet or Livewire at either 48 or 96kHz */836HPI_SAMPLECLOCK_SOURCE_NETWORK = 8,837/** From previous adjacent module (ASI2416 only)*/838HPI_SAMPLECLOCK_SOURCE_PREV_MODULE = 10,839/** Blu link sample clock*/840HPI_SAMPLECLOCK_SOURCE_BLULINK = 11,841/*! Update this if you add a new clock source.*/842HPI_SAMPLECLOCK_SOURCE_LAST = 11843};844845/** Equalizer filter types. Used by HPI_ParametricEq_SetBand()846\ingroup parmeq847*/848enum HPI_FILTER_TYPE {849HPI_FILTER_TYPE_BYPASS = 0, /**< filter is turned off */850851HPI_FILTER_TYPE_LOWSHELF = 1, /**< EQ low shelf */852HPI_FILTER_TYPE_HIGHSHELF = 2, /**< EQ high shelf */853HPI_FILTER_TYPE_EQ_BAND = 3, /**< EQ gain */854855HPI_FILTER_TYPE_LOWPASS = 4, /**< standard low pass */856HPI_FILTER_TYPE_HIGHPASS = 5, /**< standard high pass */857HPI_FILTER_TYPE_BANDPASS = 6, /**< standard band pass */858HPI_FILTER_TYPE_BANDSTOP = 7 /**< standard band stop/notch */859};860861/** Async Event sources862\ingroup async863*/864enum ASYNC_EVENT_SOURCES {865HPI_ASYNC_EVENT_GPIO = 1, /**< GPIO event. */866HPI_ASYNC_EVENT_SILENCE = 2, /**< silence event detected. */867HPI_ASYNC_EVENT_TONE = 3 /**< tone event detected. */868};869/*******************************************/870/** HPI Error codes871872Almost all HPI functions return an error code873A return value of zero means there was no error.874Otherwise one of these error codes is returned.875Error codes can be converted to a descriptive string using HPI_GetErrorText()876877\note When a new error code is added HPI_GetErrorText() MUST be updated.878\note Codes 1-100 are reserved for driver use879\ingroup utility880*/881enum HPI_ERROR_CODES {882/** Message type does not exist. */883HPI_ERROR_INVALID_TYPE = 100,884/** Object type does not exist. */885HPI_ERROR_INVALID_OBJ = 101,886/** Function does not exist. */887HPI_ERROR_INVALID_FUNC = 102,888/** The specified object does not exist. */889HPI_ERROR_INVALID_OBJ_INDEX = 103,890/** Trying to access an object that has not been opened yet. */891HPI_ERROR_OBJ_NOT_OPEN = 104,892/** Trying to open an already open object. */893HPI_ERROR_OBJ_ALREADY_OPEN = 105,894/** PCI, ISA resource not valid. */895HPI_ERROR_INVALID_RESOURCE = 106,896/* HPI_ERROR_SUBSYSFINDADAPTERS_GETINFO= 107 */897/** Default response was never updated with actual error code. */898HPI_ERROR_INVALID_RESPONSE = 108,899/** wSize field of response was not updated,900indicating that the message was not processed. */901HPI_ERROR_PROCESSING_MESSAGE = 109,902/** The network did not respond in a timely manner. */903HPI_ERROR_NETWORK_TIMEOUT = 110,904/* An HPI handle is invalid (uninitialised?). */905HPI_ERROR_INVALID_HANDLE = 111,906/** A function or attribute has not been implemented yet. */907HPI_ERROR_UNIMPLEMENTED = 112,908/** There are too many clients attempting909to access a network resource. */910HPI_ERROR_NETWORK_TOO_MANY_CLIENTS = 113,911/** Response buffer passed to HPI_Message912was smaller than returned response.913wSpecificError field of hpi response contains the required size.914*/915HPI_ERROR_RESPONSE_BUFFER_TOO_SMALL = 114,916/** The returned response did not match the sent message */917HPI_ERROR_RESPONSE_MISMATCH = 115,918/** A control setting that should have been cached was not. */919HPI_ERROR_CONTROL_CACHING = 116,920/** A message buffer in the path to the adapter was smaller921than the message size.922wSpecificError field of hpi response contains the actual size.923*/924HPI_ERROR_MESSAGE_BUFFER_TOO_SMALL = 117,925926/* HPI_ERROR_TOO_MANY_ADAPTERS= 200 */927/** Bad adpater. */928HPI_ERROR_BAD_ADAPTER = 201,929/** Adapter number out of range or not set properly. */930HPI_ERROR_BAD_ADAPTER_NUMBER = 202,931/** 2 adapters with the same adapter number. */932HPI_ERROR_DUPLICATE_ADAPTER_NUMBER = 203,933/** DSP code failed to bootload. Usually a DSP memory test failure. */934HPI_ERROR_DSP_BOOTLOAD = 204,935/** Couldn't find or open the DSP code file. */936HPI_ERROR_DSP_FILE_NOT_FOUND = 206,937/** Internal DSP hardware error. */938HPI_ERROR_DSP_HARDWARE = 207,939/** Could not allocate memory */940HPI_ERROR_MEMORY_ALLOC = 208,941/** Failed to correctly load/config PLD. (unused) */942HPI_ERROR_PLD_LOAD = 209,943/** Unexpected end of file, block length too big etc. */944HPI_ERROR_DSP_FILE_FORMAT = 210,945946/** Found but could not open DSP code file. */947HPI_ERROR_DSP_FILE_ACCESS_DENIED = 211,948/** First DSP code section header not found in DSP file. */949HPI_ERROR_DSP_FILE_NO_HEADER = 212,950/* HPI_ERROR_DSP_FILE_READ_ERROR= 213, */951/** DSP code for adapter family not found. */952HPI_ERROR_DSP_SECTION_NOT_FOUND = 214,953/** Other OS specific error opening DSP file. */954HPI_ERROR_DSP_FILE_OTHER_ERROR = 215,955/** Sharing violation opening DSP code file. */956HPI_ERROR_DSP_FILE_SHARING_VIOLATION = 216,957/** DSP code section header had size == 0. */958HPI_ERROR_DSP_FILE_NULL_HEADER = 217,959960/* HPI_ERROR_FLASH = 220, */961962/** Flash has bad checksum */963HPI_ERROR_BAD_CHECKSUM = 221,964HPI_ERROR_BAD_SEQUENCE = 222,965HPI_ERROR_FLASH_ERASE = 223,966HPI_ERROR_FLASH_PROGRAM = 224,967HPI_ERROR_FLASH_VERIFY = 225,968HPI_ERROR_FLASH_TYPE = 226,969HPI_ERROR_FLASH_START = 227,970HPI_ERROR_FLASH_READ = 228,971HPI_ERROR_FLASH_READ_NO_FILE = 229,972HPI_ERROR_FLASH_SIZE = 230,973974/** Reserved for OEMs. */975HPI_ERROR_RESERVED_1 = 290,976977/* HPI_ERROR_INVALID_STREAM = 300 use HPI_ERROR_INVALID_OBJ_INDEX */978/** Invalid compression format. */979HPI_ERROR_INVALID_FORMAT = 301,980/** Invalid format samplerate */981HPI_ERROR_INVALID_SAMPLERATE = 302,982/** Invalid format number of channels. */983HPI_ERROR_INVALID_CHANNELS = 303,984/** Invalid format bitrate. */985HPI_ERROR_INVALID_BITRATE = 304,986/** Invalid datasize used for stream read/write. */987HPI_ERROR_INVALID_DATASIZE = 305,988/* HPI_ERROR_BUFFER_FULL = 306 use HPI_ERROR_INVALID_DATASIZE */989/* HPI_ERROR_BUFFER_EMPTY = 307 use HPI_ERROR_INVALID_DATASIZE */990/** Null data pointer used for stream read/write. */991HPI_ERROR_INVALID_DATA_POINTER = 308,992/** Packet ordering error for stream read/write. */993HPI_ERROR_INVALID_PACKET_ORDER = 309,994995/** Object can't do requested operation in its current996state, eg set format, change rec mux state while recording.*/997HPI_ERROR_INVALID_OPERATION = 310,998999/** Where a SRG is shared amongst streams, an incompatible samplerate1000is one that is different to any currently active stream. */1001HPI_ERROR_INCOMPATIBLE_SAMPLERATE = 311,1002/** Adapter mode is illegal.*/1003HPI_ERROR_BAD_ADAPTER_MODE = 312,10041005/** There have been too many attempts to set the adapter's1006capabilities (using bad keys), the card should be returned1007to ASI if further capabilities updates are required */1008HPI_ERROR_TOO_MANY_CAPABILITY_CHANGE_ATTEMPTS = 313,1009/** Streams on different adapters cannot be grouped. */1010HPI_ERROR_NO_INTERADAPTER_GROUPS = 314,1011/** Streams on different DSPs cannot be grouped. */1012HPI_ERROR_NO_INTERDSP_GROUPS = 315,1013/** Stream wait cancelled before threshold reached. */1014HPI_ERROR_WAIT_CANCELLED = 316,1015/** A character string is invalid. */1016HPI_ERROR_INVALID_STRING = 317,10171018/** Invalid mixer node for this adapter. */1019HPI_ERROR_INVALID_NODE = 400,1020/** Invalid control. */1021HPI_ERROR_INVALID_CONTROL = 401,1022/** Invalid control value was passed. */1023HPI_ERROR_INVALID_CONTROL_VALUE = 402,1024/** Control attribute not supported by this control. */1025HPI_ERROR_INVALID_CONTROL_ATTRIBUTE = 403,1026/** Control is disabled. */1027HPI_ERROR_CONTROL_DISABLED = 404,1028/** I2C transaction failed due to a missing ACK. */1029HPI_ERROR_CONTROL_I2C_MISSING_ACK = 405,1030HPI_ERROR_I2C_MISSING_ACK = 405,1031/** Control is busy, or coming out of1032reset and cannot be accessed at this time. */1033HPI_ERROR_CONTROL_NOT_READY = 407,10341035/** Non volatile memory */1036HPI_ERROR_NVMEM_BUSY = 450,1037HPI_ERROR_NVMEM_FULL = 451,1038HPI_ERROR_NVMEM_FAIL = 452,10391040/** I2C */1041HPI_ERROR_I2C_BAD_ADR = 460,10421043/** Entity type did not match requested type */1044HPI_ERROR_ENTITY_TYPE_MISMATCH = 470,1045/** Entity item count did not match requested count */1046HPI_ERROR_ENTITY_ITEM_COUNT = 471,1047/** Entity type is not one of the valid types */1048HPI_ERROR_ENTITY_TYPE_INVALID = 472,1049/** Entity role is not one of the valid roles */1050HPI_ERROR_ENTITY_ROLE_INVALID = 473,1051/** Entity size doesn't match target size */1052HPI_ERROR_ENTITY_SIZE_MISMATCH = 474,10531054/* AES18 specific errors were 500..507 */10551056/** custom error to use for debugging */1057HPI_ERROR_CUSTOM = 600,10581059/** hpioct32.c can't obtain mutex */1060HPI_ERROR_MUTEX_TIMEOUT = 700,10611062/** Backend errors used to be greater than this.1063\deprecated Now, all backends return only errors defined here in hpi.h1064*/1065HPI_ERROR_BACKEND_BASE = 900,10661067/** Communication with DSP failed */1068HPI_ERROR_DSP_COMMUNICATION = 9001069/* Note that the dsp communication error is set to this value so that1070it remains compatible with any software that expects such errors1071to be backend errors i.e. >= 900.1072Do not define any new error codes with values > 900.1073*/1074};10751076/** \defgroup maximums HPI maximum values1077\{1078*/1079/** Maximum number of PCI HPI adapters */1080#define HPI_MAX_ADAPTERS 201081/** Maximum number of in or out streams per adapter */1082#define HPI_MAX_STREAMS 161083#define HPI_MAX_CHANNELS 2 /* per stream */1084#define HPI_MAX_NODES 8 /* per mixer ? */1085#define HPI_MAX_CONTROLS 4 /* per node ? */1086/** maximum number of ancillary bytes per MPEG frame */1087#define HPI_MAX_ANC_BYTES_PER_FRAME (64)1088#define HPI_STRING_LEN 1610891090/** Networked adapters have index >= 100 */1091#define HPI_MIN_NETWORK_ADAPTER_IDX 10010921093/** Velocity units */1094#define HPI_OSTREAM_VELOCITY_UNITS 40961095/** OutStream timescale units */1096#define HPI_OSTREAM_TIMESCALE_UNITS 100001097/** OutStream timescale passthrough - turns timescaling on in passthough mode */1098#define HPI_OSTREAM_TIMESCALE_PASSTHROUGH 9999910991100/**\}*/11011102/**************/1103/* STRUCTURES */1104#ifndef DISABLE_PRAGMA_PACK11105#pragma pack(push, 1)1106#endif11071108/** Structure containing sample format information.1109See also HPI_FormatCreate().1110*/1111struct hpi_format {1112u32 sample_rate;1113/**< 11025, 32000, 44100 ... */1114u32 bit_rate; /**< for MPEG */1115u32 attributes;1116/**< Stereo/JointStereo/Mono */1117u16 mode_legacy;1118/**< Legacy ancillary mode or idle bit */1119u16 unused; /**< Unused */1120u16 channels; /**< 1,2..., (or ancillary mode or idle bit */1121u16 format; /**< HPI_FORMAT_PCM16, _MPEG etc. see #HPI_FORMATS. */1122};11231124struct hpi_anc_frame {1125u32 valid_bits_in_this_frame;1126u8 b_data[HPI_MAX_ANC_BYTES_PER_FRAME];1127};11281129/** An object for containing a single async event.1130*/1131struct hpi_async_event {1132u16 event_type; /**< type of event. \sa async_event */1133u16 sequence; /**< Sequence number, allows lost event detection */1134u32 state; /**< New state */1135u32 h_object; /**< handle to the object returning the event. */1136union {1137struct {1138u16 index; /**< GPIO bit index. */1139} gpio;1140struct {1141u16 node_index; /**< what node is the control on ? */1142u16 node_type; /**< what type of node is the control on ? */1143} control;1144} u;1145};11461147#ifndef DISABLE_PRAGMA_PACK11148#pragma pack(pop)1149#endif11501151/*****************/1152/* HPI FUNCTIONS */1153/*****************/11541155/* Stream */1156u16 hpi_stream_estimate_buffer_size(struct hpi_format *pF,1157u32 host_polling_rate_in_milli_seconds, u32 *recommended_buffer_size);11581159/*************/1160/* SubSystem */1161/*************/11621163u16 hpi_subsys_get_version_ex(u32 *pversion_ex);11641165u16 hpi_subsys_get_num_adapters(int *pn_num_adapters);11661167u16 hpi_subsys_get_adapter(int iterator, u32 *padapter_index,1168u16 *pw_adapter_type);11691170/***********/1171/* Adapter */1172/***********/11731174u16 hpi_adapter_open(u16 adapter_index);11751176u16 hpi_adapter_close(u16 adapter_index);11771178u16 hpi_adapter_get_info(u16 adapter_index, u16 *pw_num_outstreams,1179u16 *pw_num_instreams, u16 *pw_version, u32 *pserial_number,1180u16 *pw_adapter_type);11811182u16 hpi_adapter_get_module_by_index(u16 adapter_index, u16 module_index,1183u16 *pw_num_outputs, u16 *pw_num_inputs, u16 *pw_version,1184u32 *pserial_number, u16 *pw_module_type, u32 *ph_module);11851186u16 hpi_adapter_set_mode(u16 adapter_index, u32 adapter_mode);11871188u16 hpi_adapter_set_mode_ex(u16 adapter_index, u32 adapter_mode,1189u16 query_or_set);11901191u16 hpi_adapter_get_mode(u16 adapter_index, u32 *padapter_mode);11921193u16 hpi_adapter_set_property(u16 adapter_index, u16 property, u16 paramter1,1194u16 paramter2);11951196u16 hpi_adapter_get_property(u16 adapter_index, u16 property,1197u16 *pw_paramter1, u16 *pw_paramter2);11981199u16 hpi_adapter_enumerate_property(u16 adapter_index, u16 index,1200u16 what_to_enumerate, u16 property_index, u32 *psetting);1201/*************/1202/* OutStream */1203/*************/1204u16 hpi_outstream_open(u16 adapter_index, u16 outstream_index,1205u32 *ph_outstream);12061207u16 hpi_outstream_close(u32 h_outstream);12081209u16 hpi_outstream_get_info_ex(u32 h_outstream, u16 *pw_state,1210u32 *pbuffer_size, u32 *pdata_to_play, u32 *psamples_played,1211u32 *pauxiliary_data_to_play);12121213u16 hpi_outstream_write_buf(u32 h_outstream, const u8 *pb_write_buf,1214u32 bytes_to_write, const struct hpi_format *p_format);12151216u16 hpi_outstream_start(u32 h_outstream);12171218u16 hpi_outstream_wait_start(u32 h_outstream);12191220u16 hpi_outstream_stop(u32 h_outstream);12211222u16 hpi_outstream_sinegen(u32 h_outstream);12231224u16 hpi_outstream_reset(u32 h_outstream);12251226u16 hpi_outstream_query_format(u32 h_outstream, struct hpi_format *p_format);12271228u16 hpi_outstream_set_format(u32 h_outstream, struct hpi_format *p_format);12291230u16 hpi_outstream_set_punch_in_out(u32 h_outstream, u32 punch_in_sample,1231u32 punch_out_sample);12321233u16 hpi_outstream_set_velocity(u32 h_outstream, short velocity);12341235u16 hpi_outstream_ancillary_reset(u32 h_outstream, u16 mode);12361237u16 hpi_outstream_ancillary_get_info(u32 h_outstream, u32 *pframes_available);12381239u16 hpi_outstream_ancillary_read(u32 h_outstream,1240struct hpi_anc_frame *p_anc_frame_buffer,1241u32 anc_frame_buffer_size_in_bytes,1242u32 number_of_ancillary_frames_to_read);12431244u16 hpi_outstream_set_time_scale(u32 h_outstream, u32 time_scaleX10000);12451246u16 hpi_outstream_host_buffer_allocate(u32 h_outstream, u32 size_in_bytes);12471248u16 hpi_outstream_host_buffer_free(u32 h_outstream);12491250u16 hpi_outstream_group_add(u32 h_outstream, u32 h_stream);12511252u16 hpi_outstream_group_get_map(u32 h_outstream, u32 *poutstream_map,1253u32 *pinstream_map);12541255u16 hpi_outstream_group_reset(u32 h_outstream);12561257/************/1258/* InStream */1259/************/1260u16 hpi_instream_open(u16 adapter_index, u16 instream_index,1261u32 *ph_instream);12621263u16 hpi_instream_close(u32 h_instream);12641265u16 hpi_instream_query_format(u32 h_instream,1266const struct hpi_format *p_format);12671268u16 hpi_instream_set_format(u32 h_instream,1269const struct hpi_format *p_format);12701271u16 hpi_instream_read_buf(u32 h_instream, u8 *pb_read_buf, u32 bytes_to_read);12721273u16 hpi_instream_start(u32 h_instream);12741275u16 hpi_instream_wait_start(u32 h_instream);12761277u16 hpi_instream_stop(u32 h_instream);12781279u16 hpi_instream_reset(u32 h_instream);12801281u16 hpi_instream_get_info_ex(u32 h_instream, u16 *pw_state, u32 *pbuffer_size,1282u32 *pdata_recorded, u32 *psamples_recorded,1283u32 *pauxiliary_data_recorded);12841285u16 hpi_instream_ancillary_reset(u32 h_instream, u16 bytes_per_frame,1286u16 mode, u16 alignment, u16 idle_bit);12871288u16 hpi_instream_ancillary_get_info(u32 h_instream, u32 *pframe_space);12891290u16 hpi_instream_ancillary_write(u32 h_instream,1291const struct hpi_anc_frame *p_anc_frame_buffer,1292u32 anc_frame_buffer_size_in_bytes,1293u32 number_of_ancillary_frames_to_write);12941295u16 hpi_instream_host_buffer_allocate(u32 h_instream, u32 size_in_bytes);12961297u16 hpi_instream_host_buffer_free(u32 h_instream);12981299u16 hpi_instream_group_add(u32 h_instream, u32 h_stream);13001301u16 hpi_instream_group_get_map(u32 h_instream, u32 *poutstream_map,1302u32 *pinstream_map);13031304u16 hpi_instream_group_reset(u32 h_instream);13051306/*********/1307/* Mixer */1308/*********/1309u16 hpi_mixer_open(u16 adapter_index, u32 *ph_mixer);13101311u16 hpi_mixer_close(u32 h_mixer);13121313u16 hpi_mixer_get_control(u32 h_mixer, u16 src_node_type,1314u16 src_node_type_index, u16 dst_node_type, u16 dst_node_type_index,1315u16 control_type, u32 *ph_control);13161317u16 hpi_mixer_get_control_by_index(u32 h_mixer, u16 control_index,1318u16 *pw_src_node_type, u16 *pw_src_node_index, u16 *pw_dst_node_type,1319u16 *pw_dst_node_index, u16 *pw_control_type, u32 *ph_control);13201321u16 hpi_mixer_store(u32 h_mixer, enum HPI_MIXER_STORE_COMMAND command,1322u16 index);1323/************/1324/* Controls */1325/************/1326/******************/1327/* Volume control */1328/******************/1329u16 hpi_volume_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]1330);13311332u16 hpi_volume_get_gain(u32 h_control,1333short an_gain0_01dB_out[HPI_MAX_CHANNELS]1334);13351336u16 hpi_volume_set_mute(u32 h_control, u32 mute);13371338u16 hpi_volume_get_mute(u32 h_control, u32 *mute);13391340#define hpi_volume_get_range hpi_volume_query_range1341u16 hpi_volume_query_range(u32 h_control, short *min_gain_01dB,1342short *max_gain_01dB, short *step_gain_01dB);13431344u16 hpi_volume_query_channels(const u32 h_control, u32 *p_channels);13451346u16 hpi_volume_auto_fade(u32 h_control,1347short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms);13481349u16 hpi_volume_auto_fade_profile(u32 h_control,1350short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms,1351u16 profile);13521353u16 hpi_volume_query_auto_fade_profile(const u32 h_control, const u32 i,1354u16 *profile);13551356/*****************/1357/* Level control */1358/*****************/1359u16 hpi_level_query_range(u32 h_control, short *min_gain_01dB,1360short *max_gain_01dB, short *step_gain_01dB);13611362u16 hpi_level_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]1363);13641365u16 hpi_level_get_gain(u32 h_control,1366short an_gain0_01dB_out[HPI_MAX_CHANNELS]1367);13681369/*****************/1370/* Meter control */1371/*****************/1372u16 hpi_meter_query_channels(const u32 h_meter, u32 *p_channels);13731374u16 hpi_meter_get_peak(u32 h_control,1375short an_peak0_01dB_out[HPI_MAX_CHANNELS]1376);13771378u16 hpi_meter_get_rms(u32 h_control, short an_peak0_01dB_out[HPI_MAX_CHANNELS]1379);13801381u16 hpi_meter_set_peak_ballistics(u32 h_control, u16 attack, u16 decay);13821383u16 hpi_meter_set_rms_ballistics(u32 h_control, u16 attack, u16 decay);13841385u16 hpi_meter_get_peak_ballistics(u32 h_control, u16 *attack, u16 *decay);13861387u16 hpi_meter_get_rms_ballistics(u32 h_control, u16 *attack, u16 *decay);13881389/************************/1390/* ChannelMode control */1391/************************/1392u16 hpi_channel_mode_query_mode(const u32 h_mode, const u32 index,1393u16 *pw_mode);13941395u16 hpi_channel_mode_set(u32 h_control, u16 mode);13961397u16 hpi_channel_mode_get(u32 h_control, u16 *mode);13981399/*****************/1400/* Tuner control */1401/*****************/1402u16 hpi_tuner_query_band(const u32 h_tuner, const u32 index, u16 *pw_band);14031404u16 hpi_tuner_set_band(u32 h_control, u16 band);14051406u16 hpi_tuner_get_band(u32 h_control, u16 *pw_band);14071408u16 hpi_tuner_query_frequency(const u32 h_tuner, const u32 index,1409const u16 band, u32 *pfreq);14101411u16 hpi_tuner_set_frequency(u32 h_control, u32 freq_ink_hz);14121413u16 hpi_tuner_get_frequency(u32 h_control, u32 *pw_freq_ink_hz);14141415u16 hpi_tuner_get_rf_level(u32 h_control, short *pw_level);14161417u16 hpi_tuner_get_raw_rf_level(u32 h_control, short *pw_level);14181419u16 hpi_tuner_query_gain(const u32 h_tuner, const u32 index, u16 *pw_gain);14201421u16 hpi_tuner_set_gain(u32 h_control, short gain);14221423u16 hpi_tuner_get_gain(u32 h_control, short *pn_gain);14241425u16 hpi_tuner_get_status(u32 h_control, u16 *pw_status_mask, u16 *pw_status);14261427u16 hpi_tuner_set_mode(u32 h_control, u32 mode, u32 value);14281429u16 hpi_tuner_get_mode(u32 h_control, u32 mode, u32 *pn_value);14301431u16 hpi_tuner_get_rds(u32 h_control, char *p_rds_data);14321433u16 hpi_tuner_query_deemphasis(const u32 h_tuner, const u32 index,1434const u16 band, u32 *pdeemphasis);14351436u16 hpi_tuner_set_deemphasis(u32 h_control, u32 deemphasis);1437u16 hpi_tuner_get_deemphasis(u32 h_control, u32 *pdeemphasis);14381439u16 hpi_tuner_query_program(const u32 h_tuner, u32 *pbitmap_program);14401441u16 hpi_tuner_set_program(u32 h_control, u32 program);14421443u16 hpi_tuner_get_program(u32 h_control, u32 *pprogram);14441445u16 hpi_tuner_get_hd_radio_dsp_version(u32 h_control, char *psz_dsp_version,1446const u32 string_size);14471448u16 hpi_tuner_get_hd_radio_sdk_version(u32 h_control, char *psz_sdk_version,1449const u32 string_size);14501451u16 hpi_tuner_get_hd_radio_signal_quality(u32 h_control, u32 *pquality);14521453u16 hpi_tuner_get_hd_radio_signal_blend(u32 h_control, u32 *pblend);14541455u16 hpi_tuner_set_hd_radio_signal_blend(u32 h_control, const u32 blend);14561457/***************/1458/* PAD control */1459/***************/14601461u16 hpi_pad_get_channel_name(u32 h_control, char *psz_string,1462const u32 string_length);14631464u16 hpi_pad_get_artist(u32 h_control, char *psz_string,1465const u32 string_length);14661467u16 hpi_pad_get_title(u32 h_control, char *psz_string,1468const u32 string_length);14691470u16 hpi_pad_get_comment(u32 h_control, char *psz_string,1471const u32 string_length);14721473u16 hpi_pad_get_program_type(u32 h_control, u32 *ppTY);14741475u16 hpi_pad_get_rdsPI(u32 h_control, u32 *ppI);14761477/****************************/1478/* AES/EBU Receiver control */1479/****************************/1480u16 hpi_aesebu_receiver_query_format(const u32 h_aes_rx, const u32 index,1481u16 *pw_format);14821483u16 hpi_aesebu_receiver_set_format(u32 h_control, u16 source);14841485u16 hpi_aesebu_receiver_get_format(u32 h_control, u16 *pw_source);14861487u16 hpi_aesebu_receiver_get_sample_rate(u32 h_control, u32 *psample_rate);14881489u16 hpi_aesebu_receiver_get_user_data(u32 h_control, u16 index, u16 *pw_data);14901491u16 hpi_aesebu_receiver_get_channel_status(u32 h_control, u16 index,1492u16 *pw_data);14931494u16 hpi_aesebu_receiver_get_error_status(u32 h_control, u16 *pw_error_data);14951496/*******************************/1497/* AES/EBU Transmitter control */1498/*******************************/1499u16 hpi_aesebu_transmitter_set_sample_rate(u32 h_control, u32 sample_rate);15001501u16 hpi_aesebu_transmitter_set_user_data(u32 h_control, u16 index, u16 data);15021503u16 hpi_aesebu_transmitter_set_channel_status(u32 h_control, u16 index,1504u16 data);15051506u16 hpi_aesebu_transmitter_get_channel_status(u32 h_control, u16 index,1507u16 *pw_data);15081509u16 hpi_aesebu_transmitter_query_format(const u32 h_aes_tx, const u32 index,1510u16 *pw_format);15111512u16 hpi_aesebu_transmitter_set_format(u32 h_control, u16 output_format);15131514u16 hpi_aesebu_transmitter_get_format(u32 h_control, u16 *pw_output_format);15151516/***********************/1517/* Multiplexer control */1518/***********************/1519u16 hpi_multiplexer_set_source(u32 h_control, u16 source_node_type,1520u16 source_node_index);15211522u16 hpi_multiplexer_get_source(u32 h_control, u16 *source_node_type,1523u16 *source_node_index);15241525u16 hpi_multiplexer_query_source(u32 h_control, u16 index,1526u16 *source_node_type, u16 *source_node_index);15271528/***************/1529/* Vox control */1530/***************/1531u16 hpi_vox_set_threshold(u32 h_control, short an_gain0_01dB);15321533u16 hpi_vox_get_threshold(u32 h_control, short *an_gain0_01dB);15341535/*********************/1536/* Bitstream control */1537/*********************/1538u16 hpi_bitstream_set_clock_edge(u32 h_control, u16 edge_type);15391540u16 hpi_bitstream_set_data_polarity(u32 h_control, u16 polarity);15411542u16 hpi_bitstream_get_activity(u32 h_control, u16 *pw_clk_activity,1543u16 *pw_data_activity);15441545/***********************/1546/* SampleClock control */1547/***********************/15481549u16 hpi_sample_clock_query_source(const u32 h_clock, const u32 index,1550u16 *pw_source);15511552u16 hpi_sample_clock_set_source(u32 h_control, u16 source);15531554u16 hpi_sample_clock_get_source(u32 h_control, u16 *pw_source);15551556u16 hpi_sample_clock_query_source_index(const u32 h_clock, const u32 index,1557const u32 source, u16 *pw_source_index);15581559u16 hpi_sample_clock_set_source_index(u32 h_control, u16 source_index);15601561u16 hpi_sample_clock_get_source_index(u32 h_control, u16 *pw_source_index);15621563u16 hpi_sample_clock_get_sample_rate(u32 h_control, u32 *psample_rate);15641565u16 hpi_sample_clock_query_local_rate(const u32 h_clock, const u32 index,1566u32 *psource);15671568u16 hpi_sample_clock_set_local_rate(u32 h_control, u32 sample_rate);15691570u16 hpi_sample_clock_get_local_rate(u32 h_control, u32 *psample_rate);15711572u16 hpi_sample_clock_set_auto(u32 h_control, u32 enable);15731574u16 hpi_sample_clock_get_auto(u32 h_control, u32 *penable);15751576u16 hpi_sample_clock_set_local_rate_lock(u32 h_control, u32 lock);15771578u16 hpi_sample_clock_get_local_rate_lock(u32 h_control, u32 *plock);15791580/***********************/1581/* Microphone control */1582/***********************/1583u16 hpi_microphone_set_phantom_power(u32 h_control, u16 on_off);15841585u16 hpi_microphone_get_phantom_power(u32 h_control, u16 *pw_on_off);15861587/********************************/1588/* Parametric Equalizer control */1589/********************************/1590u16 hpi_parametric_eq_get_info(u32 h_control, u16 *pw_number_of_bands,1591u16 *pw_enabled);15921593u16 hpi_parametric_eq_set_state(u32 h_control, u16 on_off);15941595u16 hpi_parametric_eq_set_band(u32 h_control, u16 index, u16 type,1596u32 frequency_hz, short q100, short gain0_01dB);15971598u16 hpi_parametric_eq_get_band(u32 h_control, u16 index, u16 *pn_type,1599u32 *pfrequency_hz, short *pnQ100, short *pn_gain0_01dB);16001601u16 hpi_parametric_eq_get_coeffs(u32 h_control, u16 index, short coeffs[5]1602);16031604/*******************************/1605/* Compressor Expander control */1606/*******************************/16071608u16 hpi_compander_set_enable(u32 h_control, u32 on);16091610u16 hpi_compander_get_enable(u32 h_control, u32 *pon);16111612u16 hpi_compander_set_makeup_gain(u32 h_control, short makeup_gain0_01dB);16131614u16 hpi_compander_get_makeup_gain(u32 h_control, short *pn_makeup_gain0_01dB);16151616u16 hpi_compander_set_attack_time_constant(u32 h_control, u32 index,1617u32 attack);16181619u16 hpi_compander_get_attack_time_constant(u32 h_control, u32 index,1620u32 *pw_attack);16211622u16 hpi_compander_set_decay_time_constant(u32 h_control, u32 index,1623u32 decay);16241625u16 hpi_compander_get_decay_time_constant(u32 h_control, u32 index,1626u32 *pw_decay);16271628u16 hpi_compander_set_threshold(u32 h_control, u32 index,1629short threshold0_01dB);16301631u16 hpi_compander_get_threshold(u32 h_control, u32 index,1632short *pn_threshold0_01dB);16331634u16 hpi_compander_set_ratio(u32 h_control, u32 index, u32 ratio100);16351636u16 hpi_compander_get_ratio(u32 h_control, u32 index, u32 *pw_ratio100);16371638/********************/1639/* Cobranet control */1640/********************/1641u16 hpi_cobranet_hmi_write(u32 h_control, u32 hmi_address, u32 byte_count,1642u8 *pb_data);16431644u16 hpi_cobranet_hmi_read(u32 h_control, u32 hmi_address, u32 max_byte_count,1645u32 *pbyte_count, u8 *pb_data);16461647u16 hpi_cobranet_hmi_get_status(u32 h_control, u32 *pstatus,1648u32 *preadable_size, u32 *pwriteable_size);16491650u16 hpi_cobranet_get_ip_address(u32 h_control, u32 *pdw_ip_address);16511652u16 hpi_cobranet_set_ip_address(u32 h_control, u32 dw_ip_address);16531654u16 hpi_cobranet_get_static_ip_address(u32 h_control, u32 *pdw_ip_address);16551656u16 hpi_cobranet_set_static_ip_address(u32 h_control, u32 dw_ip_address);16571658u16 hpi_cobranet_get_macaddress(u32 h_control, u32 *p_mac_msbs,1659u32 *p_mac_lsbs);16601661/*************************/1662/* Tone Detector control */1663/*************************/1664u16 hpi_tone_detector_get_state(u32 hC, u32 *state);16651666u16 hpi_tone_detector_set_enable(u32 hC, u32 enable);16671668u16 hpi_tone_detector_get_enable(u32 hC, u32 *enable);16691670u16 hpi_tone_detector_set_event_enable(u32 hC, u32 event_enable);16711672u16 hpi_tone_detector_get_event_enable(u32 hC, u32 *event_enable);16731674u16 hpi_tone_detector_set_threshold(u32 hC, int threshold);16751676u16 hpi_tone_detector_get_threshold(u32 hC, int *threshold);16771678u16 hpi_tone_detector_get_frequency(u32 hC, u32 index, u32 *frequency);16791680/****************************/1681/* Silence Detector control */1682/****************************/1683u16 hpi_silence_detector_get_state(u32 hC, u32 *state);16841685u16 hpi_silence_detector_set_enable(u32 hC, u32 enable);16861687u16 hpi_silence_detector_get_enable(u32 hC, u32 *enable);16881689u16 hpi_silence_detector_set_event_enable(u32 hC, u32 event_enable);16901691u16 hpi_silence_detector_get_event_enable(u32 hC, u32 *event_enable);16921693u16 hpi_silence_detector_set_delay(u32 hC, u32 delay);16941695u16 hpi_silence_detector_get_delay(u32 hC, u32 *delay);16961697u16 hpi_silence_detector_set_threshold(u32 hC, int threshold);16981699u16 hpi_silence_detector_get_threshold(u32 hC, int *threshold);1700/*********************/1701/* Utility functions */1702/*********************/17031704u16 hpi_format_create(struct hpi_format *p_format, u16 channels, u16 format,1705u32 sample_rate, u32 bit_rate, u32 attributes);17061707#endif /*_HPI_H_ */170817091710