PT630 Programming Reference Guide
Page 57 of 59
------------------------------------------------------------------------------------------------------------------
1.9.2 Get Character from COM 2 RS232 Port
Entry Parameter: AH = 1
Return Value: 1) AH = 0
; has character input
AL
=
character
2)
AH
=
1
;
no
character
input
Note:
Only for NONE communication protocol
Example:
unsigned char TC_232_char_I()
{
regs.h.ah = 1;
int86(0x
14
,®s,®s);
if (regs.h.ah == 0)
{
return(regs.h.al);
}
return(255);
}
1.9.3 Send Character to COM2 RS232 Port
Entry Parameter: AH = 2
AL
=
character
Return
Value:
None
Note:
Only for NONE communication protocol
Example:
void TC_232_char_O(unsigned char ch)
{
regs.h.ah = 2;
regs.h.al = ch;
int86(0X
14,
®s,®s);
}
1.9.4 Enable COM2 RS-232 Port
Entry Parameter: AH = 3
Return
Value:
None
Example:
void TC_232_enable()
{
regs.h.ah = 3;
int86(0x
14
,®s,®s);
}
1.9.5 Disable COM2 RS-232 Port
Entry Parameter: AH = 4
Returned
Value: None
Example:
void TC_232_disable()
{
regs.h.ah = 4;
int86(0X
14
®s,®s);
}