Serial Line Driver¶
The serial line driver is implemented in
os/drivers/serial/serial_line.c
Implements a simple serial line driver. It provides means for outputting data via serial port, and it provides an interrupt handler to pass received data as an EV_SERIAL to the input subsystem.
Initialization¶
This driver is initialized by calling
-
void serial_line_init(void)¶
Initialize the serial line.
Allocating a Serial Line¶
A serial line is allocated by calling
-
serial_line_t *serial_line_alloc(void)¶
Allocate a serial line data structure.
Serial Line Operations¶
This driver implements the serial line operations
(serial_line_operations_t):
Open¶
Implements the operation serial_line_operations_t.open:
-
static int __serial_line_open(serial_line_t *sl)¶
Open the serial line
sl.- Returns:
0 on success
- Returns:
-EIO on failure
Put Character¶
Implements the operation serial_line_operations_t.putc:
-
static int __serial_line_putc(serial_line_t *sl, char c)¶
Write a byte
cto the serial linesl.- Returns:
0
Input Handling¶
The serial line registers an interrupt handler on opening the line:
-
static void __serial_line_isr(void)¶
Handle interrupts from the serial port.
This handler passes received input as
EV_SERIALevents to the input subsystem.