📄 led_test.c
字号:
/********************************************************************************************/
/* File name: led.c */
/* Software: Blackfin DSP Debug Tools */
/* Hardware: Embest EDUKIT-III */
/* purpose: light and close the led 1,2 */
/* modify: */
/* command: */
/********************************************************************************************/
#include "cdefBF533.h"
/********************************************************************************************/
/* function declare */
/********************************************************************************************/
void delay(int time);
void led_init();
void led_allon();
void led_alloff();
/********************************************************************************************/
/* name: delay() */
/* func: functiong of delay */
/* para: none */
/* ret : none */
/* modify: */
/* command: */
/********************************************************************************************/
//void delay(int time)
//{
// int i, j;
// for(i=0; i<time; i++)
// for(j=0; j<5000; j++);
//}
/********************************************************************************************/
/* name: led_init() */
/* func: initialize the LED */
/* para: none */
/* ret : none */
/* modify: */
/* command: */
/********************************************************************************************/
void led_init()
{
__asm(
"R0 = 0x32;\n"
"SYSCFG = R0;\n"
);
*pFIO_DIR = 0x0180; //Direction setiing
*pFIO_INEN = 0x0400; //Enable Button Interruption >PF9
*pFIO_MASKA_D = 0x0400;
*pFIO_EDGE = 0x0400; //Setting PFA interrupt
}
/********************************************************************************************/
/* name: led_allon() */
/* func: light two LED */
/* ret : none */
/* modify: */
/* command: */
/********************************************************************************************/
void led_allon()
{
int i=0;
*pFIO_FLAG_D &= 0xfe7f;
while(i<0xffffff)
i++;
}
/********************************************************************************************/
/* name: led_allof() */
/* func: close two LED */
/* para: none */
/* ret : none */
/* modify: */
/* command: */
/********************************************************************************************/
void led_alloff()
{
*pFIO_FLAG_D |= 0x0180;
int i=0;
while(i<0xffffff)
i++;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -