CS计算机代考程序代写 #include

#include

/* config I/O ports for LCD */
void LCD_Config(void);

/* Inititiation process for LCD */
void init_LCD(void);
void LCD_Write(uint8_t x, int8_t i);

/* copy display buffer to lcd */
void copy_to_lcd(void);

/* set one pixel in buffer */
void pixel(int x, int y, int color);

/** draw a 1 pixel line
*
* @param x0,y0 start point
* @param x1,y1 stop point
* @param color ,1 set pixel ,0 erase pixel
*
*/
void line(int x0, int y0, int x1, int y1, int color);

/** draw a rectangle
*
* @param x0,y0 top left corner
* @param x1,y1 down right corner
* @param color 1 set pixel ,0 erase pixel
* *
*/
void rect(int x0, int y0, int x1, int y1, int color);

/** draw a filled rectangle
*
* @param x0,y0 top left corner
* @param x1,y1 down right corner
* @param color 1 set pixel ,0 erase pixel
* *
*/
void fillrect(int x0, int y0, int x1, int y1, int color);

/** draw a circle
*
* @param x0,y0 center
* @param r radius
* @param colour ,1 set pixel ,0 erase pixel
*
*/
void circle(int x0, int y0, int r, int color);

/** draw a filled circle
*
* @param x0,y0 center
* @param r radius
* @param colour ,1 set pixel ,0 erase pixel
*
*/
void fillcircle(int x, int y, int r, int color);

/* clear the screen */
void cls(void);

/** select the font to use
*
* @param f pointer to font array
*
* font array can created with GLCD Font Creator from http://www.mikroe.com
* you have to add 4 parameter at the beginning of the font array to use:
* – the number of byte / char
* – the vertial size in pixel
* – the horizontal size in pixel
* – the number of byte per vertical line
* you also have to change the array to char[]
*
*/
void set_font(unsigned char* f);

/** calculate the max number of columns
*
* @returns max column
* depends on actual font size
*
*/
int columns();

/** calculate the max number of rows
*
* @returns max rows
* depends on actual font size
*
*/
int rows();

/** draw a character on given position out of the active font to the LCD
*
* @param x x-position of char (top left)
* @param y y-position
* @param c char to print
*
*/
void character(int x, int y, int c);

/** put a char on the screen
*
* @param value char to print
* @returns printed char
*
*/
int putc(int value);

/** setup cursor position
*
* @param x x-position (top left)
* @param y y-position
*/
void locate(int x, int y);

/** put a string on the screen
*
* @param x column (1-21)
* @param y row (1-3)
* @param value chars to print
* @returns printed char
*
*/
void putstr(int x, int y, char *s);

/** put a character on the screen
*
* @param x column (1-21)
* @param y row (1-3)
* @param value char to print
* @returns printed char
*
*/
void putchar(int y, int x, char c);

/*********************** Copywright 2020 © Dibin Zhu ************************/