Re: rs232 and c
hi,
I have seen that you are continuesly facing the rs232 interfacing problem in C..
:?: If you found it difficult to handel rs232 communication in C then I will suggest you to shift on VB... 8)
Well there are varity of functions available to communicate with rs232 ports in C the list is given below..
inp, inpw, outp, outpw <CONIO.H>
inp reads a byte from a hardware port
inpw reads a word from a hardware port
outp outputs a byte to a hardware port
outpw outputs a word to a hardware port
Declaration:
int inp(unsigned portid);
unsigned inpw(unsigned portid);
int outp(unsigned portid, int value);
unsigned outpw(unsigned portid, unsigned value);
Remarks
Both inp and inpw are macros that read from the input port specified by
portid.
Both outp and outpw are macros that write to the output port specified by
portid.
inp reads a byte
inpw reads a 16-bit word (the low byte of the word from portid,
the high byte from portid + 1)
outp writes the low byte of value
outpw writes the low byte of value to portid, and the high byte
to portid + 1, using a single 16-bit OUT instruction
If you call any of these macros when CONIO.H has been included, they are
treated as macros that expand to inline code.
If you don't include CONIO.H, or if you do include CONIO.H and #undef the
macro, you get the function of the same name.
Portability
DOS UNIX ANSI C C++
Return Value
inp and inpw return the value read
outp and outpw return the parameter "value"
Other Functions.............................................
inport, inportb outport, outportb