/*
stm32f446, stm32f411, stm32f401 NUCLEO板
最小系统测试程序
不需要头文件和库函数,很小巧实用!
用于I/o口翻转频率测试、跑马灯演示!
作者: 大秦正声,小电子
日期: 2015.10.6
博客: http://yang96381.blog.163.com
邮箱: yang96381@163.com
*/
#define DELAY_COUNT 0x3fFFFF
#define ledoff *(long*)0x40020014=0x0000;///PA口输出低
#define ledon *(long*)0x40020014=0xffff;///PA口输出高
void Delay( long int Count)
{
for(; Count!= 0;Count--);
}
int main(void)
{ *(long*)0x40023830=0x001000ff;// i/0口使能
*(long*)0x40020000=0xa8555555;//PA口输出
*(long*)0x40020008=0xffffffff;//PA口high speed
*(long*)0x40020004=0x0000;//PA口上拉
while(1)
{
ledon
ledoff
ledon
ledoff
ledon
ledoff
ledon
ledoff
ledon
ledoff
ledon
ledoff
ledon
ledoff
ledon
ledoff
ledon
ledoff
ledon
ledoff
ledon
ledoff
ledon
ledoff
ledon
ledoff
ledon
ledoff
ledon
ledoff
ledon
ledoff
/*
ledon /// *(long*)0x40020014=0xffff;//高
Delay(DELAY_COUNT);///延时,翻转测试不用
ledoff /// *(long*)0x40020014=0x0000;//低
Delay(DELAY_COUNT);///延时,翻转测试不用
*/
}
}
|