Changeset 758 for trunk/softs/tsar_boot/drivers
- Timestamp:
- Jul 24, 2014, 3:19:18 PM (10 years ago)
- Location:
- trunk/softs/tsar_boot/drivers
- Files:
-
- 9 added
- 6 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/softs/tsar_boot/drivers/reset_tty.c
r757 r758 2 2 * \file reset_tty.c 3 3 * \date 5 mars 2014 4 * \author Cesar Fuguet 4 * \author Cesar Fuguet 5 5 * 6 * Minimal driver for TTY controler 6 * Minimal driver for TTY controler 7 7 *******************************************************************/ 8 8 … … 11 11 #include <defs.h> 12 12 13 #ifndef SEG_TTY_BASE 14 # error "SEG_TTY_BASE constant must be defined in the hard_config.h file" 15 #endif 16 17 static int* const tty_address = (int* const)SEG_TTY_BASE; 18 19 enum tty_registers { 20 TTY_WRITE = 0, 21 TTY_STATUS = 1, 22 TTY_READ = 2, 23 TTY_CONFIG = 3, 24 25 TTY_SPAN = 4, 26 }; 27 13 28 /////////////////////// 14 29 int reset_getc(char *c) 15 30 { 16 unsigned int* tty_address = (unsigned int*) TTY_PADDR_BASE;17 18 31 if (ioread32( &tty_address[TTY_STATUS] ) == 0) return 0; 19 32 *c = ioread32( &tty_address[TTY_READ] ); … … 24 37 void reset_putc(const char c) 25 38 { 26 unsigned int* tty_address = (unsigned int*) TTY_PADDR_BASE;27 28 39 iowrite32( &tty_address[TTY_WRITE], (unsigned int)c ); 29 40 if (c == '\n') reset_putc( '\r' ); … … 31 42 32 43 /////////////////////////////////// 33 void reset_puts(const char *buffer) 44 void reset_puts(const char *buffer) 34 45 { 35 46 unsigned int n; … … 40 51 reset_putc(buffer[n]); 41 52 } 42 } 53 } 43 54 44 55 ///////////////////////////////// … … 54 65 55 66 for ( c = 0 ; c < 8 ; c++ ) 56 { 67 { 57 68 buf[9-c] = HexaTab[val&0xF]; 58 69 val = val >> 4; -
trunk/softs/tsar_boot/drivers/reset_tty.h
r757 r758 1 1 #ifndef RESET_TTY_H 2 2 #define RESET_TTY_H 3 4 # include <tty.h>5 3 6 4 void reset_exit();
Note: See TracChangeset
for help on using the changeset viewer.