lcd.c File Reference

The LCD driver for the ST7637. More...


Functions

void LCD_SendLCDCmd (u8 Cmd)
void LCD_SendLCDData (u8 Data)
u32 LCD_ReadLCDData (void)
void LCD_FillRect (u16 x, u16 y, u16 width, u16 height, u16 color)
void LCD_DrawRect (u16 x, u16 y, u16 width, u16 height, u16 color)
void LCD_DrawPixel (u8 XPos, u8 YPos, u16 Color)
void LCD_RectRead (u16 x, u16 y, u16 width, u16 height, u8 *bmp)
u16 LCD_GetPixel (u8 x, u8 y)
void LCD_DisplayChar (u8 x, u8 y, u8 Ascii, u16 TextColor, u16 BGndColor, u16 CharMagniCoeff)
void LCD_SetRect_For_Cmd (s16 x, s16 y, s16 width, s16 height)
void LCD_SetBackLight (u32 newBacklightStart)
void LCD_SetBackLightOff (void)
void LCD_SetBackLightOn (void)
u32 LCD_GetBackLight (void)
void LCD_SetRotateScreen (u8 RotateScreen)
u8 LCD_GetRotateScreen (void)
void LCD_SetScreenOrientation (Rotate_H12_V_Match_TypeDef ScreenOrientation)
Rotate_H12_V_Match_TypeDef LCD_GetScreenOrientation (void)


Detailed Description

Author:
FL
Date:
07/2007

Function Documentation

void LCD_DisplayChar ( u8  x,
u8  y,
u8  Ascii,
u16  TextColor,
u16  BGndColor,
u16  CharMagniCoeff 
)

Display at provided coordinates the provided ASCII character with the provided text and background colors and with the provided magnify coefficient.

Parameters:
[in] x The horizontal coordinate of the character.
[in] y The vertical coordinate of the character.
[in] Ascii The ASCII code of the character to display.
Ascii must be higher than 31 and lower than 127.
[in] TextColor The color used to draw the character.
[in] BGndColor The background color of the drawn character.
[in] CharMagniCoeff The magnify coefficient used to draw the character.
Warning:
The (0x0) point in on the low left corner.

void LCD_DrawPixel ( u8  XPos,
u8  YPos,
u16  Color 
)

Draw a pixel on the LCD with the provided color.

Parameters:
[in] XPos The horizontal coordinate of the pixel.
[in] YPos The vertical coordinate of the pixel.
[in] Color The RGB color to draw the pixel with.
Warning:
The (0x0) point in on the low left corner.

void LCD_DrawRect ( u16  x,
u16  y,
u16  width,
u16  height,
u16  color 
)

Draw a rectangle with a provided color.

Parameters:
[in] x The horizontal coordinate of the rectangle low left corner.
[in] y The vertical coordinate of the rectangle low left corner.
[in] width The rectangle width in pixels.
[in] height The rectangle height in pixels.
[in] color The RGB color to draw the rectangle with.
Warning:
The (0x0) point in on the low left corner.

void LCD_FillRect ( u16  x,
u16  y,
u16  width,
u16  height,
u16  color 
)

Fill a rectangle with a provided color.

Parameters:
[in] x The horizontal coordinate of the rectangle low left corner.
[in] y The vertical coordinate of the rectangle low left corner.
[in] width The rectangle width in pixels.
[in] height The rectangle height in pixels.
[in] color The RGB color to fill the rectangle with.
Warning:
The (0x0) point in on the low left corner.

u32 LCD_GetBackLight ( void   ) 

Returns le LCD PWM rate.

Returns:
The current LCD PWM rate.

u16 LCD_GetPixel ( u8  x,
u8  y 
)

Read the RGB color of the pixel the coordinate are provided in parameter.

Parameters:
[in] x The horizontal coordinate of the pixel.
[in] y The vertical coordinate of the pixel.
Returns:
An unsigned 16 bit word containing the RGB color of the pixel.
Warning:
The (0x0) point in on the low left corner.
See also:
LCD_RectRead

u8 LCD_GetRotateScreen ( void   ) 

Return the screen rotation mode.

Return values:
0 screen rotation is disabled.
1 screen rotation is enabled.

Rotate_H12_V_Match_TypeDef LCD_GetScreenOrientation ( void   ) 

Return current screen orientation.

Returns:
A Rotate_H12_V_Match_TypeDef telling the current screen orientation.

u32 LCD_ReadLCDData ( void   ) 

Read one data byte from the LCD.

Returns:
An unsigned 32 bit word containing the data returned by a LCD command.
Precondition:
An LCD_SendLCDCmd was done with a command returning data.

void LCD_RectRead ( u16  x,
u16  y,
u16  width,
u16  height,
u8 *  bmp 
)

Save the pixels of a rectangle part of the LCD into a RAM variable.

Parameters:
[in] x The horizontal coordinate of the rectangle low left corner.
[in] y The vertical coordinate of the rectangle low left corner.
[in] width The rectangle width in pixels.
[in] height The rectangle height in pixels.
[out] bmp The variable to store the read data into.
Warning:
One pixel weights 2 bytes.

The (0x0) point in on the low left corner.

void LCD_SendLCDCmd ( u8  Cmd  ) 

Send on command byte to the LCD.

Parameters:
[in] Cmd An unsigned char containing the user command to send to the LCD.

void LCD_SendLCDData ( u8  Data  ) 

Send one data byte to the LCD.

Parameters:
[in] Data An unsigned character containing the data to send to the LCD.
Precondition:
An LCD_SendLCDCmd was done with a command waiting for data.

void LCD_SetBackLight ( u32  newBacklightStart  ) 

Modify the PWM rate. Any value below BACKLIGHTMIN reset the value to the default value (DEFAULT_CCR_BACKLIGHTSTART).

Parameters:
[in] newBacklightStart The new PWM rate.

void LCD_SetBackLightOff ( void   ) 

Switch the LCD back light off.

void LCD_SetBackLightOn ( void   ) 

Switch the LCD back light on.

void LCD_SetRect_For_Cmd ( s16  x,
s16  y,
s16  width,
s16  height 
)

Define the rectangle for the next command to be applied.

Parameters:
[in] x The horizontal coordinate of the rectangle low left corner.
[in] y The vertical coordinate of the rectangle low left corner.
[in] width The rectangle width in pixels.
[in] height The rectangle height in pixels.
Warning:
The (0x0) point in on the low left corner.

void LCD_SetRotateScreen ( u8  RotateScreen  ) 

Enable or disable the ability of the screen display to rotate according to the MEMs information.

Parameters:
[in] RotateScreen 0 to disable screen rotation and 1 to enable.

void LCD_SetScreenOrientation ( Rotate_H12_V_Match_TypeDef  ScreenOrientation  ) 

Set the screen orientation.

Parameters:
[in] ScreenOrientation The new screen orientation.