-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlcd.h
40 lines (33 loc) · 1 KB
/
lcd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* Author: Steve Gunn
* Licence: This work is licensed under the Creative Commons Attribution License.
* View this license at http://creativecommons.org/about/licenses/
*/
#include <avr/io.h>
#include <stdint.h>
#include "svgrgb565.h"
#define LCDWIDTH 240
#define LCDHEIGHT 320
typedef enum {North, West, South, East} orientation;
typedef struct {
uint16_t width, height;
orientation orient;
uint16_t x, y;
uint16_t foreground, background;
} lcd;
extern lcd display;
typedef struct {
uint16_t left, right;
uint16_t top, bottom;
} rectangle;
void init_lcd();
void lcd_brightness(uint8_t i);
void set_orientation(orientation o);
void set_frame_rate_hz(uint8_t f);
void clear_screen();
void fill_rectangle(rectangle r, uint16_t col);
void fill_rectangle_indexed(rectangle r, uint16_t* col);
void display_char(char c);
void display_string(char *str);
void display_string_xy(char *str, uint16_t x, uint16_t y);
void display_move(uint16_t x, uint16_t y);
void display_color(uint16_t fg, uint16_t bg);