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

Subversion Repositories mips789

[/] [mips789/] [branches/] [avendor/] [bench/] [demo/] [demo.c] - Blame information for rev 53

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

Line No. Rev Author Line
1 35 mcupro
/******************************************************************
2
 *                                                                *
3
 *    Author: Liwei                                               *
4
 *                                                                *
5
 *    This file is part of the "mips789" project.                 *
6
 *    Downloaded from:                                            *
7
 *    http://www.opencores.org/pdownloads.cgi/list/mips789        *
8
 *                                                                *
9
 *    If you encountered any problem, please contact me via       *
10
 *    Email:mcupro@opencores.org  or mcupro@163.com               *
11
 *                                                                *
12
 ******************************************************************/
13
 
14
 
15
 
16 15 mcupro
#include "..\..\clib\dvc_lib.h"
17
 
18
void main2()
19
{
20
    unsigned char i=0 ;
21
 
22
    uart0_putstr((char*)"HELLO CPU WORLD!\nThis is MIPS789 Running\n");
23
    LCD_init();
24
    LCD_write_string(0,0," THIS'S MIPS789");
25
    LCD_write_string(0,1,"MIPS789 demo...");
26
    while(1)
27
    { if(i==0)
28
          uart0_putstr((char*)"HI can you see me?\n");
29
        dis_byte(i++);
30
        dly_us(100*1000);
31
        led1_off();
32
        led2_off();
33
        /*
34
        if(get_key1()&&get_key2())
35
        {
36
            led1_off();
37
            led2_off();
38
            LCD_write_string(0,1,"Ready to RCV ");
39
            uart0_putstr((char*)"I am ready to rcv program...\n");
40
            download();
41
        }
42
        else
43
        */
44
        if(get_key1())
45
        {
46
            LCD_write_string(0,1,"hello key1      ");
47
            led1_on();
48
            uart0_putstr((char*)"you have pressed key1\n");
49
            while(get_key1());
50
                LCD_write_string(0,1,"MIPS789 demo...");
51
        }
52
        else if(get_key2())
53
        {
54
           LCD_write_string(0,1,"hello key2      ");
55
            led2_on();
56
             uart0_putstr((char*)"you have pressed key2\n");
57
            while(get_key2());
58
            LCD_write_string(0,1,"MIPS789 demo...");
59
        }
60
 
61
    }
62
}

powered by: WebSVN 2.1.0

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