IBM H8 Network Card User Manual


 
HTEB1
User manual
Issue 0.2 Page 40 07/2002
return TRUE;
}
return FALSE;
}
u8 V24PutChar(u8 c) // simple PutChar via V24
{
if (IS_SCI_TX_FREE) // Tx register free ?
{
TDR = c; // yes, put data in tx register
return TRUE;
}
return FALSE;
}
u8 V24Write(u8 *s) // simple Write(string) via V24
{
while (*s != 0) // while not end of string
{
if (V24PutChar(*s) == TRUE) s++; // PutChar
}
return TRUE;
}
u8 V24WriteLn(u8 *s) // simple WriteLine (string + CR/LF)
{
u8 ret = FALSE;
ret = V24Write(s);
ret |= V24Write("\n\r");
return ret;
}
void ShowUse(void) // simple menu
{
V24WriteLn("\n\n\rV24-DemoProgram");
V24WriteLn("-1- Line 1");
V24WriteLn("-2- Line 2");
V24Write("make your choise :");
}
void main(void)
{
char c;
V24Init(9600); // init sci with 9600Baud, 8N1
ShowUse(); // display start msg
while(1) // loop ...
{
if (V24GetChar(&c)==TRUE)
{
if (c=='1')
{
V24WriteLn("\n\n\rGreat! This was '1'");
}
else if (c=='2')
{
V24WriteLn("\n\n\rSuper! '2'");
}
else
{
V24WriteLn("\n\n\rSorry! Only '1' or '2' are supported!");
}
ShowUse();
}
}
}