/* * if value is 1, enables box cursor around character * 0 disables it. */ void LCD_Blink(int value) { Send_LCD(254); if(value==1) Send_LCD(0x0D); else Send_LCD(0x0C); }
/* * if value is 'L' or 'l', moves the cursor to the left * by one segment, any other value will move the cursor * to the right by one segment. */ void LCD_MoveCursor(char value) { Send_LCD(254); if(value==(('L')||('l'))) Send_LCD(0x10); else Send_LCD(0x14); }
/* * if value is 1, enables line under the character * 0 disables it. */ void LCD_Underline(int value) { Send_LCD(254); if(value==1) Send_LCD(0x0E); else Send_LCD(0x0C); }
unsigned char scib_msg(char * msg) { int i; i = 0; while(msg[i] != '\0') { while(Send_LCD(msg[i]) == 0 && LCD_S.timeout_count < LCD_TIMEOUT_COUNT); i++; } if(LCD_S.timeout_count < LCD_TIMEOUT_COUNT) { return 0; } else { return 1; } }
/************************************************* Function: LCD_DISPLAY Description: TFT display Input: x:x-axis of TFT y:y-axis of TFT *Str:point of the displayed character Output: Return: void *************************************************/ void LCD_DISPLAY(uint16_t x, uint16_t y, char *Str) { if(g_u08_LCDStatus == LCDSON) { Send_LCD(0xAA); //---命令头 Send_LCD(0x98); //---命令码,任意点阵,选择字库显示 Send_LCD((x&0xFF00)>>8); //---X坐标 Send_LCD((x&0xFF)); Send_LCD((y&0xFF00)>>8); //---Y轴坐标 Send_LCD((y&0xFF)); Send_LCD(0x20); //---选择字库:"SDW系列智能显示终端指令集" page=14 0x20=标准字库 Send_LCD(0x90); //---文本显示模式以及编码方式:"SDW系列智能显示终端指令集" page=15 Send_LCD(0x03); //---显示字符点阵大小 0x03 12*24 Send_LCD(0x00); //---字符显示的前景色 Send_LCD(0x00); //---字符显示的背景色 Send_LCD(0x00); //---字符串数据显示间隔 Send_LCD(0x00); while(*Str) { Send_LCD(*Str++); //---发送字符串 } Send_LCD(0xCC); //---结束码 Send_LCD(0x33); Send_LCD(0xC3); Send_LCD(0x3C); }
void LCD_Reset(void) { Send_LCD(254); Send_LCD(0x72); }
/* * when called, whatever is currently on the LCD is saved to * ROM and will be displayed as the splash screen next time * the LCD boots up. * **OBSERVED ISSUES** * - Reset the LCD after using this command. Once the splash * screen is updated, the LCD might not respond to commands * until it is reset. * - Splash screen will not be displayed if splash screens are * disabled. Try using the LCD_Splash function to enable it. * - To be safe, try using spaces to indent your custom splash * screen instead of using LCD_Cursor. I noticed that there * were undesired characters in the custom splash screen. */ void LCD_SplashSave(void) { Send_LCD(254); Send_LCD(0x0A); }
/* * when called, it toggles splash screen. If called when * splash screen is enabled, it will be disabled and vice versa. */ void LCD_Splash(void) { Send_LCD(254); Send_LCD(0x09); }
/* * Places cursor on the xth segment (0-15) on line Y(0-1) * Y=0 is the top line, Y=1 is the bottom line */ void LCD_Cursor(int x, int y) { Send_LCD(254); Send_LCD(((128)+(64*y)+x)); }
/* * Changes the brightness of backlight LCD. * Value between 0-30. 0=off, 30=%100 on */ void LCD_Backlight(int value) { Send_LCD(254); Send_LCD(128+value); }
/* * Slides all characters on the screen to left by one segemnt */ void LCD_ScrollL(void) { Send_LCD(254); Send_LCD(0x18); }
/* * Slides all characters on the screen to right by one segemnt */ void LCD_ScrollR(void) { Send_LCD(254); Send_LCD(0x1C); }
/* * Clears the screen. */ void LCD_Clear(void) { Send_LCD(254); Send_LCD(0x01); }