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

📄 spt6608.inc

📁 凌阳单片机对语音的处理和调用
💻 INC
字号:
//============================================================================*/
//                         Register address definitions                       */
//============================================================================*/
//-------------------------------------*/
//         Port A, B, C, D, E, F       */
//-------------------------------------*/
.const  P_IOA_Data      =0x7000;        //R/W, portA data
        // IOA0~IOA7 can be set as input or output pin by pin.
        // Input mode  - IOA0~IOA7 provide pull-high resistosrs
        //               IOA6 & IOA7 provide pull-low resistors
        // Output mode - CMOS output
        // Wake-up     - IOA0~IOA7 all provide wake-up function

.const  P_IOA_Buf       =0x7001;        //R, port A output latch
.const  P_IOA_Dir       =0x7002;        //R/W, portA direction, 0/1 = I/O
.const  P_IOA_PullR     =0x7003;        //R/W, portA pull-highs & pull-lows
                        // b15~b8 = 1 to enable pull-high of IOA7~IOA0
                        // b7~b6 = 1 to enable pull-low of IOA7~IOA6
.const  P_IOA_Latch     =0x7004;        //R, latch IO for wakeup

//---------------------------------
.const  P_IOB_Data      =0x7005;        //R/W, portB data
        // IOB0~IOB7 can be set as input or output pin by pin.
        // Input mode  - CMOS input (without pulled reisitors)
        // Output mode - IOB0~IOB5 are CMOS outputs
        //               IOB6 & IOB7 are NMOS open-drain
        // Wake-up     - no wake-up function
        
        
.const  P_IOB_Buf       =0x7006;        //R, portB output latch
.const  P_IOB_Dir       =0x7007;        //R/W, portB direction, 0/1 = I/O

//---------------------------------
.const  P_IOC_Data      =0x7008;        //R/W, portC data
        // IOC0~IOC7 can be set as input or output pin by pin.
        // Input mode  - CMOS input (without pulled reisitors)
        // Output mode - IOC0~IOC4 are CMOS outputs
        //               IOC5 & IOC7 are NMOS open-drain
        // Wake-up     - IOC0 & IOC1 provide wake-up function
.const  P_IOC_Buf       =0x7009;        //R, portC output latch
.const  P_IOC_Dir       =0x700A;        //R/W, portC direction

//---------------------------------
.const  P_IOD_Data      =0x700B;        //R/W, portD data
        // IOD0~7 can be set as input or output pin by pin.
        // Input mode  - CMOS input (without pulled reisitors)
        // Output mode - IOD0~IOD7 are CMOS outputs
        // Wake-up     - no wake-up function

.const  P_IOD_Buf       =0x700C;        //R, portD output latch
.const  P_IOD_Dir       =0x700D;        //R/W, portD direction, 0/1 = I/O


//---------------------------------
.const  P_IOE_Data      =0x7050;        //R/W, portA data
        // IOE0~IOE7 can be set as input or output pin by pin.
        // Input mode  - IOE0~IOE7 provide pull-high resistosrs
        //               IOE6 & IOE7 provide pull-low resistors
        // Output mode - CMOS output
        // Wake-up     - IOE0~IOE7 all provide wake-up function

.const  P_IOE_Buf       =0x7051;        //R, port E output latch
.const  P_IOE_Dir       =0x7052;        //R/W, portE direction, 0/1 = I/O
.const  P_IOE_PullR     =0x7053;        //R/W, portE pull-highs & pull-lows
                        // b15~b8 = 1 to enable pull-high of IOE7~IOE0
                        // b7~b6 = 1 to enable pull-low of IOE7~IOE6
.const  P_IOE_Latch     =0x7054;        //R, latch IO for wakeup
//---------------------------------

.const  P_IOCD_Ctrl     =0x700E;
//   		b0,b1, 00 - C0 provide interrupt/wake-up at falling edge
//	       	       01 - C0 provide interrupt/wake-up at rising edge
//                     1x - C0 provide interrupt/wake-up at both edges
//              b3~b2, 00 - C1 provide interrupt/wake-up at falling edge
//                     01 - C1 provide interrupt/wake-up at rising edge
//                     1x - C1 provide interrupt/wake-up at both edgex
//              b4,    0 - tone output (IOD1) comes from timer A overflow
//                     1 - tone output (IOD1) comes from timer B overflow
//              b5,    0 - IOD1 is normal I/O
//                     1 - IOD1 is tone-output



