作者:新纪元 | 更新时间:2016-04-06 | 浏览量:2436
最近在做基于ESP8266驱动NOkia5110 LCD屏幕的菜单显示,献上LCD的底层驱动。
底层实现的功能:
/*初始化*/ void LCD5110_init(void); /*设置显示模式 0普通模式 1反转显示*/ void LCD5110_setMode(unsigned char mode); /*关闭显示*/ void LCD5110_disable(void); /*开显示*/ void LCD5110_enable(void); /******************************2D图形库******************************/ /*清屏*/ void LCD5110_clear(void); /*在指定坐标 瞄一个像素 0空白像素(不显示) 1显示*/ void LCD5110_drawPixel(unsigned char x,unsigned char y,unsigned char point); /*获取指定坐标的像素值 0不显示的像素 1显示的*/ unsigned char LCD5110_getPixel(unsigned char x, unsigned char y); /*从指定坐标开始 画一条水平线 Hsize为线长度*/ void LCD5110_drawHLine(unsigned char x0, unsigned char y0, unsigned char Hsize); /*从指定坐标开始画一条垂直线 Vsize 为线长度*/ void LCD5110_drawVLine(unsigned char x0, unsigned char y0, unsigned char Vsize); /*画任意线*/ void LCD5110_bresenhamLine ( unsigned char x1, unsigned char y1, unsigned char x2, unsigned char y2); //在指定位置画一个指定大小的圆 //(x,y):中心点 //r :半径 void Draw_Circle(unsigned char x0,unsigned char y0,unsigned char r); /*从指定坐标开始 画一个矩形 xsize ysize分别为 x y 轴长度*/ void LCD5110_drawRect(unsigned char x0, unsigned char y0, unsigned char xsize, unsigned char ysize); /*从指定坐标开始 填充一个矩形*/ void LCD5110_fillRect(unsigned char x0, unsigned char y0, unsigned char xszie, unsigned char yszie); /*************************字符显示库**********************************/ /*显示一个字符 英文*/ unsigned char LCD5110_showChar(unsigned char x0,unsigned char y0, unsigned char size, char *c); /*显示一串字符串*/ void LCD5110_showString(unsigned char x0,unsigned char y0, unsigned char size, char *str);
没找你想要的就自己实现吧!!
附件: