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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [i386/] [ts_386ex/] [tools/] [dos_sup/] [ts1325.inc] - Blame information for rev 773

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

Line No. Rev Author Line
1 30 unneback
; Some nasm macros to turn on TS-1325 LEDs and wait for button presses.
2
; This should be '%include'ed in your nasm source file.
3
;
4
; Tony Ambardar
5
 
6
P1LTC  equ  0F862h
7
P1PIN  equ  0F860h
8
 
9
%macro  LED_OFF         0
10
        mov     dx, P1LTC
11
        in      al, dx
12
        or      al, 01000000b           ; turn off red
13
        and     al, 11011111b           ; turn off green
14
        out     dx, al
15
%endmacro
16
 
17
%macro  LED_GRN         0
18
        mov     dx, P1LTC
19
        in      al, dx
20
        or      al, 01100000b           ; turn off red, turn on green
21
        out     dx, al
22
%endmacro
23
 
24
%macro  LED_YEL         0
25
        mov     dx, P1LTC
26
        in      al, dx
27
        or      al, 00100000b           ; turn on green
28
        and     al, 10111111b           ; turn on red
29
        out     dx, al
30
%endmacro
31
 
32
%macro  LED_RED         0
33
        mov     dx, P1LTC
34
        in      al, dx
35
        and     al, 10011111b           ; turn on red, turn off green
36
        out     dx, al
37
%endmacro
38
 
39
%macro  PSW_WAIT        0
40
        mov     dx, P1PIN               ; Get PSW state
41
        mov     ecx, 80000h
42
%%read  in      al, dx
43
        test    al, 00000001b           ; is PSW asserted?
44
        jnz     %%read                  ; if not, we're done
45
        dec     ecx
46
        jnz     %%read
47
%endmacro
48
 

powered by: WebSVN 2.1.0

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