am_mdi_queue_controller.c
来自「Motorola synergy audio component」· C语言 代码 · 共 151 行
C
151 行
#ifdef __cplusplusextern "C" {#endif/*================================================================================================== Module Name: am_mdi_queue_controller.h General Description: Provides access to the mdi audio command and reply queues.==================================================================================================== Motorola Confidential Proprietary Advanced Technology and Software Operations (c) Copyright Motorola 2001 All Rights Reserved Revision History: Modification TrackingAuthor Date Number Description of Changes------------------------- ------------ ---------- -------------------------------------------L Haegele-w18944 09/24/2002 LIBBb50981 TCMD use of audio queueL Haegele-w18944 09/12/2001 LIBbb03971 Creation of file Portability: This module is portable to other compilers.==================================================================================================== INCLUDE FILES==================================================================================================*/#include <ENGINE_AUDIO/aud_prim_ids.h>#include <ENGINE_AUDIO/am_mdi_queue_controller.h>#include <audio/am_server_task.h>#include <ENGINE_AUDIO/am_hw_string_primitive.h>/*================================================================================================== LOCAL FUNCTION PROTOTYPES==================================================================================================*/ /*================================================================================================== LOCAL CONSTANTS==================================================================================================*//*================================================================================================== LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)==================================================================================================*//*================================================================================================== LOCAL MACROS==================================================================================================*//*================================================================================================== LOCAL VARIABLES==================================================================================================*//*================================================================================================== GLOBAL VARIABLES==================================================================================================*//*================================================================================================== LOCAL FUNCTIONS==================================================================================================*//*================================================================================================== GLOBAL FUNCTIONS==================================================================================================*//*==================================================================================================FUNCTION: AM_MDI_Q_registerDESCRIPTION: This function is used to register for dsp replies. The caller must specify the message ids it wishes to receive and register a callback function for those replies. The caller can register for a linear range of message ids or a single message id.ARGUMENTS PASSED: low_id - This is a mdi message id. If registering for a range of message ids, this is the lowest value. If registering for a single message id, this is the desired id. high_id - This is a mdi message id. If registering for a range of message ids, this is the highest value. If registering for a single message id, this is the desired id. reply_cfcn - This is a pointer to the callback function which will be used to send the dsp replies to callerRETURN VALUE: TRUE - If the request was honored FALSE - If the request was not honoredPRE-CONDITIONS: None POST-CONDITIONS: NoneIMPORTANT NOTES:==================================================================================================*/BOOLAM_MDI_Q_register(UINT16 low_id, UINT16 high_id, AM_MDI_Q_CFCN_T *reply_cfcn){ return TRUE;}/*==================================================================================================FUNCTION: AM_MDI_Q_send_msgDESCRIPTION: This function is used to send a message to the dsp via the MCU DSP AUIDO COMMAND QUEUE.ARGUMENTS PASSED: data - This is a pointer to the data to be sent to the dsp. The data must include the command header (messageid, timestamp, length) num_words - This is the length, in number of words, of the entire command. It should include to command header.RETURN VALUE: TRUE - If the request was honored FALSE - If the request was not honored.PRE-CONDITIONS: None POST-CONDITIONS: NoneIMPORTANT NOTES: The memory associated with the data can be released by the caller at the return of this function call. The caller cannot use a timestamp in the rango 0xF0 and 0xFF. Doing so will result in an error.==================================================================================================*/BOOLAM_MDI_Q_send_msg(void *data, UINT8 num_words){ BOOL status = FALSE; UINT8 timestamp = *((UINT8*)data+3); /* The timestamp in the MDI message passed in */ if (timestamp < AM_HW_STRING_PRIMITIVE_TIMESTAMP_MAX) { AM_MDI_Q_MSG_T* msg_ptr = (AM_MDI_Q_MSG_T *) suCreateMessage(((sizeof(AM_MDI_Q_MSG_T))+(num_words * 2)), AM_MDI_Q_MSG_ID, SU_INVALID_HANDLE, NULL); msg_ptr->num_words = num_words; memcpy(msg_ptr->data, data, (num_words * 2)); suSendMessage(msg_ptr, am_server_task_port, NULL); status = TRUE; } return status;}#ifdef __cplusplus}#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?