📄 led_test.c
字号:
/*__________________________________________________________________________
| |
| File : led_test.c |
| Software : VisualDSP++ |
| Hardware : Embest ADSP-BF53X EVB |
| Author : embest |
| Desc : led test example file |
|___________________________________________________________________________|
*/
#include <cdefBF533.h>
/*__________________________________________________________________________
| |
| Name: led_init() |
| |
| Func: initialize the LED |
| |
| para: none |
| |
| ret : none |
|___________________________________________________________________________|
*/
static void led_init(void)
{
__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 |
| |
| para: none |
| |
| ret : none |
|___________________________________________________________________________|
*/
static void led_allon(void)
{
int i = 0;
*pFIO_FLAG_D &= 0xfe7f;
while( i < 0x8fffff )
i++;
}
/*__________________________________________________________________________
| |
| Name: led_allof() |
| |
| Func: close two LED |
| |
| para: none |
| |
| ret : none |
|___________________________________________________________________________|
*/
static void led_alloff(void)
{
int i = 0;
*pFIO_FLAG_D |= 0x0180;
while( i < 0x8fffff )
i++;
}
/*__________________________________________________________________________
| |
| Name: led_test() |
| |
| Func: close two LED |
| |
| para: none |
| |
| ret : none |
|___________________________________________________________________________|
*/
void led_test()
{
led_init();
while(1)
{
led_allon();
led_alloff();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -