<< Previous | Next >> | |
|
int serXopen( long baud ); /* where X is A-F */
Description
- Opens serial port X. This function is non-reentrant.
- The user must define the buffer sizes for each port being used with the buffer size macros
XINBUFSIZE
andXOUTBUFSIZE
. The values must be a power of 2 minus 1, e.g.#define XINBUFSIZE 63
#define XOUTBUFSIZE 127
- Defining the buffer sizes to 2n - 1 makes the circular buffer operations very efficient. If a value not equal to 2n- 1 is defined, a default of 31 is used and a compiler warning is given.
- The functions
serEopen()
andserFopen()
may be used with the Rabbit 3000 and Rabbit 4000.
- The user must #define the following if not using the default (PCDR) settings:
SERE_TXPORT
define to PEDR or PDDR
SERE_RXPORT
define to PEDR or PDDR
- For Rabbit 4000 Users: To use DMA for transfers, call
serXdmaOn()
after this function.Parameters
- baud
- Bits per second (bps) of data transfer. Note that the baud rate must be greater than or equal to the peripheral clock frequency divided by 8192.
Return value
1
: The Rabbit's bps setting is within 5% of the input baud.
0
: The Rabbit's bps setting differs by more than 5% of the input baud.Library
- RS232.LIB
See also
- serXgetc, serXpeek, serXputs, serXwrite, cof_serXgetc,
cof_serXgets, cof_serXread, cof_serXputc, cof_serXputs,
cof_serXwrite, serXclose
Dynamic C Functions | << Previous | Next >> | rabbit.com |