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

📄 g711lib_internal.h

📁 Audio compression on embedded board
💻 H
字号:
/*********************************************************************
*                                                                    *
*                       Software License Agreement                   *
*                                                                    *
*   The software supplied herewith by Microchip Technology           *
*   Incorporated (the "Company") for its dsPIC controller            *
*   is intended and supplied to you, the Company's customer,         *
*   for use solely and exclusively on Microchip dsPIC                *
*   products. The software is owned by the Company and/or its        *
*   supplier, and is protected under applicable copyright laws. All  *
*   rights are reserved. Any use in violation of the foregoing       *
*   restrictions may subject the user to criminal sanctions under    *
*   applicable laws, as well as to civil liability for the breach of *
*   the terms and conditions of this license.                        *
*                                                                    *
*   THIS SOFTWARE IS PROVIDED IN AN "AS IS" CONDITION.  NO           *
*   WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING,    *
*   BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND    *
*   FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE     *
*   COMPANY SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL,  *
*   INCIDENTAL OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.  *
*                                                                    *
*********************************************************************/

#ifndef _G711LIB_INTERNAL_H
#define _G711LIB_INTERNAL_H

//-----------------------------------------------------------------------------
//INCLUDE FILES
//-----------------------------------------------------------------------------
#include <p33Fxxxx.h>
#include "G711Lib_common.h"

//-----------------------------------------------------------------------------
//PREPROCESSOR CONSTANTS/MACROS
//-----------------------------------------------------------------------------

#define TDEC ((1.0f/Fcy)*55600L)                //Time taken by decoder to 
                                                //decode one frame of speech 
                                                //data.
#define START_DECODE_COUNT ((0.02f-TDEC)/0.0005)//Calculation for realtime 
                                                //decoder playout count.


                         
/*------Constants used to initialize the DCI module------*/
#define DCICON1VAL 0x0040         //Set for multichannel frame sync mode
						          //Data txmit/rx begins 1 clock after Fs pulse
						 		  //Data changes on rising, sampled on falling
						 		  //Tristate output CSDO pin when not txing
						 		  //Frame sync generated by dsPIC DCI
						 		  //Clock is output from DCI
						 		  //Ensure module is disabled for now		
#define DCICON2VAL 0x0def         //Data word size is 16-bits (bits 3:0)
								  //Data frame is 16 words (bits 8:5)
								  //Set buffer length control (4 data words
								  //Will be buffered between interrupts)																
#define DCISTATVAL 0x0000         //DCI module status information.                                  
#define RSCONVAL 0x0001           //Set receive slot 1 enable RSCON
#define TSCONVAL 0x0001           //Set transmit slot 1 enable TSCON
#define BUFFERLENGTH 0x0004       //Length of the buffer in DCI.




/*-----------------------------------------------------------------------------
 Constants used to initialize the Timer and Output Compare Module
-----------------------------------------------------------------------------*/

#define TXCONVAL 0x8000           //Set _TON bit to enable the Timer.
#define TMRXVAL 0x0000            //Sets the value to clear the Timer Count
                                  //Register.          
#define OCXRSVAL 0x0060           //Sets the value to clear the Output Compare
                                  //Secondary Register.      
#define OCXRVAL 0x0060            //Sets the value to clear the Output Compare 
                                  //Main Register.


/*Timer2*/
#define   _T2ON  T2CONbits.TON
/*Timer3*/
#define   _T3ON  T3CONbits.TON

/*------Constants useful to initialize Si3000 Codec--------*/
#define MINUS_ONE 0x8000
#define MINUS_ONE_WITH_SECONDARY 0x8001
#define PLUS_ONE 0x7FFE
#define PLUS_ONE_WITH_SECONDARY 0x7FFF

/*---------------------------------------------------------------------------
                 Si3000 Register Address Summary (Table 13, Si30000-DS11)
                 Read Control Address has bit 13 set
                 Write Control Address has bit 13 clear
---------------------------------------------------------------------------*/
#define READ_CONTROL_1 0x2100
#define WRITE_CONTROL_1 0x0100

#define READ_CONTROL_2 0x2200
#define WRITE_CONTROL_2 0x0200

#define READ_PLL1_DIVIDE_N1 0x2300
#define WRITE_PLL1_DIVIDE_N1 0x0300

#define READ_PLL1_MULTIPLY_M1    0x2400
#define WRITE_PLL1_MULTIPLY_M1  0x0400

#define READ_RX_GAIN_CONTROL_1 0x2500
#define WRITE_RX_GAIN_CONTROL_1 0x0500

#define READ_ADC_VOLUME_CONTROL 0x2600
#define WRITE_ADC_VOLUME_CONTROL 0x0600

#define READ_DAC_VOLUME_CONTROL 0x2700
#define WRITE_DAC_VOLUME_CONTROL 0x0700

#define READ_STATUS_REPORT 0x2800
#define WRITE_STATUS_REPORT 0x0800

#define READ_ANALOG_ATTENUATION 0x2900
#define WRITE_ANALOG_ATTENUATION 0x0900

#endif /* _G711LIB_INTERNAL_H */

/*-----------------------------------------------------------------------------
                                End of File; G711Lib_internal.h
-----------------------------------------------------------------------------*/

⌨️ 快捷键说明

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