Hitachi Network Adapter H8 User Manual page 40

Lowcost evaluation board
Table of Contents

Advertisement

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

Advertisement

Table of Contents
loading

This manual is also suitable for:

H8/tiny 3664fHteb1

Table of Contents