Sample PDL device definition for an async driver
This sample driver shows the structure and components of an async driver:
Structure | define device;
| type: async;
| path: device-path;
| baud: baud-rate
| parity: parity-mode
| data-bits: data-bits;
| stop-bits: stop-bits;
| xon-xoff: sw-flow-flag
| hw-flow-control: hw-flow-flag
| require-cd: cd-mode flag
| end device;
Options for async drivers
Option | Description |
---|---|
path: device-path | Identifies the path to the UNIX device file that represents the async line to drive. This is a required attribute. |
baud: baud-rate | Uses an integer constant from this list:
If omitted, then |
parity: parity-mode | Specifies the available parity-modes: even, odd, and none. If the parity is not specified, then it defaults to none. |
data-bits: data-bits | Specifies the number of data bits.
|
stop-bits: stop-bits | Controls the number of stop bits in the async frame and is an integer constant (1 or 2). If an integer constant is not specified, then it defaults to 1. |
xon-off: sw-flow-flag | Determines whether to use software flow control
(that is, xon /xoff ).
|
hw-flow-control: hw-flow-flag | Controls whether to use hardware flow control
(RTS and CTS signals).
|
require-cd: cd-mode-flag | Controls whether CD (Carrier Detect) is used and
required.
|
Example
For example, a typical device declaration for driving tty0
would look similar to this sample:
define device;
type: async;
path: "/dev/tty0";
baud: 9600;
end device;
Many options can default to the commonplace values.