/**
 * @file printer.h
 * @brief Header file for printer.c
 * 
 */

#ifndef _PRINTER_H_
#define _PRINTER_H_

#include "sys.h"


/**
 * @name Printer addresses
 * 
 * Note that the virtual address is different from
 * the physical position of the device. First three bits of the virtual address
 * are used to select the operation mode. The kseg1 mode (first three bits are
 * 101) is the most important for us - the physical address is calculated by
 * subtracting 0xa0000000 form the virtual address and all operations
 * are unmapped and uncached. This is important to all memory-mapped registers.
 * 
 * @{
 */
#define PRINTER_PHYSICAL_ADDRESS	0x01000000
#define PRINTER_ADDRESS			(PRINTER_PHYSICAL_ADDRESS | OM_KSEG1)
/** }@ */

/**
 * @brief Writes a character directly into the printer register
 * @param c - char to put
 * 
 */
#define def_putc(c) \
		*((volatile char *) PRINTER_ADDRESS) = (c);


void print (const char *s);


#endif /* _PRINTER_H_ */
