summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/netlist/devices/nld_ne555.h
blob: 487e8d33789d45c6a57bb719d917f609e529e554 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// license:GPL-2.0+
// copyright-holders:Couriersud
/*
 * nld_NE555.h
 *
 *  NE555: PRECISION TIMERS
 *
 *          +--------+
 *      GND |1  ++  8| VCC
 *     TRIG |2      7| DISCH
 *      OUT |3      6| THRES
 *    RESET |4      5| CONT
 *          +--------+
 *
 *  Naming conventions follow Texas Instruments datasheet
 *
 */

#ifndef NLD_NE555_H_
#define NLD_NE555_H_

#include "../nl_base.h"
#include "nld_twoterm.h"

#define NETDEV_NE555(_name)                                                        \
		NET_REGISTER_DEV(NE555, _name)
NETLIB_DEVICE(NE555,
	NETLIB_NAME(R) m_R1;
	NETLIB_NAME(R) m_R2;
	NETLIB_NAME(R) m_R3;
	NETLIB_NAME(R) m_RDIS;

	netlist_logic_input_t m_RESET;
	netlist_analog_input_t m_THRES;
	netlist_analog_input_t m_TRIG;
	netlist_analog_output_t m_OUT;

	bool m_last_out;

	double clamp(const double v, const double a, const double b);

);



#endif /* NLD_NE555_H_ */