LCD

LCD_Init

{{#Widget:LibTable}}
Defination void LCD_Init(uint8_t lcdMode, uint8_t lcdtype)
Input Arguments uint8_t: required Mode 4/8-bit. uint8_t: Type of LCD used (16x2/16x1 etc)
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)
Usage

LCD_CmdWrite

{{#Widget:LibTable}}
Defination void LCD_CmdWrite( uint8_t cmd)
Input Arguments 8-bit command supported by LCD.
Return Value none
Description This function sends a command to LCD. Some of the commonly used commands are defined in lcd.h. For more commands refer the data sheet and send the supported command. The behaviour is undefined if unsupported commands are sent.
Usage

LCD_DataWrite

{{#Widget:LibTable}}
Defination static void lcd_DataWrite( uint8_t dat)
Input Arguments uint8_t: 8-bit value to be sent to LCD.
Return Value none
Description This functions is used to send a byte of data to LCD.
Usage

LCD_Clear

{{#Widget:LibTable}}
Defination void LCD_Clear()
Input Arguments none.
Return Value none.
Description This function clears the LCD and moves the cursor to beginning of first line
Usage

LCD_GoToLine

{{#Widget:LibTable}}
Defination void LCD_GoToLine(uint8_t LineNumber)
Input Arguments uint8_t: Line number.
Return Value none
Description This function moves the Cursor to beginning of the specified line. If the requested line number is out of range, it will not move the cursor.
Usage

LCD_GoToNextline

{{#Widget:LibTable}}
Defination void LCD_GoToNextLine()
Input Arguments none
Return Value none
Description This function moves the Cursor to beginning of the next line. If the cursor is on last line and NextLine command is issued then it will move the cursor to first line.
Usage

LCD_DisplayString

{{#Widget:LibTable}}
Defination void LCD_DisplayString(char *string_ptr)
Input Arguments String(Address of the string) to be displayed.
Return Value none
Description This function is used to display the ASCII string on the lcd.
  • The string_ptr points to the first char of the string and traverses till the end(NULL CHAR)and displays a char each time.
Usage

LCD_ScrollMessage

{{#Widget:LibTable}}
Defination void LCD_ScrollMessage(uint8_t linenumber, char *msg_ptr)
Input Arguments
  • uint8_t  : Line number on which the message has to be scrolled
  • char *: pointer to the string to be scrolled
Return Value none
Description This function scrolls the given message on the specified line. If the specified line number is out of range then the message will be scrolled on first line
Usage

LCD_DisplayDecimalNumber

{{#Widget:LibTable}}
Defination void LCD_DisplayNumber(uint32_t num, uint8_t NumOfDigits )
Input Arguments
  • uint32_t: Number to be displayed on the LCD.
  • uint8_t : Number of digits to be displayed
Return Value none
Description This function is used to display a max of 10digit decimal number.

2nd parameter specifies the number of digits from the right side to be displayed The output for the input combinations is as below

  • (12345,4) then 4-digits ie. 2345 will be displayed
  • (12345,6) then 6-digits ie. 012345 will be displayed
  • (12345,C_DefaultDigits) then 12345 will be displayed.
Usage

==LCD_DisplayHexNumber==

{{#Widget:LibTable}}
Defination void LCD_DisplayHexNumber(uint32_t num, uint8_t NumOfDigits )
Input Arguments
  • uint32_t: Hexadecimal Number to be displayed on the LCD.
  • uint8_t : Number of digits to be displayed
Return Value none
Description This function is used to display a max of 10digit hex number.2nd parameter specifies the number of digits from the right side to be displayed .

The output for the input combinations is as below

  • (0x12AB,3) then 3-digits ie. 2AB will be displayed
  • (0x12AB,6) then 6-digits ie. 0012AB will be displayed
  • (0x12AB,C_DefaultDigits) then 12AB will be displayed.
Usage

LCD_DisplayBinaryNumber

{{#Widget:LibTable}}
Defination void LCD_DisplayBinaryNumber(uint32_t num, uint8_t NumOfBits )
Input Arguments
  • uint32_t: Hexadecimal Number to be displayed on the LCD.
  • uint8_t: Number of bits to be displayed
Return Value none
Description This function is used to display the binary equivalent of the given number.2nd parameter specifies the number of LSB to be displayed .

The output for the input combinations is as below

  • (10,4) then 4-LSB will be displayed ie. 1010
  • (10,8) then 8-LSB will be displayed ie. 00001010
  • (10,2) then 2-LSB will be displayed ie. 10
Usage

LCD_DisplayFloatNumber

{{#Widget:LibTable}}
Defination void LCD_DisplayFloatNumber(float num)
Input Arguments float Number to be displayed on the LCD.
Return Value none
Description This function is used to display a floating point number It supports 6digits of precision.

Note: Float will be disabled by default as it takes huge controller resources It can be enabled by changing value of Enable_LCD_DisplayFloatNumber to 1 in lcd.h

Usage

LCD_Printf

{{#Widget:LibTable}}
Defination void LCD_Printf(const char *argList, ...)
Input Arguments variable length arguments similar to printf
Return Value none
Description This function is similar to printf function in C. It takes the arguments with specified format and prints accordingly .

The supported format specifiers are as below.

  • %c: character
  • %d: decimal
  • %b: binary
  • %s: string
  • %f: float
  • %x: hexadecimal
Usage