amiga_boottest
annotate src/serial.h @ 4:995d42b33974
serial output
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 23 Feb 2018 13:29:37 +0200 |
parents | |
children |
rev | line source |
---|---|
nuclear@4 | 1 #ifndef SERIAL_H_ |
nuclear@4 | 2 #define SERIAL_H_ |
nuclear@4 | 3 |
nuclear@4 | 4 #include "hwregs.h" |
nuclear@4 | 5 |
nuclear@4 | 6 /* dff030 is REG_SERDAT |
nuclear@4 | 7 * dff018 is REG_SERDATR |
nuclear@4 | 8 * bit 13 of SERDATR is TBE (transmit buffer empty) |
nuclear@4 | 9 */ |
nuclear@4 | 10 #define ser_putchar(c) \ |
nuclear@4 | 11 asm volatile( \ |
nuclear@4 | 12 "or.w #0x100, %0\n\t" \ |
nuclear@4 | 13 "0: btst #13, 0xdff018\n\t" \ |
nuclear@4 | 14 "beq 0b\n\t" \ |
nuclear@4 | 15 "move.w %0, 0xdff030\n\t" \ |
nuclear@4 | 16 :: "d"((int16_t)c)) |
nuclear@4 | 17 |
nuclear@4 | 18 void ser_init(int baud); |
nuclear@4 | 19 void ser_print(const char *s); |
nuclear@4 | 20 |
nuclear@4 | 21 #endif /* SERIAL_H_ */ |