source: soft/giet_vm/giet_drivers/tty_driver.h @ 496

Last change on this file since 496 was 496, checked in by alain, 9 years ago

1) Introduce access functions to MMC intrumentation registers.
2) Use _printf for error or debug messages.

File size: 2.6 KB
Line 
1///////////////////////////////////////////////////////////////////////////////////
2// File     : tty_driver.h
3// Date     : 01/11/2013
4// Author   : alain greiner
5// Copyright (c) UPMC-LIP6
6///////////////////////////////////////////////////////////////////////////////////
7// The tty_driver.c and tty_drivers.h files are part ot the GIET-VM kernel.
8// This driver supports the SocLib vci_multi_tty component.
9//
10// The total number of TTY terminals must be defined by the configuration
11// parameter NB_TTY_CHANNELS in the hard_config.h file.
12//
13// The "system" terminal is TTY[0].
14// The "user" TTYs are allocated to applications requesting it.
15//
16// The SEG_TTY_BASE address must be defined in the hard_config.h file.
17//
18// All physical accesses to device registers are done by the two
19// _tty_get_register(), _tty_set_register() low-level functions,
20// that are handling virtual / physical addressing.
21///////////////////////////////////////////////////////////////////////////////////
22
23#ifndef _GIET_TTY_DRIVERS_H_
24#define _GIET_TTY_DRIVERS_H_
25
26#include "hard_config.h"
27#include "kernel_locks.h"
28
29///////////////////////////////////////////////////////////////////////////////////
30//                     registers offsets
31///////////////////////////////////////////////////////////////////////////////////
32
33enum TTY_registers
34{
35    TTY_WRITE   = 0,
36    TTY_STATUS  = 1,
37    TTY_READ    = 2,
38    TTY_CONFIG  = 3,
39    /**/
40    TTY_SPAN    = 4,
41};
42
43//////////////////////////////////////////////////////////////////////////////////
44//                    access functions
45//////////////////////////////////////////////////////////////////////////////////
46
47extern unsigned int _tty_get_register( unsigned int channel,
48                                       unsigned int index );
49
50extern void _tty_set_register( unsigned int channel,
51                               unsigned int index,
52                               unsigned int value );
53
54extern void _tty_init( unsigned int channel );
55
56//////////////////////////////////////////////////////////////////////////////////
57//                 Interrupt Service Routine
58///////////////////////////////////////////////////////////////////////////////////
59
60extern void _tty_rx_isr( unsigned int irq_type,
61                         unsigned int irq_id,
62                         unsigned int channel );
63
64extern void _tty_tx_isr( unsigned int irq_type,
65                         unsigned int irq_id,
66                         unsigned int channel );
67
68
69#endif
70
71// Local Variables:
72// tab-width: 4
73// c-basic-offset: 4
74// c-file-offsets:((innamespace . 0)(inline-open . 0))
75// indent-tabs-mode: nil
76// End:
77// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
78
Note: See TracBrowser for help on using the repository browser.