-
Notifications
You must be signed in to change notification settings - Fork 0
/
graphic_display_controller_interface.h
42 lines (40 loc) · 1.2 KB
/
graphic_display_controller_interface.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
41
42
#ifndef GRAPHIC_DISPLAY_CONTROLLER_INTERFACE_H
#define GRAPHIC_DISPLAY_CONTROLLER_INTERFACE_H
#include "defines.h"
typedef struct tPoint {
unsigned char x;
unsigned char y;
} POINT;
typedef struct tGeometry {
int numpoints;
int sizeX;
int sizeY;
POINT px[MAX_POINTS];
} GEOMETRY, *PGEOMETRY;
typedef struct tObj {
PGEOMETRY geo;
int dirx, diry;
int posx, posy;
void (* draw)(struct tObj*);
void (* clear)(struct tObj*);
void (* move)(struct tObj*);
void (* set_speed)(struct tObj*,int, int);
} OBJECT, *POBJECT;
typedef unsigned char uint8_t;
void select_controller(uint8_t controller);
void graphic_ctrl_bit_set(uint8_t x);
void graphic_ctrl_bit_clear(uint8_t x);
void graphic_wait_ready();
uint8_t graphic_read(uint8_t controller);
void graphic_write(uint8_t value, uint8_t controller);
void graphic_write_command(uint8_t cmd, uint8_t controller);
void graphic_write_data(uint8_t data, uint8_t controller);
uint8_t graphic_read_data(uint8_t controller);
void graphic_initialize();
void graphic_clear_screen();
void pixel(unsigned x, unsigned y, unsigned set);
void set_object_speed(POBJECT o, int speedx, int speedy);
void draw_object(POBJECT o);
void clear_object(POBJECT o);
void move_object(POBJECT o);
#endif