<< Previous | Next >>

cof_serXgetc

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

Description

This single-user cofunction yields to other tasks until a character is read from port X. This function only returns when a character is successfully written. It is non-reentrant.

The functions cof_serEgetc() and cof_serFgetc() may be used with the Rabbit 3000 or 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: cof_serXgetc(int port), where "port" is one of the macros SER_PORT_A through SER_PORT_F.

Return value

An integer with the character read into the low byte.

Library

RS232.LIB

Example

// echoes characters
main() {
int c;
serXopen(19200);
loopinit();
while (1) {
loophead();
wfd c = cof_serAgetc();
wfd cof_serAputc(c);
}
serAclose();
}


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