Changes between Version 6 and Version 7 of Component/Vci Multi Tty


Ignore:
Timestamp:
Jan 4, 2008, 12:37:31 PM (16 years ago)
Author:
Nicolas Pouillon
Comment:

soclib_io

Legend:

Unmodified
Added
Removed
Modified
  • Component/Vci Multi Tty

    v6 v7  
    2424Each TTY controller contains 3 memory mapped registers:
    2525
    26  * `TTY_WRITE`: ADDRESS![3:0] = 0x0
     26 * `TTY_WRITE`
    2727This 8 bits pseudo-register is write only.
    2828Any write request will interpret the 8 LSB bits of the WDATA field
    2929as an ASCII character, and this character will be displayed on the addressed terminal.
    3030
    31  * `TTY_STATUS`: ADDRESS![3:0] = 0x4
     31 * `TTY_STATUS`
    3232This Boolean status register is read-only.
    3333A read request returns the zero value if there is no pending character.
    3434It returns a non zero value if there is a pending character in the keyboard buffer.
    3535
    36  * `TTY_READ`: ADDRESS![3:0] = 0x8
     36 * `TTY_READ`
    3737This 8 bits register contains one single ASCII character.
    3838This register is read-only. A read request returns the ACSII character
     
    5454static inline void putc(const size_t term_no, const char x)
    5555{
    56     volatile int *tty = ((int*)tty_address) + term_no*TTY_SPAN;
    57     tty[TTY_WRITE] = x;
     56    soclib_io_set( tty_address, term_no*TTY_SPAN + TTY_WRITE, x );
    5857}
    5958
    6059static inline char getc(const size_t term_no)
    6160{
    62     volatile int *tty = ((int*)tty_address) + term_no*TTY_SPAN;
    63     return tty[TTY_READ];
     61    return soclib_io_get( tty_address, term_no*TTY_SPAN + TTY_READ );
    6462}
    6563}}}