[Lite5200/Linux] Setting on-board LEDs

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

[Lite5200/Linux] Setting on-board LEDs

955 次查看
michael_wahler
Contributor III

Hi everyone,

 

I used LTIB to build a Linux kernel for the Lite5200 board. The Linux kernel boots without any problems and I can run a hello world program that I compiled with LTIB's gcc toolchain. 

 

What I would like to do now is to switch the general-purpose LEDs on the board on and off. However, I do not have any experience in hardware programming. The user manual says: "General purpose LEDs have been provided for debug and development purposes. The LEDs are driven by an inverting buffer connected to the MCU pins described in the following table", followed by a table in which LED 1 is mapped to the IRDA_RX pin of the CPU. How do I find the address of this buffer in my code?

 

Best regards

 

Michael

标签 (1)
0 项奖励
回复
1 回复

616 次查看
J2MEJediMaster
Specialist I

If you are building the project using the CodeWarrior wizard, the wizard should have generated a processor-specific header file that contains the mappings of variable names to peripheral registers, which in turn drive the pins. Look for a header file the uses the CPU's name or board's name, say Lite5200.h. In there you shoud find the variable name IRDA_RX, and what address that is associated with  it. To write to the pin, you have to set it as an output (if it is a general-purpose I/O pin that could be an input or an output), then write a bit using IRDA_RX as the reference to the register.

 

Look at some of the example programs that should have come with the board's CD. There is usually a simple example program that blinks the LEDs that you can study and learn.

0 项奖励
回复