Pixel graphics version of new logo created by Benedikt Freisen, as used for SourceFor...
[sdcc.git] / sdcc / sim / ucsim / src / sims / pdk.src / wdtcl.h
blob8467ff92540efd1bd5b361bb490cf7f14104d1a8
1 /*
2 * Simulator of microcontrollers (wdtcl.h)
4 * Copyright (C) 2024 Drotos Daniel
5 *
6 * To contact author send email to dr.dkdb@gmail.com
8 */
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
25 02111-1307, USA. */
26 /*@1@*/
28 #ifndef WDTCL_HEADER
29 #define WDTCL_HEADER
31 #include "hwcl.h"
33 #include "pdkcl.h"
36 enum wdt_cfg {
37 wdt_on = 0,
38 wdt_cnt = 1,
39 wdt_nuof = 2
42 class cl_wdt: public cl_hw
44 public:
45 bool run;
46 class cl_pdk *puc;
47 class cl_memory_cell *mod, *misc;
48 t_mem cnt;
49 t_mem len;
50 u32_t last;
51 public:
52 cl_wdt(class cl_uc *auc, const char *aname);
53 virtual int init(void);
54 virtual unsigned int cfg_size(void) { return wdt_nuof; }
55 virtual const char *cfg_help(t_addr addr);
56 virtual void reset(void);
57 virtual void recalc(void);
58 virtual void set_len(void);
59 virtual void clear(void) { cnt= 0; }
60 virtual void write(class cl_memory_cell *cell, t_mem *val);
61 virtual t_mem conf_op(cl_memory_cell *cell, t_addr addr, t_mem *val);
62 virtual int tick(int cycles);
63 virtual void print_info(class cl_console_base *con);
67 #endif
69 /* End of pdk.src/wdtcl.h */