【嵌入式】裸机烧写LED
发布日期:2021-05-10 10:12:44 浏览次数:12 分类:精选文章

本文共 2250 字,大约阅读时间需要 7 分钟。

���������������������LED������������������

���������������������������������������������������LED������������������������������������GPIO���������������������������������������������������������������������������������������������������������������������

1. ������������

���������������������������������������

1.���������������������������������������������������Makefile���������������
2.������GPIO������������������������������
3.������������������������������������������������LED������������

2. ���������������������������

2.1 ������������������

������������������������������������������

  • ������������������������NAND���������������ARM���������������CY8C develepment kit���
  • ���������������������ARM������������arm-gcc���������������������
  • ���������������������������������������������������������������PC������
2.2 ������������������

1.������������������������������������������������������������������

2.������_GPIO������������������������������������������������
3.������������������������NAND������������������������������

3. ���������������

3.1 Makefile������

Makefile���������������������������������

led.elf: start.o led.o
arm-linux-ld -Ttext 0xd0020010 -o led.elf $^
arm-linux-objcopy -O binary led.elf led.bin
%.o: %.S
arm-linux-gcc -nostdlib -o $@ $<
%.o: %.c
arm-linux-gcc -nostdlib -o $@ $<
clean:
rm -rf *.o *.elf
3.2 ���������������
#define GPJ2CON (*(volatile unsigned long*)0xE0200280)
#define GPJ2DAT (*(volatile unsigned long*)0xE0200284)
void delay(int t) {
volatile int count = t;
while(count--);
}
void led_blink() {
GPJ2CON = 0x00001111;
while(1) {
GPJ2DAT = 0;
delay(0x100000);
GPJ2DAT = 0xF;
delay(0x100000);
}
}

4. ���������������������������

1.���������������������������������������������USB���������

2.������������������������������������
3.������������������������Dawn of a new world���������������������

5. ������������

1.������������������PC���������NAND������������

2.������������������������������������������LED������
3.���������������������������������

6. ������������

������������������������������������LED������������������������

������������������������������������������������������������������������������������������������������������}.

上一篇:谁才是物联网连接技术中的王者?
下一篇:【MYSQL】日期转换与查询,昨天,今天,过去第n天,过去n天的数据

发表评论

最新留言

留言是一种美德,欢迎回访!
[***.207.175.100]2025年04月13日 05时41分56秒