Exemplo n.º 1
0
//0xb4: Block Width REG 0(BWR0) / DMA Transfer Number REG 0 (DTNR0)
//0xb5: Block Width REG 1 (BWR1)
void DMA_BlockWidthSet(uint16_t width)
{
		LCD_CmdWrite(0xb4);
		LCD_DataWrite(width);
		LCD_CmdWrite(0xb5);
		LCD_DataWrite(width >> 8);
}
Exemplo n.º 2
0
//0xb6: Block Height REG 0(BHR0) / DMA Transfer Number REG 1 (DTNR1)
//0xb7: Block Height REG 1(BHR1)
void DMA_BlockHeightSet(uint16_t height)
{
		LCD_CmdWrite(0xb6);
		LCD_DataWrite(height);
		LCD_CmdWrite(0xb7);
		LCD_DataWrite(height >> 8);
}
Exemplo n.º 3
0
//0xa9: Draw Triangle Point 2 Horizontal Address Register 0 (DTPH0)
//0xaa: Draw Triangle Point 2 Horizontal Address Register 1 (DTPH1)
void Draw_TriangleXPoint2Set(uint16_t XPoint2)
{
		LCD_CmdWrite(0xa9);
		LCD_DataWrite((uint8_t)XPoint2);
		LCD_CmdWrite(0xaa);
		LCD_DataWrite((uint8_t)(XPoint2>>8));
}
Exemplo n.º 4
0
//0xab: Draw Triangle Point 2 Vertical Address Register 0 (DTPV0)
//0xac: Draw Triangle Point 2 Vertical Address Register 1 (DTPV1)
void Draw_TriangleYPoint2Set(uint16_t YPoint2)
{
		LCD_CmdWrite(0xab);
		LCD_DataWrite((uint8_t)YPoint2);
		LCD_CmdWrite(0xac);
		LCD_DataWrite((uint8_t)(YPoint2>>8));
}
Exemplo n.º 5
0
//0xa7: Draw Ellipse/Ellipse Square Center Vertical Address Register 0 (DEVR0)
//0xa8: Draw Ellipse/Ellipse Square Center Vertical Address Register 1 (DEHR1)
void Draw_EESYCenterSet(uint16_t YCenter)
{
		LCD_CmdWrite(0xa7);
		LCD_DataWrite((uint8_t)YCenter);
		LCD_CmdWrite(0xa8);
		LCD_DataWrite((uint8_t)(YCenter>>8));
}
Exemplo n.º 6
0
//0xa5: Draw Ellipse/Ellipse Square Center Horizontal Address Register 0 (DEHR0)
//0xa6: Draw Ellipse/Ellipse Square Center Horizontal Address Register 1 (DEHR1)
void Draw_EESXCenterSet(uint16_t XCenter)
{
		LCD_CmdWrite(0xa5);
		LCD_DataWrite((uint8_t)XCenter);
		LCD_CmdWrite(0xa6);
		LCD_DataWrite((uint8_t)(XCenter>>8));
}
Exemplo n.º 7
0
//0xa3: Draw Ellipse/Ellipse Square Short Axis Setting Register (ELL_B0)
//0xa4: Draw Ellipse/Ellipse Square Short Axis Setting Register (ELL_B1)
void Draw_EESShortAxisSet(uint16_t shortAxis)
{
		LCD_CmdWrite(0xa3);
		LCD_DataWrite((uint8_t)shortAxis);
		LCD_CmdWrite(0xa4);
		LCD_DataWrite((uint8_t)(shortAxis>>8));
}
Exemplo n.º 8
0
//0xb9: Source Picture Width REG1(SPWR1)
void DMA_SourcePicWidthSet(uint16_t width)
{
		LCD_CmdWrite(0xb8);
		LCD_DataWrite(width);
		LCD_CmdWrite(0xb9);
		LCD_DataWrite(width >> 8);
}
Exemplo n.º 9
0
/**************************************************************************************************
void LCD_Init(uint8_t v_lcdNoOfLines_u8, uint8_t v_MaxCharsPerLine_u8)
***************************************************************************************************
 * Function name:  LCD_Init()
 * I/P Arguments:  uint8_t: Number of lines of LCD
                   uint8_t: Number of Chars per line
 * Return value    : none

 * description  :This function is used to initialize the lcd.
                 *It initializes the LCD for selected mode(4/8-bit) and Type(16x2/16x1 etc)
**************************************************************************************************/
void LCD_Init(uint8_t v_lcdNoOfLines_u8, uint8_t v_MaxCharsPerLine_u8)
{


    LCDConfig.v_MaxSupportedChars_U8 = v_MaxCharsPerLine_u8; //Maintaian the LCD type
    LCDConfig.v_MaxSupportedLines_U8 = v_lcdNoOfLines_u8;
    if(v_lcdNoOfLines_u8 > C_LcdLineTwo)
    {
        ARR_LcdLineNumAddress_U8[C_LcdLineTwo] =  0x90 + (v_MaxCharsPerLine_u8 & 0x0fu);
        ARR_LcdLineNumAddress_U8[C_LcdLineThree] =  0xd0 + (v_MaxCharsPerLine_u8 & 0x0fu);
    }

    DELAY_ms(100);

    if(LCDConfig.v_LcdMode_U8 == C_EightBitMode_U8)
    {
        LCD_CmdWrite(CMD_LCD_EIGHT_BIT_MODE); // Initialize the LCD for 8-bit 5x7 matrix type
    }
    else if(LCDConfig.v_LcdMode_U8 == C_FourBitMode_U8)
    {
        lcd_Reset();
        LCD_CmdWrite(CMD_LCD_FOUR_BIT_MODE); // Initialize the LCD for 4-bit 5x7 matrix type 
    }

    LCD_CmdWrite(CMD_DISPLAY_ON_CURSOR_ON);     // Display ON cursor ON
    LCD_Clear();                             // Clear the LCD and go to First line First Position
}
Exemplo n.º 10
0
void Backlight_PWM2Initial(void)
{
		LCD_CmdWrite(0x8c);//PWM setting
		LCD_DataWrite(0x80);
		LCD_CmdWrite(0x8c);//PWM setting
		LCD_DataWrite(0x81);//open PWM
}
Exemplo n.º 11
0
//0x80: Graphic Cursor Horizontal Position Register 0 (GCHP0)
//0x81: Graphic Cursor Horizontal Position Register 1 (GCHP1)
void Graphic_CursorXPostionSet(uint16_t XPosition)
{
		LCD_CmdWrite(0x80);
		LCD_DataWrite((uint8_t)XPosition);
		LCD_CmdWrite(0x81);
		LCD_DataWrite((uint8_t)(XPosition>>8));
}
Exemplo n.º 12
0
//0x46: Memory Write Cursor Horizontal Position Register 0 (CURH0)
//0x47: Memory Write Cursor Horizontal Position Register 1 (CURH1)
void Memory_CursorXPositiomSet(uint16_t XPosition)
{
		LCD_CmdWrite(0x46);
		LCD_DataWrite((uint8_t)XPosition);
		LCD_CmdWrite(0x47);
		LCD_DataWrite((uint8_t)(XPosition >> 8));
}
Exemplo n.º 13
0
//0x48: Memory Write Cursor Vertical Position Register 0 (CURV0)
//0x49: Memory Write Cursor Vertical Position Register 1 (CURV1)
void Memory_CursorYPositiomSet(uint16_t YPosition)
{
		LCD_CmdWrite(0x48);
		LCD_DataWrite((uint8_t)YPosition);
		LCD_CmdWrite(0x49);
		LCD_DataWrite((uint8_t)(YPosition >> 8));
}
Exemplo n.º 14
0
//0xa1: Draw Ellipse/Ellipse Square Long Axis Setting Register (ELL_A0)
//0xa2: Draw Ellipse/Ellipse Square Long Axis Setting Register (ELL_A1)
void Draw_EESLongAxisSet(uint16_t longAxis)
{
		LCD_CmdWrite(0xa1);
		LCD_DataWrite((uint8_t)longAxis);
		LCD_CmdWrite(0xa2);
		LCD_DataWrite((uint8_t)(longAxis>>8));
}
Exemplo n.º 15
0
//0x82: Graphic Cursor Vertical Position Register 0 (GCVP0)
//0x83: Graphic Cursor Vertical Position Register 1 (GCVP1)
void Graphic_CursorYPositionSet(uint16_t YPosition)
{
		LCD_CmdWrite(0x82);
		LCD_DataWrite((uint8_t)YPosition);
		LCD_CmdWrite(0x83);
		LCD_DataWrite((uint8_t)(YPosition>>8));
}
Exemplo n.º 16
0
/**
 * FUNCTION_PURPOSE:LCD Initialization
 * FUNCTION_INPUTS: void
 * FUNCTION_OUTPUTS: none
 */
