2 * Simulator of microcontrollers (serial.cc)
4 * Copyright (C) 1999,99 Drotos Daniel, Talker Bt.
6 * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
10 /* This file is part of microcontroller simulator: ucsim.
12 UCSIM is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 UCSIM is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with UCSIM; see the file COPYING. If not, write to the Free
24 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
32 cl_serial::cl_serial(class cl_uc *auc):
33 cl_hw(auc, HW_UART, 0, "uart")
43 cl_serial::print_info(class cl_console *con)
45 char *modes[]= { "Shift, fixed clock",
46 "8 bit UART timer clocked",
47 "9 bit UART fixed clock",
48 "9 bit UART timer clocked" };
49 int scon= uc->get_mem(MEM_SFR, SCON);
51 con->printf("%s[%d]", id_string, id);
52 int mode= (scon&(bmSM0|bmSM1))>>6;
53 con->printf(" %s MultiProc=%s", modes[mode],
54 (mode&2)?((scon&bmSM2)?"ON":"OFF"):"none");
55 con->printf(" irq=%s", (uc->get_mem(MEM_SFR, IE)&bmES)?"en":"dis");
56 con->printf(" prio=%d", uc->it_priority(bmPS));
59 con->printf("Receiver");
60 con->printf(" %s", (scon&bmREN)?"ON":"OFF");
61 con->printf(" RB8=%c", (scon&bmRB8)?'1':'0');
62 con->printf(" irq=%c", (scon&bmRI)?'1':'0');
65 con->printf("Transmitter");
66 con->printf(" TB8=%c", (scon&bmTB8)?'1':'0');
67 con->printf(" irq=%c", (scon&bmTI)?'1':'0');
72 /* End of s51.src/serial.cc */