<< Previous | Next >> | |
|
void serXparity( int parity_mode ); /* where X is A-F */
Description
- Sets parity mode for channel X. A call to
serXopen()
must be made before calling this function.
- Parity generation for 8-bit data can be unusually slow due to the current method for generating high 9th bits. Whenever a 9th high bit is needed, the UART is disabled for approximately 10 baud times to create a long stop bit that should be recognized by the receiver as a high 9th bit.
- The long delay is imposed because we are using the serial port itself to handle timing for the delay. Creating a shorter delay would the require use of some other timer resource.
- This function is non-reentrant.
- The functions
serEparity()
andserFparity()
may be used with the Rabbit 3000 and Rabbit 4000.Parameters
- parity_mode
- An integer indicating what parity mode to use. It is best to use one of the macros provided:
PARAM_OPARITY
- Odd parity; parity bit set to "0" if odd number of 1's in data bits.
PARAM_EPARITY
- Even parity; parity bit set to "1" if even number of 1's in data bits.
PARAM_MPARITY
- Mark parity; parity bit always set to logical 1. (Rabbit 4000 only)
PARAM_SPARITY
- Space parity; parity bit always set to logical 0. (Rabbit 4000 only)- From a logical standpoint, the first three of these
PARAM_
macros cannot be combined, but evenPARAM_2STOP
must stand alone due to limitations in the UART hardware that will not allow parity bits and extra stop bits.
Library
- RS232.LIB
Dynamic C Functions | << Previous | Next >> | rabbit.com |