procedure SerialPort_Init

Libraries ›› The SSERIAL unit ›› Interface ››
Parent Previous Next

procedure SerialPort_Init;

Initialize the serial port: set I/O directions and default states.

This procedure should be called in place of a BAUD() standard procedure call to initialize the port I/O.

The procedure generates a full setup of TX and RX pins if they are defined.

The baud rate is set according to the SERIAL_BAUD conditional define.

These initializations may be done in the main program (TRIS bits and TX high); this is mandatory for PICs without an implemented TRISIO, the TRIS and initial TX state have to be set in the main program.