|
| 以 PDF 格式下載這本書
NAME
- mic - Multi-interface Chip driver
SYNOPSIS
-
#include <fcntl.h>
-
-
#include <sys/termios.h>
#include <sys/micio.h>
-
open("/dev/term/mic/a", mode);
-
-
open("/dev/term/mic/b", mode);
open("/dev/term/mic/ir", mode);
AVAILABILITY
-
SUNWmic
PLATFORM
-
SPARCstation Voyager
DESCRIPTION
- The Multi-interface Chip (MIC) provides two asynchronous serial input/output channels. These channels provide high speed buffered serial I/O, with optional hardware flow control support. Baud rates from 110 to 115200 are supported.
- The first channel can either be routed through an infra-red port or the "a" serial port. If the device is opened using the "ir" device, then the driver routes the first channel through the infra-red port. If the device is opened using the "a" device the first channel is routed through the "a" serial port. You cannot use both the "a" port and the "ir" port simultaneously. The second channel (the "b" serial port) has no infra-red capability and may be used independently of the first channel.
- The mic module is a loadable STREAMS driver that provides basic support for the MIC hardware, together with basic asynchronous communication support. The driver supports those termio (7)device control functions specified by flags in the c_cflag word of the termios structure, excluding HUPCL, CLOCAL, CIBAUD, CRTSCTS and PAREXT. The driver does not support device control functions specified by flags in the c_iflag word of the termios structure. Specifically, the driver assumes that IGNBRK and IGNPAR are always set. All other termio (7)functions must be performed by STREAMS modules pushed atop the driver. When a device is opened, the ldterm(7) and ttcompat(7) STREAMS modules are automatically pushed on top of the stream, providing the standard termio (7)interface.
- The infra-red port provides access to two different modes of modulation. The default mode is called pulse mode and is compatible with the Infra-red Data Association (IrDA) modulation and the Hewlett-Packard Serial Infra-red (SIR) modulation. The second modulation is called high frequency mode and is compatible with the Sharp Amplitude Shift Keying (ASK) modulation. The default modulation when using high frequency mode is 500 KHz.
- The character-special devices /dev/term/mic/a and /dev/term/mic/b are used to access the two serial ports on the MIC chip.
- The character-special device /dev/term/mic/ir is used to access the infra-red port of the chip.
IOCTLS
- The standard set of termio ioctl( ) calls are supported by the mic driver.
- Breaks can be generated by the TCSBRK ,TIOCSBRK ,and TIOCCBRK ioctl( ) calls.
- The input and output line speeds may be set to any of the speeds supported by termio . The speeds cannot be set independently; when the output speed is set, the input speed is set to the same speed. To support higher speeds than defined in termio the two lowest speeds, B50 and B75, have been remapped to 96000 and 115200 baud respectively.
- There are six ioctl( ) calls which are specific to the infra-red port and can only be used when the device has been opened in infra-red mode:
-
-
MIOCGETM_IR
- Returns the current IR mode defined in micio.h
-
-
MIOCSETM_IR
- Takes an additional argument of the desired IR mode (defined in micio.h) and sets the port to this mode.
-
-
MIOCGETD_IR
- Returns the current IR carrier divisor. The carrier frequency can be calculated from the divisor and the formula:
-
carrier frequency = 19660 / (4 (divisor +1)) KHz
-
-
MIOCSETD_IR
- Sets the current IR carrier divisor. The desired frequency can be set by using a divisor calculated by the following formula, where the frequency is specified in KHz:
-
divisor = 19660 / frequency / 4 - 1
-
-
MIOCSLPBK_IR
- Set IR loopback mode. This enables the receiver during transmit, so that sent messages are also received through the IR port.
-
-
MIOCCLPBK_IR
- Clears IR loopback mode.
- There are two mic specific ioctl( ) calls:
-
-
MIOCSLPBK
- Set SCC loopback mode. This internally loops back transmitted messages within the channel.
-
-
MIOCCLPBK
- Clear SCC loopback mode.
ERRORS
- An open( ) will fail if:
-
-
ENXIO
- The unit being opened does not exist.
-
-
EBUSY
- The channel is in use by another serial protocol. Remember that both the "a"
- and "ir" ports use the same channel.
FILES
-
-
/dev/term/mic/a
- asynchronous serial line using port a
-
-
/dev/term/mic/b
- asynchronous serial line using port b
-
-
/dev/term/mic/ir
- asynchronous serial infra-red line using the infra-red port
DIAGNOSTICS
-
mic: Rx FIFO overflow
- The mic's internal 64 character buffer overflowed before it could be serviced.
-
mic: Rx buffer full - draining
- The driver's character input buffer overflowed before it could be serviced.
NOTES
- Currently hardware flow control is not implemented. The state of DCD, CTS, RTS and DTR interface signals cannot be queried, nor can hardware flow control be enabled using the CRTSCTS flag in the c_cflag word of the termios structure.
SEE ALSO
-
tip(1), ports(1M), ioctl(2), open(2), ldterm(7), termio (7),ttcompat(7),
|
|