1 | # |
---|
2 | # $Id$ |
---|
3 | # |
---|
4 | |
---|
5 | This driver was submitted by Katsutoshi Shibuya <shibuya@mxb.meshnet.or.jp>. |
---|
6 | |
---|
7 | Configuration |
---|
8 | ------------- |
---|
9 | The application can choose this driver by using "CONSOLEX_DRIVER_TABLE_ENTRY" |
---|
10 | in the driver table definition, in place of "CONSOLE_DRIVER_TABLE_ENTRY". |
---|
11 | See consolex/cTest.c for an example and consolex/README for more information. |
---|
12 | |
---|
13 | Programmatic Usage |
---|
14 | ------------------ |
---|
15 | |
---|
16 | - You can open 9 devices; console tty00, tty01, tty02, tty03, |
---|
17 | rtty00, rtty01, rtty02, rtty03 |
---|
18 | tty00, rtty00 and console correspond to port#1 of MVME162LX, |
---|
19 | tty01 and rtty01 correspond to port#2, and so on. |
---|
20 | - tty0x are "cooked" devices. They support following flags on termios |
---|
21 | definition; |
---|
22 | ISTRIP, INLCR, IGNCR, ICRNL, IUCLC, OLCUC, ONLCR, OCRNL, ICANON, ECHO, |
---|
23 | CBAUD, B38400, B19200, B9600, CSIZE, CS8, CS7, PARENB, PARODD, CSTOPB, |
---|
24 | - rtty0x are "raw" devices. They support following flags on termios |
---|
25 | definition; |
---|
26 | CBAUD, B38400, B19200, B9600, CSIZE, CS8, CS7, PARENB, PARODD, CSTOPB, |
---|
27 | - The default parameter is; |
---|
28 | B38400, CS8, ICRNL, ONLCR, ICANON, ECHO |
---|
29 | (but all flags except B38400 and CS8 will be ignored on raw device.) |
---|
30 | - All devices support O_NDELAY (non blocking read/write) mode operation. |
---|
31 | (Non-blocking cooked mode output is valid, but will not work fine.) |
---|
32 | (Non-blocking cooked mode input with ECHO flag may be blocked while sending |
---|
33 | echoed character.) |
---|
34 | - All devices support hardware flow control by CTS/RTS. |
---|
35 | (There is no way to disable it. There are no supports for soft flow control.) |
---|
36 | - The application can use tcgetattr or ioctl to obtain the parameters of the |
---|
37 | device into struct termios. |
---|
38 | - The application can use tcsetattr or ioctl to set the parameters of the |
---|
39 | device within the struct temios. The action argument (2nd arg) of the |
---|
40 | tcsetattr must be TCSANOW. |
---|
41 | - On opening the device, the driver activate DTR line. On closing the device, |
---|
42 | the driver deactivate DTR line. |
---|
43 | If 2 or more device opening occures at the same time on the same port, only |
---|
44 | the first open procedure activates DTR line, and only the last close |
---|
45 | procedure deactivate it. |
---|
46 | - There are no device locking mechanisms. Application can open same device |
---|
47 | several times. |
---|
48 | But 2 simultanious reading operation on the same port will cause unexpected |
---|
49 | result. |
---|
50 | |
---|
51 | Porting Notes |
---|
52 | ------------- |
---|
53 | - This code can be used for any Zilog SCC based board. |
---|
54 | Change the time constant parameters and SCC register base addresses. |
---|
55 | |
---|
56 | - This code is well separated into "device depended part" and "device |
---|
57 | independed part". |
---|
58 | They can use device independed part for any other board. The device |
---|
59 | independed part requires following functions; |
---|
60 | |
---|
61 | void SCCInitialize(); |
---|
62 | Initialize hardware. |
---|
63 | rtems_boolean SCCGetOne(int port, char *ch); |
---|
64 | Get one character from port. If no character is in the receiver buffer, |
---|
65 | this function returns FALSE, otherwise TRUE. |
---|
66 | char SCCGetOneBlocked(int port); |
---|
67 | Get one character from port. If no character is in the receiver buffer, |
---|
68 | wait it passing the CPU to the other task. |
---|
69 | rtems_boolean SCCSendOne(int port, char ch); |
---|
70 | Send one character via port. If the transmitter is not ready, this function |
---|
71 | returns FALSE, otherwise TRUE. |
---|
72 | void SCCSendOneBlocked(int port, char ch); |
---|
73 | Send one character via port. Wait until the transmitter is ready, passing |
---|
74 | the CPU to the other task. |
---|
75 | unsigned32 SCCSetAttributes(int port, struct termios *tm); |
---|
76 | Set device attribute according to the information in the struct termios. |
---|
77 | c_cflags parameter (baud, parity, stopbits and code size) will be checked. |
---|
78 | On the successful completion, this function should return 0. |
---|
79 | unsigned32 SCCGetAttributes(int port, struct termios *tm); |
---|
80 | Get device attribute according into the struct termios. |
---|
81 | c_cflags parameter (baud, parity, stopbits and code size) will be set. |
---|
82 | On the successful completion, this function should return 0. |
---|
83 | void SCCSetDTR(port); |
---|
84 | Activate DTR line. |
---|
85 | void SCCResetDTR(port); |
---|
86 | Deactivate DTR line. |
---|
87 | void SCCSetRTS(port); |
---|
88 | Activate RTS line. |
---|
89 | void SCCResetRTS(port); |
---|
90 | Deactivate RTS line. |
---|
91 | int SCCGetCTS(port); |
---|
92 | Return non zero when CTS line is activated. |
---|
93 | |
---|
94 | - If you don't want console port, undefine "CONSOLEPORT". |
---|
95 | |
---|
96 | - This code does not use ESCC feature; i.e. does not read register #4/#5/#14 |
---|
97 | |
---|