Exemplo n.º 1
0
void LCD5110_set_XY(unsigned char X,unsigned char Y)
{
	unsigned char x;
	x = 6*X;

	LCD5110_LCD_write_byte(0x40|Y,0);
	LCD5110_LCD_write_byte(0x80|x,0);
}
Exemplo n.º 2
0
void LCD5110_clear()
{
	unsigned char i,j;
	for(i=0;i<6;i++)
		for(j=0;j<84;j++)
			LCD5110_LCD_write_byte(0,1);
}
Exemplo n.º 3
0
void LCD5110_WriteDataInversed(uint8_t c) {
	uint8_t line;
	c -= 32;
	for (line = 0; line < 6; line++) {
		LCD5110_LCD_write_byte(~font6x8[c][line], 1);
	}
}
Exemplo n.º 4
0
void LCD5110_Clear() {
//	LCD5110_LCD_write_byte(0x0c, 0);
//	LCD5110_LCD_write_byte(0x80, 0); //Inna wersja - tego nie bylo wczesniej
	for (uint16_t i = 0; i < 504; i++) {	//6x84 = 504 pixeli
		LCD5110_LCD_write_byte(0, 1);
	}
}
Exemplo n.º 5
0
void LCD5110_ClearLine(uint8_t line) {
//	LCD5110_LCD_write_byte(0x0c, 0);
//	LCD5110_LCD_write_byte(0x80, 0); //Inna wersja - tego nie bylo wczesniej

	LCD5110_GoTo(0,line);
	for (uint16_t i = 0; i < 84; i++) {	//6x84 = 504 pixeli
		LCD5110_LCD_write_byte(0, 1);
	}
}
Exemplo n.º 6
0
void LCD5110_bar(unsigned int val2,unsigned int val3)
{
	unsigned char val1;
		unsigned char ch = 0x7E,ch2 = 0x42;

		if (val2>val3){return;}

		LCD5110_LCD_write_byte(ch,1);
	 for(val1=0;val1<val2;val1++)
		{
			LCD5110_LCD_write_byte(ch,1);
		}
	 for(val1=val2;val1<val3;val1++)
	 {
	 	LCD5110_LCD_write_byte(ch2,1);
	 }
	 LCD5110_LCD_write_byte(ch,1);

}
Exemplo n.º 7
0
void LCD5110_write_char_neg(unsigned char c)
{
	unsigned char line;
	unsigned char ch = 0;

	c = c - 12;

	for(line=0;line<6;line++)
	{
		ch = ~font6_8[c][line];
		LCD5110_LCD_write_byte(ch,1);
		
	}
}
Exemplo n.º 8
0
/*-----------------------------------------------------------------------
 LCD_draw_map      : Bitmap drawing function
 input parameter
 starting point X,Y
 *map    bitmap data
 Pix_x   height
 Pix_y   width
 -----------------------------------------------------------------------*/
void LCD5110_draw_bmp_pixel(uint8_t X, uint8_t Y, uint8_t *map, uint8_t Pix_x,
		uint8_t Pix_y) {
	uint8_t i, n;
	uint8_t row;

	if (Pix_y % 8 == 0)
		row = Pix_y / 8;      //calculate how many line is needed
	else
		row = Pix_y / 8 + 1;

	for (n = 0; n < row; n++) {
		LCD5110_GoTo(X, Y);
		for (i = 0; i < Pix_x; i++) {
			LCD5110_LCD_write_byte(map[i + n * Pix_x], 1);
		}
		++Y;	//change line
	}
}
Exemplo n.º 9
0
/*
 * Before, sysTick must be initialized.
 * It use delay_ms function!
 */
void LCD5110_Initialize() {
	LCD5110_GPIO_Config();
	delay_ms(10);

	LCD5110_RST(0); //LCD_RST = 0;
	delay_ms(1);
	LCD5110_RST(1); //LCD_RST = 1;

	LCD5110_CS(0); //SPI_CS = 0;
	delay_ms(1);
	LCD5110_CS(1); //SPI_CS = 1;

	delay_ms(1);

#define LCD5110_BIAS_1x24 0x15
#define LCD5110_BIAS_1x40_1x34 0x14
#define LCD5110_BIAS_1x100 0x10	//n=7 1:100
#define LCD5110_BIAS_1x80 0x11	//n=6 1:80
#define LCD5110_BIAS_1x65  0x12	//n=5 1:65/1:65
#define LCD5110_BIAS_1x48 0x13	//n=4 1:48
#define LCD5110_BIAS_1x40_1x34 0x14	//n=3 1:40/1:34
#define LCD5110_BIAS_1x24 0x15	//n=2 1:24
#define LCD5110_BIAS_1x18_1x16  0x16	//n=1 1:18/1:16
#define LCD5110_BIAS_1x10_1x9_1x8  0x17	//n=0 1:10/1:9/1:8

	//Must be adjusted to the temperature of ambient.
#define LCD5110_TEMPERATURE_COEFFICIENT0 0x04
#define LCD5110_TEMPERATURE_COEFFICIENT1 0x05
#define LCD5110_TEMPERATURE_COEFFICIENT2 0x06
#define LCD5110_TEMPERATURE_COEFFICIENT3 0x07

#define LCD5110_CommandSet_Extended 0x21	//H = 1
#define LCD5110_CommandSet_Basic 0x20	//H = 0

#define LCD5110_NormalMode 0x0C	//H = 0


	LCD5110_LCD_write_byte(LCD5110_CommandSet_Extended, 0);
	LCD5110_LCD_write_byte(0xC0, 0);//Value of Vop(controls contrast) = (0x80 | 7-bit Vop value )
	LCD5110_LCD_write_byte(LCD5110_TEMPERATURE_COEFFICIENT2, 0);
	LCD5110_LCD_write_byte(LCD5110_BIAS_1x40_1x34, 0);
	LCD5110_LCD_write_byte(LCD5110_CommandSet_Basic, 0);
	LCD5110_Clear();				//Clear LCD
	LCD5110_LCD_write_byte(LCD5110_NormalMode, 0);	//enable normal display (dark on light), horizontal addressing
	LCD5110_CS(0);	//SPI_CS = 0;
}
Exemplo n.º 10
0
void LCD5110_init()
{
	LCD5110_GPIO_Config();

	LCD5110_DC(1);//LCD_DC = 1;
	LCD5110_MO(1);//SPI_MO = 1;
	LCD5110_SCK(1);//SPI_SCK = 1;
	LCD5110_CS(1);//SPI_CS = 1;


	LCD5110_LCD_delay_ms(70);


	LCD5110_LCD_write_byte(0x21,0);  //21
	LCD5110_LCD_write_byte(0xC2,0);  //C2
	LCD5110_LCD_write_byte(0x06,0);  //06
	LCD5110_LCD_write_byte(0x13,0);  //13
	LCD5110_LCD_write_byte(0x20,0); //20
	LCD5110_clear();
	LCD5110_LCD_write_byte(0x0C,0); // 0X0D positive
}
Exemplo n.º 11
0
void LCD5110_GoTo(uint8_t X, uint8_t Y) {
	uint8_t x = 6 * X;	//Tego nie ma w innym
	LCD5110_LCD_write_byte(0x40 | Y, 0);	//Column
	LCD5110_LCD_write_byte(0x80 | x, 0);	//Row
}