//-------------------------------*/
//      Interrupt & Wake-Up      */
//-------------------------------*/
.const  P_Int           =0x7010; // write 0/1 - disable/enable interrupt
                                 // read  0/1 - interrupt is disabled/enabled
.const  P_IntClr        =0x7011; // write 1 - clear happened interrupt flag
                                 // read  1 - interrupt is happened
.const  P_WakeUp        =0x7012; // write 0/1 - disable/enable wake-up
                                 // read  0/1 - wake-up is disabled/enabled
.const  P_WakeUpClr     =0x7013; // write 1 - clear happened wake-up flag
                                 // read  1 - wake-up is happened


.const  B_Irq0          =0x0001;        // vector = FFF8
.const  B_RiInt         =0x0001;

.const  B_Irq1          =0x0002;        // vector = FFF9
.const  B_IoaInt        =0x0002;

.const  B_Irq2          =0x0004;        // vector = FFFA
.const  B_TmrAInt       =0x0004;
.const  B_Irq3          =0x0008;        // vector = FFFB
.const  B_TmrBInt       =0x0008;
.const  B_Irq4          =0x0010;        // vector = FFFC
.const  B_T32KHzInt     =0x0010;
.const  B_8KHzInt       =0x0010;
.const  B_Irq5          =0x0020;        // vector = FFFD
.const  B_T2KHzInt      =0x0020;
.const  B_1KHzInt       =0x0020;
.const  B_512HzInt      =0x0020;
.const  B_Irq6          =0x0040;        // vector = FFFE
.const  B_T128HzInt     =0x0040;
.const  B_T8HzInt       =0x0080;	// vector = FFFF
.const  B_2HzInt        =0x0080;
.const  B_Ioc0Int       =0x0100;	// vector = FFF6
.const  B_Ioc1Int       =0x0200;	// vector = FFF8
.const  B_LineInt       =0x0400;	// vector = FFF8
.const  B_URATInt	=0x0800;	// vector = FFF6
.const  B_IrDAInt	=0x0800;	// vector = FFF6
//-------------------------------*/
.const  P_IoaWakeUp     =0x7014; // R/W, b7~b0=1 to enable IOA7~0 wake-up
.const  P_IoeWakeUp     =0x7055; // R/W, b7~b0=1 to enable IOE7~0 wake-up

//-------------------------------*/
//        System Clock           */
//-------------------------------*/
.const  P_SystemClock   =0x7015;
//	b2~b0:  CPU Operating Clock Select
//                      000 - Fosc
//                      001 - Fosc/2
// 	       	 	010 - Fosc/4
//     			011 - Fosc/8  (default)
//                      100 - Fosc/8
//                      101 - Fosc/8
//                      110 - Fosc/8
//                      111 - Stop/Sleep
//	   b7:		0 - Fosc=  Low-Speed Mode
//	 		1 - Fosc=  High-Speed Mode
.const   B_FoscDivBy1      =0x0000;
.const   B_FoscDivBy2      =0x0001;
.const   B_FoscDivBy4      =0x0002;
.const   B_FoscDivBy8      =0x0003;
.const   B_Sleep           =0x0007;
.const   B_NormalCpuClock  =B_FoscDivBy4;
.const   B_10M             =0x0080;

.const  P_Watchdog_Clr  =0x7016; // period = 2sec
                                 // write 16-bit (0x55AA) value to reset watch dog

//-------------------------------*/
//          Time Base            */
//-------------------------------*/
.const  P_TimeBaseSet   =0x7018;
//            b15: enable 32768
//            b14: weak/strong mode
//	      b7~b6: T32KHzS
//      	     00 - 4KHz     
//          	     01 - 8KHz    
//         	     10 - 16KHz   
//           	     11 - 32KHz 
//	      b5~b4: T2KHz 			
//  	    	     00 - 256Hz              
//          	     01 - 512Hz              
//      	     10 - 1KHz               
//      	     11 - 2KHz               
//	      b3~b2: T128HzS
//		     00 - 16Hz
//		     01 - 32Hz
//		     10 - 64Hz
//		     11 - 128Hz
//	      b1~b0: T8HzS	
//        	     00 - 1Hz
//		     01 - 2Hz
//		     10 - 4Hz
//         	     11 - 8Hz
// Time Base, generated by 32768Hz, is a combination of frequency selection
// for timers and interrupt.

