From 81ad17d2164523859d14464b9950a39f87e04937 Mon Sep 17 00:00:00 2001 From: Bernard Blackham Date: Tue, 12 Aug 2003 07:56:24 +0000 Subject: [PATCH] Beginnings of 16550 code --- ROM2/16550.c | 6 ++++++ ROM2/16550.h | 24 ++++++++++++++++++++++++ ROM2/Makefile | 6 ++++-- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 ROM2/16550.c create mode 100644 ROM2/16550.h diff --git a/ROM2/16550.c b/ROM2/16550.c new file mode 100644 index 0000000..c29e9dd --- /dev/null +++ b/ROM2/16550.c @@ -0,0 +1,6 @@ + +#include "16550.h" +#include "vend.h" + + + diff --git a/ROM2/16550.h b/ROM2/16550.h new file mode 100644 index 0000000..e7e0263 --- /dev/null +++ b/ROM2/16550.h @@ -0,0 +1,24 @@ +#ifndef _16550_H_ +#define _16550_H_ + +#include "vend.h" + +/* Must be accessed with DLAB low */ +#define UART_RX_BUF 0x00 /* read */ +#define UART_TX_BUF 0x00 /* write */ +#define UART_INT_ENABLE 0x01 +#define UART_INT_IDENT 0x02 /* read */ +#define UART_FIFO_CTL 0x02 /* write */ +#define UART_LINE_CTL 0x03 +#define UART_MODEM_CTL 0x04 +#define UART_LINE_STATUS 0x05 +#define UART_MODEM_STATUS 0x06 +#define UART_SCRATCH 0x07 + +/* Same addresses as above, but accessed with DLAB high */ +#define UART_DLAB_LSB 0x00 +#define UART_DLAB_MSB 0x01 + +extern volatile u8 _uart_regs[]; /* UART registers - fixed at link time */ + +#endif /* _16550_H_ */ diff --git a/ROM2/Makefile b/ROM2/Makefile index b023d7d..58e78bd 100644 --- a/ROM2/Makefile +++ b/ROM2/Makefile @@ -1,7 +1,8 @@ # muchly stolen from m68hc1x's example.tar.gz's Makefile OBJS = \ - motors.o keypad.o display_basic.o coinmech.o chime.o helpers.o server.o main_basic.o \ + motors.o keypad.o display_basic.o coinmech.o chime.o \ + helpers.o server.o 16550.o main_basic.o \ vectors.o INCLUDES = vend.h keypad.h chime.h asm.h display_basic.h ports.h types.h @@ -15,7 +16,8 @@ LDFLAGS = -m68hc11 -mshort -Wl,-m,m68hc11elfb \ -Wl,-defsym,_misc_input=0x2000 \ -Wl,-defsym,_home_sensors=0x2800 \ -Wl,-defsym,_changer_output=0x3000 \ - -Wl,-defsym,_misc_output=0x3800 + -Wl,-defsym,_misc_output=0x3800 \ + -Wl,-defsym,_uart_regs=0x4000 OBJCOPY_FLAGS=--only-section=.text \ --only-section=.rodata \ -- 2.20.1