OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [uIP_Demo_Rowley_ARM7/] [uip/] [main_led] - Blame information for rev 867

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 583 jeremybenn
// Copyright (c) 2001-2004 Rowley Associates Limited.
2
//
3
// This file may be distributed under the terms of the License Agreement
4
// provided with this software.
5
//
6
// THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING THE
7
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
8
//
9
////////////////////////////////////////////////////////////////////////////////
10
//
11
//                      Olimex LPC-P1  LED Example
12
//
13
// Description
14
// -----------
15
// This example demonstrates writing to the programmable peripheral interface.
16
//
17
////////////////////////////////////////////////////////////////////////////////
18
 
19
#include 
20
 
21
#define LED_RED (1<<8)
22
#define LED_GREEN (1<<10)
23
#define LED_YELLOW (1<<11)
24
 
25
#define LED1 LED_YELLOW
26
 
27
static void
28
ledInit()
29
{
30
  IODIR |= LED1;
31
  IOSET = LED1;
32
}
33
 
34
static void
35
ledOn(void)
36
{
37
  IOCLR = LED1;
38
}
39
 
40
static void
41
ledOff(void)
42
{
43
  IOSET = LED1;
44
}
45
 
46
void
47
delay(int d)
48
{
49
  for(; d; --d);
50
}
51
 
52
int
53
main(void)
54
{
55
  MAMCR = 2;
56
  ledInit();
57
  while (1)
58
    {
59
      ledOn();
60
      delay(100000);
61
      ledOff();
62
      delay(100000);
63
    }
64
  return 0;
65
}
66
 
67
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.