uart_setup()


Configuring the designated UART port

Description

void uart_setup(int $uart_id, int $baud [, string $ctrl = "N81N"])

Parameters

ctrl available values
parity N: None, E: Even, O: Odd, M: Mark, S: Space
data bit 8 or 7
stop bit 1 or 2
flow control N: None, H: RTS/CTS, S: Xon/Xoff, T: TxDE(RS485) enable

Return Value

none

Example

<?php
include "/lib/sd_340.php";
uart_setup(0, 9600, "E71N"); // set UART0 to 9600 bps, Even parity, 7 data bits, 1 stop bit, No-flowcontrol
uart_setup(1, 115200);       // set UART1 to 115200bps
?>

See also