-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmipslab.h
63 lines (50 loc) · 1.93 KB
/
mipslab.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* mipslab.h
Header file for all labs.
This file written 2015 by F Lundevall
Some parts are original code written by Axel Isaksson
Latest update 2015-08-28 by F Lundevall
For copyright and licensing, see file COPYING */
/* Declare display-related functions from mipslabfunc.c */
void display_image(int x, const uint8_t *data);
void display_init(void);
void display_string(int line, char *s);
void display_update(void);
uint8_t spi_send_recv(uint8_t data);
/* Declare lab-related functions from mipslabfunc.c */
char * itoaconv( int num );
void labwork(void);
int nextprime( int inval );
void quicksleep(int cyc);
void tick( unsigned int * timep );
/* Declare display_debug - a function to help debugging.
After calling display_debug,
the two middle lines of the display show
an address and its current contents.
There's one parameter: the address to read and display.
Note: When you use this function, you should comment out any9
repeated calls to display_image; display_image overwrites
about half of the digits shown by display_debug.
*/
void display_debug( volatile int * const addr );
/* Declare bitmap array containing font */
extern const uint8_t const font[128*8];
/* Declare bitmap array containing icon */
extern const uint8_t const icon[128];
/* Declare text buffer for display output */
extern char textbuffer[4][16];
extern const uint8_t const number[10][3];
uint8_t display[32][100];
uint8_t oled_display[512];
extern const int const food_x[10];
extern const int const food_y [8];
/* Declare functions written by students.
Note: Since we declare these functions here,
students must define their functions with the exact types
specified in the laboratory instructions. */
/* Written as part of asm lab: delay, time2string */
void delay(int);
void time2string( char *, int );
/* Written as part of i/o lab: getbtns, getsw, enable_interrupt */
int getbtns(void);
int getsw(void);
void enable_interrupt(void);