2 #include <AT91SAM7S64.h>
4 #define GREEN_PIN AT91C_PIO_PA3
5 #define YELLOW_PIN AT91C_PIO_PA4
6 #define RED_PIN AT91C_PIO_PA8
8 #define ALL_PINS (GREEN_PIN | YELLOW_PIN | RED_PIN)
13 *AT91C_PIOA_PER = ALL_PINS;
14 *AT91C_PIOA_OER = ALL_PINS;
15 *AT91C_PIOA_MDER = ALL_PINS;
16 *AT91C_PIOA_SODR = ALL_PINS;
23 if (*AT91C_PIOA_ODSR & GREEN_PIN) on |= LEDS_GREEN;
24 if (*AT91C_PIOA_ODSR & YELLOW_PIN) on |= LEDS_YELLOW;
25 if (*AT91C_PIOA_ODSR & RED_PIN) on |= LEDS_RED;
30 leds_arch_set(
unsigned char leds)
33 if (leds & LEDS_GREEN)
set |= GREEN_PIN;
34 if (leds & LEDS_YELLOW)
set |= YELLOW_PIN;
35 if (leds & LEDS_RED)
set |= RED_PIN;
36 *AT91C_PIOA_CODR =
set;
37 *AT91C_PIOA_SODR = (~set) & ALL_PINS;