.const  B_Enable32768   =0x8000;
.const  B_Strong32768   =0x4000; // After powering on, set 32768 at strong mode
.const  B_1Hz           =0x0000;
.const  B_2Hz           =0x0001;
.const  B_4Hz           =0x0002;
.const  B_8Hz           =0x0003;
.const  B_16Hz          =0x0000;
.const  B_32Hz          =0x0004;
.const  B_64Hz          =0x0008;
.const  B_128Hz         =0x000C;
.const  B_256Hz         =0x0000;
.const  B_512Hz         =0x0010;
.const  B_1KHz          =0x0020;
.const  B_2KHz          =0x0030;
.const  B_4KHz          =0x0000;
.const  B_8KHz          =0x0040;
.const  B_16KHz         =0x0080;
.const  B_32KHz         =0x00C0;

//-------------------------------*/
//          Timer A & B          */
//-------------------------------*/
// Writing a value of N to P_TimerA_Data or P_TimerB_Data and selecting an
// appropriate clock sources, the timer will count up from N, N+1, N+2, ....
// ,FFFE, FFFF. After the timer reaches 'FFFF', and INT signal is generated
// and is sent to INT controller for processing. At the same time, N will be
// reloaded into timer and count up again.

.const  P_Tmr_Ctrl      =0x701A;
//	 b15: TMA_En
//         	     0 - disable             吵    111 - T8Hz   (1Hz,2Hz,4Hz,8Hz)
//     		     1 - enable              趁驴               (P_TimeBaseSet, 0x7018)
//	 b14: TMA_Ctrl
//   		     0 - TMA_Sel    	    
//         	     1 - source1,2  	    
//	 b13: TMA_Sel
// 		     0 - Fosc                  
//          	     1 - Timer B Overflow      
//	 b12~b10: Source 1 of Timer A
//		     000 - External Clock (IOD1)	
//		     001 - 0Hz (VDD)
//		     010 - Fosc/2
//                   011 - Fosc/4
//                   100 - Fosc/8
//                   101 - 32768
//		     110 - T32KHz (4KHz,8KHz,16KHz,32KHz)
//		     111 - T2KHz  (256Hz,512Hz,1KHz,2KHz)    	
//	  b9~b8:  Source 2 of Timer A
//		     00 - External Clock (IOD0)
//		     01 - 0Hz (VDD)  	
//		     10 - T128Hz (16Hz,32Hz,64Hz,128Hz)	
//		     11 - T8Hz   (1Hz,2Hz,4Hz,8Hz)	
//        b7: TMB_En 
//         	     0 - disable             吵    111 - T8Hz   (1Hz,2Hz,4Hz,8Hz)
//     		     1 - enable              趁驴               (P_TimeBaseSet, 0x7018)
//        b6~b4:   Source of Timer B
//                 000 - Fosc
//                 001 - Fosc/2
//                 010 - Fosc/4
//                 010 - 32768
//                 100 - T32KHz (4KHz,8KHz,16KHz,32KHz)
//                 101 - T2KHz  (256Hz,512Hz,1KHz,2KHz)

.const  P_TmrA_Data   =0x701B; // R/W, up-counter
.const  P_TmrA_Load   =0x701C; // W, write any value to load data to timer A

.const  P_TmrB_Data   =0x701E; // R/W, up-counter
.const  P_TmrB_Load   =0x701F; // W, write any value to load data to timer B

//-------------------------------*/
//      Low Voltage Detect       */
//-------------------------------*/
//.const   P_BatDet          =0x7021;
//	b2~b0:	adjust low-battery threshold
//	b5: Detection result
//          0 - voltage is lower than threshold
//          1 - voltage is higher than threshold
//      b7: Low-Battery detector enable 
//	    0/1- disable/enable battery detect. 50us is a must to get detect result !!!

//-------------------------------*/
//      DTMF & Tone Generator    */
//-------------------------------*/
.const  P_DtmfTone      =0x7022;

.const  B_DtmfColEn     =0x0080;
.const  B_Tone1En       =0x0040;
.const  B_DtmfRowEn     =0x0008;
.const  B_Tone0En       =0x0004;
.const  B_DacEn         =0x0100;
.const  B_OutputSelDACO =0x0200;

.const  P_Ch0Envelope   =0x7023;
//	b15~b8 :envelope output
.const  P_Ch1Envelope   =0x7024;
//	b15~b8 :envelope output


.const  P_DAC		=0x7029
//	b15~b8 :envelope output

