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

📄 led.c

📁 codewarrior dsp 56807 中断编程实现灯闪烁,有详细的注释
💻 C
字号:




/*  metrowerks sample code  */



/*
	this source illustrates code called by ISR 
	and #pragma directives necessary for ISR-safe code
		
*/



#include "DSP56F807.h"
#include "led.h"

/* libraries called by interrupt handlers need this pragma, it will:
1. save used register
2. return with RTS instead of RTI */
#pragma interrupt called

void initLED()
{  //////111111111111111111111111
	/* disable SSI peripheral   */
	asm(bfclr	#$0001,X:GPIO_B_PER);  /// 0001
	asm(bfclr	#$0002,X:GPIO_B_PER);  /// 0010
	asm(bfclr	#$0004,X:GPIO_B_PER);  /// 0100
	
	/* output direction  输出方向定义  */
	asm(bfset	#$0001,X:GPIO_B_DDR); ////  0001 GPIO_B_DDR 为寄存器 B 

⌨️ 快捷键说明

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