RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
bsps
include
libchip
ns16550.h
Go to the documentation of this file.
1
5
6
/*
7
* COPYRIGHT (c) 1998 by Radstone Technology
8
*
9
* THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
10
* KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
11
* IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
12
* AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
13
*
14
* You are hereby granted permission to use, copy, modify, and distribute
15
* this file, provided that this notice, plus the above copyright notice
16
* and disclaimer, appears in all copies. Radstone Technology will provide
17
* no support for this code.
18
*
19
* COPYRIGHT (c) 1989-2012.
20
* On-Line Applications Research Corporation (OAR).
21
*
22
* The license and distribution terms for this file may be
23
* found in the file LICENSE in this distribution or at
24
* http://www.rtems.org/license/LICENSE.
25
*/
26
27
#ifndef _NS16550_H_
28
#define _NS16550_H_
29
30
#include <
rtems/termiostypes.h
>
31
#include <
libchip/serial.h
>
32
33
#ifdef __cplusplus
34
extern
"C"
{
35
#endif
36
37
/*
38
* Driver function table
39
*/
40
41
extern
const
console_fns ns16550_fns;
42
extern
const
console_fns ns16550_fns_polled;
43
44
/*
45
* Flow control function tables
46
*/
47
48
extern
const
console_flow ns16550_flow_RTSCTS;
49
extern
const
console_flow ns16550_flow_DTRCTS;
50
51
/*
52
* Helpers for printk
53
*/
54
void
ns16550_outch_polled
(console_tbl *c,
char
out);
55
int
ns16550_inch_polled(console_tbl *c);
56
57
/* Alternative NS16550 driver using the Termios device context */
58
59
typedef
uint8_t (*ns16550_get_reg)(uintptr_t port, uint8_t reg);
60
61
typedef
void (*ns16550_set_reg)(uintptr_t port, uint8_t reg, uint8_t value);
62
63
typedef
struct
ns16550_context
ns16550_context
;
64
65
typedef
uint32_t (*ns16550_calculate_baud_divisor)(
ns16550_context
*ctx, uint32_t baud);
66
67
struct
ns16550_context
{
68
rtems_termios_device_context
base;
69
ns16550_get_reg get_reg;
70
ns16550_set_reg set_reg;
71
uintptr_t port;
72
rtems_vector_number
irq;
73
uint32_t clock;
74
uint32_t initial_baud;
75
bool
has_fractional_divider_register;
76
bool
has_precision_clock_synthesizer;
77
uint8_t modem_control;
78
uint8_t line_control;
79
uint32_t baud_divisor;
80
size_t
out_total;
81
size_t
out_remaining;
82
size_t
out_current;
83
const
char
*out_buf;
84
rtems_termios_tty
*tty;
85
ns16550_calculate_baud_divisor calculate_baud_divisor;
86
};
87
88
extern
const
rtems_termios_device_handler
ns16550_handler_interrupt;
89
extern
const
rtems_termios_device_handler
ns16550_handler_polled;
90
extern
const
rtems_termios_device_handler
ns16550_handler_task;
91
92
extern
const
rtems_termios_device_flow
ns16550_flow_rtscts;
93
extern
const
rtems_termios_device_flow
ns16550_flow_dtrcts;
94
95
void
ns16550_polled_putchar
(
rtems_termios_device_context
*base,
char
out);
96
97
int
ns16550_polled_getchar(
rtems_termios_device_context
*base);
98
99
bool
ns16550_probe(
rtems_termios_device_context
*base);
100
101
#ifdef __cplusplus
102
}
103
#endif
104
105
#endif
/* _NS16550_H_ */
rtems_vector_number
ISR_Vector_number rtems_vector_number
This integer type represents interrupt vector numbers.
Definition
intr.h:102
ns16550_outch_polled
void ns16550_outch_polled(console_tbl *c, char out)
Polled write for NS16550.
Definition
ns16550.c:348
ns16550_polled_putchar
void ns16550_polled_putchar(rtems_termios_device_context *base, char out)
Polled write for NS16550.
Definition
ns16550-context.c:500
serial.h
The generic libchip serial driver interface.
ns16550_context
Definition
ns16550.h:67
rtems_termios_device_context
Termios device context.
Definition
termiosdevice.h:68
rtems_termios_device_flow
Termios device flow control handler.
Definition
termiosdevice.h:207
rtems_termios_device_handler
Termios device handler.
Definition
termiosdevice.h:100
rtems_termios_tty
Definition
termiostypes.h:94
termiostypes.h
Generated by
1.18.0