summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine/upd7002.h
diff options
context:
space:
mode:
author Curt Coder <curtcoder@mail.com>2013-03-07 15:28:25 +0000
committer Curt Coder <curtcoder@mail.com>2013-03-07 15:28:25 +0000
commit76ac08a0b805820f12be6dac3daee17f8eb26953 (patch)
tree74a1a81d8e2a6cf242d498978b3573015c4d7a0c /src/emu/machine/upd7002.h
parent7e0b63efa9978e8611337c4ac80ffc293bb527ee (diff)
Moved some files to where they belong. (nw)
Diffstat (limited to 'src/emu/machine/upd7002.h')
-rw-r--r--src/emu/machine/upd7002.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/emu/machine/upd7002.h b/src/emu/machine/upd7002.h
new file mode 100644
index 00000000000..d7456ed0f44
--- /dev/null
+++ b/src/emu/machine/upd7002.h
@@ -0,0 +1,76 @@
+/*****************************************************************************
+ *
+ * machine/upd7002.h
+ *
+ * uPD7002 Analogue to Digital Converter
+ *
+ * Driver by Gordon Jefferyes <mess_bbc@gjeffery.dircon.co.uk>
+ *
+ ****************************************************************************/
+
+#ifndef UPD7002_H_
+#define UPD7002_H_
+
+/***************************************************************************
+ MACROS
+***************************************************************************/
+
+class uPD7002_device : public device_t
+{
+public:
+ uPD7002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~uPD7002_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type UPD7002;
+
+
+/***************************************************************************
+ TYPE DEFINITIONS
+***************************************************************************/
+
+typedef int (*uPD7002_get_analogue_func)(device_t *device, int channel_number);
+#define UPD7002_GET_ANALOGUE(name) int name(device_t *device, int channel_number )
+
+typedef void (*uPD7002_eoc_func)(device_t *device, int data);
+#define UPD7002_EOC(name) void name(device_t *device, int data )
+
+
+struct uPD7002_interface
+{
+ uPD7002_get_analogue_func get_analogue_func;
+ uPD7002_eoc_func EOC_func;
+};
+
+/***************************************************************************
+ FUNCTION PROTOTYPES
+***************************************************************************/
+
+/* Standard handlers */
+
+DECLARE_READ8_DEVICE_HANDLER ( uPD7002_EOC_r );
+DECLARE_READ8_DEVICE_HANDLER ( uPD7002_r );
+DECLARE_WRITE8_DEVICE_HANDLER ( uPD7002_w );
+
+
+/***************************************************************************
+ DEVICE CONFIGURATION MACROS
+***************************************************************************/
+
+#define MCFG_UPD7002_ADD(_tag, _intrf) \
+ MCFG_DEVICE_ADD(_tag, UPD7002, 0) \
+ MCFG_DEVICE_CONFIG(_intrf)
+
+
+#endif /* UPD7002_H_ */