diff options
author | Stelian Pop <stelian@popies.net> | 2008-03-26 20:52:32 +0100 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2008-04-01 01:45:50 +0200 |
commit | 983c1db04c1dd0f92e02f06d29f0c65a3d9a2687 (patch) | |
tree | 59c4e30276a49cf468cdea9a9ef2b6258238acb6 /board/atmel/at91cap9adk/led.c | |
parent | 177e8a5ac81bbc531a1d54abdb47f2860266c3aa (diff) | |
download | u-boot-imx-983c1db04c1dd0f92e02f06d29f0c65a3d9a2687.zip u-boot-imx-983c1db04c1dd0f92e02f06d29f0c65a3d9a2687.tar.gz u-boot-imx-983c1db04c1dd0f92e02f06d29f0c65a3d9a2687.tar.bz2 |
Port AT91CAP9 to the new headers
Adapt the existing AT91CAP9 code to the new headers and APIs.
Signed-off-by: Stelian Pop <stelian@popies.net>
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); } |