yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame] | 1 | /*******************************************************************************
|
| 2 | * Copyright (C) 2007, ZTE Corporation.
|
| 3 | *
|
| 4 | * File Name: drvs_iokeys.h
|
| 5 | * File Mark:
|
| 6 | * Description:
|
| 7 | * Others:
|
| 8 | * Version: 1.0
|
| 9 | * Author: geanfeng
|
| 10 | * Date: 2014-02-11
|
| 11 | * History 1:
|
| 12 | * Date:
|
| 13 | * Version:
|
| 14 | * Author:
|
| 15 | * Modification:
|
| 16 | * History 2:
|
| 17 | ********************************************************************************/
|
| 18 |
|
| 19 | #ifndef _DRVS_IO_VOICE_H
|
| 20 | #define _DRVS_IO_VOICE_H
|
| 21 |
|
| 22 | /****************************************************************************
|
| 23 | * Include files
|
| 24 | ****************************************************************************/
|
| 25 | #include "drvs_io.h"
|
| 26 | /****************************************************************************
|
| 27 | * Macros
|
| 28 | ****************************************************************************/
|
| 29 | #define ZDRV_DEV_VOICE "voice" /*The device name of voice driver.*/
|
| 30 | #define ZDRV_DEV_VOLTE "volte" /*The device name of voice driver.*/
|
| 31 |
|
| 32 | /****************************************************************************
|
| 33 | * Types
|
| 34 | ****************************************************************************/
|
| 35 | /* Voice input channel selection. */
|
| 36 | typedef enum
|
| 37 | {
|
| 38 | CODEC_INPUT_MICPHONE =0, /*input path in earphone mic*/
|
| 39 | CODEC_INPUT_HEADSET, /*input path in headset*/
|
| 40 | CODEC_INPUT_BLUETOOTH, /*input path in bluetooth*/
|
| 41 | CODEC_INPUT_HANDSFREE, /*input path in mic(handsfree)*/
|
| 42 |
|
| 43 | MAX_CODEC_INPUT_PATH
|
| 44 | } T_ZDrv_CodecInputPath;
|
| 45 |
|
| 46 | /* Voice output channel selection. */
|
| 47 | typedef enum
|
| 48 | {
|
| 49 | CODEC_OUTPUT_RECEIVER =0, /*output path in receiver*/
|
| 50 | CODEC_OUTPUT_SPEAKER, /*output path in speaker*/
|
| 51 | CODEC_OUTPUT_HEADSET, /*output path in headset*/
|
| 52 | CODEC_OUTPUT_BLUETOOTH, /*output path in bluetooth*/
|
| 53 | CODEC_OUTPUT_HSANDSPK, /*output path in both headset and speaker*/
|
| 54 |
|
| 55 |
|
| 56 | MAX_CODEC_OUTPUT_PATH
|
| 57 | }T_ZDrv_CodecOutputPath;
|
| 58 |
|
| 59 | #define T_ZDrv_AudioInputPath T_ZDrv_CodecInputPath
|
| 60 | #define T_ZDrv_VoiceInputPath T_ZDrv_CodecInputPath
|
| 61 | #define T_ZDrv_AudioOutputPath T_ZDrv_CodecOutputPath
|
| 62 | #define T_ZDrv_VoiceOutputPath T_ZDrv_CodecOutputPath
|
| 63 |
|
| 64 |
|
| 65 | typedef struct
|
| 66 | {
|
| 67 | UINT16 uiStartX;
|
| 68 | UINT16 uiStartY;
|
| 69 | UINT16 uiWidth;
|
| 70 | UINT16 uiHeight;
|
| 71 | } T_ZDrv_Rect;
|
| 72 |
|
| 73 | /* Record data format. */
|
| 74 | typedef enum
|
| 75 | {
|
| 76 | RECORD_DATA_FORMAT_AMR = 0,
|
| 77 | RECORD_DATA_FORMAT_FR,
|
| 78 | RECORD_DATA_FORMAT_HR,
|
| 79 | RECORD_DATA_FORMAT_EFR,
|
| 80 |
|
| 81 | MAX_RECORD_DATA_FORMAT
|
| 82 | } T_ZDrvRcd_DataFormat;
|
| 83 |
|
| 84 | /*add on the platform of 7502 for record the different of channel online voice*/
|
| 85 | /* channel selection for voice record function */
|
| 86 | typedef enum
|
| 87 | {
|
| 88 | VOICE_RECORD_UPLINK = 0,
|
| 89 | VOICE_RECORD_DOWNLINK,
|
| 90 | VOICE_RECORD_UPLINK_AND_DOWNLINK,
|
| 91 | MAX_VOICE_RECORD_CHANNEL
|
| 92 | } T_ZDrvVoice_RecordChannel;
|
| 93 |
|
| 94 | typedef struct
|
| 95 | {
|
| 96 | T_ZDrvRcd_DataFormat dataformat;
|
| 97 | UINT32 bufsize;
|
| 98 | T_ZDrvVoice_RecordChannel channel; /*add on the platform of 7502 for record the different of channel online voice*/
|
| 99 | } T_ZDrvRcd_InfoParam;
|
| 100 |
|
| 101 | /* Voice input channel volum level selection.*/
|
| 102 | typedef enum{
|
| 103 | VOICE_INPUT_VOL_LEVEL_0 = 0,
|
| 104 | VOICE_INPUT_VOL_LEVEL_1 ,
|
| 105 | VOICE_INPUT_VOL_LEVEL_2 ,
|
| 106 | VOICE_INPUT_VOL_LEVEL_3 ,
|
| 107 | VOICE_INPUT_VOL_LEVEL_4 ,
|
| 108 | VOICE_INPUT_VOL_LEVEL_5 ,
|
| 109 |
|
| 110 | MAX_VOICE_INPUT_VOL_LEVEL
|
| 111 | } T_ZDrvVoice_InputVolLevel;
|
| 112 |
|
| 113 | /* Audio output channel volum level selection.*/
|
| 114 | typedef enum{
|
| 115 | VOICE_OUTPUT_VOL_LEVEL_0 = 0,
|
| 116 | VOICE_OUTPUT_VOL_LEVEL_1 ,
|
| 117 | VOICE_OUTPUT_VOL_LEVEL_2 ,
|
| 118 | VOICE_OUTPUT_VOL_LEVEL_3 ,
|
| 119 | VOICE_OUTPUT_VOL_LEVEL_4 ,
|
| 120 | VOICE_OUTPUT_VOL_LEVEL_5 ,
|
| 121 | VOICE_OUTPUT_VOL_LEVEL_6 ,
|
| 122 | VOICE_OUTPUT_VOL_LEVEL_7 ,
|
| 123 | VOICE_OUTPUT_VOL_LEVEL_8 ,
|
| 124 | VOICE_OUTPUT_VOL_LEVEL_9 ,
|
| 125 | VOICE_OUTPUT_VOL_LEVEL_10 ,
|
| 126 | VOICE_OUTPUT_VOL_LEVEL_11 ,
|
| 127 |
|
| 128 | MAX_VOICE_OUTPUT_VOL_LEVEL
|
| 129 | } T_ZDrvVoice_OutputVolLevel;
|
| 130 |
|
| 131 | /* voice sample rate selection. */
|
| 132 | typedef enum
|
| 133 | {
|
| 134 | VOICE_SAMPLE_8K =0, /* voice sample rate 8K. */
|
| 135 | VOICE_SAMPLE_16K , /* voice sample rate 16K. */
|
| 136 |
|
| 137 | MAX_VOICE_SAMPLE
|
| 138 | } T_ZDrvVoice_Sample;
|
| 139 |
|
| 140 | /* voice codec format, which is not the codec of PCM format */
|
| 141 | typedef enum
|
| 142 | {
|
| 143 | VOICE_DATA_FORMAT_AMR = 0,
|
| 144 | VOICE_DATA_FORMAT_FR,
|
| 145 | VOICE_DATA_FORMAT_HR,
|
| 146 | VOICE_DATA_FORMAT_EFR,
|
| 147 | MAX_VOICE_DATA_FORMAT
|
| 148 | } T_ZDrvVoice_DataFormat;
|
| 149 | /* channel selection for voice mute function */
|
| 150 | typedef enum
|
| 151 | {
|
| 152 | VOICE_UPLINK = 0,
|
| 153 | VOICE_DOWNLINK,
|
| 154 | VOICE_UPLINK_AND_DOWNLINK,
|
| 155 | MAX_VOICE_MUTE_CHANNEL
|
| 156 | } T_ZDrvVoice_MuteChannel;
|
| 157 |
|
| 158 | /* voice mute switch */
|
| 159 | typedef enum
|
| 160 | {
|
| 161 | VOICE_MUTE_DISABLE = 0,
|
| 162 | VOICE_MUTE_ENABLE,
|
| 163 | MAX_VOICE_MUTE_SWITCH
|
| 164 | } T_ZDrvVoice_mute_Switch;
|
| 165 |
|
| 166 | /* voice mute control information */
|
| 167 | typedef struct
|
| 168 | {
|
| 169 | T_ZDrvVoice_mute_Switch enable;
|
| 170 | T_ZDrvVoice_MuteChannel channel; /* input & output function */
|
| 171 | } T_ZDrvVoice_MuteInfo;
|
| 172 |
|
| 173 | /* voice switch */
|
| 174 | typedef enum
|
| 175 | {
|
| 176 | VOICE_DISABLE = 0,
|
| 177 | VOICE_ENABLE,
|
| 178 | MAX_VOICE_SWITCH
|
| 179 | } T_ZDrvVoice_Switch;
|
| 180 |
|
| 181 | /* voice buffer information */
|
| 182 | typedef struct
|
| 183 | {
|
| 184 | VOID *pBuf; /* voice buffer */
|
| 185 | UINT32 bufferSize; /* voice buffer size */
|
| 186 | }T_ZDrvVoice_BufInfo;
|
| 187 |
|
| 188 | /* The frame type of AMR */
|
| 189 | typedef enum {
|
| 190 | VOICE_FRAME_MR475 = 0,
|
| 191 | VOICE_FRAME_MR515,
|
| 192 | VOICE_FRAME_MR59,
|
| 193 | VOICE_FRAME_MR67,
|
| 194 | VOICE_FRAME_MR74,
|
| 195 | VOICE_FRAME_MR795,
|
| 196 | VOICE_FRAME_MR102,
|
| 197 | VOICE_FRAME_MR122,
|
| 198 |
|
| 199 | MAX_VOICE_FRAME_TYPE
|
| 200 | }T_ZDrvVoice_FrameType;
|
| 201 |
|
| 202 | /* The frame formate of AMR */
|
| 203 | typedef enum {
|
| 204 | VOICE_AMR_IF2,
|
| 205 | VOICE_AMR_IF1,
|
| 206 |
|
| 207 | MAX_VOICE_AMR_IF
|
| 208 | }T_ZDrvVoice_AmrIf;
|
| 209 |
|
| 210 | /* The frame formate of AMR information*/
|
| 211 | typedef struct
|
| 212 | {
|
| 213 | T_ZDrvVoice_FrameType frametype; /* The frame type of AMR */
|
| 214 | T_ZDrvVoice_AmrIf amrif; /* The frame formate of AMR */
|
| 215 | }T_ZDrvVoice_AmrInfo, *T_ZDrvVoice_AmrInfoPtr;
|
| 216 |
|
| 217 | /* Audio channel */
|
| 218 | typedef enum
|
| 219 | {
|
| 220 | AUDIO_MONO_CHANNEL,
|
| 221 | AUDIO_DUAL_CHANNEL
|
| 222 | }T_ZDrvAudio_Channel;
|
| 223 | #endif/*_DRVS_IO_VOICE_H*/
|
| 224 |
|