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

📄 main.asm

📁 LCD output example code for BF5
💻 ASM
字号:
/*****************************************************************************
**																			**
**	 Project Name: 	LCD Colorbar									**	
**																			**
******************************************************************************

Analog Devices, Inc.  All rights reserved.

File Name:	Main.asm

Hardware:       ADSP-BF537

Special Connections:  None

Purpose:	Demonstrate LCD interface.
	
				
******************************************************************************/


#include "defBF537.h"
					

/*****************************************************************
 Program Define Section
****************************************************************/


/****************************************************************
 Main Program
****************************************************************/
.global _main;
.extern _setup_sdram;
.extern _config_dma;
.extern _config_ppi;
.extern _config_timer;
.extern _create_data;

.section program;

_main:
	CALL _setup_sdram;	// Initialize SDRAM Refresh Rates
	
	// Initialize SIC IMASK
	P1.L = lo(SIC_IMASK);
	P1.H = hi(SIC_IMASK);
	R1 = [P1];
	BITSET(R1,4);
	[P1] = R1;			//Unmask PPI DMA0 interrupt in System Interrupt Controller.
	SSYNC;
	
	// Initialize EVT8 for DMA_ISR Function
	P2.L = lo(EVT8);
	P2.H = hi(EVT8);
	R2.L = DMA_ISR;	
	R2.H = DMA_ISR;
	[P2] = R2;                                                                                                                                                                                                                                                                                                                                                                                                   
	SSYNC;
	
	// Initialize PPI DMA0 Interrupt Handler
	P0.L = lo(IMASK);
	P0.H = hi(IMASK);
	R0 = [P0];
	BITSET(R0,8);
	[P0] = R0;			//Unmask PPI DMA0 interrupt in Core Interrupt Controller.
	SSYNC;
	
	CALL _create_data;	// Create Color Bar
	CALL _config_ppi;	// Initialize PPI to driver LCD
 	CALL _config_timer;	// Initialize Timers to control HSync and VSync
	CALL _config_dma;	// Initialize DMA0 to pass color bar to PPI

	// Enable DMA0
	P0.L = lo(DMA0_CONFIG);
	P0.H = hi(DMA0_CONFIG);
	R0.L = W[P0];
	bitset(R0,0);
	W[P0] = R0.L;
	ssync;
	
	// Enable PPI
	P1.L = lo(PPI_CONTROL);
	P1.H = hi(PPI_CONTROL);
	R1.L = W[P1];
	bitset(R1,0);	
	W[P1] = R1.L;	
	ssync;
	
	//Enable Timer
	P1.L = lo(TIMER_ENABLE);

	R1.L = W[P1];
	bitset(R1,0);	
	bitset(R1,1);
	W[P1] = R1.L;
	ssync;
	

do_nothing:  jump do_nothing;	
	
	
DMA_ISR:

	
	//Clear DMA Interrupt.
	P0.L = lo(DMA0_IRQ_STATUS);
	P0.H = hi(DMA0_IRQ_STATUS);
	R0.L = W[P0];
	BITSET(R0,0);	
	W[P0] = R0.L;
	ssync;
	RTI;
	
_main.END:	nop;

⌨️ 快捷键说明

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