AN1921 Motorola / Freescale Semiconductor, AN1921 Datasheet - Page 5

no-image

AN1921

Manufacturer Part Number
AN1921
Description
AN1921 General DSP568xx Interface Examples using the Embedded SDK
Manufacturer
Motorola / Freescale Semiconductor
Datasheet
Code Example 1 continues below.
As shown in the code LCDsimple.c, processing starts by a call to open(), which allocates a handle
(UART) to the application for the RS-232 serial port to which the SPI1 is interfaced. The control
variable, NewUartState, is initialized to define the attributes of the interface to the MAX3100 UART
chip and is directed to the MAX3100 by a call using the function ioctl().
Code Example 1, continued:
printf("State = %x \n", NewUartState );
press */
UWord16
/* Open Serial Device */
Uart = open(BSP_DEVICE_NAME_SERIAL_0, 0);
/* Define some of the attributes of the MAX3100 UART - note BAUD
NewUartState =
/* Modify DSP56824 EVM’s MAX3100 UART characteristics */
ioctl(Uart, SERIAL_DEVICE_RESET, &NewUartState);
write( Uart, BackLightOn, 2);
write( Uart, LightLevel, 2 );
write( Uart, DispContrast, 2);
write( Uart, NewScr, 1 );
write( Uart, DispKeypad, 2 );
sum = write (Uart, astring, 16);
printf(" sum = %d \n", sum );
sum = read (Uart, &input, 1);
printf(" input = %d
sum = 0;
for ( I=0; I < 10; I++ )
{
}
strcpy( bstring, "Keypad: hit any key.");
strcat( bstring, LF );
write( Uart, bstring, strlen(bstring));
sum = read (Uart, &input, 1);
rate is set to 9600 */
write( Uart, NewScr, 1 );
sprintf(astring, " %d ", I );
write (Uart, astring, strlen(astring));
Interface Examples Using the Embedded SDK
BS[]={8,0};
MAX3100_FIFO_DISABLE | \
MAX3100_INT_ENABLE_DATA | \
MAX3100_IR_DISABLE | \
MAX3100_STOPBIT_1 | \
MAX3100_PARITY_NONE | \
MAX3100_WORD_8BIT | \
MAX3100_BAUD_9600;
keypad = %d \n", sum, input );
/* Turn-on LCD’s Backlight */
/* Adjust LCD’s Backlight level */
/* Adjust LCD’s Display contrast */
/* Wipe clean LCD’s Display */
/* Setup keypad - beep with each key
LCD and Keypad User Interface Description
5

Related parts for AN1921