Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / colonet / utilities / robot_wireless_relay / lcd.h @ 13

History | View | Annotate | Download (1.92 KB)

1
#ifndef _LCD_H_
2
#define _LCD_H_
3

    
4
#ifndef FFPP
5

    
6
//////lcd defines
7
#define RST 0x04  // pe2 (GPIO)
8
#define SCE 0x01  // pb0 (~SS)
9
#define D_C 0x10  // pb4 (GPIO?)
10
#define SDI 0x04  // pb2 (MOSI)
11
#define SCK 0x02  // pb1 (SCK)
12

    
13
#define LCDPORT PORTB
14
#define LCDDDR DDRB
15

    
16
#define LCDRESETPORT PORTE
17
#define LCDRESETDDR DDRE
18

    
19
#else
20
        
21

    
22
// other OLED pins
23
//#define LCD_RW    0x00000080
24
#define LCD_RS    PB4 // Command/Data
25
//#define LCD_RD    0x00008000
26
#define LCD_RSTB  PE2 // reset line
27
#define LCD_CS    PB0
28

    
29

    
30

    
31
// inialize OLED and SPI
32
void OLED_init(void);
33

    
34
// reset Controller
35
void Reset_SSD1339(void);
36

    
37
// write command or data
38
void write_c(unsigned char out_command);
39
void write_d(unsigned char out_data);
40

    
41
// these write data to the OLED on 8 bit data bus,  depends on MCU
42
void LCD_out(unsigned char cmd);
43

    
44
// these functions set / clear pins for OLED control lines.  they accecpt a 0 or 1 
45
//void RD(char stat);
46
//void RW(char stat);
47
void DC(char stat);
48
void RES(char stat);
49
void CS(char stat);
50

    
51
void drawcircle(char col, char row, char radius, int lcolor,  int fcolor);
52
void drawrect(char scol, char srow, char ecol, char erow, int lcolor,  int fcolor);
53
void drawline(char scol, char srow, char ecol, char erow, int lcolor);
54
void drawcopy(char scol, char srow, char ecol, char erow, char ncol, char nrow);
55
void drawfill(char fill);
56

    
57
void drawclearwindow(char scol, char srow, char ecol, char erow);
58
inline void drawclear(void);
59

    
60
void drawscroll(char hoff, char srow, char rows, char speed);
61
inline void drawscrollstart(void);
62
inline void drawscrollstop(void);
63

    
64
void drawIR(void);
65

    
66
void crazycircle (void);
67
void crazyrect (void) ;
68

    
69
void OLEDtest (void) ;
70

    
71

    
72
#endif
73

    
74
void lcd_init(void);
75
void lcd_clear_screen( void );
76
void lcd_putbyte(unsigned char c);
77
void lcd_putchar(char c);
78
void lcd_putstr(char *s);
79
void lcd_gotoxy(int x, int y);
80
void lcd_putint(int value);
81

    
82

    
83

    
84
#endif