⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 codec.h

📁 seed的滤波器设计程序
💻 H
📖 第 1 页 / 共 2 页
字号:
/*     value - a number containing the bits to by written, already in their   */
/*             correct field locations.                                       */
/*     mask - a number indicating the position of the bits in "value" to be   */
/*            written.                                                        */
/*                                                                            */
/*    Returns -                                                               */
/*                                                                            */
/******************************************************************************/
u16 codec_write_reg(HANDLE hDevice, CodecReg reg, u16 value, u16 mask);

/******************************************************************************/
/*    codec_read() - Read one or more words from the AD50 data stream         */
/*                                                                            */
/*    Parameters -                                                            */
/*     hDevice - a handle to a specific instance of codec.                .   */
/*     pbuf - pointer to array for word storage.                              */
/*     cnt - number of words to be read.                                      */
/*                                                                            */
/*    Returns -                                                               */
/*                                                                            */
/******************************************************************************/
s16 codec_read(HANDLE hDevice, s16 * pbuf, s16 cnt);

/******************************************************************************/
/*    codec_write() - Write one or more words to the AD50 data stream         */
/*                                                                            */
/*    Parameters -                                                            */
/*     hDevice - a handle to a specific instance of codec.                .   */
/*     pbuf - pointer to array of words to be written.                        */
/*     cnt - number of words to be written.                                   */
/*                                                                            */
/*    Returns -                                                               */
/*                                                                            */
/*    WARNING: This function is not compatible with DSP/BIOS                  */
/*                                                                            */
/******************************************************************************/
s16 codec_write(HANDLE hDevice, s16 * pbuf, s16 cnt);

/******************************************************************************/
/*    codec_power() - Power up/down the analog and filter functions           */
/*                                                                            */
/*    Parameters -                                                            */
/*         hDevice - a handle to a specific instance of codec.            .   */
/*         ctrl - member of an enumeration indicating enable or disable of    */
/*                power down features                                         */
/*                                                                            */
/*    Returns -                                                               */
/*                                                                            */
/******************************************************************************/
int codec_power(HANDLE hDevice, CodecPower ctrl);

/******************************************************************************/
/* codec_monitor_gain() - Set monitor amplifier gain                          */
/*                                                                            */
/*    Parameters -                                                            */
/*         hDevice - a handle to a specific instance of codec.            .   */
/*         gain - member of an enumeration indicating gain for monitor amp    */
/*                                                                            */
/*    Returns -                                                               */
/*                                                                            */
/*                                                                            */
/******************************************************************************/
int codec_monitor_gain(HANDLE hDevice, CodecMonGain gain);

/******************************************************************************/
/* codec_digital_loopback() - Enables digital loopback                        */
/*                                                                            */
/*    Parameters -                                                            */
/*         hDevice - a handle to a specific instance of codec.            .   */
/*         on - a logical where TRUE enables digital loopback                 */
/*                                                                            */
/*    Returns -                                                               */
/*                                                                            */
/*                                                                            */
/******************************************************************************/
int codec_digital_loopback(HANDLE hDevice, bool on);

/******************************************************************************/
/* codec_dac_mode() - Sets 16-bit or 15-bit+1 mode for the DAC portion of the */ 
/*                    codec.                                                  */
/*                                                                            */
/*    Parameters -                                                            */
/*         hDevice - a handle to a specific instance of codec.            .   */
/*         mode - a member of an enumeration indicating 16 bit or 15+1 bit    */
/*                serial communications protocol.                             */
/*                                                                            */
/*    Returns -                                                               */
/*                                                                            */
/*                                                                            */
/******************************************************************************/
int codec_dac_mode(HANDLE hDevice, CodecDacMode mode);

/******************************************************************************/
/* codec_adc_mode() - Sets 16-bit or 15-bit+1 mode for the ADC portion of the */ 
/*                    codec.                                                  */
/*                                                                            */
/*    Parameters -                                                            */
/*         hDevice - a handle to a specific instance of codec.            .   */
/*         mode - a member of an enumeration indicating 16 bit or 15+1 bit    */
/*                serial communications protocol.                             */
/*                                                                            */
/*    Returns -                                                               */
/*                                                                            */
/*                                                                            */
/******************************************************************************/
int codec_adc_mode(HANDLE hDevice, CodecAdcMode mode);

/******************************************************************************/
/* codec_analog_loopback() - Enables analog loopback                          */
/*                                                                            */
/*    Parameters -                                                            */
/*         hDevice - a handle to a specific instance of codec.            .   */
/*         on - a logical where TRUE enables analog loopback                  */
/*                                                                            */
/*    Returns -                                                               */
/*                                                                            */
/*                                                                            */
/******************************************************************************/
int codec_analog_loopback(HANDLE hDevice, bool on);

