📄 audio.h
字号:
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
//------------------------------------------------------------------------------
//
// Copyright (C) 2004, Freescale Semiconductor, Inc. All Rights Reserved
// THIS SOURCE CODE IS CONFIDENTIAL AND PROPRIETARY AND MAY NOT
// BE USED OR DISTRIBUTED WITHOUT THE WRITTEN PERMISSION OF
// FREESCALE SEMICONDUCTOR, INC.
//
//------------------------------------------------------------------------------
//
// Copyright (C) 2005, MOTOROLA, INC. All Rights Reserved
// THIS SOURCE CODE IS CONFIDENTIAL AND PROPRIETARY AND MAY NOT
// BE USED OR DISTRIBUTED WITHOUT THE WRITTEN PERMISSION OF
// MOTOROLA, INC.
//
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//
// File: audio.h
//
// Provides definitions for common audio helper library
//
//-----------------------------------------------------------------------------
#ifndef __DRIVERS_AUDIO_COMMON_RT5620_AUDIO_H
#define __DRIVERS_AUDIO_COMMON_RT5620_AUDIO_H
#include "bsp.h"
#include "SsiClass.h"
#include "AudmuxClass.h"
#include "RTCodecComm.h"
#ifdef __cplusplus
extern "C" {
#endif
//------------------------------------------------------------------------------
// MACRO DEFINITIONS
//------------------------------------------------------------------------------
#define AUDIO_TX_WORD_LEN SSI_WORDLEN_BITS16 // 16
#define AUDIO_RX_WORD_LEN SSI_WORDLEN_BITS16 // 16
#define CODECSAMPLERATE (48000)
// Note: This is max allowed when using double buffering for each
// dir.
//#define AUDIO_DMA_PAGE_SIZE (BSP_DMAC_AUDIO_BUFF_SIZE / 4)
#define AUDIO_RECORD_DMA BSP_DMAC_CH_AUDIO_RX
#define AUDIO_PLAYBACK_DMA BSP_DMAC_CH_AUDIO_TX
#define AUDIO_SSI_ID SSI_ID_SSI1
#define AUDIO_TX_FIFO_WATERMARK 4
#define AUDIO_RX_FIFO_WATERMARK 6
#define AUDIO_BITCLK_OVERSAMPLE_RATE 256
//------------------------------------------------------------------------------
// ENUMERATIONS AND STRUCTURES
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// FUNCTION PROTOTYPES
//------------------------------------------------------------------------------
BOOL audioHwInit( BOOL ssiDmaEn,
BOOL ssiIntrEn,
UINT32 txBuffer,
UINT32 txBufferSize,
UINT32 rxBuffer,
UINT32 rxBufferSize,
UINT8 *txDmaCh,
UINT8 *rxDmaCh);
void audioHwDeinit(void);
void audioSetPowerOnOff(BOOL bSetPlayback, BOOL bSetRecord, BOOL bOff);
//------------------------------------------------------------------------------
// EXTERN DECLARATIONS
//------------------------------------------------------------------------------
extern SsiClass *g_Ssi;
extern RT_CodecComm *g_Codec;
#ifdef __cplusplus
}
#endif
//------------------------------------------------------------------------------
// CLASS DEFINITIONS
//------------------------------------------------------------------------------
#endif /* _DRIVERS_AUDIO_COMMON_AUDIO_H */
//------------------------------------------------------------------------------
// END OF FILE
//------------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -