<< Previous | Next >>

serXwrite

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

Description

Transmits length bytes to serial port X. This function is non-reentrant.

The functions serEwrite() and serFwrite() 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: serXwrite(int port, ...), where "port" is one of the macros SER_PORT_A through SER_PORT_F.

Parameters

data
Data structure to write to serial port X

length
Number of bytes to write

Return value

The number of bytes successfully written to the serial port.

Library

RS232.LIB

Example

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


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