Main Page   Modules   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

TTY component


Functions

void TTY_setcontty (int whichtty)
 selects the console TTY TTY =0 is the SCI interface TTY =1 is the DUART channel A TTY =1 is the DUART channel B. More...

void TTY_conecho_on ()
 enables echo of input characters on the console tty. More...

void TTY_conecho_off ()
 disables echo of input characters on the console tty. More...

int TTY_setbps (struct TTY_tty_dev *tty, int bps)
 sets the connection speed on tty to bps. More...

void TTY_setmode (struct TTY_tty_dev *tty, char mode)
 Sets tty into mode. More...

char TTY_getmode (struct TTY_tty_dev *tty)
 returns the current mode of tty. More...

char TTY_getstate (struct TTY_tty_dev *tty)
 returns the current state of tty. More...

char TTY_readchar (struct TTY_tty_dev *tty)
 reads one character of tty. More...

void TTY_writechar (struct TTY_tty_dev *tty, char byte)
 writes one character to tty. More...

char TTY_inchar (void)
 reads one character from the current console The function returns the character read. In nonblocking mode, it returns a 0 if there is no character in the queue. More...

void TTY_soutchar (char byte)
 writes one character to the current console tty without blocking interrupts This function should be used with caution, it is usefull to print from an ISR. More...

void TTY_init (void)
 initializes all TTYs in the system. This function is normally called from the crt0.s startup file. More...

void TTY_outchar (char byte)

Variables

char _TTY_console_echo
 internal console echo state. More...

int _TTY_contty
 internal console tty pointer. More...


Detailed Description

This component contains all serial IO related code. It contains initalisation, tty driver interfaces and generic API functions.

Function Documentation

void TTY_conecho_off  
 

disables echo of input characters on the console tty.

Definition at line 68 of file ttyio.c.

References _TTY_console_echo.

void TTY_conecho_on  
 

enables echo of input characters on the console tty.

Definition at line 60 of file ttyio.c.

References _TTY_console_echo.

Referenced by DUART_duart, and TTY_init.

char TTY_getmode struct TTY_tty_dev   tty
 

returns the current mode of tty.

Parameters:
tty  is the tty of which the mode is read For a definition of the MODE constants, see TTY_setmode()

Definition at line 108 of file ttyio.c.

References TTY_tty_dev::mode.

char TTY_getstate struct TTY_tty_dev   tty
 

returns the current state of tty.

Parameters:
tty  is the tty of which the state is read The following state constants are defined, the state is a bitwise or of these
TTY_STATE_RXEMPTY is set whenever there is no character to be read from the inbound queue. TTY_STATE_TXFULL is set whenever there is no room for another character in the outbound queue.

Definition at line 121 of file ttyio.c.

References TTY_tty_dev::state.

char TTY_inchar void   
 

reads one character from the current console The function returns the character read. In nonblocking mode, it returns a 0 if there is no character in the queue.

Definition at line 222 of file ttyio.c.

References _TTY_contty, disable, enable, ERR_PANIC, KERN_complain, and TTY_outchar.

Referenced by _LIBC_inbyte.

void TTY_init void   
 

initializes all TTYs in the system. This function is normally called from the crt0.s startup file.

Definition at line 296 of file ttyio.c.

References TTY_tty_dev::break_process, BUFLEN, TTY_tty_dev::char_process, TTY_tty_dev::dis_rx_irq, TTY_tty_dev::dis_tx_irq, DUART_duart, dummy, TTY_tty_dev::en_rx_irq, TTY_tty_dev::en_tx_irq, TTY_tty_dev::hsmode, TTY_tty_dev::inq, iobuf_init, TTY_tty_dev::mode, TTY_tty_dev::outq, QSM_sciinit, TTY_tty_dev::setbps, TTY_tty_dev::sethandshake, TTY_tty_dev::setrts, TTY_tty_dev::state, TTY_conecho_on, TTY_HS_NONE, TTY_setcontty, and TTY_tty_dev::txchar.

void TTY_outchar char    byte
 

char TTY_readchar struct TTY_tty_dev   tty
 

reads one character of tty.

Parameters:
tty  is the tty of which a character is read The function returns the character read. In nonblocking mode, it returns a 0 if there is no character in the queue.

Definition at line 133 of file ttyio.c.

References iobuf::buflen, iobuf::cnt, iobuf::data, disable, enable, ERR_PANIC, TTY_tty_dev::hsmode, TTY_tty_dev::inq, KERN_complain, TTY_tty_dev::mode, TTY_tty_dev::setrts, TTY_tty_dev::state, iobuf::tail, TTY_HS_RTSCTS, TTY_MODE_RXBLOCKING, TTY_RTS_TRESHOLD, and TTY_STATE_RXEMPTY.

int TTY_setbps struct TTY_tty_dev   tty,
int    bps
 

sets the connection speed on tty to bps.

Parameters:
tty  is the tty of which the connections speed is to be set
bps  is the bits-per-second-rate to be set. Depending on the TTY, different baud rates are possible, normally, 300 - 57600 bps are supportet in the usual stepping

Definition at line 81 of file ttyio.c.

References TTY_tty_dev::setbps.

void TTY_setcontty int    whichtty
 

selects the console TTY TTY =0 is the SCI interface TTY =1 is the DUART channel A TTY =1 is the DUART channel B.

Parameters:
whichtty  is the TTY number to be console

Definition at line 52 of file ttyio.c.

References _TTY_contty.

void TTY_setmode struct TTY_tty_dev   tty,
char    mode
 

Sets tty into mode.

Parameters:
tty  is the tty of which the mode is to be changed
mode  is the mode parameter. It is a bitwise or of the TTY_MODE constants. The following TTY_MODE constants are defined, but not all TTYs support all modes.
TTY_MODE_RXBLOCKING makes all TTY_readchar calls blocking until a char arrives TTY_MODE_TXBLOCKING makes all TTY_writechar calls blocking until there is room in the outbound queue TTY_MODE_TXUNBUF disables transmit interrupt processing and directly sends chars via the TX register of the device. TTY_MODE_RSM redirects all incomming chars to the radio state machine (see RSM component)

Definition at line 97 of file ttyio.c.

References TTY_tty_dev::mode.

void TTY_soutchar char    byte
 

writes one character to the current console tty without blocking interrupts This function should be used with caution, it is usefull to print from an ISR.

Definition at line 245 of file ttyio.c.

References _TTY_contty.

Referenced by KERN_exphandler, and TTY_outchar.

void TTY_writechar struct TTY_tty_dev   tty,
char    byte
 

writes one character to tty.

Parameters:
tty  is the tty to which a character is written

Definition at line 170 of file ttyio.c.

References iobuf::buflen, iobuf::cnt, iobuf::data, TTY_tty_dev::dis_tx_irq, disable, TTY_tty_dev::en_tx_irq, enable, iobuf::head, TTY_tty_dev::mode, TTY_tty_dev::outq, TTY_tty_dev::state, iobuf::tail, TTY_MODE_TXBLOCKING, TTY_MODE_TXUNBUF, TTY_STATE_TXFULL, and TTY_tty_dev::txchar.


Variable Documentation

char _TTY_console_echo
 

internal console echo state.

For internal use only.

Definition at line 36 of file ttyio.c.

Referenced by TTY_conecho_off, and TTY_conecho_on.

int _TTY_contty
 

internal console tty pointer.

For internal use only.

Definition at line 42 of file ttyio.c.

Referenced by TTY_inchar, TTY_outchar, TTY_setcontty, and TTY_soutchar.


Generated on Thu Feb 20 15:39:02 2003 for cubeOS by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002