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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [i386/] [ts_386ex/] [start/] [ts_1325.inc] - Blame information for rev 672

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

Line No. Rev Author Line
1 30 unneback
/*
2
  These are just some useful macros that control the TS-1325's
3
  LEDs and push-button switch. Useful for debugging.
4
 
5
  NOTE: This *must* be 16-bit compatible code to work in start.s
6
 
7
  Tony Ambardar
8
*/
9
 
10
        .macro  LED_OFF
11
        movw    $P1LTC, dx
12
        inb     dx,     al
13
        orb     $0b01000000,    al
14
        andb    $0b11011111,    al
15
        outb    al,     dx
16
        .endm
17
 
18
        .macro  LED_GREEN
19
        movw    $P1LTC, dx
20
        inb     dx,     al
21
        orb     $0b01100000,    al
22
        outb    al,     dx
23
        .endm
24
 
25
        .macro  LED_YELLOW
26
        movw    $P1LTC, dx
27
        inb     dx,     al
28
        orb     $0b00100000,    al
29
        andb    $0b10111111,    al
30
        outb    al,     dx
31
        .endm
32
 
33
        .macro  LED_RED
34
        movw    $P1LTC, dx
35
        inb     dx,     al
36
        andb    $0b10011111,    al
37
        outb    al,     dx
38
        .endm
39
 
40
        .macro  WAIT_BUTTON     # Wait till the button is pressed for a bit.
41
        movw    $P1PIN, dx      # ~25-30 cycles per loop, 25MHz -> 1 sec.
42
        movl    $300000,ecx    # "Timer" count determines how long.
43
0:      inb     dx,     al
44
        andb    $0b00000001,al
45
        jnz     0b              # Button pressed?
46
        decl    ecx
47
        jnz     0b              # CX count expired?
48
        .endm
49
 
50
 

powered by: WebSVN 2.1.0

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