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

📄 macro4096.inc

📁 利用PWM功能实现语音播放功能。本系统应用于Suplus SPMC65* Series上
💻 INC
字号:
;====================================================================================
; The information contained herein is the exclusive property of
; Sunplus Technology Co. And shall not be distributed, reproduced,
; or disclosed in whole in part without prior written permission.
;       (C) COPYRIGHT 2004   SUNPLUS TECHNOLOGY CO.                                  
;                   ALL RIGHTS RESERVED
; The entire notice above must be reproduced on all authorized copies.
;====================================================================================
																					
;====================================================================================
;  Program Name		:	Macro4096.inc
;  Description		:	macro for I/O accessing SPR4096		 
;  Reference		:	SPMC65P2404A Programming Guide
;  Revision history	:
;---------------------------------------------------------------------------------- 
;  Version		Date 		Description
;  1.0.0    	2005-5-10	First Edition 
;====================================================================================

;====================================================================================
;Macro Name:		M_StartSignal
;Description:		Create Start Signal
;Parameters:		None
;Return Value:		None
;Usage:				M_StartSignal
;Example:			M_StartSignal	
;====================================================================================
M_StartSignal:	.MACRO
					set		P_IOD_Data,0
					set		P_IOD_Data,1		
					M_Delay;
					clr		P_IOD_Data,0					
					M_Delay;
					clr		P_IOD_Data,1				
				.ENDM
;====================================================================================
;Macro Name:		M_StopSignal
;Description:		Create Stop Signal
;Parameters:		None
;Return Value:		None
;Usage:				M_StopSignal
;Example:			M_StopSignal	
;====================================================================================
M_StopSignal:	.MACRO
					clr		P_IOD_Data,0				
					M_Delay;
					set		P_IOD_Data,0
				.ENDM	
;====================================================================================
;Macro Name:		M_SetIO_Input
;Description:		set PD0(SDA) input with pull-low  
;Parameters:		None
;Return Value:		None
;Usage:				M_SetIO_Input
;Example:			M_SetIO_Input			
;====================================================================================
M_SetIO_Input:	.MACRO
					clr		P_IOD_Dir,0	
					clr		P_IOD_Data,0	
				.ENDM
;====================================================================================
;Macro Name:		M_SetIO_Output
;Description:		set PD0(SDA) output low
;Parameters:		None
;Return Value:		None
;Usage:				M_SetIO_Output
;Example:			M_SetIO_Output			
;====================================================================================
M_SetIO_Output:	.MACRO
					clr		P_IOD_Data,0		
					set		P_IOD_Dir,0
					clr		P_IOD_Attrib,0
				.ENDM
				
;====================================================================================
;Macro Name:		M_ClrSCK
;Description:		clear SCK
;Parameters:		None
;Return Value:		None
;Usage:				M_ClrSCK
;Example:			M_ClrSCK			
;====================================================================================
M_ClrSCK:		.MACRO
					clr		P_IOD_Data,1
				.ENDM
;====================================================================================
;Macro Name:		M_SetSCK
;Description:		set SCK
;Parameters:		None
;Return Value:		None
;Usage:				M_SetSCK
;Example:			M_SetSCK			
;====================================================================================
M_SetSCK:		.MACRO
					set		P_IOD_Data,1
				.ENDM
;====================================================================================
;Macro Name:		M_ClrSDA
;Description:		clear SDA
;Parameters:		None
;Return Value:		None
;Usage:				M_ClrSDA
;Example:			M_ClrSDA			
;====================================================================================
M_ClrSDA:		.MACRO
					clr		P_IOD_Data,0
				.ENDM
;====================================================================================
;Macro Name:		M_SetSDA
;Description:		set SDA
;Parameters:		None
;Return Value:		None
;Usage:				M_SetSDA
;Example:			M_SetSDA			
;====================================================================================
M_SetSDA:		.MACRO
					set		P_IOD_Data,0
				.ENDM
;====================================================================================
;Macro Name:		M_Delay
;Description:		delay 
;Parameters:		None
;Return Value:		None
;Usage:				M_Delay
;Example:			M_Delay			
;====================================================================================
M_Delay:		.MACRO	
					nop
					nop
					nop
					nop
					nop
					nop
					nop
					nop
					nop
					nop
				.ENDM
;====================================================================================
;Macro Name:		M_SckDelay
;Description:		delay 
;Parameters:		None
;Return Value:		None
;Usage:				M_SckDelay
;Example:			M_SckDelay			
;====================================================================================
M_SckDelay:		.MACRO	
					nop
					nop
					nop
					nop
					nop
					nop					
				.ENDM
													

⌨️ 快捷键说明

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