<< Previous | Next >>

HDLCopenX

int HDLCopenX( long baud, char encoding, unsigned long buffers, int buffer_count, int buffer_size ); /* Where X is E or F */

Description

Opens serial port E or F in HDLC mode. Sets up buffers to hold received packets. This function is intended for use with the Rabbit 3000 and Rabbit 4000. Please see the chip manuals for more details on HDLC and the bit encoding modes to use.

Parameters

baud
The baud rate for the serial port. Due to imitations in the baud generator, non-standard baud rates will be approximated within 5% of the value requested.

encoding
The bit encoding mode to use. Macro labels for the available options are:

  • HDLC_NRZ

  • HDLC_NRZI

  • HDLC_MANCHESTER

  • HDLC_BIPHASE_SPACE

  • HDLC_BIPHASE_MARK

buffers
A pointer to the start of the extended memory block containing the receive buffers. This block must be allocated beforehand by the user. The size of the block should be:

(# of buffers) * ((size of buffer) + 4)

buffer_count
The number of buffers in the block pointed to by buffer.

buffer_size
The capacity of each buffer in the block pointed to by buffer.

Return Value

1: Actual baud rate is within 5% of the requested baud rate,
0: Otherwise.

Library

HDLC_PACKET.LIB

See Also

SetSerialTATxRValues, TAT1R_SetValue


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