void LCD_Init()
{
  sdelay(100);
  LCD_CmdWrite(0x38);   	// LCD 2lines, 5*7 matrix
  LCD_CmdWrite(0x0E);			// Display ON cursor ON  Blinking off
  LCD_CmdWrite(0x01);			// Clear the LCD
  LCD_CmdWrite(0x80);			// Cursor to First line First Position
}
Exemplo n.º 17
0
//0x5e: BTE Height Register 0 (BEHR0)
//0x5f: BTE Height Register 1 (BEHR0)
void BTE_HeightSet(uint16_t height)
{
		uint8_t temp = (uint8_t)(height % 0x100);
		LCD_CmdWrite(0x5e);
		LCD_DataWrite(temp);
		temp = (uint8_t)(height / 0x100);
		LCD_CmdWrite(0x5f);
		LCD_DataWrite(temp);
}
Exemplo n.º 18
0
//0x5c: BTE Width Register 0 (BEWR0)
//0x5d: BTE Width Register 1 (BEWR1)
void BTE_WidthSet(uint16_t width)
{
		uint8_t temp = (uint8_t)(width % 0x100);
		LCD_CmdWrite(0x5c);
		LCD_DataWrite(temp);
		temp = (uint8_t)(width / 0x100);
		LCD_CmdWrite(0x5d);
		LCD_DataWrite(temp);
}
Exemplo n.º 19
0
//0x5a: Vertical Destination Point 0 of BTE (VDBE0) 
//0x5b: Vertical Destination Point 1 of BTE (VDBE1)
void BTE_YDstPointSet(uint16_t YDst)
{
		uint8_t temp = (uint8_t)(YDst % 0x100);
		LCD_CmdWrite(0x5a);
		LCD_DataWrite(temp);
		temp = (uint8_t)(YDst / 0x100);
		LCD_CmdWrite(0x5b);
		LCD_DataWrite(temp);
}
Exemplo n.º 20
0
//0x58: Horizontal Destination Point 0 of BTE (HDBE0)
//0x59: Horizontal Destination Point 1 of BTE (HDBE1)
void BTE_XDstPointSet(uint16_t XDst)
{
		uint8_t temp = (uint8_t)(XDst % 0x100);
		LCD_CmdWrite(0x58);
		LCD_DataWrite(temp);
		temp = (uint8_t)(XDst / 0x100);
		LCD_CmdWrite(0x59);
		LCD_DataWrite(temp);
}
Exemplo n.º 21
0
//0x34: Horizontal End Point 0 of Active Window (HEAW0)
//0x35: Horizontal End Point 1 of Active Window (HEAW1)
void Window_ActiveXEndPointSet(uint16_t XEnd)
{
		uint8_t temp = XEnd%0x100;
		LCD_CmdWrite(0x34);
		LCD_DataWrite(temp);
		temp = XEnd/0x100;
		LCD_CmdWrite(0x35);
		LCD_DataWrite(temp);
}
Exemplo n.º 22
0
/////////////PLL setting
void PLL_ini(void)
{
    LCD_CmdWrite(0x88);
    LCD_DataWrite(0x0C);
    Delay1ms(1);
    LCD_CmdWrite(0x89);
    LCD_DataWrite(0x02);
    Delay1ms(1);
}
Exemplo n.º 23
0
//0x3e: Vertical End Point 0 of Scoll Window (VESW0)
//0x3f: Vertical End Point 1 of Scoll Window (VESW0)
void Window_ScrollYEndPointSet(uint16_t YEnd)
{
		uint8_t temp = YEnd%0x100;
		LCD_CmdWrite(0x3e);
		LCD_DataWrite(temp);
		temp = YEnd/0x100;
		LCD_CmdWrite(0x3f);
		LCD_DataWrite(temp);
}
Exemplo n.º 24
0
//0x3a: Vertical Start Point 0 of Scoll Window (VSSW0)
//0x3b: Vertical Start Point 1 of Scoll Window (VSSW1)
void Window_ScrollYStartPointSet(uint16_t YStart)
{
		uint8_t temp = YStart%0x100;
		LCD_CmdWrite(0x3a);
		LCD_DataWrite(temp);
		temp = YStart/0x100;
		LCD_CmdWrite(0x3b);
		LCD_DataWrite(temp);
}
Exemplo n.º 25
0
//0x38: Horizontal Start Point 0 of Scoll Window (HSSW0)
//0x39: Horizontal Start Point 1 of Scoll Window (HSSW1)
void Window_ScrollXStartPointSet(uint16_t XStart)
{
		uint8_t temp = XStart%0x100;
		LCD_CmdWrite(0x38);
		LCD_DataWrite(temp);
		temp = XStart/0x100;
		LCD_CmdWrite(0x39);
		LCD_DataWrite(temp);
}
Exemplo n.º 26
0
//0x36: Vertical End Point 0 of Active Window (VEAW0)
//0x37: Vertical End Point 1 of Active Window (VEAW0)
void Window_ActiveYEndPointSet(uint16_t YEnd)
{
		uint8_t temp = YEnd%0x100;
		LCD_CmdWrite(0x36);
		LCD_DataWrite(temp);
		temp = YEnd/0x100;
		LCD_CmdWrite(0x37);
		LCD_DataWrite(temp);
}
Exemplo n.º 27
0
//0x54: Horizontal Source Point 0 of BTE (HSBE0)
//0x55: Horizontal Source Point 1 of BTE (HSBE1)
void BTE_XSourcePointSet(uint16_t XSource)
{
		uint8_t temp = (uint8_t)(XSource % 0x100);
		LCD_CmdWrite(0x54);
		LCD_DataWrite(temp);
		temp = (uint8_t)(XSource / 0x100);
		LCD_CmdWrite(0x55);
		LCD_DataWrite(temp);
}
Exemplo n.º 28
0
//0x56: Vertical Source Point 0 of BTE (VSBE0)
//0x57: Vertical Source Point 1 of BTE (VSBE1)
void BTE_YSourcePointSet(uint16_t YSource)
{
		uint8_t temp = (uint8_t)(YSource % 0x100);
		LCD_CmdWrite(0x56);
		LCD_DataWrite(temp);
		temp = (uint8_t)(YSource / 0x100);
		LCD_CmdWrite(0x57);
		LCD_DataWrite(temp);
}
Exemplo n.º 29
0
//0x3c: Horizontal End Point 0 of Scoll Window (HESW0)
//0x3d: Horizontal End Point 1 of Scoll Window (HESW1)
void Window_ScrollXEndPointSet(uint16_t XEnd)
{
		uint8_t temp = XEnd%0x100;
		LCD_CmdWrite(0x3c);
		LCD_DataWrite(temp);
		temp = XEnd/0x100;
		LCD_CmdWrite(0x3d);
		LCD_DataWrite(temp);
}
Exemplo n.º 30
0
//0x33: Vertical Start Point 1 of Active Window (VSAW0)
void Window_ActiveYStartPointSet(uint16_t YStart)
{
		uint8_t temp = YStart%0x100;
		LCD_CmdWrite(0x32);
		LCD_DataWrite(temp);
		temp = YStart/0x100;
		LCD_CmdWrite(0x33);
		LCD_DataWrite(temp);
}