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

📄 spt6608.h

📁 凌阳单片机对语音的处理和调用
💻 H
📖 第 1 页 / 共 2 页
字号:
//     		     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)
typedef union
{
	U16	W;
	struct
	{
		U16 TMB_Ctrl		: 8;
		U16 TMA_Ctrl		: 8;
	} B8;
	struct
	{
		U16	Reserve			: 4;
		U16	TMB_Clk_S		: 3;
		U16	TMBEN			: 1;
		U16 CountA_ClkA_S	: 2;
		U16 CountA_ClkB_S	: 3;
		U16 TMA_Clk_Src		: 1;
		U16 TMACtrl			: 1;
		U16	TMAEN			: 1;
	} B;
} P_Tmr_Ctrl_Def;

#define	P_Tmr_Ctrl	(volatile unsigned int *)0x701A
#define	U_Tmr_Ctrl	((volatile P_Tmr_Ctrl_Def *)(0x701A))
// R/W, up-counter
#define	P_TmrA_Data	(volatile unsigned int *)0x701B
// W, write any value to load data to timer A
#define	P_TmrA_Load	(volatile unsigned int *)0x701C
// R/W, up-counter
#define	P_TmrB_Data	(volatile unsigned int *)0x701E
// W, write any value to load data to timer B
#define	P_TmrB_Load	(volatile unsigned int *)0x701F

//-------------------------------*/
//      Low Voltage Detect       */
//-------------------------------*/
//	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 !!!
typedef union
{
	U16	W;
	struct
	{
		U16	SW			: 3;
		U16	Reserve1	: 2;
		U16	LBDet		: 1;
		U16	Reserve2	: 1;
		U16 LBDEN		: 1;
		U16	Reserve3	: 8;
	} B;
} P_BatDet_Def;
#define	P_BatDet	(volatile unsigned int *)0x7021
#define	U_BatDet	((volatile P_BatDet_Def *)(0x7021))

//-------------------------------*/
//      DTMF & Tone Generator    */
//-------------------------------*/
//			C0	C1	C2	C3
//	R0		1	2	3	A
//	R1		4	5	6	B
//	R2		7	8	9	C
//	R3		*	0	#	D
typedef union
{
	U16	W;
	struct
	{
		U16	DTMFR		: 2;
		U16 TON0E		: 1;
		U16 DTMFRE		: 1;
		U16	DTMFC		: 2;
		U16 TON1E		: 1;
		U16 DTMFCE		: 1;
		U16 DACEN		: 1;
		U16 Tone_DACO	: 1;
		U16	Reserve		: 6;
	} B;
} P_DtmfTone_Def;
#define	P_DtmfTone	(volatile unsigned int *)0x7022
#define	U_DtmfTone	((volatile P_DtmfTone_Def *)(0x7022))

#define	B_DtmfColEn	0x0080
#define	B_Tone1En	0x0040
#define	B_DtmfRowEn	0x0008
#define	B_Tone0En	0x0004
#define	B_DacEn		0x0100
#define	B_OutputSelDACO	0x0200

typedef union
{
	U16	W;
	struct
	{
		U16	Reserve		: 8;
		U16	ENV			: 8;
	} B;
} P_Envelope_Def;
//	b15~b8 :envelope output
#define	P_Ch0Envelope	(volatile unsigned int *)0x7023
#define	U_Ch0Envelope	((volatile P_Envelope_Def *)(0x7023))
//	b15~b8 :envelope output
#define	P_Ch1Envelope	(volatile unsigned int *)0x7024;
#define	U_Ch1Envelope	((volatile P_Envelope_Def *)(0x7024))

// Write only, 10 bits
typedef union
{
	U16	W;
	struct
	{
		U16	Reserve		: 6;
		U16	Value		: 10;
	} B;
} P_DAC_Def;
#define	P_DAC		(volatile unsigned int *)0x7029
#define	U_DAC		((volatile P_DAC_Def *)(0x7029))

