am_hw_primitive_builder_interrupt.cc

来自「Motorola synergy audio component」· CC 代码 · 共 881 行 · 第 1/3 页

CC
881
字号
/* (c) Copyright Motorola 1998-2006, All rights reserved.           Motorola Confidential Proprietary   Contains confidential proprietary information of Motorola, Inc.   Reverse engineering is prohibited.   The copyright notice does not imply publication.     DESCRIPTION:       File contains functions handling GINT interrupt from DSP. Interrupt routine       takes part in VA/VR data transfer between DSP and FDI task.   *************** REVISION HISTORY *********************************************     Date       Author      Reference   ========   ========    ==========================   2006-02-09 a19950      CR - LIBhh86762              port LIBhh30373 to P44   2005-12-13 w16355      CR - LIBhh59411              AUL stereo DAC can take up to 160ms to fully power up.   05-11-29   e42737      LIBhh30827              Protect against getting an interrupt from DSP when not expecting one   05-01-11   aja099      Libff52262              Fixing merge error when LIBff48418 was integrated   04-12-22   aja099      LIBff48418              -PANIC:  When playing second prompt.  Reset flag for               is_va_playback_active in new VST transfer function   04-11-23   aja099      LIBff38547                          VST VR Port   03-06-13   aaa063      LIBdd01040                          Implementation of VST VR functionality   04-02-19   w17860      LIBdd76721              PANIC: When fast forwarding on Voice Record.              - This occurs when we FF to end.    04-02-03   w17860      CR - LIBdd72293              FT:Panic when VoiceRecord was playing and fast forward was pressed              - Removed the MCU_DSP_VA_PLAYBACK_OFF from the Interrupt handler                for VA playback. This is already handled in the audio manager.   03-08-28   qcf001      CR - LIBdd34394              Offset was hardcoded for GSM FR, needs to work for AMR.              This causes FFWD/REW VA bugs.   03-08-13   w18944      CR - LIBdd27220              For neptune, always send global data first on recognize   01-12--2   w18944      CR - LIBbb13452              Integrate VR LITE 2.0 (no global data)   02-05-06   baf044      CR - LIBbb31304              Porting CR LIBbb19762 for LCA.   02-02-27   arc095      CR - LIBbb19762              Make AM VR code complaint with both GROM3 and GROM6 DSPs.   01-08-03   arc095      CR - LIBbb00693              MCU AM should check for message ID when reading VR model data from DSP   01-01-10   qcf001      CR - CSGce83048              Remove Whitecap code to clear interrupt, fixes VR Powerdown   00-12-21   mtaraba     CSGce82934              main_comp_hardware.h within engine_audio vob should be removed   00-09-01   blamers     CR - CSGce61298              Complete functionality for VA FF/Rew              - Add an offset parameter for VA messaging   00-08-09   mtaraba     CR - CSGce55882              Eliminate file gsm.h from audio manager   00-05-15   cfarrel     CR - CSGce58264              Update Audio Manager to use l1_modem_api queue functions for              CDMA and HAPI_mdi_queue functions for other MAs.   00-05-08   cfarrel     CR - CSGce57355              Provide VA/VR interrupt function for RX/TX0              - added stub called AUDIO_VA_VR_transfer_data for now   00-05-01   wchoi       CR - csgce56606              VA/VR Interrupt routine rewritten.              Added full support for VA/VR.   00-04-14   hchuang     CR - CSGce54805              update current prim id to HAPI generic prim id              - replace sc_prim_ids with hapi_mdi_message_ids   99-03-29   blamers     PR - CSGce30057              no tag playback using volume keys              - Added a global variable used to determine if the complete from the                DSP is handled. The variable is set when this interrupt handler                sends a va stop to the DSP without handling it in the AM.   99-03-23   blamers     CR - CSGce30036              VR Lockup due to missing global data              - The stop semaphore was removed and replaced with a volatile BOOL flag.                If the semaphore is set when the seem has already halted the stop will                incorrectly occur on the next start.              - The BOOL flag will be properly set in the initialization function.   99-03-10   blamers     CR - CSGce29457              VR Recognize and VA Count              - Reset the rd and wr pointers when switching between banks to prevent                rereading a previously read buffer.              - Write data into the API in a while loop to make sure it is full.              - Moved Bank enum to this file and created Switch_Banks macro.   99-02-26   blamers     CR - CSGce28847              VA/VR Stream Task Improvements              - Added an initialization function              - Fixed the VA Playback powerdown   98-12-21   mkloza      CR - CSGce26100              VA/VR Interrupt Data Transfer              - updated file to follow latest FDI/EEPROM                design requirements   98-10-02   mkloza      CR - CSGce22795*//************** INCLUDES ******************************************************/#include <SUAPI/suapi.h>#include <string.h>#include <ENGINE_AUDIO/audio_conditional_compile_def.h>#include <ENGINE_AUDIO/am_hw_primitive_builder_interrupt.h>#if (AUDIO_DATA_STREAM_CAPABLE == TRUE)#include <audio/am_va_info.h>#include <audio/AM_Relay_Layer.H>#include <ENGINE_AUDIO/am_hw_string_primitive.h>#include <ENGINE_HAPI/hapi_mdi_queue_map.h>#include <ENGINE_HAPI/hapi_mdi_queue.h>#include <ENGINE_HAPI/hapi_mdi_message_ids.h>#include <ENGINE_SEEM/seem_fdi_type.h>#include <seem/seem_globals.h>#include <seem/seem_data_stream_main_task.h>#include <seem/seem_fdi_internal.h>#include <audio/am_utils.h>#include <ENGINE_AUDIO/aud_interface.h>/************** LOCAL CONSTANTS ***********************************************//************** LOCAL STRUCTURES, ENUMS, AND TYPEDEFS *************************/// BANK enumsenum{    BANK_A,    BANK_B,    NUM_BANKS};extern "C" {void ReadConfirmed(void);#endif};/************** LOCAL MACROS **************************************************/// DESCRIPTION: This macro toggles between BANK_A and BANK_B#define Switch_Banks(bank) bank ^= BANK_B/************** STATIC DECLARATION ********************************************/AM_VA_VR_INT_INFO am_va_vr_int_info = {    0,                                          // msg_offset    SEEM_FDI_NO_TRANSFER,                       // data_mode    (AM_TRANSFER_DATA)MCU_DSP_VA_PLAYBACK_DATA, // data_type    0,                                          // message_length    0,                                          // max_transfer_size    FALSE,                                      // eom    FALSE                                       // is_va_playback_active};BOOL am_va_vr_int_handle_vtag_complete = FALSE;#if (AUDIO_RAINBOW == TRUE)extern BOOL dsp_awake;#endif/************** LOCAL VARIABLES ***********************************************/UINT16* const start_seem_bank_ptr[ NUM_BANKS ] = {    SEEM_data_stream_bank_a, SEEM_data_stream_bank_b   };UINT16** const seem_bank_wr_ptr[ NUM_BANKS ] = {    &SEEM_data_stream_bank_a_wt_ptr,    &SEEM_data_stream_bank_b_wt_ptr  };UINT16** const seem_bank_rd_ptr[ NUM_BANKS ] = {    &SEEM_data_stream_bank_a_rd_ptr,    &SEEM_data_stream_bank_b_rd_ptr };// NOTE: In API_RAM we treat both buffers as though they have the same lengthconst UINT16 seem_bank_size[ NUM_BANKS ] = {    SEEM_DATA_STREAM_BANK_B_SIZE, SEEM_DATA_STREAM_BANK_B_SIZE};static UINT8 current_SEEM_bank = BANK_A;/***********************FUNCTION PROTOTYPES ************************************/void FinishTransfer();UINT16 CheckOtherBank(BOOL);void TransferVAFromSeemToMDI();void TransferVAFromMDIToSeem();void TransferModelDataFromSeemToMDI();void TransferModelDataFromMDIToSeem();void TransferVAFromRAMToMDI();/************** FUNCTION DEFINITIONS ******************************************//* DESCRIPTION:       This function is used to setup the read and write pointer when transferring       data from the API to RAM. This routine also forces the interrupt to read or       write using bank A first.   INPUTS:       none   OUTPUTS:       none   IMPORTANT NOTES:       none*/void AM_HW_Primitive_Builder_interrupt_init(void){     //reset global boolean stop    seem_stop_data_transfer = FALSE;    current_SEEM_bank = BANK_A;    //reset read pointers    *(seem_bank_rd_ptr[BANK_A]) = start_seem_bank_ptr[BANK_A];    *(seem_bank_rd_ptr[BANK_B]) = start_seem_bank_ptr[BANK_B];    *(seem_bank_wr_ptr[BANK_A]) = start_seem_bank_ptr[BANK_A];    *(seem_bank_wr_ptr[BANK_B]) = start_seem_bank_ptr[BANK_B];}/* DESCRIPTION:       Interrupt routine handling data transfer during        VA/VR operations.    INPUTS:       none   OUTPUTS:       none   IMPORTANT NOTES:       This function must be of "void" type and should not accept any parameters.       This will allow for the function to be called from "C" code.*/                            void GINT_interrupt(void)    {#if (AUDIO_DATA_STREAM_CAPABLE == TRUE)    if( am_va_vr_int_info.data_mode == SEEM_FDI_VA_VR_TRANSFER_API_RAM )    {        if(am_va_vr_int_info.data_type == AM_DSP_MCU_VR_MODEL_DATA)        {            TransferModelDataFromMDIToSeem();        }        else        {            TransferVAFromMDIToSeem();        }    }    else if( am_va_vr_int_info.data_mode == SEEM_FDI_VA_VR_TRANSFER_RAM_API )    {        if(am_va_vr_int_info.data_type == AM_MCU_DSP_VR_MODEL_DATA)        {            TransferModelDataFromSeemToMDI();        }        else        {            TransferVAFromSeemToMDI();        }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?