Contents
GLCD
GLCD_Init
Defination | void GLCD_Init () |
Input Arguments | none |
Return Value | none |
Description | This function is used to initialize the glcd. |
Usage | GLCD_Init() //Initialize GLCD |
GLCD_CmdWrite
Defination | void GLCD_CmdWrite( uint8_t var_lcdCmd_u8) |
Input Arguments | 8-bit command supported by GLCD. |
Return Value | none |
Description | This function sends a command to GLCD. Some of the commonly used commands are defined in glcd.h. For more commands refer the data sheet. The behaviour is undefined if unsupported commands are sent. |
Usage |
GLCD_CmdWrite(0xB8); //Sets cursor to first line |
GLCD_Clear
Defination | void GLCD_Clear() |
Input Arguments | none. |
Return Value | none. |
Description | This function clears the GLCD and moves the cursor to beginning of first line |
Usage |
GLCD_Clear(); // Clears the lcd and sets the cursor to beginning of the first line. |
GLCD_GoToLine
Defination | void GLCD_GoToLine(uint8_t var_lineNumber_u8) |
Input Arguments | uint8_t: Line number to move the cursor. |
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. Note: The line numbers run from 1 to Maxlines.
|
Usage |
GLCD_GoToLine(1); //Moves the cursor to beginning of first line GLCD_GoToLine(E_LcdLineOne); //Recommended usage |
GLCD_GoToNextline
Defination | void GLCD_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 |
GLCD_GoToNextline(); //Moves the cursor to beginning of next line. |
GLCD_SetCursor
Defination | void GLCD_SetCursor(char var_lineNumber_u8,char var_charNumber_u8) |
Input Arguments |
|
Return Value | none |
Description | This function moves the Cursor to specified position.
|
Usage |
GLCD_SetCursor(1,10); //Moves the cursor to 1st line 11th char. GLCD_SetCursor(5,10); //No action taken as line 5 is out of range |
GLCD_DisplayChar
Defination | void GLCD_DisplayChar( char var_lcdData_u8) |
Input Arguments | uint8_t: ASCII value of the char to be displayed. |
Return Value | none |
Description | This function sends a character to be displayed on GLCD. Any valid ascii value can be passed to display the respective character |
Usage |
GLCD_DisplayChar(65); //Displays 'A' on GLCD |
GLCD_DisplayString
Defination | void GLCD_DisplayString(char *ptr_stringPointer_u8) |
Input Arguments | char*:String(Address of the string) to be displayed. |
Return Value | none |
Description | This function is used to display the ASCII string on the lcd. |
Usage |
void main() { char myString[]={"hello, world"}; GLCD_DisplayString(myString); GLCD_DisplayString("good morning"); } |
GLCD_ScrollMessage
Defination | void GLCD_ScrollMessage(uint8_t var_lineNumber_u8, char *ptr_msgPointer_u8) |
Input Arguments |
|
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 |
GLCD_ScrollMessage(" Welcome to embedded programming "); |
GLCD_DisplayNumber
Defination | void GLCD_DisplayNumber(NumericSystem_et e_typeOfNum_e8, uint32_t var_number_u32, uint8_t var_numOfDigitsToDisplay_u8) |
Input Arguments |
|
Return Value | none |
Description |
This function is used to display a max of 10digit decimal/Hex number OR specified number of bits for binary number.
Decimal:
Hex:
|
Usage |
uint32_t decNumber = 123456; |
GLCD_Printf
Defination | void GLCD_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 displays accordingly .
The supported format specifiers are as below.
|
Usage |
void main() { uint16_t decNum=1234;//16-bit uint32_t longDec=12345678;//32-bit float floatNum=1234.5678; uint16_t hexNum=0xABCD; char myString[]={"hello, world}; GLCD_Printf("%d %l %f %x %b %s",decNum,longDec,floatNum,hexNum,hexNum,myString); GLCD_Printf("D:%d,L:%l,F=%f,H:%x,Str:%s",1234,12345678,123.456,0xAB,"hello"); } |
Usage Guide