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

Subversion Repositories copyblaze

[/] [copyblaze/] [trunk/] [copyblaze/] [sw/] [code/] [pbcc/] [demo/] [demo.c] - Blame information for rev 55

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 55 ameziti
//#include <stdio.h>
2
 
3
void __port_write(char port, char arg) { }
4
char __port_read(char port) { }
5
void __nop() { }
6
 
7
#define LCD_wr(arg)   __port_write(0x01, (arg))
8
#define LCD_rd()   __port_read(0x01)
9
#define LCD_busy()  (LCD_rd() & 0x80) == 0x80
10
 
11
void delay_ms(int ms)
12
{
13
 int i;
14
 for (;;) {
15
     for (i=0; i < 10000; i++) __nop();
16
 }
17
}
18
 
19
void LCD_init()
20
{
21
  LCD_wr(0x42);
22
  while (LCD_rd()) { __nop();}
23
  LCD_wr(0x43);
24
 delay_ms(10);
25
  LCD_wr(0x44);
26
  LCD_wr(0x45);
27
}
28
 
29
void LCD_write(char ch)
30
{
31
  LCD_wr(0x46);
32
  LCD_wr(0x47);
33
}
34
 
35
int main(void) {
36
 char ch = 0x31;
37
 LCD_init();
38
 while (1) {
39
   LCD_write(ch);
40
   delay_ms(1000);
41
 }
42
}

powered by: WebSVN 2.1.0

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