From: Bernard Blackham Date: Tue, 12 Aug 2003 07:56:24 +0000 (+0000) Subject: Beginnings of 16550 code X-Git-Tag: ROMW~70 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=81ad17d2164523859d14464b9950a39f87e04937;p=uccvend-snackrom.git Beginnings of 16550 code --- 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 \