source: svn/trunk/newcon3bcm2_21bu/magnum/portinginterface/ape/7552/bape_output.h

Last change on this file was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 26.1 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2006-2011, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile: bape_output.h $
11 * $brcm_Revision: Hydra_Software_Devel/11 $
12 * $brcm_Date: 7/8/11 6:38p $
13 *
14 * Module Description: Audio Decoder Interface
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /magnum/portinginterface/ape/7422/bape_output.h $
19 *
20 * Hydra_Software_Devel/11   7/8/11 6:38p jgarrett
21 * SWDTV-6760: Adding I2sMultiOutput
22 *
23 * Hydra_Software_Devel/10   5/3/11 6:58p gskerl
24 * SW7422-354: First attempt at adding support for the audio return
25 * channel
26 *
27 * Hydra_Software_Devel/9   3/25/11 12:41p gskerl
28 * SW7422-375: Removed peakA1 and peakA2 from DAC settings
29 *
30 * Hydra_Software_Devel/8   3/22/11 5:02p gskerl
31 * SW7422-375: Added settings to BAPE_DacSettings for DAC peaking filter
32 * coefficients
33 *
34 * Hydra_Software_Devel/7   3/21/11 7:08p jgarrett
35 * SW7422-356: Adding MuxOutput
36 *
37 * Hydra_Software_Devel/6   2/22/11 5:43p jgarrett
38 * SW7422-146: Implemented type renaming based on filter graph review
39 * comments
40 *
41 * Hydra_Software_Devel/5   1/31/11 6:48p gskerl
42 * SW7422-146:Removed mclkRate from BAPE_SpdifOutputSettings,
43 * BAPE_MaiOutputSettings, and BAPE_I2sOutputSettings structs.
44 *
45 * Hydra_Software_Devel/4   1/18/11 5:08p gskerl
46 * SW7422-146:Adding mclkRate to BAPE_SpdifOutputSettings,
47 * BAPE_MaiOutputSettings, and BAPE_I2sOutputSettings structs.
48 *
49 * Hydra_Software_Devel/3   12/16/10 4:04p jgarrett
50 * SW7422-146: Initial compilable APE for 7422
51 *
52 * Hydra_Software_Devel/2   12/14/10 2:39p jgarrett
53 * SW7422-146: Renaming MixerOutput to OutputPort
54 *
55 * Hydra_Software_Devel/1   12/14/10 2:16p jgarrett
56 * SW7422-146: Adding initial API for APE/DSP
57 *
58 ***************************************************************************/
59
60#ifndef BAPE_OUTPUT_H_
61#define BAPE_OUTPUT_H_
62
63/***************************************************************************
64Summary:
65Audio DAC Handle
66***************************************************************************/
67typedef struct BAPE_Dac *BAPE_DacHandle;
68
69/***************************************************************************
70Summary:
71Audio DAC Mute Modes
72***************************************************************************/
73typedef enum BAPE_DacMuteType
74{
75    BAPE_DacMuteType_eDrive0,
76    BAPE_DacMuteType_eDriveNegative1,
77    BAPE_DacMuteType_eCustom,
78    BAPE_DacMuteType_eMax
79} BAPE_DacMuteType;
80
81/***************************************************************************
82Summary:
83Audio DAC Settings
84***************************************************************************/
85typedef struct BAPE_DacSettings
86{
87    BAPE_StereoMode stereoMode;         /* Mode to handle stereo mixer ouptut */
88    BAPE_DacMuteType muteType;          /* Mute mode. */
89    uint16_t customLeftValue;           /* 16-bit left sample, used only with custom mute type */
90    uint16_t customRightValue;          /* 16-bit right sample, used only with custom mute type */
91    uint32_t peakGain;                  /* PEAK_GAIN - Peaking filter gain          */
92    struct
93    {
94        bool enabled;           /* If true, test tone output is enabled with the settings below.  If false, the tone output is disabled. */
95        int32_t samples[64];    /* Test tone samples.  The samples are 20-bit signed data. */
96        bool zeroOnLeft;        /* If true, the left channel will output zeroes */
97        bool zeroOnRight;       /* If true, the right channel will output zeroes */
98        bool sharedSamples;     /* If true (default), samples 0..63 will be output on both Left and Right.
99                                   If false, samples 0..31 will output on Left and 32..63 on Right. */
100        unsigned numSamplesLeft;            /* Number of samples to play on the left channel before repeating (1..64) */
101        unsigned numSamplesRight;           /* Number of samples to play on the right channel before repeating (1..64) */
102        unsigned sampleRate;                /* Sampling frequency of the samples */
103    } testTone;
104} BAPE_DacSettings;
105
106/***************************************************************************
107Summary:
108Get Default Audio DAC Settings
109***************************************************************************/
110void BAPE_Dac_GetDefaultSettings(
111    BAPE_DacSettings *pSettings
112    );
113
114/***************************************************************************
115Summary:
116Open an audio DAC
117***************************************************************************/
118BERR_Code BAPE_Dac_Open(
119    BAPE_Handle deviceHandle,
120    unsigned index,
121    const BAPE_DacSettings *pSettings,
122    BAPE_DacHandle *pHandle             /* [out] */
123    );
124
125/***************************************************************************
126Summary:
127Close an audio DAC
128***************************************************************************/
129void BAPE_Dac_Close(
130    BAPE_DacHandle handle
131    );
132
133/***************************************************************************
134Summary:
135Get DAC Settings
136***************************************************************************/
137void BAPE_Dac_GetSettings(
138    BAPE_DacHandle handle,
139    BAPE_DacSettings *pSettings     /* [out] */
140    );
141
142/***************************************************************************
143Summary:
144Set DAC Settings
145***************************************************************************/
146BERR_Code BAPE_Dac_SetSettings(
147    BAPE_DacHandle handle,
148    const BAPE_DacSettings *pSettings
149    );
150
151/***************************************************************************
152Summary:
153Get mixer output connector for a DAC
154***************************************************************************/
155void BAPE_Dac_GetOutputPort(
156    BAPE_DacHandle handle,
157    BAPE_OutputPort *pConnector        /* [out] */
158    );
159
160/***************************************************************************
161Summary:
162SPDIF Output Handle
163***************************************************************************/
164typedef struct BAPE_SpdifOutput *BAPE_SpdifOutputHandle;
165
166/***************************************************************************
167Summary:
168SPDIF Output Settings
169***************************************************************************/
170typedef struct BAPE_SpdifOutputSettings
171{
172    BAPE_StereoMode stereoMode; /* Mode to handle stereo mixer ouptut.  Ignored with compressed input. */
173    bool ditherEnabled;         /* If true, a dither signal will be sent
174                                   out when there is no PCM data.  Every
175                                   192 samples, a zero PCM sample will be overwritten
176                                   with one.  Non-zero or compressed samples are ignored.  */
177    bool limitTo16Bits;         /* If true, PCM data will be limited to 16 bits */
178    BAPE_SpdifBurstType underflowBurst; /* A burst of the specified type will be sent
179                                           if the input underflows.  */
180
181    bool useRawChannelStatus;       /* If true, values from rawChannelStatus will be used instead of channelStatus */
182    BAPE_SpdifChannelStatus channelStatus;
183    uint8_t rawChannelStatus[24];   /* Programs the channel status directly, sample rate and other values will not be set internally */
184} BAPE_SpdifOutputSettings;
185
186/***************************************************************************
187Summary:
188Get Default SPDIF Output Settings
189***************************************************************************/
190void BAPE_SpdifOutput_GetDefaultSettings(
191    BAPE_SpdifOutputSettings *pSettings
192    );
193
194/***************************************************************************
195Summary:
196Open a SPDIF Output
197***************************************************************************/
198BERR_Code BAPE_SpdifOutput_Open(
199    BAPE_Handle deviceHandle,
200    unsigned index,
201    const BAPE_SpdifOutputSettings *pSettings,
202    BAPE_SpdifOutputHandle *pHandle             /* [out] */
203    );
204
205/***************************************************************************
206Summary:
207Close a SPDIF Output
208***************************************************************************/
209void BAPE_SpdifOutput_Close(
210    BAPE_SpdifOutputHandle handle
211    );
212
213/***************************************************************************
214Summary:
215Get SPDIF Output Settings
216***************************************************************************/
217void BAPE_SpdifOutput_GetSettings(
218    BAPE_SpdifOutputHandle handle,
219    BAPE_SpdifOutputSettings *pSettings     /* [out] */
220    );
221
222/***************************************************************************
223Summary:
224Set SPDIF Output Settings
225***************************************************************************/
226BERR_Code BAPE_SpdifOutput_SetSettings(
227    BAPE_SpdifOutputHandle handle,
228    const BAPE_SpdifOutputSettings *pSettings
229    );
230
231/***************************************************************************
232Summary:
233Get mixer output connector for SPDIF
234***************************************************************************/
235void BAPE_SpdifOutput_GetOutputPort(
236    BAPE_SpdifOutputHandle handle,
237    BAPE_OutputPort *pConnector        /* [out] */
238    );
239
240/***************************************************************************
241Summary:
242MAI (HDMI Output) Handle
243***************************************************************************/
244typedef struct BAPE_MaiOutput *BAPE_MaiOutputHandle;
245
246/***************************************************************************
247Summary:
248MAI (HDMI Output) Settings
249***************************************************************************/
250typedef struct BAPE_MaiOutputSettings
251{
252    BAPE_StereoMode stereoMode; /* Mode to handle stereo mixer ouptut.  Ignored with compressed or multichannel input. */
253    bool ditherEnabled;     /* If true, a dither signal will be sent
254                               out when there is no PCM data.  Every
255                               192 samples, a zero PCM sample will be overwritten
256                               with one.  Non-zero or compressed samples are ignored.  */
257    BAPE_SpdifBurstType underflowBurst; /* A burst of the specified type will be sent
258                                           if the input underflows.  */
259
260    bool useRawChannelStatus;           /* If true, values from rawChannelStatus will be used instead of channelStatus */
261    BAPE_SpdifChannelStatus channelStatus;
262    uint8_t rawChannelStatus[24];       /* Programs the channel status directly, sample rate and other values will not be set internally */
263} BAPE_MaiOutputSettings;
264
265/***************************************************************************
266Summary:
267Get Default MAI (HDMI Output) Settings
268***************************************************************************/
269void BAPE_MaiOutput_GetDefaultSettings(
270    BAPE_MaiOutputSettings *pSettings
271    );
272
273/***************************************************************************
274Summary:
275Open a MAI Output (HDMI)
276***************************************************************************/
277BERR_Code BAPE_MaiOutput_Open(
278    BAPE_Handle deviceHandle,
279    unsigned index,
280    const BAPE_MaiOutputSettings *pSettings,
281    BAPE_MaiOutputHandle *pHandle             /* [out] */
282    );
283
284/***************************************************************************
285Summary:
286Close a MAI Output (HDMI)
287***************************************************************************/
288void BAPE_MaiOutput_Close(
289    BAPE_MaiOutputHandle handle
290    );
291
292/***************************************************************************
293Summary:
294Get MAI Output (HDMI) Settings
295***************************************************************************/
296void BAPE_MaiOutput_GetSettings(
297    BAPE_MaiOutputHandle handle,
298    BAPE_MaiOutputSettings *pSettings     /* [out] */
299    );
300
301/***************************************************************************
302Summary:
303Set MAI Output (HDMI) Settings
304***************************************************************************/
305BERR_Code BAPE_MaiOutput_SetSettings(
306    BAPE_MaiOutputHandle handle,
307    const BAPE_MaiOutputSettings *pSettings
308    );
309
310/***************************************************************************
311Summary:
312Get mixer output connector for MAI Output (HDMI)
313***************************************************************************/
314void BAPE_MaiOutput_GetOutputPort(
315    BAPE_MaiOutputHandle handle,
316    BAPE_OutputPort *pConnector        /* [out] */
317    );
318
319/***************************************************************************
320Summary:
321HDMI output interrupts
322***************************************************************************/
323typedef struct BAPE_MaiOutputInterruptHandlers
324{
325    struct
326    {
327        void (*pCallback_isr)(void *pParam1, int param2, unsigned sampleRate);
328        void *pParam1;
329        int param2;       
330    } sampleRate;
331} BAPE_MaiOutputInterruptHandlers;
332
333/***************************************************************************
334Summary:
335Get HDMI output interrupts
336***************************************************************************/
337void BAPE_MaiOutput_GetInterruptHandlers(
338    BAPE_MaiOutputHandle handle,
339    BAPE_MaiOutputInterruptHandlers *pInterrupts    /* [out] */
340    );
341
342/***************************************************************************
343Summary:
344Set HDMI output interrupts
345***************************************************************************/
346BERR_Code BAPE_MaiOutput_SetInterruptHandlers(
347    BAPE_MaiOutputHandle handle,
348    const BAPE_MaiOutputInterruptHandlers *pInterrupts
349    );
350
351/***************************************************************************
352Summary:
353I2S Output Handle
354***************************************************************************/
355typedef struct BAPE_I2sOutput *BAPE_I2sOutputHandle;
356
357/***************************************************************************
358Summary:
359I2S Output Settings
360***************************************************************************/
361typedef struct BAPE_I2sOutputSettings
362{
363    BAPE_StereoMode stereoMode; /* Mode to handle stereo mixer ouptut. */
364
365    BAPE_I2sJustification   justification;    /* Data Justification*/
366    BAPE_I2sDataAlignment   dataAlignment;    /* Data Alignment */
367    BAPE_I2sLRClockPolarity lrPolarity;       /* LRCK polarity */
368    BAPE_I2sSclkPolarity    sclkPolarity;     /* SCLK polarity */
369
370    BAPE_SclkRate sclkRate;     /* Bit clock Rate in multiple of Fs */
371} BAPE_I2sOutputSettings;
372
373/***************************************************************************
374Summary:
375Get Default I2S Output Settings
376***************************************************************************/
377void BAPE_I2sOutput_GetDefaultSettings(
378    BAPE_I2sOutputSettings *pSettings
379    );
380
381/***************************************************************************
382Summary:
383Open an I2S Output
384***************************************************************************/
385BERR_Code BAPE_I2sOutput_Open(
386    BAPE_Handle deviceHandle,
387    unsigned index,
388    const BAPE_I2sOutputSettings *pSettings,
389    BAPE_I2sOutputHandle *pHandle             /* [out] */
390    );
391
392/***************************************************************************
393Summary:
394Close an I2S Output
395***************************************************************************/
396void BAPE_I2sOutput_Close(
397    BAPE_I2sOutputHandle handle
398    );
399
400/***************************************************************************
401Summary:
402Get I2S Output Settings
403***************************************************************************/
404void BAPE_I2sOutput_GetSettings(
405    BAPE_I2sOutputHandle handle,
406    BAPE_I2sOutputSettings *pSettings     /* [out] */
407    );
408
409/***************************************************************************
410Summary:
411Set I2S Output Settings
412***************************************************************************/
413BERR_Code BAPE_I2sOutput_SetSettings(
414    BAPE_I2sOutputHandle handle,
415    const BAPE_I2sOutputSettings *pSettings
416    );
417
418/***************************************************************************
419Summary:
420Get mixer output connector for I2S
421***************************************************************************/
422void BAPE_I2sOutput_GetOutputPort(
423    BAPE_I2sOutputHandle handle,
424    BAPE_OutputPort *pConnector        /* [out] */
425    );
426
427/***************************************************************************
428Summary:
429Multichannel I2S Output Handle
430***************************************************************************/
431typedef struct BAPE_I2sMultiOutput *BAPE_I2sMultiOutputHandle;
432
433/***************************************************************************
434Summary:
435Multichannel I2S Output Settings
436***************************************************************************/
437typedef struct BAPE_I2sMultiOutputSettings
438{
439    BAPE_I2sMultiMode mode; /* Mode of operation, multichannel or stereo.
440                               Must be set prior to BAPE_I2sMultiOutput_Open()
441                               and cannot be changed on the fly. */
442
443    BAPE_I2sOutputSettings i2sSettings; /* I2S Settings */
444} BAPE_I2sMultiOutputSettings;
445
446/***************************************************************************
447Summary:
448Get Default Multichannel I2S Output Settings
449***************************************************************************/
450void BAPE_I2sMultiOutput_GetDefaultSettings(
451    BAPE_I2sMultiOutputSettings *pSettings
452    );
453
454/***************************************************************************
455Summary:
456Open a Multichannel I2S Output
457***************************************************************************/
458BERR_Code BAPE_I2sMultiOutput_Open(
459    BAPE_Handle deviceHandle,
460    unsigned index,
461    const BAPE_I2sMultiOutputSettings *pSettings,
462    BAPE_I2sMultiOutputHandle *pHandle             /* [out] */
463    );
464
465/***************************************************************************
466Summary:
467Close a Multichannel I2S Output
468***************************************************************************/
469void BAPE_I2sMultiOutput_Close(
470    BAPE_I2sMultiOutputHandle handle
471    );
472
473/***************************************************************************
474Summary:
475Get Multichannel I2S Output Settings
476***************************************************************************/
477void BAPE_I2sMultiOutput_GetSettings(
478    BAPE_I2sMultiOutputHandle handle,
479    BAPE_I2sMultiOutputSettings *pSettings     /* [out] */
480    );
481
482/***************************************************************************
483Summary:
484Set Multichannel I2S Output Settings
485***************************************************************************/
486BERR_Code BAPE_I2sMultiOutput_SetSettings(
487    BAPE_I2sMultiOutputHandle handle,
488    const BAPE_I2sMultiOutputSettings *pSettings
489    );
490
491/***************************************************************************
492Summary:
493Get mixer output connector for Multichannel I2S or the first stereo pair
494if set to stereo mode.
495***************************************************************************/
496void BAPE_I2sMultiOutput_GetOutputPort(
497    BAPE_I2sMultiOutputHandle handle,
498    BAPE_OutputPort *pConnector        /* [out] */
499    );
500
501/***************************************************************************
502Summary:
503Get mixer output connector for an individual stereo pair on Multichannel I2S.
504Only supported if BAPE_I2sMultiOutputSettings.mode is set to
505BAPE_I2sMultiMode_eStereo.
506***************************************************************************/
507void BAPE_I2sMultiOutput_GetStereoOutputPort(
508    BAPE_I2sMultiOutputHandle handle,
509    BAPE_ChannelPair channelPair,
510    BAPE_OutputPort *pConnector        /* [out] */
511    );
512
513/***************************************************************************
514Summary:
515RF Modulator Handle
516***************************************************************************/
517typedef struct BAPE_RfMod *BAPE_RfModHandle;
518
519/***************************************************************************
520Summary:
521RF Modulator Settings
522***************************************************************************/
523typedef struct BAPE_RfModSettings
524{
525    BAPE_OutputPort master;    /* The RF Modulator must slave to a DAC output */
526    bool muted;                 /* If true, the RF Modulator will be muted */
527} BAPE_RfModSettings;
528
529/***************************************************************************
530Summary:
531Get Default RF Modulator Settings
532***************************************************************************/
533void BAPE_RfMod_GetDefaultSettings(
534    BAPE_RfModSettings *pSettings
535    );
536
537/***************************************************************************
538Summary:
539Open an RF Modulator
540***************************************************************************/
541BERR_Code BAPE_RfMod_Open(
542    BAPE_Handle deviceHandle,
543    unsigned index,
544    const BAPE_RfModSettings *pSettings,
545    BAPE_RfModHandle *pHandle             /* [out] */
546    );
547
548/***************************************************************************
549Summary:
550Close an RF Modulator
551***************************************************************************/
552void BAPE_RfMod_Close(
553    BAPE_RfModHandle handle
554    );
555
556/***************************************************************************
557Summary:
558Get RF Modulator Settings
559***************************************************************************/
560void BAPE_RfMod_GetSettings(
561    BAPE_RfModHandle handle,
562    BAPE_RfModSettings *pSettings     /* [out] */
563    );
564
565/***************************************************************************
566Summary:
567Set RF Modulator Settings
568***************************************************************************/
569BERR_Code BAPE_RfMod_SetSettings(
570    BAPE_RfModHandle handle,
571    const BAPE_RfModSettings *pSettings
572    );
573
574/***************************************************************************
575Summary:
576Audio Return Channel Handle
577***************************************************************************/
578typedef struct BAPE_AudioReturnChannel *BAPE_AudioReturnChannelHandle;
579
580/***************************************************************************
581Summary:
582Audio Return Channel Settings
583***************************************************************************/
584typedef struct BAPE_AudioReturnChannelSettings
585{
586    BAPE_OutputPort master;    /* The Audio Return Channel must slave to a Spdif output */
587    bool muted;                 /* If true, the Audio Return Channel will be muted */
588} BAPE_AudioReturnChannelSettings;
589
590/***************************************************************************
591Summary:
592Get Default Audio Return Channel Settings
593***************************************************************************/
594void BAPE_AudioReturnChannel_GetDefaultSettings(
595    BAPE_AudioReturnChannelSettings *pSettings
596    );
597
598/***************************************************************************
599Summary:
600Open an Audio Return Channel
601***************************************************************************/
602BERR_Code BAPE_AudioReturnChannel_Open(
603    BAPE_Handle deviceHandle,
604    unsigned index,
605    const BAPE_AudioReturnChannelSettings *pSettings,
606    BAPE_AudioReturnChannelHandle *pHandle             /* [out] */
607    );
608
609/***************************************************************************
610Summary:
611Close an Audio Return Channel
612***************************************************************************/
613void BAPE_AudioReturnChannel_Close(
614    BAPE_AudioReturnChannelHandle handle
615    );
616
617/***************************************************************************
618Summary:
619Get Audio Return Channel Settings
620***************************************************************************/
621void BAPE_AudioReturnChannel_GetSettings(
622    BAPE_AudioReturnChannelHandle handle,
623    BAPE_AudioReturnChannelSettings *pSettings     /* [out] */
624    );
625
626/***************************************************************************
627Summary:
628Set Audio Return Channel Settings
629***************************************************************************/
630BERR_Code BAPE_AudioReturnChannel_SetSettings(
631    BAPE_AudioReturnChannelHandle handle,
632    const BAPE_AudioReturnChannelSettings *pSettings
633    );
634
635/***************************************************************************
636Summary:
637Dummy Output Handle
638***************************************************************************/
639typedef struct BAPE_DummyOutput *BAPE_DummyOutputHandle;
640
641/***************************************************************************
642Summary:
643Dummy Output Settings
644***************************************************************************/
645typedef struct BAPE_DummyOutputOpenSettings
646{
647    BAPE_MultichannelFormat maxMultichannelFormat;   /* Set to the worst case multichannel format
648                                                        you would like to handle.  Controls the
649                                                        number of HW resources allocated. */
650} BAPE_DummyOutputOpenSettings;
651
652/***************************************************************************
653Summary:
654Get Default Dummy Output Settings
655***************************************************************************/
656void BAPE_DummyOutput_GetDefaultOpenSettings(
657    BAPE_DummyOutputOpenSettings *pSettings
658    );
659
660/***************************************************************************
661Summary:
662Open a Dummy Output
663***************************************************************************/
664BERR_Code BAPE_DummyOutput_Open(
665    BAPE_Handle deviceHandle,
666    unsigned index,
667    const BAPE_DummyOutputOpenSettings *pSettings,
668    BAPE_DummyOutputHandle *pHandle             /* [out] */
669    );
670
671/***************************************************************************
672Summary:
673Close a Dummy Output
674***************************************************************************/
675void BAPE_DummyOutput_Close(
676    BAPE_DummyOutputHandle handle
677    );
678
679/***************************************************************************
680Summary:
681Get mixer output connector for a Dummy Output
682***************************************************************************/
683void BAPE_DummyOutput_GetOutputPort(
684    BAPE_DummyOutputHandle handle,
685    BAPE_OutputPort *pConnector        /* [out] */
686    );
687
688#endif /* #ifndef BAPE_OUTPUT_H_ */
689
Note: See TracBrowser for help on using the repository browser.