~ubuntu-branches/ubuntu/maverick/uboot-imx/maverick

« back to all changes in this revision

Viewing changes to board/atmel/at91sam9261ek/led.c

  • Committer: Bazaar Package Importer
  • Author(s): Oliver Grawert
  • Date: 2010-01-20 15:41:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100120154126-7bha1jeyjegu7xm5
Tags: 2009.08+really2009.01-0ubuntu1
* revert to the 2009.01 upstream version, 2009.08 has still to 
  many work in progress items in the freescale patchset (MMC and NIC
  dont work at all)
* add the latest patchset from freescale for 2009.01
* add 1002_enable_hush_shell_and_ext2.patch to enable hush shell and ext2 
* add 1003_fix_board_revision_numbers to make sure babbage 2.5 boards have 
  revision 51120 and babbage 3.0 boards have revision 51130 properly set in 
  their cpuinfo

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include <asm/arch/gpio.h>
29
29
#include <asm/arch/io.h>
30
30
 
 
31
#define RED_LED         AT91_PIN_PA23   /* this is the power led */
 
32
#define GREEN_LED       AT91_PIN_PA13   /* this is the user1 led */
 
33
#define YELLOW_LED      AT91_PIN_PA14   /* this is the user2 led */
 
34
 
 
35
void red_LED_on(void)
 
36
{
 
37
        at91_set_gpio_value(RED_LED, 1);
 
38
}
 
39
 
 
40
void red_LED_off(void)
 
41
{
 
42
        at91_set_gpio_value(RED_LED, 0);
 
43
}
 
44
 
 
45
void green_LED_on(void)
 
46
{
 
47
        at91_set_gpio_value(GREEN_LED, 0);
 
48
}
 
49
 
 
50
void green_LED_off(void)
 
51
{
 
52
        at91_set_gpio_value(GREEN_LED, 1);
 
53
}
 
54
 
 
55
void yellow_LED_on(void)
 
56
{
 
57
        at91_set_gpio_value(YELLOW_LED, 0);
 
58
}
 
59
 
 
60
void yellow_LED_off(void)
 
61
{
 
62
        at91_set_gpio_value(YELLOW_LED, 1);
 
63
}
 
64
 
 
65
 
31
66
void coloured_LED_init(void)
32
67
{
33
68
        /* Enable clock */
34
69
        at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9261_ID_PIOA);
35
70
 
36
 
        at91_set_gpio_output(CONFIG_RED_LED, 1);
37
 
        at91_set_gpio_output(CONFIG_GREEN_LED, 1);
38
 
        at91_set_gpio_output(CONFIG_YELLOW_LED, 1);
 
71
        at91_set_gpio_output(RED_LED, 1);
 
72
        at91_set_gpio_output(GREEN_LED, 1);
 
73
        at91_set_gpio_output(YELLOW_LED, 1);
39
74
 
40
 
        at91_set_gpio_value(CONFIG_RED_LED, 0);
41
 
        at91_set_gpio_value(CONFIG_GREEN_LED, 1);
42
 
        at91_set_gpio_value(CONFIG_YELLOW_LED, 1);
 
75
        at91_set_gpio_value(RED_LED, 0);
 
76
        at91_set_gpio_value(GREEN_LED, 1);
 
77
        at91_set_gpio_value(YELLOW_LED, 1);
43
78
}