devc-sersci

Serial driver for Hitachi 7750, 7751 7760, 7770, 7780, and 7785 SCI and SCIF ports


Note: You must be root to start this driver.

Syntax:

devc-sersci [options] port [[options] port] &

Runs on:

SH4 Renesas 7750, 7751 7760, 7770, 7780, and 7785

Options:

The options are position-dependent and affect the subsequent ports.

-b number
The initial baud rate (default 38400).
-C size
The size of the canonical buffer in bytes (default 256).
-c clock[/divisor]
Define a custom clock rate, in hertz, and divisor for the serial port. The default (-c 33333333/16) is suitable for 200MHz SH4 boards.
-E
Start in raw mode (the default). Software flow control is disabled by default.
-e
Start in edited mode (default raw). Software flow control is enabled by default.
-F
Disable hardware flow control (default to hardware flow control enabled). Hardware flow control is not supported in edited mode.
-f
Enable hardware flow control (default). Hardware flow control is not supported in edited mode.
-h
Enable RS-232 use of RTS and CTS lines (default).
-H
Permanently disable RS-232 use of RTS and CTS lines. When RS-232 is disabled, the RTS and CTS lines can be used as GPIO lines.

Note: The -H option only works when the -F option to disable HW flow control is set.

-I number
The size of the raw input buffer in bytes (default 2048).
-O number
The size of the interrupt output buffer in bytes (default 2048).
-r number
Set the RTS trigger level. This option doesn't apply to the 7750 or 7751. The possible values are as follows:
Core Values Default
7760 1, 16, 32, 64, 96, 108, 120, or 127 16
7770 1, 4, 6, 8, 10, 12, 14, or 15 15
7780, 7785 1, 8, 16, 32, 48, 54, 60, or 63 8
-S|s
Disable / enable software flow control. The default depends on the mode: in raw mode (-E, the default), it's disabled; in edited mode (-e), it's enabled.

The order in which you specify the -E or -e, and -S or -s options matters:

Options Mode Software flow control
-e Edited Enabled
-S -e Edited Enabled
-e -S Edited Disabled
-E Raw Disabled
-s -E Raw Disabled
-E -s Raw Enabled
-t tx_number[,rx_number]
(SCIF ports only) Enable the transmit and (optionally) receive FIFOs and set the thresholds, in characters. The possible values are as follows:
Core tx_number rx_number Default
7750, 7751 1, 2, 4, or 8 1, 4, 8, or 14 1, 1
7760 4, 32, or 64   1, 16, 64, or 96   64, 1
7770 1, 2, 4, or 8 1, 4, 8, or 14 1, 1
7780, 7785 4, 16, or 32 1, 16, 32, or 48 32, 1
-u number
Append number to the device name prefix (/dev/ser). The default is 1; additional devices are given increasing numbers.
port
The port to use; one of:

You must specify at least one port; you can't specify the same port twice on the command line.

Description:

The devc-sersci driver is a small serial device driver for the Renenas 7750, 7751 7760, 7770, 7780, and 7785 Serial Communications Interface (SCI) and Serial Communications Interface with builtin FIFO registers (SCIF) serial ports.

This driver can support the SCI and/or SCIF ports. The driver initializes itself with the appropriate interrupts.

Each device is given a name in the pathname space of /dev/sern, where n starts at 1 (unless changed via the -u option) and increases. The assignments of names to ports depends on the order in which you specify the ports on the command line.


Note: If your application uses /dev/console, you should create a link from it to one of /dev/ser1, /dev/ser2, ... by adding a line like this to the buildfile used by mkifs:
[type=link] /dev/console = /dev/ser1

All devices are fully interrupt driven and by default support hardware flow control on input and output (RTS/CTS). This can be disabled by the -F option.


Note: Hardware flow control isn't supported in edited mode.

For input hardware flow control, when the SCIF chipset asserts the RTS line (to signal the transmitting device to stop sending characters), the chipset assumes that the transmitting device responds within one character. If more than one character is transmitted after the SCIF chip asserts the RTS line, the extra characters are lost.


A read request by default returns when at least 1 character is available. To increase efficiency, you can control three parameters to control when a read is satisfied:

Time
Return after a specified amount of time has elapsed.
Min
Return when this number of characters are in the input buffer.
Char
Return if this forwarding character is in the input buffer.

Note: If the Min value is greater than the size of the input buffer, the Min value is clipped to the size of the buffer. To avoid this, the size of the input buffer can be changed with the -I option.

These parameters are set using library routines (see tcgetattr(), tcsetattr(), readcond() and TimerTimeout() in the Library Reference).

The devc-sersci manager supports both raw and edited modes, making it a real tty device.

The following fields and flags are supported in the termios structure:

Field Supported flags
c_cc All characters
c_iflag BRKINT ICRNL IGNBRK IXON
c_oflag OPOST
c_cflag CLOCAL CSIZE CSTOPB PARENB PARODD
c_lflag ECHO ECHOE ECHOK ECHONL ICANON IEXTEN ISIG NOFLSH

Examples:

Start devc-sersci for the SCIF and SCI ports, specifying a baud rate of 57600 and using edited mode. The SCIF port is assigned /dev/ser1, and the SCI port is assigned /dev/ser2:

devc-sersci -b57600 -e scif sci &

See also:

Character I/O drivers (devc-*) in the Utilities Summary