//-------------------------------*/
//          A/D & AGC            */
//-------------------------------*/
typedef union
{
	U16	W;
	struct
	{
		U16	Gain		: 5;
		U16	Reserve1	: 2;
		U16	QuickCh		: 1;
		U16	Reserve2	: 8;
	} B;
} P_PGACtrl_Def;
#define	P_PGACtrl		(volatile unsigned int *)0x7025
#define	U_PGACtrl		((volatile P_PGACtrl_Def *)(0x7025))
#define	B_AdcQuickCharge	0x0080;

typedef union
{
	U16	W;
	struct
	{
		U16	EN_DAC2		: 1;
		U16	Reserve1	: 1;
		U16 EN_ADIN3	: 1;
		U16 EN_ADIN4	: 1;
		U16 MIC_QCH		: 1;
		U16 EN_MIC		: 1;
		U16 T32KTMA		: 1;
		U16 EN_Line		: 1;
		U16	Reserve2	: 8;
	} B;
} P_AFECtrl_Def;
#define	P_AFECtrl		(volatile unsigned int *)0x7026
#define	U_AFECtrl		((volatile P_AFECtrl_Def *)(0x7026))
#define	B_EnLine		0x0080
#define	B_EnMic			0x0020
#define	B_EnADIN4		0x0008
#define	B_EnADIN3		0x0004
#define	B_EnDAC			0x0001
#define	B_MicQuickCharge	0x0010

// 	b0 : AD Source Input
//	   1 - Sampled data is from telephone Line
//	   0 - Sampled data is from mic line
typedef union
{
	U16	W;
	struct
	{
		U16	Source		: 1;
		U16	Reserve1	: 5;
		U16	Value		: 10;
	} B;
} P_Adc_Def;
 // (R) 10-bit ADC (b15~b6)
#define	P_Adc			(volatile unsigned int *)0x7027
#define	U_Adc			((volatile P_Adc_Def *)(0x7027))
#define	B_Source	0x0001; 

typedef union
{
	U16	W;
	struct
	{
		U16	RDEG		: 2;
		U16	Reserve1	: 4;
		U16 RingFlag	: 1;
		U16 ENRD		: 1;
		U16	Reserve2	: 8;
	} B;
} P_RiDet_Def;
#define	P_RiDet		(volatile unsigned int *)0x7028
#define	U_RiDet		((volatile P_RiDet_Def *)(0x7028))
#define	B_RiDet		0x0040
#define	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....
//-----------------------------------------------------------------------------//
typedef union
{
	U16	W;
	struct
	{
		U16	Reserve1	: 6;
		U16 EN_WPINT	: 1;
		U16 EN_DET		: 1;
		U16	Reserve2	: 8;
	} B;
} P_LineDetCtrl_Def;
#define	P_LineDetCtrl	(volatile unsigned int *)0x702E
#define	U_LineDetCtrl	((volatile P_LineDetCtrl_Def *)(0x702E))
#define	B_CMPOut	0x0001
#define	B_En_WPINT	0x0040
#define	B_En_Det	0x0080
// Read only
#define	P_LatchLine	(volatile unsigned int *)0x702F

//-------------------------------------*/
//     SPLC501  Interference           */
//-------------------------------------*/
typedef union
{
	U16	W;
	struct
	{
		U16	Data		: 8;
		U16 WR			: 1;
		U16 RD			: 1;
		U16 A0P			: 1;
		U16 Start		: 1;
		U16	Reserve1	: 4;
	} B;
} P_Lcd501Ctrl_Def;
#define	P_Lcd501Ctrl	(volatile unsigned int *)0x7040
#define	U_Lcd501Ctrl	((volatile P_Lcd501Ctrl_Def *)(0x7040))
// Read Only
#define	P_Lcd501Data	(volatile unsigned int *)0x7041
typedef union
{
	U16	W;
	struct
	{
		U16	MCU			: 1;
		U16	Reserve1	: 15;
	} B;
} P_Lcd501BdySel_Def;
#define	P_Lcd501BdySel	(volatile unsigned int *)0x7042
#define	U_Lcd501BdySel	((volatile P_Lcd501BdySel_Def *)(0x7042))

