diff options
author | Couriersud <couriersud@users.noreply.github.com> | 2013-12-17 18:41:06 +0000 |
---|---|---|
committer | Couriersud <couriersud@users.noreply.github.com> | 2013-12-17 18:41:06 +0000 |
commit | 309af6d61fe0d498cbe53cc6732521b3fa2be88e (patch) | |
tree | 24c4936a1c73d509496028362c5cafacff333305 /src | |
parent | b68fc6c79144aa2ec7c3b3a7334e85f2e0b354be (diff) |
Following a recommendation by smf removing files with capitals in them. These will be added again in a couple of minutes.
Diffstat (limited to 'src')
-rw-r--r-- | src/emu/netlist/devices/nld_NE555.c | 82 | ||||
-rw-r--r-- | src/emu/netlist/devices/nld_NE555.h | 47 |
2 files changed, 0 insertions, 129 deletions
diff --git a/src/emu/netlist/devices/nld_NE555.c b/src/emu/netlist/devices/nld_NE555.c deleted file mode 100644 index 54a5debd4cd..00000000000 --- a/src/emu/netlist/devices/nld_NE555.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * nld_NE555.c - * - */ - -#include "nld_NE555.h" -#include "../nl_setup.h" - -#define R_OFF (1E20) -#define R_ON (1) - -inline double NETLIB_NAME(NE555)::clamp(const double v, const double a, const double b) -{ - double ret = v; - double vcc = TERMANALOG(m_R1.m_P); - - if (ret > vcc - a) - ret = vcc - a; - if (ret < b) - ret = b; - return ret; -} - -NETLIB_START(NE555) -{ - - register_sub(m_R1, "R1"); - register_sub(m_R2, "R2"); - register_sub(m_R3, "R3"); - register_sub(m_RDIS, "RDIS"); - - register_subalias("GND", m_R3.m_N); // Pin 1 - register_input("TRIG", m_TRIG); // Pin 2 - register_output("OUT", m_OUT); // Pin 3 - register_input("RESET", m_RESET); // Pin 4 - register_subalias("CONT", m_R1.m_N); // Pin 5 - register_input("THRESH", m_THRES); // Pin 6 - register_subalias("DISCH", m_RDIS.m_P); // Pin 7 - register_subalias("VCC", m_R1.m_P); // Pin 8 - - m_R1.set_R(5000); - m_R2.set_R(5000); - m_R3.set_R(5000); - m_RDIS.set_R(R_OFF); - - m_setup->connect(m_R1.m_N, m_R2.m_P); - m_setup->connect(m_R2.m_N, m_R3.m_P); - m_setup->connect(m_RDIS.m_N, m_R3.m_N); - - m_last_out = false; -} - -NETLIB_UPDATE(NE555) -{ - // FIXME: assumes GND is connected to 0V. - - double vt = clamp(TERMANALOG(m_R2.m_P), 0.7, 1.4); - bool bthresh = (INPANALOG(m_THRES) > vt); - bool btrig = (INPANALOG(m_TRIG) > clamp(TERMANALOG(m_R2.m_N), 0.7, 1.4)); - bool out = m_last_out; - - if (!btrig) - { - out = true; - } - else if (bthresh) - { - out = false; - } - - if (!m_last_out && out) - { - OUTANALOG(m_OUT, TERMANALOG(m_R1.m_P), NLTIME_FROM_NS(100)); - m_RDIS.set_R(R_OFF); - } - else if (m_last_out && !out) - { - OUTANALOG(m_OUT, TERMANALOG(m_R3.m_N), NLTIME_FROM_NS(100)); - m_RDIS.set_R(R_ON); - } - m_last_out = out; -} diff --git a/src/emu/netlist/devices/nld_NE555.h b/src/emu/netlist/devices/nld_NE555.h deleted file mode 100644 index a350a684c28..00000000000 --- a/src/emu/netlist/devices/nld_NE555.h +++ /dev/null @@ -1,47 +0,0 @@ -// 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_ */ |