source: svn/trunk/zas_dstar/hal/include/dsthalaud.h @ 2

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

1.phkim

  1. revision copy newcon3sk r27
File size: 4.8 KB
RevLine 
[2]1/******************************************************************************
2 *_Copyright (c) 2009 Digital Stream Technology Inc. All Rights Reserved.
3 *
4 * Module: dsthalaud.h
5 *
6 * Description
7 *
8 * @author
9 * @version $Revision: 1.1 $
10 *
11 ******************************************************************************/
12
13#ifndef __DSTHAL_AUD_H__
14#define __DSTHAL_AUD_H__
15
16/******************************************************************************
17 * Audio Processor Type
18 ******************************************************************************/
19typedef enum {
20        DHL_AUDIO_STA323W = 1,
21        DHL_AUDIO_STA333W,
22        DHL_AUDIO_STA333BW
23}DHL_AUD_PROC_TYPE;
24
25/******************************************************************************
26 * DHL Headphone Callback Source
27 ******************************************************************************/
28typedef enum 
29{
30        HPCALLBACK_UNKNOWN=0,
31        HPCALLBACK_STATUS_CHANGE,       /* Callback on acquisition start, DHL_FE_Start() */
32        HPCALLBACK_MAX
33} HPCallbackSource;
34
35typedef enum 
36{
37        HP_DETECT,
38        HP_UNDETECT
39} HPNotificationState_t;
40
41typedef void (*P_DHL_HP_CALLBACK)(HPNotificationState_t eventSource, DS_U32 userArg);
42
43/******************************************************************************
44 * DHL - Headphone Status/Configuration
45 ******************************************************************************/
46typedef struct tag_DHL_HP
47{
48        /* Callback Functions */
49        P_DHL_HP_CALLBACK       fnHPCallback[HPCALLBACK_MAX-1];
50        DS_U32               HPCallbackUserArg[HPCALLBACK_MAX-1];
51       
52        DS_U32                          hpThreadId;
53        volatile DS_BOOL                bThreadActive;
54        HPNotificationState_t   NotifyState;
55       
56        /* Platform/Project Specific fields */
57       
58} *P_DHL_HP, DHL_HP;
59
60/******************************************************************************
61 * DHL Audio Configuration
62 ******************************************************************************/
63typedef struct tag_DHL_AUD_AUDIO
64{
65        OS_MUTEX_ID             Mutex;
66
67        DS_U16                          uVolLvl;                        // Audio Volume
68        DS_U16                      uHPVolLvl;
69        int                                             Balance;
70        int                                             Treble;
71        int                                             Bass;
72        DS_S32                          iAudioDelay;            // Audio Delay in msec.
73       
74        DS_BOOL                                 bCurI2SMute;            //current audio mixer mute
75        DS_BOOL                                 bCurSpdifMute;          //current spdif mute
76        DS_BOOL                                 bCurAuxMute;
77        DHL_AUD_OUTPUT_FORMAT   AudOutFormat;           //audio output format - current audio output   
78        DHL_AUD_OUTPUT_FORMAT   AudOutFormatNxt;        //audio output format -  next audio output
79       
80        DS_BOOL                 bAudioHWInit;
81       
82        DHL_HP                  mHeadPhone;
83} DHL_AUDIO_CONFIG, *P_DHL_AUDIO_CONFIG;
84
85#if defined __cplusplus
86extern "C" {
87#endif
88
89/******************************************************************************
90 * Audio Output Common APIs
91 ******************************************************************************/
92DHL_RESULT DHL_AUD_Init(void);
93DHL_RESULT DHL_AUD_Close(void);
94DHL_RESULT DHL_AUD_PresetAudProcessor(DHL_AUD_PROC_TYPE type);
95DHL_RESULT DHL_AUD_PresetAudOutput(P_DHL_AUDIO_CONFIG pAudConfig);
96DHL_RESULT DHL_AUD_ChangeAudOutFormat(DHL_AUD_OUTPUT_FORMAT UserAudOutFmt);
97DHL_AUD_OUTPUT_FORMAT DHL_AUD_GetAudOutFormat(void);
98
99/******************************************************************************
100 * Audio Output Volume
101 ******************************************************************************/
102DHL_RESULT DHL_AUD_SetVolume(DS_U16 uVolLvl);
103DHL_RESULT DHL_AUD_SetVolumeHP(DS_U16 uVolLvl);
104DHL_RESULT DHL_AUD_GetVolume(DS_U16 *puVolLvl, DS_BOOL *pbMute);
105DHL_RESULT DHL_AUD_SetAMPPower(int n);
106DHL_RESULT DHL_AUD_VolumeFadeInOut_I2S(DS_BOOL bFadeOut);
107DHL_RESULT DHL_AUD_VolumeFadeInOut_AMP(DS_BOOL bFadeOut);
108
109/******************************************************************************
110 * Audio Output Mute
111 ******************************************************************************/
112DHL_RESULT DHL_AUD_MuteMain(DS_BOOL bMute);
113DHL_RESULT DHL_AUD_MuteAUX(DS_BOOL bMute);
114DHL_RESULT DHL_AUD_MuteSPDIF(DS_BOOL bMute);
115DS_BOOL DHL_AUD_IsMainMuted(void);
116DS_BOOL DHL_AUD_IsSpdifMuted(void);
117DS_BOOL DHL_AUD_IsAuxMuted(void);
118
119/******************************************************************************
120 * Audio Output - Headphone
121 ******************************************************************************/
122DHL_RESULT DHL_AUD_SetHPCallback( HPCallbackSource eventSource,P_DHL_HP_CALLBACK fn, DS_U32 userArg );
123
124/******************************************************************************
125 * Audio Processing APIs
126 ******************************************************************************/
127DHL_RESULT DHL_AUD_SetAudioDelay(DS_S32 offset);
128DHL_RESULT DHL_AUD_SetBalance(int Balance);
129DHL_RESULT DHL_AUD_GetBalance(int *pBalance);
130DHL_RESULT DHL_AUD_SetTreble(int Treble);
131DHL_RESULT DHL_AUD_GetTreble(int *pTreble);
132DHL_RESULT DHL_AUD_SetBass(int Bass);
133DHL_RESULT DHL_AUD_GetBass(int *pBass);
134DHL_RESULT DHL_AUD_SetAVL(DS_BOOL Enable);
135DHL_RESULT DHL_AUD_SetSRS(DS_BOOL Enable);
136
137#if defined __cplusplus
138}
139#endif
140
141#endif /* __DSTHAL_AUD_H__ */
Note: See TracBrowser for help on using the repository browser.