- #include
- #include "N5110.h"
- void main(void)
- {
- WDTCTL=WDTPW+WDTHOLD;
- N5110_init();
- while(1)
- {
- draw_circle(20,20,10);
- draw_dot(40,10);
- }
- }
- #include //#include
- #include "N5110.h"
- const uchar ASCALL[]= // ASCII
- {
-
- 0x00,0x00,0x00,0x00,0x00, // - -
- 0x00,0x00,0x5F,0x00,0x00, // -!-
- 0x00,0x07,0x00,0x07,0x00, // -"-
- 0x14,0x7F,0x14,0x7F,0x14, // -#-
- 0x24,0x2E,0x7B,0x2A,0x12, // -$-
- 0x23,0x13,0x08,0x64,0x62, // -%-
- 0x36,0x49,0x56,0x20,0x50, // -&-
- 0x00,0x04,0x03,0x01,0x00, // -'-
- 0x00,0x1C,0x22,0x41,0x00, // -(-
- 0x00,0x41,0x22,0x1C,0x00, // -)-
- 0x22,0x14,0x7F,0x14,0x22, // -*-
- 0x08,0x08,0x7F,0x08,0x08, // -+-
- 0x40,0x30,0x10,0x00,0x00, // -,-
- 0x08,0x08,0x08,0x08,0x08, // ---
- 0x00,0x60,0x60,0x00,0x00, // -.-
- 0x20,0x10,0x08,0x04,0x02, // -/-
- 0x3E,0x51,0x49,0x45,0x3E, // -0-
- 0x00,0x42,0x7F,0x40,0x00, // -1-
- 0x62,0x51,0x49,0x49,0x46, // -2-
- 0x21,0x41,0x49,0x4D,0x33, // -3-
- 0x18,0x14,0x12,0x7F,0x10, // -4-
- 0x27,0x45,0x45,0x45,0x39, // -5-
- 0x3C,0x4A,0x49,0x49,0x31, // -6-
- 0x01,0x71,0x09,0x05,0x03, // -7-
- 0x36,0x49,0x49,0x49,0x36, // -8-
- 0x46,0x49,0x49,0x29,0x1E, // -9-
- 0x00,0x36,0x36,0x00,0x00, // -:-
- 0x40,0x36,0x36,0x00,0x00, // -;-
- 0x08,0x14,0x22,0x41,0x00, // -<-
- 0x14,0x14,0x14,0x14,0x14, // -=-
- 0x00,0x41,0x22,0x14,0x08, // ->-
- 0x02,0x01,0x59,0x05,0x02, // -?-
- 0x3E,0x41,0x5D,0x55,0x5E, // -@-
- 0x7C,0x12,0x11,0x12,0x7C, // -A-
- 0x7F,0x49,0x49,0x49,0x36, // -B-
- 0x3E,0x41,0x41,0x41,0x22, // -C-
- 0x7F,0x41,0x41,0x41,0x3E, // -D-
- 0x7F,0x49,0x49,0x49,0x41, // -E-
- 0x7F,0x09,0x09,0x09,0x01, // -F-
- 0x3E,0x41,0x51,0x51,0x72, // -G-
- 0x7F,0x08,0x08,0x08,0x7F, // -H-
- 0x00,0x41,0x7F,0x41,0x00, // -I-
- 0x20,0x40,0x41,0x3F,0x01, // -J-
- 0x7F,0x08,0x14,0x22,0x41, // -K-
- 0x7F,0x40,0x40,0x40,0x40, // -L-
- 0x7F,0x02,0x0C,0x02,0x7F, // -M-
- 0x7F,0x04,0x08,0x10,0x7F, // -N-
- 0x3E,0x41,0x41,0x41,0x3E, // -O-
- 0x7F,0x09,0x09,0x09,0x06, // -P-
- 0x3E,0x41,0x51,0x21,0x5E, // -Q-
- 0x7F,0x09,0x19,0x29,0x46, // -R-
- 0x26,0x49,0x49,0x49,0x32, // -S-
- 0x01,0x01,0x7F,0x01,0x01, // -T-
- 0x3F,0x40,0x40,0x40,0x3F, // -U-
- 0x1F,0x20,0x40,0x20,0x1F, // -V-
- 0x7F,0x20,0x18,0x20,0x7F, // -W-
- 0x63,0x14,0x08,0x14,0x63, // -X-
- 0x03,0x04,0x78,0x04,0x03, // -Y-
- 0x61,0x51,0x49,0x45,0x43, // -Z-
- 0x7F,0x7F,0x41,0x41,0x00, // -[-
- 0x02,0x04,0x08,0x10,0x20, // -\-
- 0x00,0x41,0x41,0x7F,0x7F, // -]-
- 0x04,0x02,0x7F,0x02,0x04, // -^-
- 0x08,0x1C,0x2A,0x08,0x08, // -_-
- 0x00,0x00,0x01,0x02,0x04, // -`-
- 0x24,0x54,0x54,0x38,0x40, // -a-
- 0x7F,0x28,0x44,0x44,0x38, // -b-
- 0x38,0x44,0x44,0x44,0x08, // -c-
- 0x38,0x44,0x44,0x28,0x7F, // -d-
- 0x38,0x54,0x54,0x54,0x08, // -e-
- 0x08,0x7E,0x09,0x09,0x02, // -f-
- 0x98,0xA4,0xA4,0xA4,0x78, // -g-
- 0x7F,0x08,0x04,0x04,0x78, // -h-
- 0x00,0x00,0x79,0x00,0x00, // -i-
- 0x00,0x80,0x88,0x79,0x00, // -j-
- 0x7F,0x10,0x28,0x44,0x40, // -k-
- 0x00,0x41,0x7F,0x40,0x00, // -l-
- 0x78,0x04,0x78,0x04,0x78, // -m-
- 0x04,0x78,0x04,0x04,0x78, // -n-
- 0x38,0x44,0x44,0x44,0x38, // -o-
- 0xFC,0x24,0x24,0x24,0x18, // -p-
- 0x18,0x24,0x24,0x24,0xFC, // -q-
- 0x04,0x78,0x04,0x04,0x08, // -r-
- 0x48,0x54,0x54,0x54,0x24, // -s-
- 0x04,0x3F,0x44,0x44,0x24, // -t-
- 0x3C,0x40,0x40,0x3C,0x40, // -u-
- 0x1C,0x20,0x40,0x20,0x1C, // -v-
- 0x3C,0x40,0x3C,0x40,0x3C, // -w-
- 0x44,0x28,0x10,0x28,0x44, // -x-
- 0x9C,0xA0,0xA0,0x90,0x7C, // -y-
- 0x44,0x64,0x54,0x4C,0x44, // -z-
- 0x08,0x36,0x41,0x00,0x00, // -{-
- 0x00,0x00,0x77,0x00,0x00, // -|-
- 0x00,0x00,0x41,0x36,0x08, // -}-
- 0x06,0x09,0x09,0x06,0x00, // -°-
- 0x08,0x04,0x08,0x10,0x08, // -~-
- 0x55,0x2A,0x55,0x2A,0x55, // --
- };
- void N5110_sent_8bit(uchar num)
- {
- uchar n;
- for(n=0;n<8;n++)
- {
- N5110_CLK_0();
- if(num&0X80)
- N5110_DIN_1();
- else
- N5110_DIN_0();
- N5110_CLK_1();
- num=num<<1;
- }
- }
- void N5110_sent_oder(uchar com)
- {
- N5110_RST_1();
- N5110_CE_1();
- N5110_CLK_0();
- N5110_CE_0();
- N5110_DC_0();
- N5110_sent_8bit(com);
- N5110_CE_1();
- }
- void N5110_sent_data(uchar num)
- {
- N5110_RST_1();
- N5110_CE_1();
- N5110_CLK_0();
- N5110_CE_0();
- N5110_DC_1();
- N5110_sent_8bit(num);
- N5110_CE_1();
- }
- void N5110_add_xy(uchar x,uchar y)
- {
- if(x>83)x=83;
- if(y>5) y=5;
- N5110_sent_oder(N5110_Address_Y|y);
- N5110_sent_oder(N5110_Address_X|x);
- }
- void N5110_clear_screen(void)
- {
- int n;
- N5110_sent_oder(N5110_Address_Y);
- N5110_sent_oder(N5110_Address_X);
- for(n=0;n<504;n++)
- N5110_sent_data(0x00);
- }
- void N5110_init(void)
- {
- N5110IOOUT; //I/O配置为输出模式
- N5110_RST_0();
- N5110_RST_1();
- N5110_sent_oder(N5110_Expend_Commond);
- N5110_sent_oder(0x98);
- N5110_sent_oder(0x06);
- N5110_sent_oder(0x13);
- N5110_sent_oder(N5110_Bisic_Commond);
- N5110_clear_screen();
- N5110_sent_oder(N5110_Display_Normal);
- N5110_CE_0();
- N5110_LIGHT_ON();
- }
- void N5110_display_image(void)
- {
- N5110_sent_oder(N5110_Display_Image);
- }
- void N5110_led_ASCALLS(unsigned char *string)
- {
- unsigned char i=0;
- while(*(string+i))
- {
- N5110_led_ASCALL(*(string+i));
- i++;
- }
- }
- void N5110_led_ASCALL(uchar c)
- {
- char n;
- for(n=0;n<5;n++)
- N5110_sent_data(*(ASCALL+5*(c-' ')+n));
- }
- void N5110_led_int(unsigned int dat)
- {
- unsigned char i=0;
- char string[10]={0};
- for(i=0;dat>0;i++)
- {
- string[i]=dat;
- dat/=10;
- }
- if(i==0)
- {
- N5110_led_ASCALL('0');
- return;
- }
- else
- {
- for(i--;;)
- {
- N5110_led_ASCALL('0'+string[i]);
- if(i>0)
- i--;
- else
- return;
- }
- }
- }
-
- const uchar HZ[]=
- {
- 0x00,0x00,0x00,0x00,0x00,0xFF,0x10,0x10,0x10,0x10,0x00,0x00,0x04,0x04,0x04,0x04,
- 0x04,0x07,0x04,0x04,0x04,0x04,0x04,0x00,
- 0xFF,0x81,0x99,0xE7,0x00,0xFF,0x25,0xE5,0x25,0xBF,0x40,0x00,0x07,0x00,0x00,0x00,
- 0x00,0x07,0x04,0x02,0x01,0x02,0x04,0x00,
- 0x02,0x02,0x02,0x02,0x02,0xFE,0x12,0x12,0x22,0x43,0x02,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x11,0x15,0xFD,0x13,0x30,0x01,0xFD,0x07,0xF5,0x05,0xFD,0x00,0x04,0x04,0x07,0x00,
- 0x04,0x04,0x02,0x01,0x01,0x02,0x04,0x00,
- 0x04,0x16,0xD2,0x12,0x12,0xF3,0x92,0x92,0x92,0x92,0x06,0x00,0x04,0x02,0x01,0x01,
- 0x02,0x03,0x04,0x04,0x04,0x04,0x04,0x00,
- 0x22,0x44,0x00,0xC0,0x5F,0xD5,0x55,0xD5,0x5F,0xC0,0x00,0x00,0x04,0x02,0x09,0x0F,
- 0x08,0x0F,0x08,0x0F,0x08,0x0F,0x08,0x00,
- 0x00,0xFE,0x0A,0x8A,0xBE,0xAA,0xAB,0xAA,0xBE,0x8A,0x0A,0x00,0x08,0x07,0x00,0x08,
- 0x09,0x0A,0x04,0x04,0x0A,0x09,0x08,0x00,
- 0x0C,0x04,0x75,0x56,0x54,0xD7,0x54,0x56,0x75,0x04,0x0C,0x00,0x00,0x07,0x01,0x01,
- 0x01,0x0F,0x01,0x01,0x05,0x07,0x00,0x00,
- 0x00,0x00,0xFC,0xA4,0xA4,0xA5,0xA6,0xA4,0xA4,0xA4,0xBC,0x00,0x08,0x06,0x01,0x0F,
- 0x04,0x04,0x04,0x04,0x04,0x04,0x0F,0x00,
- 0x10,0xD2,0x32,0x92,0x10,0x00,0x08,0xFF,0x08,0x08,0xF8,0x00,0x03,0x02,0x02,0x02,
- 0x03,0x08,0x06,0x01,0x08,0x08,0x07,0x00,
- 0x10,0x11,0xF2,0x00,0x50,0xCF,0x41,0x41,0x4F,0xD0,0x10,0x00,0x00,0x00,0x07,0x02,
- 0x08,0x08,0x05,0x02,0x05,0x08,0x08,0x00,
- 0x2C,0x24,0xA4,0x24,0x25,0xE6,0x24,0x24,0x24,0x24,0x2C,0x00,0x08,0x04,0x03,0x04,
- 0x08,0x0F,0x09,0x09,0x09,0x09,0x08,0x00,
- 0x11,0xF2,0x00,0x22,0xEA,0xAA,0xBF,0xAA,0xAA,0xEA,0x22,0x00,0x00,0x0F,0x04,0x00,
- 0x0F,0x02,0x02,0x02,0x0A,0x0F,0x00,0x00,
- 0x10,0x11,0xF2,0x00,0x28,0x26,0xE4,0x3F,0xE4,0x24,0x20,0x00,0x08,0x04,0x03,0x04,
- 0x0A,0x09,0x08,0x08,0x09,0x0A,0x0B,0x00,
- 0x88,0x88,0xFF,0x48,0x21,0xA3,0x95,0xE9,0x95,0xA3,0x20,0x00,0x00,0x08,0x0F,0x00,
- 0x02,0x02,0x02,0x0F,0x02,0x02,0x02,0x00,
- 0x22,0x44,0x00,0xC0,0x5F,0xD5,0x55,0xD5,0x5F,0xC0,0x00,0x00,0x04,0x02,0x09,0x0F,
- 0x08,0x0F,0x08,0x0F,0x08,0x0F,0x08,0x00,
- 0x00,0xFE,0x0A,0x8A,0xBE,0xAA,0xAB,0xAA,0xBE,0x8A,0x0A,0x00,0x08,0x07,0x00,0x08,
- 0x09,0x0A,0x04,0x04,0x0A,0x09,0x08,0x00,
- 0x34,0x2C,0xF7,0xA4,0xE8,0xA4,0xEA,0x09,0xCA,0x04,0xE8,0x00,0x01,0x01,0x0F,0x00,
- 0x0F,0x02,0x0F,0x00,0x03,0x08,0x0F,0x00,
- 0x00,0x00,0x01,0x81,0x72,0x0C,0x70,0x80,0x00,0x00,0x00,0x00,0x08,0x04,0x02,0x01,
- 0x00,0x00,0x00,0x01,0x02,0x04,0x08,0x00,
- 0x40,0x42,0x42,0xFE,0x42,0x42,0x42,0xFE,0x42,0x42,0x40,0x00,0x00,0x08,0x06,0x01,
- 0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x00,
- 0x88,0x68,0xFF,0x28,0x40,0xFE,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x00,0x0F,0x08,
- 0x04,0x03,0x00,0x00,0x07,0x08,0x0E,0x00,
- 0x46,0x32,0x82,0xB2,0x46,0x6B,0x52,0x4A,0x62,0x12,0x66,0x00,0x00,0x0E,0x08,0x08,
- 0x08,0x0F,0x08,0x08,0x08,0x0E,0x00,0x00,
- 0x42,0xF2,0x2E,0xE2,0x01,0x3D,0x21,0x21,0x21,0x3F,0xE0,0x00,0x00,0x07,0x02,0x07,
- 0x01,0x01,0x01,0x01,0x09,0x08,0x07,0x00,
- 0x98,0xF7,0x94,0x84,0x10,0xD4,0x5F,0x54,0x54,0x5F,0xD4,0x00,0x00,0x0F,0x04,0x02,
- 0x00,0x0F,0x05,0x05,0x05,0x05,0x0F,0x00,
- 0x11,0xF2,0x80,0xA0,0xAF,0xA9,0xE9,0xA9,0xAF,0xA0,0x80,0x00,0x00,0x07,0x02,0x08,
- 0x04,0x02,0x01,0x02,0x04,0x08,0x08,0x00,
- 0x20,0xA4,0x24,0xFF,0x24,0x20,0xD2,0x4E,0x42,0x52,0xDE,0x00,0x08,0x07,0x04,0x0F,
- 0x09,0x09,0x0B,0x0A,0x0A,0x0A,0x0B,0x00,
- 0x10,0x11,0xF2,0x00,0x08,0x28,0xC8,0x08,0x08,0xFF,0x08,0x00,0x08,0x04,0x03,0x04,
- 0x08,0x08,0x08,0x0A,0x0A,0x0B,0x08,0x00,
- 0x02,0x04,0x80,0x20,0x18,0x87,0x74,0x84,0x04,0x14,0x0C,0x00,0x02,0x01,0x08,0x04,
- 0x02,0x01,0x00,0x01,0x02,0x04,0x08,0x00,
- 0x02,0xFA,0xAA,0xAA,0xAA,0xFE,0xAA,0xAA,0xAA,0xFA,0x02,0x00,0x08,0x09,0x0A,0x04,
- 0x04,0x0B,0x08,0x08,0x08,0x08,0x08,0x00,
- 0xE2,0x22,0x22,0x3E,0x20,0x10,0xEF,0x08,0x88,0x78,0x08,0x00,0x0F,0x04,0x02,0x01,
- 0x08,0x04,0x02,0x01,0x02,0x04,0x08,0x00,
- 0x20,0xAA,0xB2,0xE3,0xB2,0xAA,0x00,0xFE,0x12,0xF2,0x11,0x00,0x04,0x02,0x08,0x0F,
- 0x00,0x0A,0x04,0x03,0x00,0x0F,0x00,0x00,
- 0x00,0xFC,0x24,0x24,0xE4,0x04,0xFF,0x04,0x85,0x66,0x04,0x00,0x08,0x07,0x00,0x02,
- 0x0B,0x04,0x02,0x01,0x02,0x04,0x0F,0x00,
- 0x04,0x04,0xFC,0x04,0x04,0x08,0xFF,0x08,0x08,0x08,0xF8,0x00,0x02,0x02,0x01,0x09,
- 0x05,0x03,0x00,0x00,0x08,0x08,0x07,0x00,
- 0x04,0x05,0xF5,0x55,0x55,0xFF,0x55,0x55,0xF5,0x05,0x04,0x00,0x04,0x05,0x05,0x05,
- 0x05,0x07,0x05,0x05,0x05,0x05,0x04,0x00,
- };
-
- void N5110_led_HZ(uchar x,uchar y,uchar line,uchar byte,uchar length)
- {
- char n,i,j;
- if(line%8==0) j=line/8;
- else j=line/8+1;
- for(i=0;i
- {
- N5110_add_xy(x,y+i);
- for(n=0;n<12;n++)
- {
- N5110_sent_data(*(HZ+24*(byte-'0')+n+12*i));
- }
- }
- }
- void N5110_led_HZS(uchar x,uchar y,uchar line,uchar *string,uchar length)
- {
- uchar i=0;
- while(*(string+i))
- {
- N5110_led_HZ(x+12*i,y,line,*(string+i),length);
- i++;
- }
- }
- void N5110_Clear_Line(uchar _X)
- {
- unsigned char i = 0;
- for (i = 0; i <= 83; i++ )
- {
- N5110_add_xy(_X,i);
- N5110_sent_data(0x00); //写数据0x00
- }
- }
- void N5110_led_double(double dat,int point_n)
- {
- int i = 0;
- int double_int = 0;
- int double_point = 0;
- // int double_length = 0;
- int data_length = 0;
- int temp = 0;
- int extern_length = 0;
- long base = 1;
-
- if ((dat - 0) < EPSILON)
- {
- dat = 0 - dat;
- data_length++;
- double_int = -(int)dat;
- }
- else
- {
- double_int = (int)dat;
- }
- N5110_led_int(double_int);
-
- N5110_led_ASCALL('.');
- for (i = 0; i < point_n; i++)
- {
- base = base * 10;
- }
- double_point = (int)((dat - double_int) * base);
- temp = double_point;
- while(temp < (base / 10))
- {
- N5110_led_ASCALL('0');
- temp = temp * 10;
- extern_length++;
- if(extern_length > (point_n - 1) )
- {
- break;
- }
- }
- N5110_led_int(double_point);
- }
- /
- if(di<0)
- di +=4*a+6;
- else
- {
- di +=10+4*(a-b);
- b--;
- }
- draw_dot(x0+a,y0+b);
- }
- }
- void draw_lineX(uchar x,uchar y1,uchar y2)
- {
- uchar temp;
- if(y1>y2)//y1>y2交换这两个数
- {
- temp=y1;
- y1=y2;
- y2=temp;
- }
- for(y1=y1;y1
- draw_dot(x,y1); //将这些点显示出来
- }
- void draw_lineY(uchar x1,uchar x2,uchar y)
- {
- uchar temp;
- if(x1>x2)//若x1>x2交换两数
- {
- temp=x1;
- x1=x2;
- x2=temp;
- }
- for(;x1
- draw_dot(x1,y);
- }
- void draw_line(int x1,int y1,int x2,int y2) //两点之间画任意直线
- {
- int x,y,dx,dy,s1,s2,temp,status,p,i;
- x=x1;
- y=y1;
- if(x1>x2) //判断x1,x2的大小
- {
- dx=x1-x2; //
- s1=-1; //x的增量为-1
- }
- else
- {
- dx=x2-x1;
- s1=1; //x的增量为1
- }
- if(y1>y2)
- {
- dy=y1-y2;
- s2=-1;//y的增量为-1
- }
- else
- {
- dy=y2-y1;
- s2=1; //y的增量为1
- }
- if(dx
- {
- temp=dx;
- dy=dx;//x是y的函数
- dx=temp;
- status=1;//表示靠近Y轴
- }
- else
- status=0;//表示靠近x轴
- p=2*dy-dx; //使用Bresenhan算法
- for(i=1;i
- {
- draw_dot(x,y); //画起点
- if(p>0)
- {
- if(status==0)//靠近x轴
- y+=s2;
- else
- x+=s1;
- p=p-2*dx;
- }
- if(status==0)
- x=x+s1;
- else
- y=y+s2;
- p=p+2*dy;
- }
- }
-
- #ifndef _N5110_H
- #define _N5110_H
- #define uchar unsigned char
- #define uint unsigned int
- #define EPSILON 0.00001 //显示double时的精度定义
- #define POINT_NUM 5 //double型小数点后的位数
- #define TRUE 1
- #define FLASE 0
- #define N5110_DC_1() P2OUT |=BIT3 //数据
- #define N5110_DC_0() P2OUT &=~BIT3//命令
- #define N5110_RST_1() P2OUT |=BIT5
- #define N5110_RST_0() P2OUT &=~BIT5//低电平复位
- #define N5110_CE_1() P2OUT |=BIT4
- #define N5110_CE_0() P2OUT &=~BIT4//输入使能
- #define N5110_DIN_0() P2OUT &=~BIT2
- #define N5110_DIN_1() P2OUT |=BIT2
- #define N5110_CLK_0() P2OUT &=~BIT1
- #define N5110_CLK_1() P2OUT |=BIT1
- #define N5110_BL_0() P2OUT &=~BIT0
- #define N5110_BL_1() P2OUT |=BIT0
- #define N5110_LIGHT_ON() N5110_BL_1()
- #define N5110_LIGHT_OFF() N5110_BL_0()
- #define N5110IOOUT P2DIR |= (BIT0+BIT1+BIT2+BIT3+BIT4+BIT5)
- #define N5110_Display_Blank 0x08//白屏
- #define N5110_Display_Normal 0x0C//正常显示
- #define N5110_Display_Whole 0x09//全显
- #define N5110_Display_Image 0x0D//翻转
- #define N5110_Address_Y 0x40//设置Y地址
- #define N5110_Address_X 0x80//设置X地址
- #define N5110_Temperature_0 0x04//温度系数1
- #define N5110_Temperature_1 0x05//温度系数2
- #define N5110_Temperature_2 0x06//温度系数3
- #define N5110_Temperature_3 0x07//温度系数4
- #define N5110_Bisic_Commond 0x20//基本指令集
- #define N5110_Expend_Commond 0x21//扩展指令集(用来设置工作电压)
- #define N5110_Low_Power 0x24//节能模式
- #define N5110_Level_Addressing 0x20//水平寻址
- #define N5110_Verti_Addressing 0x22//垂直寻址
- #define N5110_Work_Voltage 0x80//工作电压(在扩展指令集模式下)
-
- extern void N5110_init(void);
-
- void N5110_sent_8bit(uchar num);
-
- void N5110_sent_oder(uchar num);
-
- void N5110_sent_data(uchar num);
-
- void N5110_add_xy(uchar x,uchar y);
- void N5110_Clear_Line(uchar _X);
- void N5110_clear_screen(void);
- void N5110_display_image(void);
- void N5110_led_ASCALL(uchar c);
- void N5110_led_ASCALLS(unsigned char *string);
- void N5110_led_int(unsigned int dat);
- void N5110_led_HZ(uchar x,uchar y,uchar line,uchar byte,uchar length);
-
- void N5110_led_HZS(uchar x,uchar y,uchar line,uchar *string,uchar length);
- void N5110_led_double(double dat,int point_n);
- //**************************************************
- //函数名称:void N5110_Write_Char (uchar _Litter,uchar _X, uchar _Num, uchar Is_Set_XY_Flag)
- //功能:显示英文字符,每个英文字母占5列
- //参数:uchar _Litter---要显示的英文字符;uchar _X——行坐标(0--5), uchar _Num--第几个字母(0--15),多出4列, uchar Is_Set_XY_Flag---是否要定位
- //返回值:无
- //**************************************************
- void N5110_Write_Char (uchar _Litter, uchar _X, uchar _Num, uchar Is_Set_XY_Flag);
- //**************************************************
- //函数名称:void N5110_Write_Litter_Str (uchar *Star, uchar _X, uchar _Y, uchar Is_Set_XY_Flag)
- //功能:N5110显示一行字符串
- //参数:uchar *Str---要显示的字符串, uchar _X——行坐标(0--5), uchar _Yuchar_Y---列坐标(0--83), uchar Is_Set_XY_Flag---是否要定位
- //返回值:无
- //**************************************************
- void N5110_Write_Litter_Str (char *Str, uchar _X, uchar _Y, uchar Is_Set_XY_Flag);
- //***********************************************
- //函数名称:int N5110_Print_Int (int data, uchar *Add_Str, uchar _X, uchar _Y, uchar Is_Set_XY_Flag)
- //功能:把整型转换为字符串,可以加单位
- //参数:int data--------要转换的整型数据, uchar *Add_Str-----增加的字符串, uchar _X----行坐标(0--5), uchar _Y---列坐标(0--83), uchar Is_Set_XY_Flag---是否要定位
- //返回值:data_length-----字符串长度,不包括单位
- //***********************************************
- int N5110_Print_Int (int dat, char *Add_Str, uchar _X, uchar _Y, uchar Is_Set_XY_Flag);
- //***********************************************
- //函数名称:int N5110_Print_Double (double data, uchar *Add_Str, uchar _X, uchar _Y, uchar Is_Set_XY_Flag)
- //功能:把浮点型数据double转换为字符串,并返回数据长度
- //参数:double data------要转换的double型数据,uchar *Add_Str-----增加的字符串, uchar _X----行坐标(0--5), uchar _Y---列坐标(0--83), uchar Is_Set_XY_Flag---是否要定位
- //返回值:data_length----字符串的长度,不包括单位
- //***********************************************
- int N5110_Print_Double (double dat, char *Add_Str, uchar _X, uchar _Y, uchar Is_Set_XY_Flag);
- void draw_dot(uchar x,uchar y); //打点函数
- extern void draw_circle(uchar x0,uchar y0,uchar r);
- void draw_lineX(uchar x,uchar y1,uchar y2);
- void draw_lineY(uchar x1,uchar x2,uchar y);
- void draw_line(int x1,int y1,int x2,int y2);
- extern const uchar ASCALL[];
- extern const uchar HZ[];
- #endif
复制代码
分享自:http://t.cn/8kMZFHf
|