3 * Atmel Nordic AB <www.atmel.com>
4 * Ulf Samuelsson <ulf@atmel.com>
6 * See file CREDITS for list of people who contributed to this
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 #include <asm/arch/AT91RM9200.h>
28 #define GREEN_LED AT91C_PIO_PB0
29 #define YELLOW_LED AT91C_PIO_PB1
30 #define RED_LED AT91C_PIO_PB2
32 void green_LED_on(void)
34 AT91PS_PIO PIOB = AT91C_BASE_PIOB;
35 PIOB->PIO_CODR = GREEN_LED;
38 void yellow_LED_on(void)
40 AT91PS_PIO PIOB = AT91C_BASE_PIOB;
41 PIOB->PIO_CODR = YELLOW_LED;
46 AT91PS_PIO PIOB = AT91C_BASE_PIOB;
47 PIOB->PIO_CODR = RED_LED;
50 void green_LED_off(void)
52 AT91PS_PIO PIOB = AT91C_BASE_PIOB;
53 PIOB->PIO_SODR = GREEN_LED;
56 void yellow_LED_off(void)
58 AT91PS_PIO PIOB = AT91C_BASE_PIOB;
59 PIOB->PIO_SODR = YELLOW_LED;
62 void red_LED_off(void)
64 AT91PS_PIO PIOB = AT91C_BASE_PIOB;
65 PIOB->PIO_SODR = RED_LED;
71 AT91PS_PIO PIOB = AT91C_BASE_PIOB;
72 AT91PS_PMC PMC = AT91C_BASE_PMC;
73 PMC->PMC_PCER = (1 << AT91C_ID_PIOB); /* Enable PIOB clock */
74 /* Disable peripherals on LEDs */
75 PIOB->PIO_PER = AT91C_PIO_PB2 | AT91C_PIO_PB1 | AT91C_PIO_PB0;
76 /* Enable pins as outputs */
77 PIOB->PIO_OER = AT91C_PIO_PB2 | AT91C_PIO_PB1 | AT91C_PIO_PB0;
78 /* Turn all LEDs OFF */
79 PIOB->PIO_SODR = AT91C_PIO_PB2 | AT91C_PIO_PB1 | AT91C_PIO_PB0;