//-------------------------------*/
//          A/D & AGC            */
//-------------------------------*/
.const  P_AgcCtrl       =0x7025;
.const  B_AdcQuickCharge =0x0080;

.const  P_AFECtrl       =0x7026;
.const  B_EnLine	=0x0080;
.const  B_EnMic		=0x0020;
.const  B_EnADIN4	=0x0008;
.const  B_EnADIN3	=0x0004;
.const  B_EnDAC	=0x0001;
.const  B_MicQuickCharge=0x0010;

.const  P_Adc           =0x7027; // (R) 10-bit ADC (b15~b6)
// 	b0 : AD Source Input
//	   1 - Sampled data is from telephone Line
//	   0 - Sampled data is from mic line
.const  B_Source	=0x0001; 


.const  P_RiDet         =0x7028; // (R/W)
.const  B_RiDet         =0x0040;
.const  B_EnRiDet       =0x0080;


//-----------------------------------------------------------------------------//
//Line Control
//Procedure : 1. Enable Line det.
//            2. Latch line status
//            3. Enable wakeup/int
//            4. Set wakeup/int sources
//            5. Sleep....
//-----------------------------------------------------------------------------//
.const  P_LineDetCtrl   = 0x702E; //(R/W)

.const  B_CMPOut        = 0x0001; //
.const  B_En_WPINT      = 0x0040; //
.const  B_En_Det        = 0x0080; //

.const  P_LatchLine     = 0x702E; //

//-------------------------------------*/
//     SPLC501  Interference           */
//-------------------------------------*/

.const  P_Lcd501Ctrl    =0x7040;

.const  P_Lcd501Data    =0x7041;

.const  P_Lcd501BdySel  =0x7042;

//-------------------------------------*/
//     SPR1024  Interference           */
//-------------------------------------*/
.const  P_SerialData    = 0x7030;

.const  P_SerialAddr1   = 0x7031;         //M7~M0
.const  P_SerialAddr2   = 0x7032;         //M15~M8
.const  P_SerialAddr3   = 0x7033;         //M23~M16

.const  P_SerialCtrl    = 0x7034;
.const  B_EnableSI      = 0x0080;         //Enable serial SRAM interface
.const  B_RWFrame       = 0x0040;         //0:read ; 1:write
.const  B_SendFrame     = 0x0020;
.const  B_CLK_8         = 0x0000;         //Clock/8
.const  B_CLK_2         = 0x0008;         //Clock/2
.const  B_CLK_4         = 0x0010;         //Clock/4
.const  B_CLK_16        = 0x0018;         //Clock/16


.const  P_SerialStart 	=0x7035;
.const  B_Busy          = 0x0080;         //read mode

.const  P_SerialStop	=0x7036;


//-----------------------------------------------------------------------------//
//			UART/IrDA Interface		 
//-----------------------------------------------------------------------------//
.const	P_IrDACmd1	= 0x7046;
.const	B_RLAT1		= 0x0010;
.const	B_RLAT0		= 0x0008;
.const	B_POLT		= 0x0004;
.const	B_POLR		= 0x0002;
.const	B_IrDAEn	= 0x0001;
	
.const	P_IrDACmd2	= 0x7047;
.const  P_UARTCmd1	= 0x7049;
.const	B_RxIntEn	= 0x0080;
.const	B_TxIntEn	= 0x0040;
.const	B_I_Reset	= 0x0020;
.const	B_Parity	= 0x0008;
.const	B_P_Check	= 0x0004;
.const	B_SCLK1		= 0x0002;
.const	B_SCLK0		= 0x0001;

.const	P_UARTCmd2	= 0x704A;
//read mode
.const	B_RxRdy		= 0x0080;
.const	B_TxRdy		= 0x0040;
.const	B_FE		= 0x0020;
.const	B_OE		= 0x0010;
.const	B_PE		= 0x0008;
.const	B_AcRdy		= 0x0001;

//write mode
.const	B_RxPinEn	= 0x0080;
.const	B_TxPinEn	= 0x0040;
	
.const	P_UARTData	= 0x704B;
.const	P_UARTBR_Low	= 0x704C;
.const	P_UARTBR_High	= 0x704D;
.const	P_UARTABR_Low	= 0x704E;
.const	P_UARTABR_High	= 0x704F;


.const	P_SEL_IR_UART_CLK  = 0x7057;
.const	B_SEL_IR_UART_CLK  = 0x0080;

⌨️ 快捷键说明

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