//-------------------------------------*/
//     SPR1024  Interference           */
//-------------------------------------*/
#define	P_SerialData	(volatile unsigned int *)0x7030
//M7~M0
#define	P_SerialAddr1	(volatile unsigned int *)0x7031
//M15~M8
#define	P_SerialAddr2	(volatile unsigned int *)0x7032
//M23~M16
#define	P_SerialAddr3	(volatile unsigned int *)0x7033

#define	P_SerialCtrl	(volatile unsigned int *)0x7034
//Enable serial SRAM interface
#define	B_EnableSI	0x0080
//0:read ; 1:write
#define	B_RWFrame	0x0040
#define	B_SendFrame	0x0020
//Clock/8
#define	B_CLK_8		0x0000
//Clock/2
#define	B_CLK_2		0x0008
//Clock/4
#define	B_CLK_4		0x0010
//Clock/16
#define	B_CLK_16	0x0018
#define	P_SerialStart	(volatile unsigned int *)0x7035
//read mode
#define	B_Busy		0x0080
#define	P_SerialStop	(volatile unsigned int *)0x7036

//-----------------------------------------------------------------------------//
//			UART/IrDA Interface		 
//-----------------------------------------------------------------------------//
#define	P_IrDACmd1	(volatile unsigned int *)0x7046
#define	B_RLAT1		0x0010
#define	B_RLAT0		0x0008
#define	B_POLT		0x0004
#define	B_POLR		0x0002
#define	B_IrDAEn	0x0001
#define	P_IrDACmd2	(volatile unsigned int *)0x7047

typedef union
{
	U16	W;
	struct
	{
		U16	SCLK		: 2;
		U16 P_Check		: 1;
		U16 Parity		: 1;
		U16 Reserve1	: 1;
		U16 I_Reset		: 1;
		U16 TxIntEn		: 1;
		U16 RxIntEn		: 1;
		U16	Reserve2	: 8;
	} B;
} P_UARTCmd1_Def;
// Write Only
#define	P_UARTCmd1	(volatile unsigned int *)0x7049
#define	U_UARTCmd1	((volatile P_UARTCmd1_Def *)(0x7049))
#define	B_RxIntEn	0x0080
#define	B_TxIntEn	0x0040
#define	B_I_Reset	0x0020
#define	B_Parity	0x0008
#define	B_P_Check	0x0004
#define	B_SCLK1		0x0002
#define	B_SCLK0		0x0001
typedef union
{
	U16	W;
	struct
	{
		U16	AcRDY		: 1;
		U16 Reserve1	: 2;
		U16 PE			: 1;
		U16 OE			: 1;
		U16 FE			: 1;
		U16 Tx_RDY_EN	: 1;
		U16 Rx_RDY_EN	: 1;
		U16	Reserve2	: 8;
	} B;
} P_UARTCmd2_Def;
#define	P_UARTCmd2	(volatile unsigned int *)0x704A
#define	U_UARTCmd2	((volatile P_UARTCmd2_Def *)(0x704A))
//read mode
#define	B_RxRdy		0x0080
#define	B_TxRdy		0x0040
#define	B_FE		0x0020
#define	B_OE		0x0010
#define	B_PE		0x0008
#define	B_AcRdy		0x0001
//write mode
#define	B_RxPinEn	0x0080
#define	B_TxPinEn	0x0040

#define	P_UARTData	(volatile unsigned int *)0x704B
#define	P_UARTBR_Low	(volatile unsigned int *)0x704C
#define	P_UARTBR_High	(volatile unsigned int *)0x704D
#define	P_UARTABR_Low	(volatile unsigned int *)0x704E
#define	P_UARTABR_High	(volatile unsigned int *)0x704F

#define	P_SEL_IR_UART_CLK	(volatile unsigned int *)0x7057
#define	B_SEL_IR_UART_CLK	0x0080

//========================================================================================
// End of SPT6608.h
//========================================================================================

#endif

⌨️ 快捷键说明

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