/******************************************************************************/
/* codec_ain_gain() - Set the analog input gain                               */
/*                                                                            */
/*    Parameters -                                                            */
/*         hDevice - a handle to a specific instance of codec.            .   */
/*         gain - member of an enumeration indicating gain for analog input   */
/*                                                                            */
/*    Returns -                                                               */
/*                                                                            */
/*                                                                            */
/******************************************************************************/
int codec_ain_gain(HANDLE hDevice, CodecAinGain gain);

/******************************************************************************/
/* codec_aout_gain() - Set the analog output gain                             */
/*                                                                            */
/*    Parameters -                                                            */
/*         hDevice - a handle to a specific instance of codec.            .   */
/*         gain - member of an enumeration indicating gain for analog output  */
/*                                                                            */
/*    Returns -                                                               */
/*                                                                            */
/*                                                                            */
/******************************************************************************/
int codec_aout_gain(HANDLE hDevice, CodecAoutGain gain);

/******************************************************************************/
/* codec_sample_rate() - Sets the code sample rate. The specified sample rate */
/* Fs (Hz) is used to choose the value N in the equation:                     */
/*                                                                            */
/*          fs = MCLK/(128*N) or MCLK/(512*N)                                 */
/*                                                                            */
/* both the value of N, and the selection of 128 or 512 is made automatically */
/* by this routine.                                                           */
/*                                                                            */
/*                                                                            */
/*    Parameters -                                                            */
/*         hDevice - a handle to a specific instance of codec.            .   */
/*         sample_rate - desired number of samples per second                 */
/*                                                                            */
/*    Returns -                                                               */
/*                                                                            */
/*                                                                            */
/******************************************************************************/
int codec_sample_rate(HANDLE hDevice, CodecSampleRate sample_rate);


/******************************************************************************/
/* codec_fir_flag() - Returns decimation filter overflow flag value           */
/*                                                                            */
/*    Parameters -                                                            */
/*         hDevice - a handle to a specific instance of codec.            .   */
/*                                                                            */
/*    Returns - The present value of the fir flag, 1 if set 0 if clear        */
/*                                                                            */
/*                                                                            */
/******************************************************************************/
int codec_fir_flag(HANDLE hDevice);

/******************************************************************************/
/* codec_cont_play()                                                          */
/*                                                                            */
/*    This function is used to  continuously send data to the codec.          */
/*                                                                            */
/*    Parameters -                                                            */
/*         hDevice - a handle to a specific instance of codec.                */
/*         mode    - mode of operation (interrupt or DMA-driven)              */
/*         pingBuf - a buffer containing data to play                         */
/*         pongBuf - a second buffer containing data to play                  */
/*         size - the number of samples in each buffer                        */
/*         pfunc - Pointer to function to run at end of buffer                */
/*         bufStatus - pointer to pointer to transfer status.                 */
/*                     1 = transfer in progress, 0 = transfer complete        */
/*                                                                            */
/*    Returns -                                                               */
/*                                                                            */
/*    WARNING: This function is not compatible with DSP/BIOS                  */
/*                                                                            */
/******************************************************************************/
int codec_cont_play(HANDLE hDevice, 
                    CodecMode mode,
                    int *pingBuf,
                    int *pongBuf,
				    unsigned int size,
                    Fp  pfunc,
                    int **bufStatus);

/******************************************************************************/
/* codec_cont_capture()                                                       */
/*                                                                            */
/*    This function is used to capture data from the codec                    */
/*                                                                            */
/*    Parameters -                                                            */
/*         hDevice - a handle to a specific instance of codec.                */
/*         mode    - mode of operation (interrupt or DMA-driven)              */
/*         pingBuf - a buffer to contain data read                            */
/*         pongBuf - a second buffer to contain data read                     */
/*         size - the number of samples in each buffer                        */
/*         pfunc - Pointer to function to run at end of buffer                */
/*         bufStatus - pointer to pointer to transfer status.                 */
/*                     1 = transfer in progress, 0 = transfer complete        */
/*                                                                            */
/*    Returns -                                                               */
/*                                                                            */
/*    WARNING: This function is not compatible with DSP/BIOS                  */
/*                                                                            */
/******************************************************************************/
int codec_cont_capture(HANDLE hDevice, 
                       CodecMode mode,
                       int *pingBuf,
                       int *pongBuf,
   			           unsigned int size,
                       Fp  pfunc,
                       int **bufStatus);

#endif

⌨️ 快捷键说明

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