+/*
+ * functions
+ */
+
+void mmap_init(u8 memtype) {
+
+ MEMMAP=memtype;
+}
+
+void uart0_init(void) {
+
+ PINSEL0=0x05; // pin select -> tx, rx
+ UART0_FCR=0x07; // enable fifo
+ UART0_LCR=0x83; // set dlab + word length
+ UART0_DLL=0x10; // br: 9600 @ 10/4 mhz
+ UART0_DLM=0x00;
+ UART0_LCR=0x03; // unset dlab
+}
+
+void uart0_send_string(char *txbuf) {
+
+ int i;
+
+ i=0;
+
+ while(txbuf[i])
+ UART0_THR=txbuf[i++];
+ UART0_THR='\n';
+ UART0_THR='\r';
+
+ while(!(UART0_LSR&(1<<6))) {}
+}
+
+void uart0_send_char(char send) {
+
+ while(!(UART0_LSR&(1<<5)))
+ continue;
+
+ UART0_THR=send;
+}
+