<< Previous | Next >>

serXgetc

int serXgetc( void ); /* where X is A-F */

Description

Get next available character from serial port X read buffer. This function is non-reentrant.

The functions serEgetc() and serFgetc() may be used with the Rabbit 3000 and Rabbit 4000.

NOTE Alternatively you can use another form of this function that has been generalized for all serial ports. Instead of substituting for "X" in the function name, the prototype of the generalized function is: serXgetc(int port), where "port" is one of the macros SER_PORT_A through SER_PORT_F.

Return value

Success: the next character in the low byte, 0 in the high byte.
Failure: -1, which indicates either an empty or a locked receive buffer.

Library

RS232.LIB

Example

// echoes characters
main() {
int c;
serAopen(19200);
while (1) {
if ((c = serAgetc()) != -1) {
serAputc(c);
}
}
serAclose()
}


Dynamic C Functions << Previous | Next >> rabbit.com