My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* Include Standard files */
#include "AT91SAM9260.h"

#define LED_GREEN 64 /* Green LED on PA6 pin --> 0b0000000001000000 */
#define LED_YELLOW 512 /* Green LED on PA9 pin --> 0b0000001000000000 */

int _start()
{
/* === Configure LEDs === */
/* Configure the pin in output */
AT91C_BASE_PIOA->PIO_OER = (LED_GREEN + LED_YELLOW);

/* Set the PIO controller in PIO mode instead of peripheral mode */
AT91C_BASE_PIOA->PIO_PER = (LED_GREEN + LED_YELLOW);

/* Disable pull-ups */
AT91C_BASE_PIOA->PIO_PPUDR = (LED_GREEN + LED_YELLOW);

/* Turn off LED yellow */
AT91C_BASE_PIOA->PIO_CODR = LED_YELLOW;

while (1)
{
/* Switch on the led green */
AT91C_BASE_PIOA->PIO_CODR = LED_GREEN;

/* Switch off the led green */
AT91C_BASE_PIOA->PIO_SODR = LED_GREEN;
}

return (0);
}

Change log

r20 by casainho on Aug 22, 2008   Diff
Updated version of Flash_LED code.
Go to: 
Project members, sign in to write a code review

Older revisions

r10 by casainho on May 11, 2008   Diff
simple code on flash_LED
All revisions of this file

File info

Size: 946 bytes, 32 lines

File properties

svn:executable
*
Powered by Google Project Hosting