开发板 LED 如何点亮?
目前在使用MPC8313开发板,跑的linux系统,有8个可编程LED,看cfg文件有以下映射信息。
# WINDOW 3 - Read Write Buffer
writemem.l 0xe0000038 0xfa000000 # LBLAWBAR3 - begining at 0xfa000000
writemem.l 0xe000003c 0x8000000e # LBLAWAR3 - enable, size = 32kB
# CS3 - Read Write Buffer
writemem.l 0xe0005018 0xfa000801 # BR3 base address at 0xfa000000, port size 8 bit, GPCM, valid
writemem.l 0xe000501c 0xFFFF8FF7 # OR3 32KB
说明书有以下信息:
An 8-bit write register on the RDB turns the LEDs on and off. The LEDs are arranged so that the most
significant bit represents LED0 and least significant bit represents LED7; that is, LED[0..7]. A write of
0x00 turns on all LEDs, and 0xFF turns off all LEDs.
如何能控制这8个LED呢,该如何写代码?多谢。