<< Previous | Next >>

cof_serXwrite

void cof_serXwrite( void * data, int length ); /* where X is A-F */

Description

This single-user cofunction writes length bytes to port X. It yields to other tasks for as long as the input buffer is locked or whenever the buffer becomes full as characters are written. This function is non-reentrant.

The functions cof_serEwrite() and cof_serFwrite() 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_serXwrite(int port, ...), where "port" is one of the macros SER_PORT_A through SER_PORT_F.

Parameters

data
Data structure to write.

length
Number of bytes in data to write.

Library

RS232.LIB

Example


// writes a block of characters, repeatedly
main() {
const char s[] = "Hello Rabbit";
serAopen(19200);
loopinit();
while (1) {
loophead();
costate {
wfd cof_serAwrite(s, strlen(s));
}
}
serAclose();
}


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