OSDN Git Service

0c9992847dfbaf756167b584f62cb82e5d9f8b29
[bluetank/bluetank.git] / firm / bare_metal / lcd.h
1 #ifndef _LCD_H_
2 #define _LCD_H_
3
4 #include <stdbool.h>
5 #include <stdint.h>
6
7 typedef enum {
8     Left,
9     Right
10 } Direction;
11
12 typedef enum {
13     UserFont1,
14     UserFont2,
15     UserFont3,
16     UserFont4,
17     UserFont5,
18     UserFont6,
19     UserFont7,
20     UserFont8
21 } UserFont;
22
23 #define LCD_FONT_WIDTH  (5)
24 #define LCD_FONT_HEIGHT (8)
25 #define LCD_FONT_CHARS  (8)
26
27 typedef struct {
28     unsigned char data[LCD_FONT_HEIGHT];
29 } Font;
30
31 typedef struct {
32     Font fontlist[LCD_FONT_CHARS];
33 } FontSet;
34
35 void lcd_init(void);
36 void lcd_clear(void);
37 void lcd_cursor_at_home(void);
38 void lcd_entry_mode_set(bool increment, bool shifted);
39 void lcd_display(bool display, bool cursor, bool blink);
40 void lcd_cursor_shift(Direction dir);
41 void lcd_display_shift(Direction dir);
42 void lcd_goto(uint8_t x, uint8_t y);
43 void lcd_putc(char c);
44 void lcd_puts(char *str);
45 void lcd_font_init(FontSet *fs);
46 void lcd_font_set_pixel(
47         FontSet *fs, UserFont index,
48         const int x, const int y, const int on);
49 void lcd_font_setup_single(FontSet *fs, UserFont index);
50 void lcd_font_setup_all(FontSet *fs);
51
52 #endif
53