diff options
author | Wolfgang Denk <wd@denx.de> | 2008-04-08 00:16:36 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2008-04-08 00:16:36 +0200 |
commit | a1b215e2a2a013327693f2fb990957b746f26cf5 (patch) | |
tree | c998a43b8022f623ac86a0de246d05ed36a86e9e /board/atmel/at91cap9adk/led.c | |
parent | f9eabcb357ea294e3e01bfe26841bf51d6bd8f05 (diff) | |
parent | b5873f1732b92a25690e1513b90dfb0d644f6697 (diff) | |
download | u-boot-imx-a1b215e2a2a013327693f2fb990957b746f26cf5.zip u-boot-imx-a1b215e2a2a013327693f2fb990957b746f26cf5.tar.gz u-boot-imx-a1b215e2a2a013327693f2fb990957b746f26cf5.tar.bz2 |
Merge branch 'master' of git://www.denx.de/git/u-boot-at91
Diffstat (limited to 'board/atmel/at91cap9adk/led.c')
-rw-r--r-- | board/atmel/at91cap9adk/led.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/board/atmel/at91cap9adk/led.c b/board/atmel/at91cap9adk/led.c index 8588a91..04de139 100644 --- a/board/atmel/at91cap9adk/led.c +++ b/board/atmel/at91cap9adk/led.c @@ -23,58 +23,55 @@ */ #include <common.h> -#include <asm/arch/AT91CAP9.h> +#include <asm/arch/at91cap9.h> +#include <asm/arch/at91_pmc.h> +#include <asm/arch/gpio.h> +#include <asm/arch/io.h> -#define RED_LED AT91C_PIO_PC29 /* this is the power led */ -#define GREEN_LED AT91C_PIO_PA10 /* this is the user1 led */ -#define YELLOW_LED AT91C_PIO_PA11 /* this is the user1 led */ +#define RED_LED AT91_PIN_PC29 /* this is the power led */ +#define GREEN_LED AT91_PIN_PA10 /* this is the user1 led */ +#define YELLOW_LED AT91_PIN_PA11 /* this is the user1 led */ void red_LED_on(void) { - AT91C_BASE_PIOC->PIO_SODR = RED_LED; + at91_set_gpio_value(RED_LED, 1); } void red_LED_off(void) { - AT91C_BASE_PIOC->PIO_CODR = RED_LED; + at91_set_gpio_value(RED_LED, 0); } void green_LED_on(void) { - AT91C_BASE_PIOA->PIO_CODR = GREEN_LED; + at91_set_gpio_value(GREEN_LED, 0); } void green_LED_off(void) { - AT91C_BASE_PIOA->PIO_SODR = GREEN_LED; + at91_set_gpio_value(GREEN_LED, 1); } void yellow_LED_on(void) { - AT91C_BASE_PIOA->PIO_CODR = YELLOW_LED; + at91_set_gpio_value(YELLOW_LED, 0); } void yellow_LED_off(void) { - AT91C_BASE_PIOA->PIO_SODR = YELLOW_LED; + at91_set_gpio_value(YELLOW_LED, 1); } void coloured_LED_init(void) { /* Enable clock */ - AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_PIOABCD; + at91_sys_write(AT91_PMC_PCER, 1 << AT91CAP9_ID_PIOABCD); - /* Disable peripherals on LEDs */ - AT91C_BASE_PIOA->PIO_PER = GREEN_LED | YELLOW_LED; - /* Enable pins as outputs */ - AT91C_BASE_PIOA->PIO_OER = GREEN_LED | YELLOW_LED; - /* Turn all LEDs OFF */ - AT91C_BASE_PIOA->PIO_SODR = GREEN_LED | YELLOW_LED; + at91_set_gpio_output(RED_LED, 1); + at91_set_gpio_output(GREEN_LED, 1); + at91_set_gpio_output(YELLOW_LED, 1); - /* Disable peripherals on LEDs */ - AT91C_BASE_PIOC->PIO_PER = RED_LED; - /* Enable pins as outputs */ - AT91C_BASE_PIOC->PIO_OER = RED_LED; - /* Turn all LEDs OFF */ - AT91C_BASE_PIOC->PIO_CODR = RED_LED; + at91_set_gpio_output(RED_LED, 0); + at91_set_gpio_output(GREEN_LED, 1); + at91_set_gpio_output(YELLOW_LED, 1); } |