blob: 0fde9db84da62514a2159996b5a3213bb3dc926a [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/**
2 * Copyright (C) Infineon Technologies Denmark A/S. All rights reserved.
3 *
4 * This document contains proprietary information belonging to Infineon
5 * Technologies Denmark A/S. Passing on and copying of this document, use
6 * and communication of its contents is not permitted without prior written
7 * authorisation.
8 *
9 * Description:
10 * Interface header file for the audio driver
11 *
12 * Revision Information:
13 * File name: \dwddrvif\inc\aud_drv.h
14 * Version: \main\34
15 * Date: 2007-10-03 09:23:08
16 * Responsible: soerenek
17 * Comment:
18 * added HW available for I2S1
19 */
20
21#if !defined (_AUD_INTERFACES)
22#define _AUD_INTERFACES
23
24#if !defined (_WIN32) /* QQQQ Problem with including bastypes.h in the test suite - fix this later */
25#include "bastypes.h"
26//#include "scttypes.h" /* QQQQ For including SDL_Pid - scttypes.h ought to be included in the file that includes aud_drv.h */
27#include "base_api.h"
28#endif /* QQQQ */
29
30/*changed by wangjun for NV change.[20090214]*/
31#include "aud_nv.h" //#include "eep.h"
32
33/* Temporarily inserted to protect the old I2S interface until it is no longer used */
34#define aud_old_I2S_interface
35
36/******************************************************************************
37*
38* Feature defines
39*
40******************************************************************************/
41#if defined(AUD_EXTERNAL_RINGER) && !defined(AUD_EXTERNAL_RINGER_MA2)
42 #define AUD_EXTERNAL_RINGER_MA3
43#endif
44
45/******************************************************************************
46*
47* Type defines
48*
49******************************************************************************/
50/* QQQQ UINT8, UINT16, UINT32, SINT8, SINT16, and SINT32 should not be used *
51 * - remove the defines when they are not used any longer */
52 #if 0 //huojishan 200801.01
53#if !defined (UNITEST) /* UINT8 and UINT16 are already defined in Microsoft Visual Studio which is used for Unitest UMAC test environment build */
54 #if !defined (UINT8)
55 typedef unsigned char UINT8;
56 #endif
57
58 #if !defined (UINT16)
59 typedef unsigned short UINT16;
60 #endif
61#endif /* UNITEST */
62
63#if !defined (UINT32)
64 #if defined (_WIN32)
65 typedef unsigned int UINT32;
66 #else
67 typedef unsigned long UINT32;
68 #endif
69#endif /* UINT32 */
70
71#if !defined (SINT8)
72 typedef signed char SINT8;
73#endif
74
75#if !defined (SINT16)
76 typedef signed short SINT16;
77#endif
78
79#if !defined (SINT32)
80 #if !defined (_WIN32)
81 typedef signed long SINT32;
82 #else
83 typedef signed int SINT32;
84 #endif
85#endif /* SINT32 */
86
87#if defined (_WIN32) /* QQQQ Problem with including bastypes.h in the test suite - fix this later */
88 #if !defined (U8)
89 typedef unsigned char U8;
90 #endif
91 #if !defined (U16)
92 typedef unsigned short U16;
93 #endif
94 #if !defined (U32)
95 typedef unsigned int U32;
96 #endif
97 #if !defined (S8)
98 typedef signed char S8;
99 #endif
100 #if !defined (S16)
101 typedef signed short S16;
102 #endif
103 #if !defined (S32)
104 typedef signed int S32;
105 #endif
106#endif /* QQQQ _WIN32 */
107#endif
108
109/* Defines/includes for PC/target builds */
110#if defined (_WIN32)
111#define SDL_Pid U8
112#define SDL_boolean BOOL
113#endif /* _WIN32 */
114
115#define DWD_HUGE
116#define DWD_AUDIO_FAR
117
118/* Return codes */
119#define aud_rc_ok 0
120#define aud_rc_resource_in_use -1
121#define aud_rc_resource_conflict -2
122#define aud_rc_handle_not_used -3
123#define aud_rc_no_hw_support -4
124#define aud_rc_sharing_violation -5
125#define aud_rc_parameter_out_of_range -6
126#define aud_rc_audio_driver_disabled -7
127#define aud_rc_missing_dsp_resources -8
128#define aud_rc_format_not_supported -10
129#define aud_rc_no_playback -11
130#define aud_rc_unknown_position -12
131#define aud_rc_request_error -13
132#define aud_rc_syntax_error -14
133#define aud_rc_tone_error -15
134#define aud_rc_storage_problems -16
135#define aud_rc_performance_problems -17
136#define aud_rc_ram_buffer_used -18
137#define aud_rc_suspend_resume_error -19
138#define aud_rc_info -20
139#define aud_rc_playback_finish -21
140#define aud_rc_playback_started -22
141#define aud_rc_playback_stopped -23
142#define aud_rc_playback_suspended -24
143#define aud_rc_playback_loop -25
144#define aud_rc_recording_finish -26
145#define aud_rc_recording_started -27
146#define aud_rc_user_event -28
147#define aud_rc_elapsed_time -29
148#define aud_rc_total_playtime -30
149#define aud_rc_not_supported -31
150#define aud_rc_mapi -32
151#define aud_rc_current_frame -33
152#define aud_rc_backwardforward_info -34
153#define aud_rc_path_removal_success -35
154#define aud_rc_path_addition_success -36
155#define aud_rc_path_addition_conflict -37
156#define aud_rc_path_removal_error -38
157#define aud_rc_user_message -39
158#define aud_rc_encoding_started -40
159#define aud_rc_encoding_stopped -41
160#define aud_rc_encoder_suspended -42
161#define aud_rc_I2S_started -43
162#define aud_rc_I2S_stopped -44
163#define aud_rc_I2S_setup_error -45
164#define aud_rc_path_in_use -46
165/* !!! Please inform the MobileAnalyzer decoding maintainer (HHE) when adding new return codes */
166
167/* Used for defining which HW is present in the system in question - must be updated when aud_resource_enum is updated */
168#define AUD_HW_AVAILABLE_SPEECH 0x00000001
169#define AUD_HW_AVAILABLE_TONE_GENERATOR 0x00000002
170#define AUD_HW_AVAILABLE_RINGER 0x00000004
171#define AUD_HW_AVAILABLE_EXTERNAL_VIBRATOR 0x00000008
172#define AUD_HW_AVAILABLE_EXTERNAL_AMPLIFIER 0x00000010
173#define AUD_HW_AVAILABLE_FM_RADIO 0x00000020
174#define AUD_HW_AVAILABLE_RECORDING_VM 0x00000040
175#define AUD_HW_AVAILABLE_PLAYBACK_VM 0x00000080
176#define AUD_HW_AVAILABLE_PLAYBACK_MP3 0x00000100
177#define AUD_HW_AVAILABLE_I2S_PCM 0x00000200
178#define AUD_HW_AVAILABLE_INTERNAL_MIDI 0x00000400
179#define AUD_HW_AVAILABLE_TTY 0x00000800
180#define AUD_HW_AVAILABLE_PLAYBACK_PCM 0x00001000
181#define AUD_HW_AVAILABLE_RECORD_PCM 0x00002000
182#define AUD_HW_AVAILABLE_MAPI 0x00004000
183#define AUD_HW_AVAILABLE_INBAND 0x00008000
184#define AUD_HW_ABAILABLE_SMPOWER_BACKSPEAKER 0x00010000
185#define AUD_HW_AVAILABLE_SBC_ENCODER 0x00020000
186#define AUD_HW_AVAILABLE_I2S2_RX 0x00040000
187#define AUD_HW_AVAILABLE_I2S2_TX 0x00080000
188
189#define AUD_HW_AVAILABLE_I2S1_RX 0x00000000
190#define AUD_HW_AVAILABLE_I2S1_TX 0x00000000
191#define AUD_HW_AVAILABLE_I2S1_BLUETOOTH 0x00400000
192/* Test handles - update this list when the list above is updated */
193#define AUD_TEST_HANDLE 0xFF
194#define AUD_SPEECH_TEST_HANDLE 0xFE
195#define AUD_TONE_GENERATOR_TEST_HANDLE 0xFD
196#define AUD_AMPLIFIER_TEST_HANDLE 0xFC
197#define AUD_RINGER_TEST_HANDLE 0xFB
198#define AUD_FM_RADIO_TEST_HANDLE 0xFA
199#define AUD_RECORDING_VM_TEST_HANDLE 0xF9
200#define AUD_PLAYBACK_VM_TEST_HANDLE 0xF8
201#define AUD_PLAYBACK_MP3_TEST_HANDLE 0xF7
202#define AUD_TTY_TEST_HANDLE 0xF6
203#define AUD_VIBRATOR_TEST_HANDLE 0xF5
204#define AUD_MIDI_PLAYER_TEST_HANDLE 0xF4
205#define AUD_PCM_CHANNEL_TEST_HANDLE 0xF3
206#define AUD_PLAYBACK_PCM_TEST_HANDLE 0xF2
207#define AUD_RECORD_PCM_TEST_HANDLE 0xF1
208#define AUD_MAPI_TEST_HANDLE 0xF0
209#define AUD_INBAND_TEST_HANDLE 0xEF
210#define AUD_SMPOWER_BACKSPEAKER_TEST_HANDLE 0xEE
211#define AUD_SBC_ENCODER_TEST_HANDLE 0xED
212#define AUD_I2S2_RX_TEST_HANDLE 0xEC
213#define AUD_I2S2_TX_TEST_HANDLE 0xEB
214
215/* For compatility reasons with atcptst */
216#define AUD_MIC 1
217#define AUD_EARPIECE 2
218
219/******************************************************************************
220*
221* External enumerations and structures
222*
223******************************************************************************/
224
225/* Resources */
226typedef enum {
227 aud_resource_speech, /* 0 */
228 aud_resource_tone_generator,
229 aud_resource_ringer, /* This Does NOT include the vibrator */
230 aud_resource_vibrator,
231 aud_resource_amplifier, /* External amplifier for speaker phone */
232 aud_resource_radio, /* 5 */
233 aud_resource_record_vm,
234 aud_resource_playback_vm,
235 aud_resource_playback_mp3,
236 aud_resource_PCM_channel, /* Replaced by I2S2_Rx and I2S2_Tx (05-12-2006) */
237 aud_resource_midi_player, /* 10 */
238 aud_resource_tty,
239 aud_resource_playback_pcm,
240 aud_resource_record_pcm,
241 aud_resource_mapi,
242 aud_resource_inband, /* 15 */ /* Virtual resource used to indicate whether non-baseband audio is active. */
243 aud_resource_smpower_backspeaker, /* SM power only if other devices input audio through SP power gain. */
244 aud_resource_sbc_encoder, /*SBC Encoder */
245 aud_resource_I2S2_Rx,
246 aud_resource_I2S2_Tx,
247 aud_resource_end
248} aud_resource_enum; /* When adding more resources, also add them to the defines at the top of this file, and notify PhoneTool group */
249
250/* Priorities for resource allocation */
251typedef enum {
252 aud_priority_normal,
253 aud_priority_high,
254 aud_priority_end
255} aud_priority_enum;
256
257/* Mute-related enumerations */
258typedef enum {
259 aud_mute_enable,
260 aud_mute_disable,
261 aud_mute_end
262} aud_mute_enum;
263
264typedef enum {
265 aud_mute_left_channel_dac,
266 aud_mute_right_channel_dac,
267 aud_mute_dac_end
268} aud_mute_dac_enum;
269
270typedef enum {
271 aud_direction_uplink, /* 0 */
272 aud_direction_downlink,
273 aud_direction_updownlink,
274 aud_direction_downlink_left,
275 aud_direction_downlink_right,
276 aud_direction_uplink_speech, /* 5 */
277 aud_direction_downlink_speech,
278 aud_direction_updownlink_speech,
279 aud_direction_end
280} aud_direction_enum;
281
282typedef enum {
283 aud_direction_resource_uplink,
284 aud_direction_resource_downlink,
285 aud_direction_resource_updownlink,
286 aud_direction_resource_end
287} aud_ul_dl_direction_enum;
288
289/* Path-related enumerations */
290typedef enum {
291 aud_disable_path,
292 aud_enable_path,
293 aud_audio_path_end
294} aud_audio_path_enum;
295
296typedef enum {
297 aud_handset_mic, /* 0 */
298 aud_headset_mic,
299 aud_I2S1_rx, /*Now used for any kind of bluetooth device connection*/
300 aud_tty_uplink,
301 aud_hfcarkit_mic,
302 aud_I2S1_inband_rx, /* 5 */
303 aud_handset_mic_42dB,
304 aud_handset_dthf_uplink,
305 aud_mic_mute,
306 aud_handset_mic_slidedown,
307 aud_handset_mic_loopback, /* 10 */
308 aud_I2S1_rx_loopback,
309 aud_media_to_uplink,
310 aud_media_to_uplink_hifi,
311 aud_stereo_mic,
312 aud_scheduler_8kHz, /* 15 */
313 aud_scheduler_16kHz,
314 aud_scheduler_48kHz,
315 aud_external_stereo_input,
316 aud_headset_mic_42dB,
317 aud_uplink_source_end
318} aud_uplink_source_enum; /* When adding more paths, remember to notify the PhoneTool group */
319
320typedef enum {
321 aud_normal_earpiece, /* 0 */
322 aud_mono_headset,
323 aud_stereo_headset,
324 aud_backspeaker,
325 aud_I2S1_tx,
326 aud_tty_downlink, /* 5 */
327 aud_mono_headset_external_ringer,
328 aud_stereo_headset_external_ringer,
329 aud_backspeaker_path_downlink,
330 aud_earpiece_path_downlink,
331 aud_backspeaker_external_ringer, /* 10 */
332 aud_hfcarkit_speaker,
333 aud_I2S1_inband_tx, /*Special path used for routing inband audio (like ringtones) to the bt headset*/
334 aud_backspeaker_stereo,
335 aud_fmradio_backspeaker,
336 aud_fmradio_headset, /* 15 */
337 aud_companion_mono_headset,
338 aud_companion_stereo_headset,
339 aud_companion_mono_backspeaker,
340 aud_companion_stereo_backspeaker,
341 aud_smpower_backspeaker, /* 20 */ /*Special path to backspeaker for non baseband audio*/
342 aud_normal_earpiece_loopback,
343 aud_I2S1_tx_loopback,
344 aud_media_to_downlink_mute,
345 aud_sidetone_loopback,
346 aud_I2S2_external, /* 25 */
347 aud_tmp_downlink_path, /* To be replaced when a new path is added. Preserved for PhoneTool compatibility. */
348 aud_downlink_source_end
349} aud_downlink_source_enum; /* When adding more paths, remember to notify the PhoneTool group */
350
351/* Enable/disable enumerations */
352typedef enum {
353 aud_enable,
354 aud_disable,
355 aud_enable_disable_end
356} aud_enable_disable_enum;
357
358/* Volume enumerations */
359typedef enum {
360 aud_ringer_volume_off,
361 aud_ringer_volume_1,
362 aud_ringer_volume_2,
363 aud_ringer_volume_3,
364 aud_ringer_volume_4,
365 aud_ringer_volume_5,
366 aud_ringer_volume_in_call,
367 aud_ringer_volume_init, /* Only for internal use in audio driver */
368 aud_ringer_volume_end
369} aud_ringer_volume_enum;
370
371typedef enum {
372 aud_speech_volume_1,
373 aud_speech_volume_2,
374 aud_speech_volume_3,
375 aud_speech_volume_4,
376 aud_speech_volume_5,
377 aud_speech_volume_6,
378 aud_speech_volume_7,
379 aud_speech_volume_8,
380 aud_speech_volume_9,
381 aud_speech_volume_10,
382 aud_speech_volume_special, /* For test purpose only */
383 aud_speech_volume_end
384} aud_speech_volume_enum;
385
386typedef enum {
387 aud_volume_0=0,
388 aud_volume_1=1,
389 aud_volume_2,
390 aud_volume_3,
391 aud_volume_4,
392 aud_volume_5,
393 aud_volume_6,
394 aud_volume_7,
395 aud_volume_8,
396 aud_volume_9,
397 aud_volume_10,
398 aud_volume_11,
399 aud_volume_12,
400 aud_volume_13,
401 aud_volume_14,
402 aud_volume_15,
403 aud_volume_16,
404 aud_volume_17,
405 aud_volume_18,
406 aud_volume_19,
407 aud_volume_20,
408 aud_volume_21,
409 aud_volume_22,
410 aud_volume_23,
411 aud_volume_24,
412 aud_volume_25,
413 aud_volume_26,
414 aud_volume_27,
415 aud_volume_28,
416 aud_volume_29,
417 aud_volume_30,
418 aud_volume_31,
419 aud_volume_32,
420 aud_volume_33,
421 aud_volume_34,
422 aud_volume_35,
423 aud_volume_36,
424 aud_volume_37,
425 aud_volume_38,
426 aud_volume_39,
427 aud_volume_40,
428 aud_volume_41,
429 aud_volume_42,
430 aud_volume_43,
431 aud_volume_44,
432 aud_volume_45,
433 aud_volume_46,
434 aud_volume_47,
435 aud_volume_48,
436 aud_volume_49,
437 aud_volume_50,
438 aud_volume_51,
439 aud_volume_52,
440 aud_volume_53,
441 aud_volume_54,
442 aud_volume_55,
443 aud_volume_56,
444 aud_volume_57,
445 aud_volume_58,
446 aud_volume_59,
447 aud_volume_60,
448 aud_volume_61,
449 aud_volume_62,
450 aud_volume_63,
451 aud_volume_64,
452 aud_volume_65,
453 aud_volume_66,
454 aud_volume_67,
455 aud_volume_68,
456 aud_volume_69,
457 aud_volume_70,
458 aud_volume_71,
459 aud_volume_72,
460 aud_volume_73,
461 aud_volume_74,
462 aud_volume_75,
463 aud_volume_76,
464 aud_volume_77,
465 aud_volume_78,
466 aud_volume_79,
467 aud_volume_80,
468 aud_volume_81,
469 aud_volume_82,
470 aud_volume_83,
471 aud_volume_84,
472 aud_volume_85,
473 aud_volume_86,
474 aud_volume_87,
475 aud_volume_88,
476 aud_volume_89,
477 aud_volume_90,
478 aud_volume_91,
479 aud_volume_92,
480 aud_volume_93,
481 aud_volume_94,
482 aud_volume_95,
483 aud_volume_96,
484 aud_volume_97,
485 aud_volume_98,
486 aud_volume_99,
487 aud_volume_100,
488 aud_volume_special, /* For test purpose only */
489 aud_volume_end
490} aud_volume_enum;
491
492/* Tone enumerations */
493typedef enum {
494 aud_tone_DTMF_0, /* 0 */
495 aud_tone_DTMF_1,
496 aud_tone_DTMF_2,
497 aud_tone_DTMF_3,
498 aud_tone_DTMF_4,
499 aud_tone_DTMF_5, /* 5 */
500 aud_tone_DTMF_6,
501 aud_tone_DTMF_7,
502 aud_tone_DTMF_8,
503 aud_tone_DTMF_9,
504 aud_tone_DTMF_hash, /* 10 */
505 aud_tone_DTMF_asterix,
506 aud_tone_key_tone_1, // Not in use.
507 aud_tone_key_tone_2, // Not in use.
508 aud_tone_key_tone_3, // Not in use.
509 aud_tone_key_tone_4, /* 15 */ /* Not in use. */
510 aud_tone_key_tone_5, // Not in use.
511 aud_tone_sv_subscriber_busy,
512 aud_tone_sv_congestion,
513 aud_tone_sv_radio_path_ack,
514 aud_tone_sv_radio_path_not_avail, /* 20 */
515 aud_tone_sv_error_info,
516 aud_tone_sv_call_waiting,
517 aud_tone_info_free_tone,
518 aud_tone_info_connection,
519 aud_tone_info_disconnect, /* 25 */
520 aud_tone_info_device_in,
521 aud_tone_info_device_out,
522 aud_tone_info_msg_full,
523 aud_tone_info_ussd,
524 aud_tone_info_minutte_minder, /* 30 */
525 aud_tone_info_error_1,
526 aud_tone_info_error_2,
527 aud_tone_info_sms_in_call,
528 aud_tone_info_broadcast_in_call,
529 aud_tone_info_alarm_in_call, /* 35 */
530 aud_tone_info_low_bat_in_call,
531 aud_tone_info_power_off,
532 aud_tone_info_power_on,
533 aud_tone_info_single_beep,
534 aud_tone_info_positive_acknowledgement, /* 40 */
535 aud_tone_info_negative_acknowledgement,
536 aud_tone_info_auto_redial,
537 aud_tone_info_network_attention,
538 aud_tone_info_dial_tone,
539 aud_tone_info_low_bat, /* 45 */
540 aud_tone_id_end
541} aud_tone_id_enum;
542
543typedef enum {
544 aud_single_user_tone,
545 aud_dual_user_tone,
546 aud_triple_user_tone,
547 aud_tone_type_end
548} aud_tone_type_enum;
549
550/* Tone generator structures */
551typedef struct {
552 U16 freq1;
553 S16 amp1;
554 U16 duration;
555} aud_single_user_tone_type;
556
557typedef struct {
558 U16 freq1;
559 S16 amp1;
560 U16 freq2;
561 S16 amp2;
562 U16 duration;
563} aud_dual_user_tone_type;
564
565typedef struct {
566 U16 freq1;
567 S16 amp1;
568 U16 freq2;
569 S16 amp2;
570 U16 freq3;
571 S16 amp3;
572 U16 duration;
573} aud_triple_user_tone_type;
574
575/* Ringer enumerations */
576typedef enum {
577 aud_ringer_info_power_off, /* 0 */
578 aud_ringer_info_power_on,
579 aud_ringer_info_low_bat,
580 aud_ringer_info_connection,
581 aud_ringer_info_error_1,
582 aud_ringer_info_error_2, /* 5 */
583 aud_ringer_info_device_in,
584 aud_ringer_info_device_out,
585 aud_ringer_info_msg_full,
586 aud_ringer_message_1,
587 aud_ringer_message_2, /* 10 */
588 aud_ringer_message_3,
589 aud_ringer_message_4,
590 aud_ringer_message_5,
591 aud_ringer_message_6,
592 aud_ringer_message_7, /* 15 */
593 aud_ringer_message_8,
594 aud_ringer_message_9,
595 aud_ringer_message_10,
596 aud_ringer_broadcast_1,
597 aud_ringer_broadcast_2, /* 20 */
598 aud_ringer_broadcast_3,
599 aud_ringer_broadcast_4,
600 aud_ringer_broadcast_5,
601 aud_ringer_broadcast_6,
602 aud_ringer_broadcast_7, /* 25 */
603 aud_ringer_broadcast_8,
604 aud_ringer_broadcast_9,
605 aud_ringer_broadcast_10,
606 aud_ringer_alarm_1,
607 aud_ringer_alarm_2, /* 30 */
608 aud_ringer_alarm_3,
609 aud_ringer_alarm_4,
610 aud_ringer_alarm_5,
611 aud_ringer_alarm_6,
612 aud_ringer_alarm_7, /* 35 */
613 aud_ringer_alarm_8,
614 aud_ringer_alarm_9,
615 aud_ringer_alarm_10,
616 aud_ringer_1,
617 aud_ringer_2, /* 40 */
618 aud_ringer_3,
619 aud_ringer_4,
620 aud_ringer_5,
621 aud_ringer_6,
622 aud_ringer_7, /* 45 */
623 aud_ringer_8,
624 aud_ringer_9,
625 aud_ringer_10,
626 aud_ringer_11,
627 aud_ringer_12, /* 50 */
628 aud_ringer_13,
629 aud_ringer_14,
630 aud_ringer_15,
631 aud_ringer_16,
632 aud_ringer_17, /* 55 */
633 aud_ringer_18,
634 aud_ringer_19,
635 aud_ringer_20,
636 aud_ringer_21,
637 aud_ringer_22, /* 60 */
638 aud_ringer_23,
639 aud_ringer_24,
640 aud_ringer_25,
641 aud_ringer_26,
642 aud_ringer_27, /* 65 */
643 aud_ringer_28,
644 aud_ringer_29,
645 aud_ringer_30,
646 aud_ringer_31,
647 aud_ringer_32, /* 70 */
648 aud_ringer_33,
649 aud_ringer_34,
650 aud_ringer_35,
651 aud_ringer_36,
652 aud_ringer_37, /* 75 */
653 aud_ringer_38,
654 aud_ringer_39,
655 aud_ringer_40,
656 aud_ringer_41,
657 aud_ringer_42, /* 80 */
658 aud_ringer_43,
659 aud_ringer_44,
660 aud_ringer_45,
661 aud_ringer_46,
662 aud_ringer_47, /* 85 */
663 aud_ringer_48,
664 aud_ringer_49,
665 aud_ringer_50,
666 aud_ringer_game_1,
667 aud_ringer_game_2, /* 90 */
668 aud_ringer_game_3,
669 aud_ringer_game_4,
670 aud_ringer_game_5,
671 aud_ringer_game_6,
672 aud_ringer_game_7, /* 95 */
673 aud_ringer_game_8,
674 aud_ringer_game_9,
675 aud_ringer_game_10,
676 aud_ringer_camera_1,
677 aud_ringer_prod_test_1, /* 100 */
678 aud_ringer_prod_test_2,
679 aud_ringer_prod_test_3,
680 aud_ringer_prod_test_4,
681 ringer_test_01,
682 ringer_test_02, /* 105 */
683 ringer_test_03,
684 ringer_test_04,
685 ringer_test_05,
686 ringer_test_06,
687 ringer_test_07, /* 110 */
688 ringer_test_08,
689 ringer_test_09,
690 ringer_test_10,
691 ringer_test_11,
692 ringer_test_12, /* 115 */
693 ringer_test_13,
694 ringer_test_14,
695 ringer_test_15,
696 ringer_test_16,
697 ringer_test_17, /* 120 */
698 ringer_test_18,
699 ringer_test_19,
700 ringer_test_20,
701 ringer_test_21,
702 ringer_test_22, /* 125 */
703 ringer_test_23,
704 ringer_test_24,
705 ringer_test_25,
706 ringer_test_26,
707 ringer_test_rambuff,
708
709 aud_ringer_tone_id_end
710} aud_ringer_tone_id_enum;
711
712typedef enum {
713 aud_ringer_device_sound,
714 aud_ringer_device_vibrator, /* Not used anymore (the functions for starting/stopping vibrator should be used) */
715 aud_ringer_device_sound_and_vibrator, /* Not used anymore (the functions for starting/stopping vibrator should be used) */
716 aud_ringer_device_end
717} aud_ringer_device_enum;
718
719typedef enum {
720 aud_format_smaf, /* MA2/MA3 NB: SMAF is not just SMAF. With the MA3 came extentions
721 to the SMAF, which cannot be played on a MA2 */
722 aud_format_midi, /* MA2/MA3 NB: Be aware that MIDI is many different formats,
723 only following formats are supported: SP-MIDI, SMF format 0 and 1 */
724 aud_format_smaf_phrase_l1, /* MA3/MA2 */
725 aud_format_rmd, /* MA3 */
726 aud_format_imelody, /* MA2/MA3 */
727 aud_format_buzzer, /* Buzzer */
728 aud_format_wav, /* wav */
729 aud_format_mp3, /* mp3 */
730 aud_format_smafaudio, /* pcm data in smaf header container*/
731 aud_format_end
732} aud_format_enum;
733
734/* Vibrator enumerations */
735typedef enum {
736 Aud_vibrator_mode_async_1,
737 Aud_vibrator_mode_async_2,
738 Aud_vibrator_mode_sync_1,
739 Aud_vibrator_mode_sync_2,
740 aud_vibmode_end
741} aud_vibrator_mode_enum;
742
743typedef enum {
744 aud_vibrator_on, /* 0 */
745 aud_vibrator_async_blinking1,
746 aud_vibrator_async_blinking2,
747 aud_vibrator_async_blinking3,
748 aud_vibrator_async_blinking4,
749 aud_vibrator_async_blinking5, /* 5 */
750 aud_vibrator_async_blinking6,
751 aud_vibrator_async_blinking7,
752 aud_vibrator_async_blinking8,
753 aud_vibrator_async_blinking9,
754 aud_vibrator_async_blinking10, /* 10 */
755 aud_vibrator_async_blinking11,
756 aud_vibrator_async_blinking12,
757 aud_vibrator_async_blinking13,
758 aud_vibrator_async_blinking14,
759 aud_vibrator_async_blinking15, /* 15 */
760 aud_vibrator_async_blinking16,
761 aud_vibrator_sync1,
762 aud_vibrator_sync2,
763 aud_vibrator_sync3,
764 aud_vibrator_sync4, /* 20 */
765 aud_vib_mode_end
766} aud_vib_mode;
767
768typedef enum {
769 Aud_vibrator_on_200ms,
770 Aud_vibrator_on_300ms,
771 Aud_vibrator_on_400ms,
772 Aud_vibrator_on_600ms,
773 Aud_vibrator_on_800ms,
774 Aud_vibrator_on_1000ms,
775 Aud_vibrator_on,
776 Aud_vibrator_on_end
777} aud_vibrator_on_enum;
778
779typedef enum {
780 Aud_vibrator_off_200ms,
781 Aud_vibrator_off_300ms,
782 Aud_vibrator_off_400ms,
783 Aud_vibrator_off_600ms,
784 Aud_vibrator_off,
785 Aud_vibrator_off_end
786} aud_vibrator_off_enum;
787
788/* FM radio enumerations */
789typedef enum {
790 aud_fm_radio_rssi_0,
791 aud_fm_radio_rssi_1,
792 aud_fm_radio_rssi_2,
793 aud_fm_radio_rssi_3,
794 aud_fm_radio_rssi_4,
795 aud_fm_radio_rssi_5,
796 aud_fm_radio_rssi_6,
797 aud_fm_radio_rssi_7,
798 aud_fm_radio_rssi_8,
799 aud_fm_radio_rssi_9,
800 aud_fm_radio_rssi_enum_end
801} aud_fm_radio_rssi_enum;
802
803typedef enum {
804 aud_fm_radio_seek_off, /* Station preset */
805 aud_fm_radio_seek_up, /* Auto seek up */
806 aud_fm_radio_seek_down, /* Auto seek down */
807 aud_fm_radio_seek_enum_end
808} aud_fm_radio_seek_mode_enum;
809
810typedef enum {
811 aud_fm_radio_rssi_info, /* SDL message contains RSSI level */
812 aud_fm_radio_seek_info, /* SDL message contains station seek result */
813 aud_fm_radio_rds_info, /* SDL message contains RDS data - only used for module testing */
814 aud_fm_radio_freq_info, /* SDL message contains frequency returned during seeking */
815 aud_fm_radio_sdl_opcodes_end
816} aud_fm_radio_sdl_opcodes_enum;
817
818/* Voice memo enumerations */
819typedef enum {
820 aud_vm_mode_standby,
821 aud_vm_mode_tch,
822 aud_vm_mode_end
823} aud_vm_mode_enum;
824
825typedef enum {
826 aud_dsp_format_fr,
827 aud_dsp_format_amr,
828 aud_dsp_format_pcm,
829 aud_dsp_format_amr_if2,
830 aud_dsp_format_end
831} aud_dsp_format_enum;
832
833typedef enum {
834 aud_media_ffs,
835 aud_media_mmc,
836 aud_media_ram,
837 aud_media_test_ram,
838 aud_media_I2S,
839 aud_media_mmf, /* Support for Multimedia framework */
840 aud_media_mmf_test, /* Support for Multimedia framework */
841 aud_media_vr,
842 aud_media_fs_cdrive, /*FS_FTL_DEVICE1 RW mode*/
843 aud_media_fs_edrive, /*FS_FTL_DEVICE2, RO only */
844 aud_media_fs_fdrive, /*FS_FTL_DEVICE1 RW mode*/
845 aud_media_end
846} aud_media_enum;
847
848typedef enum {
849 aud_amr_475, /* 0 */
850 aud_amr_515,
851 aud_amr_590,
852 aud_amr_670,
853 aud_amr_740,
854 aud_amr_795, /* 5 */
855 aud_amr_102,
856 aud_amr_122,
857 aud_amr_end
858} aud_amr_bitrate;
859
860
861/* PCM player/recorder enumerations */
862typedef enum {
863 aud_pcm_mode_mono,
864 aud_pcm_mode_dual_mono,
865 aud_pcm_mode_stereo,
866 aud_pcm_mode_end
867} aud_pcm_mode_enum;
868
869typedef enum {
870 aud_pcm_rate_1,
871 aud_pcm_rate_2,
872 aud_pcm_rate_3,
873 aud_pcm_rate_4,
874 aud_pcm_rate_5,
875 aud_pcm_rate_6,
876 aud_pcm_rate_7,
877 aud_pcm_rate_8,
878 aud_pcm_rate_9,
879 aud_pcm_rate_end
880} aud_pcm_sample_rate_enum;
881
882typedef enum {
883 aud_pcm_format_pcm,
884 aud_pcm_format_adpcm,
885 aud_pcm_format_wave,
886 aud_pcm_format_end
887} aud_pcm_format_enum;
888
889/* Yamaha Music API (mapi) enumerations */
890typedef enum {
891 aud_mapi_getmode, /* 0 */
892 aud_mapi_setmode,
893 aud_mapi_resetmode,
894 aud_mapi_initialize,
895 aud_mapi_terminate,
896 aud_mapi_checkload, /* 5 */
897 aud_mapi_checkunload,
898 aud_mapi_getcontentsdata,
899 aud_mapi_getphraselist,
900 aud_mapi_realtime_midiopen,
901 aud_mapi_realtime_midisendchmessage, /* 10 */
902 aud_mapi_realtime_starttimer,
903 aud_mapi_realtime_stoptimer,
904 aud_mapi_realtime_midiclose,
905 aud_mapi_realtime_midisendsysexmessage,
906 aud_mapi_realtime_midisetapivolume, /* 15 */
907 aud_mapi_realtime_midigetchvolume,
908 aud_mapi_phrase_audioload,
909 aud_mapi_phrase_audioopen,
910 aud_mapi_phrase_audiostandby,
911 aud_mapi_phrase_audiocontrol, /* 20 */
912 aud_mapi_phrase_audiostart,
913 aud_mapi_phrase_audiostop,
914 aud_mapi_phrase_audioclose,
915 aud_mapi_phrase_audiounload,
916 aud_mapi_phrase_getposition, /* 25 */
917 aud_mapi_phrase_setevhandler,
918 aud_mapi_phrase_getlink,
919 aud_mapi_phrase_setlink,
920 aud_mapi_phrase_kill,
921 aud_mapi_phrase_setdata, /* 30 */
922 aud_mapi_phrase_seek,
923 aud_mapi_phrase_getlength,
924 aud_mapi_phrase_setvolume,
925 aud_mapi_phrase_setpanpot,
926 aud_mapi_phrase_play, /* 35 */
927 aud_mapi_phrase_stop,
928 aud_mapi_phrase_removedata,
929 aud_mapi_phrase_getstatus,
930 aud_mapi_phrase_pause,
931 aud_mapi_phrase_restart, /* 40 */
932 aud_mapi_melody_control,
933 aud_mapi_melody_openarginit,
934 aud_mapi_melody_open,
935 aud_mapi_melody_standby,
936 aud_mapi_melody_waitready, /* 45 */
937 aud_mapi_melody_start,
938 aud_mapi_melody_stop,
939 aud_mapi_melody_seek,
940 aud_mapi_melody_close,
941 aud_mapi_melody_load, /* 50 */
942 aud_mapi_melody_unload,
943 aud_mapi_devicecontrol,
944 aud_mapi_melody_end
945} aud_mapi_if_enum;
946
947/* SBC Encoder enumerations */
948typedef enum {
949 aud_sbc_mono,
950 aud_sbc_dual_channel,
951 aud_sbc_stereo,
952 aud_sbc_joint_stereo,
953 aud_sbc_channel_mode_end
954} aud_sbc_encoder_channel_mode_enum;
955
956typedef enum {
957 aud_sbc_sample_rate_16_khz,
958 aud_sbc_sample_rate_32_khz,
959 aud_sbc_sample_rate_44_1_khz,
960 aud_sbc_sample_rate_48_khz,
961 aud_sbc_sample_rate_end
962} aud_sbc_encoder_sample_rate_enum;
963
964typedef enum {
965 aud_sbc_number_of_blocks_4,
966 aud_sbc_number_of_blocks_8,
967 aud_sbc_number_of_blocks_12,
968 aud_sbc_number_of_blocks_16,
969 aud_sbc_number_of_blocks_end
970} aud_sbc_encoder_number_of_blocks_enum;
971
972typedef enum {
973 aud_sbc_internal_data_encoding_mode,
974 aud_sbc_external_data_encoding_mode,
975 aud_sbc_data_mode_end
976} aud_sbc_encoder_data_mode_enum;
977
978/* I2S enumerations */
979typedef enum {
980 aud_dai_mode_normal,
981 aud_dai_mode_codec_test,
982 aud_dai_mode_acoustic_test,
983 aud_dai_mode_loopback,
984 aud_dai_mode_end
985} aud_dai_mode_enum;
986
987#if defined (aud_old_I2S_interface)
988typedef enum {
989 aud_I2Sx_mode1, /* Mode 1: 16 bit 8 kHz Master, Burst Mode, Mono */
990 aud_I2Sx_mode2, /* Mode 2: 16 bit 8 kHz Slave, Burst Mode, Mono */
991 aud_I2Sx_mode3, /* Mode 3: 16 bit 8 kHz Master, Normal Mode, Mono */
992 aud_I2Sx_mode4, /* Mode 4: 16 bit 8 kHz Slave, Normal Mode, Mono */
993 aud_I2Sx_mode5, /* Mode 5: 16 bit 16 kHz Master, Normal Mode, Mono */
994 aud_I2Sx_mode6, /* Mode 6: 16 bit 16 kHz Slave, Normal Mode, Mono */
995 aud_I2Sx_mode7, /* Mode 7: 16 bit 32 kHz Master, Normal Mode, Mono */
996 aud_I2Sx_mode8, /* Mode 8: 16 bit 32 kHz Master, Normal Mode, Stereo */
997 aud_I2Sx_mode9, /* Mode 9: 16 bit 32 kHz Slave, Normal Mode, Mono*/
998 aud_I2Sx_mode10, /* Mode 10: 16 bit 44.1 kHz Master, Normal Mode, Mono */
999 aud_I2Sx_mode11, /* Mode 11: 16 bit 44.1 kHz Master, Normal Mode, Stereo */
1000 aud_I2Sx_mode12, /* Mode 12: 16 bit 44.1 kHz Slave, Normal Mode, Mono */
1001 aud_I2Sx_mode13, /* Mode 13: 16 bit 48 kHz Master, Normal Mode, Mono */
1002 aud_I2Sx_mode14, /* Mode 14: 16 bit 48 kHz Master, Normal Mode, Stereo */
1003 aud_I2Sx_mode15, /* Mode 15: 16 bit 48 kHz Slave, Normal Mode, Mono */
1004 aud_I2S2_mode_dai, /* set up the I2S2 to dai mode*/
1005 aud_I2Sx_mode16, /* Mode 16: 16bit 8 kHz, Slave, Normal mode, Stereo*/
1006 aud_I2Sx_mode17, /* Mode 17: 16bit 11.025 kHz, Slave, Normal mode, Stereo*/
1007 aud_I2Sx_mode18, /* Mode 18: 16bit 12 kHz, Slave, Normal mode, Stereo*/
1008 aud_I2Sx_mode19, /* Mode 19: 16bit 16 kHz, Slave, Normal mode, Stereo*/
1009 aud_I2Sx_mode20, /* Mode 20: 16bit 22.05 kHz, Slave, Normal mode, Stereo*/
1010 aud_I2Sx_mode21, /* Mode 21: 16bit 24 kHz, Slave, Normal mode, Stereo*/
1011 aud_I2Sx_mode22, /* Mode 22: 16bit 32 kHz, Slave, Normal mode, Stereo*/
1012 aud_I2Sx_mode23, /* Mode 23: 16bit 44.1 kHz, Slave, Normal mode, Stereo*/
1013 aud_I2Sx_mode24, /* Mode 24: 16bit 48k Hz, Slave, Normal mode, Stereo*/
1014 aud_I2Sx_mode25, /* Mode 25: 16bit 8kHz, Master, Normal mode, DualMono*/
1015 aud_I2Sx_mode_end
1016} aud_I2Sx_mode_enum;
1017#endif /* aud_old_I2S_interface */
1018
1019typedef enum {
1020 aud_I2S2_clk0,
1021 aud_I2S2_clk1,
1022 aud_I2S_clk_end
1023} aud_I2S_clk_enum;
1024
1025typedef enum { /* Changes in this enum will change the validation matrix */
1026 aud_I2S_master,
1027 aud_I2S_slave,
1028 aud_I2S_Master_Slave_end
1029} aud_I2S_Master_Slave_enum;
1030
1031typedef enum { /* Changes in this enum will change the validation matrix */
1032 aud_I2S_samplerate_08000,
1033 aud_I2S_samplerate_11025,
1034 aud_I2S_samplerate_12000,
1035 aud_I2S_samplerate_16000,
1036 aud_I2S_samplerate_22050,
1037 aud_I2S_samplerate_24000,
1038 aud_I2S_samplerate_32000,
1039 aud_I2S_samplerate_44100,
1040 aud_I2S_samplerate_48000,
1041 aud_I2S_samplerate_end
1042} aud_I2S_samplerate_enum;
1043
1044typedef enum {
1045 aud_I2S_sample_width_16,
1046 aud_I2S_sample_width_18,
1047 aud_I2S_sample_width_20,
1048 aud_I2S_sample_width_24,
1049 aud_I2S_sample_width_32,
1050 aud_I2S_sample_width_end
1051} aud_I2S_sample_width_enum;
1052
1053typedef enum { /* Changes in this enum will change the validation matrix */
1054 aud_I2S_transmission_mode_PCM,
1055 aud_I2S_transmission_mode_normal, /* Normal I2S */
1056 aud_I2S_transmission_mode_end
1057} aud_I2S_transmission_mode_emum;
1058
1059typedef enum {
1060 aud_I2S_setting_normal,
1061 aud_I2S_setting_special_case1,
1062 aud_I2S_setting_special_case2,
1063 aud_I2S_setting_end
1064} aud_I2S_setting_enum;
1065
1066typedef enum { /* Changes in this enum will change the validation matrix */
1067 aud_I2S_mode_mono,
1068 aud_I2S_mode_dual_mono,
1069 aud_I2S_mode_stereo,
1070 aud_I2S_mode_end
1071} aud_I2S_mode_enum;
1072
1073typedef enum { /* Changes in this enum will change the validation matrix */
1074 aud_I2S_entry_point_MMS,
1075 aud_I2S_entry_point_MMS_FB, /* located at the frame-based part of the voiceband processing system */
1076 aud_I2S_entry_point_External,
1077 aud_I2S_entry_point_DAI,
1078 aud_I2S_entry_point_end
1079} aud_I2S_entry_point_enum;
1080
1081typedef enum {
1082 aud_8_KHz,
1083 aud_16_KHz,
1084 aud_sample_rate_end
1085}aud_sample_rate_enum;
1086
1087#if defined (aud_old_I2S_interface)
1088typedef enum {
1089 aud_disable_pcm_channel,
1090 aud_enable_pcm_channel,
1091 aud_enable_pcm_channel_and_Dai,
1092 aud_enable_pcm_channel_externalmode,
1093 aud_audio_pcm_end
1094} aud_audio_pcm_enum;
1095
1096typedef enum {
1097 aud_pcm_direction_rx,
1098 aud_pcm_direction_tx,
1099 aud_pcm_direction_rx_tx,
1100 aud_pcm_direction_end
1101} aud_pcm_direction_enum;
1102#endif /* aud_old_I2S_interface */
1103
1104/* smaf enumerations */
1105typedef enum {
1106 aud_smaf_err_ok, /* 0 */
1107 aud_smf_err_initialize_failed,
1108 aud_smf_err_create_failed,
1109 aud_smf_err_load_failed,
1110 aud_smf_err_open_failed,
1111 aud_smf_err_evhand_failed, /* 5 */
1112 aud_smf_err_standby_failed,
1113 aud_smf_err_seek_failed,
1114 aud_smf_err_control_failed,
1115 aud_smf_err_start_failed,
1116 aud_smf_err_stop_failed, /* 10 */
1117 aud_smf_err_close_failed,
1118 aud_smf_err_unload_failed,
1119 aud_smf_err_delete_failed,
1120 aud_smf_err_invalid_parameters,
1121 aud_smf_err_wrong_state /* 15 */
1122} aud_smaf_error_enum;
1123
1124/* DSP info */
1125typedef enum {
1126 aud_dsp_tch_mode,
1127 aud_dsp_pdch_mode,
1128 aud_dsp_idle_mode,
1129 aud_dsp_bb_off_mode,
1130 aud_dsp_bb_off_tch_26_mode,
1131 aud_dsp_mode_end
1132} aud_dsp_info_enum;
1133
1134/* Accessory enumeration (deprecated) */
1135typedef enum {
1136 aud_accessory_normal, /* 0 */
1137 aud_accessory_headset,
1138 aud_accessory_back_speaker_normal_mic,
1139 aud_accessory_midi_louder_speaker,
1140 aud_accessory_bt_headset,
1141 aud_accessory_stereo_phones, /* 5 */
1142 aud_accessory_car_kit,
1143 aud_accessory_end
1144} aud_accessory_enum;
1145
1146/* Layer 1 info (deprecated) */
1147typedef enum {
1148 aud_layer1_tch_mode,
1149 aud_layer1_pdch_mode,
1150 aud_layer1_idle_mode,
1151 aud_layer1_bb_off_mode,
1152 aud_layer1_bb_off_tch_26_mode,
1153 aud_layer1_mode_end
1154} aud_layer1_info_enum;
1155
1156/* Resource capability enumerations (deprecated) */
1157typedef enum {
1158 uplink_paths_supported, //deprecated
1159 downlink_paths_supported, //deprecated
1160 resource_conflict, //deprecated
1161 features_supported //deprecated
1162} aud_resource_capability_enum; //this enum is only used by deprecated function AUD_get_resource_capability
1163
1164/* Test ram buffer enumerations */
1165typedef enum {
1166 aud_testrambufferstatus_free, /* ram buffer is free to allocate */
1167 aud_testrambufferstatus_busy, /* ram buffer is used by players */
1168 aud_testrambufferstatus_copy, /* copying is ongoing */
1169 aud_testrambufferstatus_idle, /* ram buffer is allocated and copied but not used */
1170 aud_testrambufferstatus_end
1171} aud_testrambuffer_status_enum;
1172
1173/* Callback function type definitions */
1174typedef int (*ptr_GetAudioBufferFunction)(
1175 /* audiobuffer */ U8 **,
1176 /* size */ U16 *,
1177 /* user_data */ void *user_data);
1178typedef void (*ptr_SetVbOnStatusFunction)(
1179 /* Status */ U8);
1180typedef void (*ptr_FmRadioRdsCallbackFunction)(
1181 /* rds_buffer */ U8 *,
1182 /* num_bytes */ U16);
1183
1184/* Structures for acoustic test */
1185#define AUD_MAX_MIC_FREQ_NUM 3
1186typedef struct {
1187 U16 freq_mid;
1188 U16 UpperLimit;
1189 U16 LowerLimit;
1190} InputMicVal_Type;
1191
1192typedef struct {
1193 U16 actest_no_of_freq;
1194 U16 actest_no_of_freq_outoflim;
1195 U16 actest_scal;
1196 U16 actest_ppeak;
1197 U16 actest_npeak;
1198 U16 actest_level_f1;
1199 U16 actest_level_f2;
1200 U16 actest_level_f3;
1201 U16 actest_level_f4;
1202 U16 actest_level_f5;
1203 U16 actest_level_f6;
1204} T_DSP_CMD_ACOUSTIC_TEST_RESULT_PAR;
1205
1206/******************************************************************************
1207*
1208* Global variables
1209*
1210******************************************************************************/
1211extern U8 aud_mon_gaim_setting[2];
1212
1213#if defined (VMS_PRESENT)
1214extern ptr_GetAudioBufferFunction getAudioBuffer;
1215#endif
1216
1217#if defined (MP3_PRESENT)
1218extern ptr_GetAudioBufferFunction mp3_getAudioBuffer;
1219#endif
1220
1221#define AUD_GLOBAL_TONE_DUR_INTER_DEFAULT_VALUE 10
1222extern U16 aud_global_tone_dur_inter;
1223
1224
1225#ifdef _OS_WIN
1226#define DISABLE_CLOCK
1227#define ENABLE_CLOCK
1228
1229#define ATOMIC_BEGIN
1230#define ATOMIC_END
1231#else
1232#define DISABLE_CLOCK ZOSS_DISABLE_IRQ();
1233#define ENABLE_CLOCK ZOSS_ENABLE_IRQ();
1234
1235#define ATOMIC_BEGIN ZOSS_DISABLE_IRQ();
1236#define ATOMIC_END ZOSS_ENABLE_IRQ();
1237#endif
1238
1239#ifndef MAX
1240#define MAX(A,B) ( (A) > (B) ? (A) : (B) )
1241#endif
1242
1243/******************************************************************************
1244*
1245* Prototypes for interface functions
1246*
1247******************************************************************************/
1248
1249/* Resource allocation */
1250S8 AUD_allocate_resource(U16 id, aud_resource_enum resource, aud_priority_enum priority);
1251S8 AUD_release_resource(U8 handle);
1252
1253/* Path control */
1254U32 AUD_get_downlnk_parallel_path_configuration(aud_downlink_source_enum path);
1255U32 AUD_get_uplink_parallel_path_configuration(aud_uplink_source_enum path);
1256S8 AUD_add_uplinkpath(aud_uplink_source_enum path);
1257S8 AUD_remove_uplinkpath(aud_uplink_source_enum path);
1258S8 AUD_add_downlinkpath(aud_downlink_source_enum path);
1259S8 AUD_remove_downlinkpath(aud_downlink_source_enum path);
1260S8 AUD_Pathupdate_Enable(void);
1261S8 AUD_Pathupdate_Disable(void);
1262S8 AUD_set_eq_vol_threshold(aud_downlink_source_enum path, aud_volume_enum eq_volume_threshold);
1263
1264/* Volume control */
1265S8 AUD_set_resource_volume(U8 handle, aud_volume_enum volume);
1266S8 AUD_set_master_volume(aud_volume_enum volume);
1267S8 AUD_mute_resource(U8 handle, aud_mute_enum enable_disable,
1268 aud_ul_dl_direction_enum direction);
1269S8 AUD_mute_master(aud_mute_enum enable_disable);
1270
1271/* Speech */
1272S8 AUD_speech_enable(U8 handle);
1273S8 AUD_speech_disable(U8 handle);
1274S8 AUD_set_EC_NR(U8 EC_on, U8 NR_on);
1275
1276/* Tone generator */
1277S8 AUD_tone_start(U8 handle, aud_tone_id_enum tone_id,
1278 U16 nof_repeats, S16 mix_factor);
1279S8 AUD_tone_start_user_tone(U8 handle, void *tone_data, aud_tone_type_enum type,
1280 U32 nof_tones, U16 nof_repeats, S16 mix_factor);
1281S8 AUD_tone_stop(U8 handle);
1282S8 AUD_tone_suspend(U8 handle, U8 slot_id);
1283S8 AUD_tone_resume(U8 handle, U8 slot_id);
1284S8 AUD_tone_get_total_playtime(U8 handle, aud_tone_id_enum tone_id, void *tone_data,
1285 U32 nof_tones, aud_tone_type_enum type);
1286S8 AUD_tone_get_play_position(U8 handle);
1287S8 AUD_tone_set_play_position(U8 handle, U32 pos);
1288
1289/* Ringer */
1290S8 AUD_ringer_start(U8 handle, aud_ringer_tone_id_enum tone_id,
1291 U16 nof_repeats, aud_ringer_device_enum device);
1292S8 AUD_ringer_start_user_tone(U8 handle, U8 DWD_HUGE *ringer_data,
1293 U32 size, aud_format_enum format, U16 nof_repeats,
1294 aud_ringer_device_enum device, U8 channel, U8 channel_volume);
1295S8 AUD_ringer_stop(U8 handle, U8 channel);
1296S8 AUD_ringer_set_channel_volume(U8 handle, U8 channel_volume, U8 channel);
1297S8 AUD_ringer_suspend(U8 handle, U8 SlotID, U8 channel);
1298S8 AUD_ringer_resume(U8 handle, U8 SlotID, U8 channel);
1299S8 AUD_ringer_stop_suspend(U8 handle, U8 SlotID, U8 channel);
1300S8 AUD_ringer_get_total_playtime(U8 handle, U8 DWD_HUGE *data, U32 data_size,
1301 aud_format_enum format, aud_ringer_tone_id_enum tone_id);
1302S8 AUD_ringer_get_playposition(U8 handle);
1303S8 AUD_ringer_set_playposition(U8 handle, U8 channel, U32 offset);
1304
1305/* Vibrator */
1306void AUD_vibrator_enable(aud_vib_mode mode, U8 channel);
1307void AUD_vibrator_pause(void);
1308void AUD_vibrator_disable(void);
1309
1310/* FM Radio */
1311S8 AUD_radio_enable(U8 handle);
1312S8 AUD_radio_disable(U8 handle);
1313S8 AUD_radio_rssi_subscribe(U8 handle, aud_fm_radio_rssi_enum lower_threshold,
1314 aud_fm_radio_rssi_enum upper_threshold);
1315S8 AUD_radio_rds_subscribe(U8 handle, ptr_FmRadioRdsCallbackFunction pCbFunc);
1316S8 AUD_radio_set_station(U8 handle, aud_fm_radio_seek_mode_enum seekmode,
1317 U32 frequency, aud_fm_radio_rssi_enum detect_level, U8 force_mono);
1318S8 AUD_radio_get_frequency(U8 handle);
1319
1320/* Voice memo */
1321S8 AUD_vm_start_recording(
1322 U8 handle,
1323 aud_vm_mode_enum vm_mode,
1324 aud_media_enum media_type,
1325 aud_dsp_format_enum format,
1326 U8 rate,
1327 U16 DWD_HUGE *file_handle,
1328 U32 buffer_size,
1329 U32 offset);
1330S8 AUD_vm_stop_recording(U8 handle);
1331S8 AUD_vm_start_playback(
1332 U8 handle,
1333 aud_vm_mode_enum vm_mode,
1334 aud_media_enum media_type,
1335 aud_dsp_format_enum format,
1336 U16 DWD_HUGE *file_handle,
1337 U32 buffer_size,
1338 U16 nof_repeats,
1339 U32 offset);
1340S8 AUD_vm_stop_playback(U8 handle);
1341void Aud_vms_set_getbuffer_function(U8 handle, ptr_GetAudioBufferFunction func,
1342 void * user_data);
1343S8 AUD_vm_suspend(U8 handle, U8 slot_id);
1344S8 AUD_vm_resume(U8 handle, U8 slot_id);
1345S8 AUD_vm_get_total_playtime(
1346 U8 handle,
1347 aud_media_enum media_type,
1348 aud_dsp_format_enum format,
1349 U16 DWD_HUGE *file_handle,
1350 U32 buffer_size,
1351 U32 offset);
1352S8 AUD_vm_get_play_position(U8 handle);
1353S8 AUD_vm_set_play_position(
1354 U8 handle,
1355 U32 pos,
1356 U16 DWD_HUGE *file_handle,
1357 U32 buffer_size);
1358S8 AUD_vm_stop_suspend(U8 handle, U8 slot_id);
1359
1360/* MP3 Player */
1361S8 AUD_mp3_start(U8 handle, aud_media_enum media_type, U16 DWD_HUGE *file_handle,
1362 U32 buffer_size, U32 id_offset, U32 start_frame, U16 nof_repeats);
1363S8 AUD_mp3_stop(U8 handle);
1364S8 AUD_mp3_suspend(U8 handle, U16 slot_id);
1365S8 AUD_mp3_resume(U8 handle, U16 slot_id);
1366S8 AUD_mp3_fastforward(U8 handle, U32 frame, U16 slot_id);
1367S8 AUD_mp3_backward(U8 handle, U32 frame, U16 slot_id);
1368void Aud_mp3_set_getbuffer_function(U8 handle, ptr_GetAudioBufferFunction func,
1369 void * user_data);
1370S8 Aud_mp3_get_current_frame(U8 handle, U16 slot_id);
1371S8 AUD_mp3_get_total_playtime(U8 handle, aud_media_enum media_type,
1372 U16 DWD_HUGE *file_handle, U32 buffer_size,
1373 U32 id_offset );
1374S8 AUD_mp3_get_play_position(U8 handle);
1375S8 AUD_mp3_set_play_position(U8 handle, U32 pos, U16 DWD_HUGE *file_handle,
1376 U32 buffer_size);
1377S8 AUD_mp3_stop_suspend(U8 handle, U8 SlotID);
1378
1379/* TTY */
1380S8 AUD_tty_enable(U8 handle);
1381S8 AUD_tty_disable(U8 handle);
1382S8 AUD_tty_set_negotiation(U8 handle,U8 on_off);
1383
1384/* PCM player/recorder */
1385S8 AUD_pcm_intern_start_playback(
1386 U8 handle,
1387 aud_pcm_mode_enum mode,
1388 aud_pcm_sample_rate_enum sample_rate,
1389 U8 bit_rate,
1390 aud_media_enum media_type,
1391 aud_pcm_format_enum format,
1392 U16 DWD_HUGE *file_handle,
1393 U32 buffer_size,
1394 U16 nof_repeats,
1395 U32 start_offset);
1396S8 AUD_pcm_intern_stop_playback(U8 handle);
1397S8 AUD_pcm_intern_start_recording(
1398 U8 handle,
1399 aud_pcm_sample_rate_enum sample_rate,
1400 aud_media_enum media_type,
1401 aud_pcm_format_enum format,
1402 U16 DWD_HUGE *file_handle,
1403 U32 buffer_size,
1404 U32 start_offset);
1405S8 AUD_pcm_intern_stop_recording(U8 handle);
1406S8 AUD_pcm_intern_getbuffer_function(U8 handle, ptr_GetAudioBufferFunction func,
1407 void * user_data);
1408S8 AUD_pcm_intern_suspend(U8 handle, U8 slot_id);
1409S8 AUD_pcm_intern_resume(U8 handle, U8 slot_id);
1410S8 AUD_pcm_intern_stop_suspend(U8 handle, U8 slot_id);
1411S8 AUD_pcm_intern_get_total_playtime(U8 handle, aud_media_enum media_type,
1412 aud_pcm_format_enum format, aud_pcm_sample_rate_enum sample_rate,
1413 aud_pcm_mode_enum mode, U8 bit_rate,
1414 U16 DWD_HUGE *file_handle, U32 buffer_size, U32 offset);
1415S8 AUD_pcm_intern_get_play_position(U8 handle);
1416S8 AUD_pcm_intern_set_play_position(U8 handle, U32 pos,
1417 U16 DWD_HUGE *file_handle, U32 buffer_size);
1418
1419/* Yamaha Music API (mapi) */
1420S8 AUD_mapi(U8 handle, aud_mapi_if_enum func_id, U32 parm1, U32 parm2,
1421 U32 parm3, U32 parm4, U32 parm5, U32 parm6, U32 parm7);
1422
1423/* Inband resource, used for non-baseband audio */
1424/**
1425 * AUD_non_baseband_resource_start
1426 *
1427 * This function activates the inband virtual resource, used for non-baseband audio.
1428 * Only use this when aud_resource_inband is allocated. The resource is virtual,
1429 * so the usecase is non-baseband audio output on whatever paths are enabled.
1430 *
1431 * @param handle (generated by AUD_allocate_resource)
1432 * @see AUD_allocate_resource
1433 * @return signed 8bit integer (error code)
1434 */
1435S8 AUD_non_baseband_resource_start(U8 handle);
1436
1437/**
1438 * AUD_non_baseband_resource_stop
1439 *
1440 * This function deactivates the inband virtual resource, used for non-baseband audio.
1441 * Only use this when aud_resource_inband is allocated. The resource is virtual,
1442 * so the usecase is non-baseband audio output on whatever paths are enabled.
1443 *
1444 * @param handle (generated by AUD_allocate_resource)
1445 * @see AUD_allocate_resource
1446 * @return signed 8bit integer (error code)
1447 */
1448S8 AUD_non_baseband_resource_stop(U8 handle);
1449
1450/* SM Power */
1451/**
1452 * AUD_SMPower_enable
1453 *
1454 * This function is to trigger the power-on of the SM Power Gain Amplifier
1455 * Only use this when allocating the aud_resource_smpower. The resource is virtual,
1456 * so the usecase is an external device outputting through SM power.
1457 *
1458 * @param handle (generated by AUD_allocate_resource)
1459 * @see AUD_allocate_resource
1460 * @return signed 8bit integer (error code)
1461 */
1462S8 AUD_SMPower_enable(U8 handle);
1463/**
1464 * AUD_SMPower_disable
1465 *
1466 * This function is to trigger the power-off of the SM Power Gain Amplifier
1467 * Only use this when allocating the aud_resource_smpower. The resource is virtual,
1468 * so the usecase is an external device outputting through SM power.
1469 *
1470 * @param handle (generated by AUD_allocate_resource)
1471 * @see AUD_allocate_resource
1472 * @return signed 8bit integer (error code)
1473 */
1474S8 AUD_SMPower_disable(U8 handle);
1475
1476/* SBC Encoder */
1477S8 AUD_sbc_encoder_start (U8 handle,
1478 aud_sbc_encoder_data_mode_enum data_mode,
1479 aud_sbc_encoder_channel_mode_enum channel_mode,
1480 aud_sbc_encoder_sample_rate_enum sample_rate,
1481 aud_sbc_encoder_number_of_blocks_enum no_of_blocks,
1482 U8 bitpool);
1483S8 AUD_sbc_encoder_stop(U8 handle);
1484S8 AUD_sbc_encoder_suspend(U8 handle, U8 slot_id);
1485S8 AUD_sbc_encoder_resume (U8 handle, U8 slot_id);
1486S8 AUD_sbc_encoder_set_getinputbuffer_function(U8 handle,
1487 ptr_GetAudioBufferFunction input_buffer_function,
1488 void * user_data);
1489S8 AUD_sbc_encoder_set_getoutputbuffer_function(U8 handle,
1490 ptr_GetAudioBufferFunction output_buffer_function,
1491 void * user_data);
1492
1493/* I2S2 Rx and Tx*/
1494#if defined (aud_old_I2S_interface)
1495S8 AUD_configure_pcm_channel(U8 handle, aud_I2Sx_mode_enum mode);
1496S8 AUD_pcm_channel_routing(U8 handle, U8 input_to_uplink, U8 input_to_downlink,
1497 U8 output_from_uplink, U8 output_from_downlink);
1498S8 AUD_pcm_channel_enable(U8 handle, aud_pcm_direction_enum direction);
1499S8 AUD_pcm_channel_disable(U8 handle);
1500#endif /* aud_old_I2S_interface */
1501S8 AUD_I2S_enable_resource(U8 handle);
1502S8 AUD_I2S_disable_resource (U8 handle);
1503S8 AUD_I2S_setup_clock(aud_I2S_clk_enum clock,
1504 aud_I2S_Master_Slave_enum Master_Slave,
1505 aud_I2S_samplerate_enum samplerate,
1506 aud_I2S_sample_width_enum sample_width,
1507 aud_I2S_transmission_mode_emum transmission_mode,
1508 aud_I2S_setting_enum settings,
1509 aud_I2S_mode_enum I2S_mode);
1510S8 AUD_I2S_setup_resource(U8 handle,
1511 aud_I2S_clk_enum clock,
1512 aud_I2S_entry_point_enum entry_point);
1513
1514/* I2S1 */
1515S8 AUD_configure_bluetooth(U8 handle, aud_I2Sx_mode_enum mode);
1516
1517/* 3D stereo */
1518S8 AUD_3D_mode_enable(void);
1519S8 AUD_3D_mode_disable(void);
1520
1521/* Interrupts */
1522void AUD_tone_handle_int(void);
1523void AUD_TONE_int_handler(int vector);
1524void AUD_poak_int2_handle_int(void);
1525void AUD_POAK_INT2_int_handler(int vector);
1526void AUD_TEAK_INT5_int_handler(int vector);
1527void AUD_teak_int5_handle_int(void);
1528void AUD_TEAK_INT4_int_handler(int vector);
1529void AUD_teak_int4_handle_int(void);
1530void AUD_TEAK_INT6_int_handler(int vector);
1531void AUD_teak_int6_handle_int(void);
1532void AUD_TEAK_INT7_int_handler(int vector);
1533void AUD_teak_int7_handle_int(void);
1534void AUD_hal_fm_radio_lisr_int_handler(int vector); /* LISR for FM Radio interrupt */
1535
1536/* Misc functions */
1537U32 AUD_info_hw_available(void);
1538void AUD_misc_dsp_info(aud_dsp_info_enum dsp_info); /* Only to be used on interface between DSP and AUD */
1539S8 Aud_set_vb_on_status_function(ptr_SetVbOnStatusFunction func);
1540
1541/* Misc functions */
1542void aud_drv_check_timeout(void);
1543void aud_dai_mode(aud_dai_mode_enum dai_mode);
1544void aud_drv_restart_hf(void);
1545
1546/* Test functions */
1547U16 AUD_ptest_generic_func(void *func_req_ptr); /* generic ATCP test interface */
1548U16 AUD_ptest_generic_func_memaligned(void *func_req_ptr);
1549
1550/* FFT analysis */
1551S8 AUD_FFT_Start(U16 NoOfFrames, U16 AverageExponent, U16 RefLevel, U16 QFormat,
1552 InputMicVal_Type *pMicVal);
1553S8 AUD_FFT_GetResult(T_DSP_CMD_ACOUSTIC_TEST_RESULT_PAR **pFFT_Result);
1554
1555/* Audio Dispatcher - should only be used in aud_intf.c and aud_op.c */
1556void AudioDispatcher(
1557 SDL_Pid sender,
1558 U8 event,
1559 U16 caller_id,
1560 U32 parm1,
1561 U32 parm2,
1562 U32 parm3,
1563 U32 parm4,
1564 U32 parm5,
1565 U32 parm6,
1566 U32 parm7,
1567 U32 parm8,
1568 U8 *ptr1,
1569 U8 *ptr2);
1570
1571/******************************************************************************
1572*
1573* Deprecated functions
1574*
1575******************************************************************************/
1576/* Do not remove the following functions here - file is shared between EGold, SGold and other systems */
1577/* This is old stuff that has to be removed when Apoxi has cleaned out their inclusion of old files - depending on this */
1578
1579S8 AUD_media_to_uplink(U8 enable_disable); /* deprecated - use new path aud_media_to_uplink instead */
1580S8 AUD_media_to_downlink(U8 enable_disable); /* deprecated - use new path aud_media_to_downlink_mute instead */
1581U32 AUD_get_resource_capability(aud_resource_enum resource, aud_resource_capability_enum capability);
1582S8 AUD_key_tone(aud_tone_id_enum key_tone, S16 mix_factor);
1583S8 AUD_amp_enable(U8 handle);
1584S8 AUD_amp_disable(U8 handle);
1585S8 AUD_vibrator_start(U8 handle, aud_vibrator_mode_enum mode,
1586 aud_vibrator_on_enum on, aud_vibrator_off_enum off);
1587S8 AUD_vibrator_stop(U8 handle);
1588void AUD_misc_set_accessory(aud_accessory_enum accessory);
1589void AUD_misc_set_vmic(U8 status);
1590S8 AUD_set_volume(U8 handle, aud_volume_enum volume);
1591S8 AUD_speech_set_volume(U8 handle, aud_speech_volume_enum volume);
1592S8 AUD_ringer_set_volume(U8 handle,aud_ringer_volume_enum volume);
1593void AUD_init(void);
1594S8 AUD_radio_init(U8 handle);
1595S8 AUD_radio_config(U8 handle, void * aud_radio_config_data);
1596S8 AUD_radio_read_current_status(U8 handle);
1597S8 AUD_radio_mute(U8 handle,U8 mute);
1598S8 AUD_speech_mute(U8 handle,aud_mute_enum status,aud_direction_enum direction);
1599#ifdef USE_VOICE_SUPPORT
1600void AUD_misc_layer1_info(aud_layer1_info_enum layer1_info); /* Only to be used on interface between AUD and Layer1 */
1601#endif
1602#endif /* _AUD_INTERFACES */
1603/* End of file. */