[U-Boot] [PATCH] at91: Add command to control GPIO LEDs from the console

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Sat May 23 01:33:05 CEST 2009


On 10:51 Thu 14 May     , Daniel Gorsulowski wrote:
> This patch allows any at91 board implementing the GPIO LED API
> to control vendor specific LEDs from the console.
> 
> Adding configuration items CONFIG_AT91_LED and CONFIG_CMD_LED
> enables the command.
> Moreover the GPIO Pins have to be defined by CONFIG_GPIO_LEDS
> See doc/README.LED for detailed information.
> 
> Usage:
> led [LED_number] [on|off]
why create a new led API?

the best way will be to extent the current collor led api by using something
like this

why create a new led API?

the best way will be to extent the current collor led api by using something
like this

#define LED_RED		0
#define LED_GREEN	1
#define LED_YELLOW	2
#define LED_BLUE	3

.macro led_red_off
	ldr	r0, =LED_RED
	mov	r1, #0
	bl	led_on_off
.endm

.macro led_red_on
	ldr	r0, =LED_RED
	mov	r1, #1
	bl	led_on_off
.endm

.macro led_green_off
	ldr	r0, =LED_GREEN
	mov	r1, #0
	bl	led_on_off
.endm

.macro led_green_on
	ldr	r0, =LED_GREN
	mov	r1, #1
	bl	led_on_off
.endm

.macro led_yellow_off
	ldr	r0, =LED_YELLOW
	mov	r1, #0
	bl	led_on_off
.endm

.macro led_yellow_on
	ldr	r0, =LED_YELLOW
	mov	r1, #1
	bl	led_on_off
.endm

.macro led_blue_off
	ldr	r0, =LED_BLUE
	mov	r1, #0
	bl	led_on_off
.endm

.macro led_blue_on
	ldr	r0, =LED_BLUE
	mov	r1, #1
	bl	led_on_off
.endm

and we need to keep the coloured led name and number
and if needed extendit as done for the zoom2

and please do not do it only for at91

Best Regards,
J.


More information about the U-Boot mailing list