2 * Simulator of microcontrollers (timer2cl.h)
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
28 #ifndef TIMER2CL_HEADER
29 #define TIMER2CL_HEADER
40 #define T2MODE_RELOAD 0
41 #define T2MODE_CAPTURE 1
42 #define T2MODE_BAUDRATE 2
45 #define T2MODE_CLKOUT 5
54 class cl_timer2: public cl_timer0
58 class cl_it_src *exf2it;
59 t_mem mask_RCLK, mask_TCLK, mask_CP_RL2;
60 t_mem RCLK, TCLK, CP_RL2, EXEN2;
62 class cl_cell *cell_rcap2l, *cell_rcap2h, *cell_t2mod;
63 bool bit_dcen, bit_t2oe, bit_t2ex;
65 cl_timer2(class cl_uc *auc, int aid, char *aid_string, int afeautres);
66 virtual int init(void);
68 virtual void added_to_uc(void);
69 //virtual void new_hw_added(class cl_hw *new_hw);
71 //virtual ulong read(class cl_mem *mem, long addr);
72 virtual void write(class cl_cell *cell, t_mem *val);
74 //virtual void mem_cell_changed(class cl_mem *mem, t_addr addr);
76 virtual int tick(int cycles);
77 virtual int do_t2_baud(int cycles);
78 virtual void do_t2_capture(int cycles);
79 virtual void do_t2_reload(int cycles);
80 virtual void do_t2_down(int cycles);
81 virtual void do_t2_clock_out(int cycles);
82 virtual void happen(class cl_hw *where, enum hw_event he, void *params);
84 virtual void print_info(class cl_console *con);
90 /* End of s51.src/timer2cl.h */