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

📄 main.c

📁 sst flash的读写程序的编写 完整教程和实例程序和几个实用小工具
💻 C
字号:
#include "mcf5307.h" 
#include "ext-board-RevA.h"


MCF5307_IMM   *imm;
struct ExtBoardRevA  MyBoard0;

//#pragma section  CODE  ".text2"

unsigned long *AdBufferP;
unsigned long *DiBufferP;
unsigned long AdcStatus;
int i;
int j;
 
void main(void)
{
 //adc buffer
 
 
 //to init imm
 imm=(MCF5307_IMM *)0x10000000;
 cpu_cache_disable();
 EnableCache();            //will close the int.

 
 //do  some job

 
 		
 
 #if 1
 //show the LED				
     	imm->parallel_port.PADAT=0x00;
     	imm->parallel_port.PADAT=0xff;
 #endif    	
 
 
 Flash_Test();
 
     
 
     
} 
    

void Interrupt_UART1(void)   // asigned to Level 5
{
 	
 //Add Code here!
}

void Interrupt_mbus(void)    // asigned to Level 3
{
 //Add Code here!
}

void Interrupt_Level7(void)
{
 //Add Code here!
}

void Interrupt_Level6(void)
{
 //Add Code here!
    
}

void Interrupt_Level4(void)
{
 //Add Code here!
}


void Interrupt_Level2(void)
{
 //Add Code here!
}


void Interrupt_Level1(void)
{
 //Add Code here!
 *(MyBoard0.ClearIntP)=0x00;
 *AdBufferP=0x3fff3fff&(*(MyBoard0.AdcResultP));
  AdBufferP++;		
  *AdBufferP=0x3fff3fff&(*(MyBoard0.AdcResultP));	
  AdBufferP++;		
  *AdBufferP=0x3fff3fff&(*(MyBoard0.AdcResultP));			
  AdBufferP++;
  *AdBufferP=0x3fff3fff&(*(MyBoard0.AdcResultP));			
  AdBufferP++;
  i++;
  if(i>65535)
  	{
  	AdBufferP=(unsigned long *)0x800000;
  	i=0;	
	}
	
  *(MyBoard0.DigiLowOutP)=i;

  	
  *DiBufferP=0xffff&(*(MyBoard0.DigiLowInP));
  
  DiBufferP++;
  j++;
  if(j>65535)
  	{
  	DiBufferP=(unsigned long *)0x900000;
  	j=0;	
	}
  	
 //now we send the dac with some value
  *(MyBoard0.DacAP)=i;
  *(MyBoard0.DacBP)=i;		
  
 //now send the DOUT with some value;
 
}

void BusError(void)
{
 //Add Code here!
}


⌨️ 快捷键说明

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