AN1921 Motorola / Freescale Semiconductor, AN1921 Datasheet - Page 6

no-image

AN1921

Manufacturer Part Number
AN1921
Description
AN1921 General DSP568xx Interface Examples using the Embedded SDK
Manufacturer
Motorola / Freescale Semiconductor
Datasheet
LCD and Keypad User Interface Description
6
Next, a series of calls using write() directs commands to the LCD. The commands issued are to:
In this example, selected attributes cause the keypad to both beep with each keypad entry and
immediately display (Echos) the entry on the LCD. More detailed information about the LCD used
here is found in
A call to write() next directs the string that announces the test to the LCD. The number of characters
passed (sum) is passed to printf() and displayed in the IDE’s text window.
A call to read() yields whatever key was struck on the keypad. The ASCII code of the keypad
character struck is passed to printf().
The keypad’s key assignments are shown in
Turn on the LCD’s backlight
Adjust the light level
Adjust the display contrast
Clear the display area
Set up the keypad
}
strcat( bstring, LF );
strcpy( bstring, "Input at keypad (’0000 (CR)’ to exit) ");
strcat( bstring, LF );
write( Uart, bstring , strlen(bstring));
strcpy( bstring, "Hit key to start");
write( Uart, bstring , strlen(bstring));
write( Uart, NewScr, 1 );
/* The following loop polls keypad input */
ii = 0;
while ( true )
{
}
write( Uart, NewScr, 1 );
strcpy( bstring, " Done! ");
write(Uart, bstring, strlen(bstring) );
Appendix A.
read( Uart, &inputarray[ii], 1);
if ( inputarray[ii] == CR[0]
{
}
{
}
if ( strcmp(inputarray,"0000") == 0 ) break;
ii++;
sprintf(bstring,"\n");
write ( Uart, bstring, strlen(bstring));
inputarray[ii] = 0;
sprintf(bstring, "Input - %s ", inputarray );
strcat( bstring, LF );
printf(" %s", bstring );
ii = 0;
write( Uart, &inputarray[ii], 1);
else
Interface Examples Using the Embedded SDK
Figure
4.
)

Related parts for AN1921