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
57 class cl_address_space *sfr;
59 class cl_it_src *exf2it;
60 t_mem mask_RCLK, mask_TCLK, mask_CP_RL2;
61 t_mem RCLK, TCLK, CP_RL2, EXEN2;
63 class cl_memory_cell *cell_rcap2l, *cell_rcap2h, *cell_t2mod;
64 bool bit_dcen, bit_t2oe, bit_t2ex;
66 cl_timer2(class cl_uc *auc, int aid, char *aid_string, int afeautres);
67 virtual int init(void);
69 virtual void added_to_uc(void);
70 //virtual void new_hw_added(class cl_hw *new_hw);
72 //virtual ulong read(class cl_mem *mem, long addr);
73 virtual void write(class cl_memory_cell *cell, t_mem *val);
75 //virtual void mem_cell_changed(class cl_mem *mem, t_addr addr);
77 virtual int tick(int cycles);
78 virtual int do_t2_baud(int cycles);
79 virtual void do_t2_capture(int cycles);
80 virtual void do_t2_reload(int cycles);
81 virtual void do_t2_down(int cycles);
82 virtual void do_t2_clock_out(int cycles);
83 virtual void happen(class cl_hw *where, enum hw_event he, void *params);
85 virtual void print_info(class cl_console *con);
91 /* End of s51.src/timer2cl.h */