RTEMS 6.1-rc4
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
ns16550.c File Reference
#include <stdlib.h>
#include <rtems.h>
#include <rtems/libio.h>
#include <rtems/ringbuf.h>
#include <rtems/bspIo.h>
#include <rtems/termiostypes.h>
#include <libchip/serial.h>
#include <libchip/sersupp.h>
#include <bsp.h>
#include <libchip/ns16550_p.h>
#include <libchip/ns16550.h>

Data Structures

struct  NS16550Context
 

Functions

NS16550_STATIC void ns16550_init (int minor)
 
NS16550_STATIC int ns16550_open (int major, int minor, void *arg)
 
NS16550_STATIC int ns16550_close (int major, int minor, void *arg)
 
NS16550_STATIC void ns16550_write_polled (int minor, char cChar)
 
NS16550_STATIC int ns16550_assert_RTS (int minor)
 
NS16550_STATIC int ns16550_negate_RTS (int minor)
 
NS16550_STATIC int ns16550_assert_DTR (int minor)
 
NS16550_STATIC int ns16550_negate_DTR (int minor)
 
NS16550_STATIC void ns16550_initialize_interrupts (int minor)
 
NS16550_STATIC void ns16550_cleanup_interrupts (int minor)
 
NS16550_STATIC ssize_t ns16550_write_support_int (int minor, const char *buf, size_t len)
 Transmits up to len characters from buf.
 
NS16550_STATIC ssize_t ns16550_write_support_polled (int minor, const char *buf, size_t len)
 
int ns16550_inbyte_nonblocking_polled (int minor)
 
NS16550_STATIC void ns16550_enable_interrupts (console_tbl *c, int mask)
 
NS16550_STATIC int ns16550_set_attributes (int minor, const struct termios *t)
 
void ns16550_outch_polled (console_tbl *c, char out)
 Polled write for NS16550.
 
int ns16550_inch_polled (console_tbl *c)
 

Variables

const console_flow ns16550_flow_RTSCTS
 
const console_flow ns16550_flow_DTRCTS
 
const console_fns ns16550_fns
 
const console_fns ns16550_fns_polled
 

Detailed Description

This file contains the TTY driver for the National Semiconductor NS16550.

This part is widely cloned and second sourced. It is found in a number of "Super IO" controllers.

This driver uses the termios pseudo driver.

Function Documentation

◆ ns16550_write_support_int()

ssize_t ns16550_write_support_int ( int  minor,
const char *  buf,
size_t  len 
)

Transmits up to len characters from buf.

This routine is invoked either from task context with disabled interrupts to start a new transmission process with exactly one character in case of an idle output state or from the interrupt handler to refill the transmitter.

Returns always zero.

Variable Documentation

◆ ns16550_flow_DTRCTS

const console_flow ns16550_flow_DTRCTS
Initial value:
= {
ns16550_negate_DTR,
ns16550_assert_DTR
}

◆ ns16550_flow_RTSCTS

const console_flow ns16550_flow_RTSCTS
Initial value:
= {
ns16550_negate_RTS,
ns16550_assert_RTS
}

◆ ns16550_fns

const console_fns ns16550_fns
Initial value:
= {
libchip_serial_default_probe,
ns16550_open,
ns16550_close,
NULL,
ns16550_init,
ns16550_write_polled,
ns16550_set_attributes,
true
}
NS16550_STATIC ssize_t ns16550_write_support_int(int minor, const char *buf, size_t len)
Transmits up to len characters from buf.
Definition: ns16550.c:660

◆ ns16550_fns_polled

const console_fns ns16550_fns_polled
Initial value:
= {
libchip_serial_default_probe,
ns16550_open,
ns16550_close,
ns16550_inbyte_nonblocking_polled,
ns16550_write_support_polled,
ns16550_init,
ns16550_write_polled,
ns16550_set_attributes,
false
}