AN1924 Motorola / Freescale Semiconductor, AN1924 Datasheet - Page 8

no-image

AN1924

Manufacturer Part Number
AN1924
Description
AN1924 Interfacing Serial LCDs to a DSP56F805s SCI and Porting Code Using the Embedded SDK
Manufacturer
Motorola / Freescale Semiconductor
Datasheet
Interfacing the LCDs to the DSP56F805
Code Example 2. LCDplus_sci_test.c
// LCDplus_sci_test.c
//
#include "port.h"
#include "io.h"
#include "bsp.h"
#include "fcntl.h"
#include "sci.h"
#include "stdio.h"
#include "assert.h"
#include "string.h"
int main()
//
//
//
8
UWord16
int
sci_sConfig SciConfig;
static char
static char
int
char
UWord16
UWord16
UWord16
UWord16
UWord16
static char
char
UWord16
UWord16
/* Open SCI Serial Device */
SciConfig.SciCntl
SciConfig.SciHiBit
SciConfig.BaudRate
SciFD = open(BSP_DEVICE_NAME_SCI_1, 1, &SciConfig);
ioctl( SciFD, SCI_DATAFORMAT_EIGHTBITCHARS, NULL);
write( SciFD, NewScr, 1 );
write( SciFD, DispKeypad, 2 );
{
write( SciFD, BackLightOn, 2);
write( SciFD, LightLevel, 2 );
write( SciFD, DispContrast, 2);
write (SciFD, aastring, strlen(aastring));
LF[]={10,0}, CR[]={’E’};
ii;
BS[]={8,0};
serial port LCD (NewMedia’s Serial LCD+ ) and keypad
I;
SciFD;
sum;
input, inputarray[8];
NewScr[2]= {12,0};
BackLightOn[2] = {14,0}; // Turn on LCD’s Backlight
LightLevel[2] = {2,70};
DispContrast[2] = {3,100}; //Set display contrast here set to 100
DispKeypad[2] = {24,1};
aastring[]={"DSP56F805-LCDplus
bstring[]= {"and Keypad test
astring[40];
program tests the interface to a DSP56F805 SCI
=
=
=
| SCI_CNTL_TX_INVERTED;
SCI_CNTL_WORD_8BIT | SCI_CNTL_PARITY_NONE \
SCI_HIBIT_0;
SCI_BAUD_19200;
Interfacing LCDs and Porting Code
/* Wipe clean LCD’s Display */
/* Setup keypad - beep with each key press */
/* Turn-on LCD’s Backlight */
/* Adjust LCD’s Backlight level */
/* Adjust LCD’s Display contrast */
// Clear Screen on LCD
// Set back light level here set to 70
// LCD Line Feed and CR
// LCD backspace
"};
"};

Related parts for AN1924