summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine/i2cmemdev.h
diff options
context:
space:
mode:
author davidhay <davidhay@localhost>2009-04-02 20:48:28 +0000
committer davidhay <davidhay@localhost>2009-04-02 20:48:28 +0000
commit10f7d87f23c726bf445fb92db179714c842ae2d1 (patch)
treea707f0a27295f5fea6f0303eb6b18fd791473f2e /src/emu/machine/i2cmemdev.h
parent84233100254afb64a781709254d6b63745502b92 (diff)
Eeprom and i2c implemeted as devices [Samuele Zannoli]
The eepromdev.* files are the device impementation for the serial eeproms The i2cmemdev.* files are the device impementation for the i2c memory These aren't currently hooked up I'm committing this so that the Naomi changes don't accidentally get applied. The idea seems good, but they conflict with the current driver and I'd rather not have them accidentally slipping in and breaking things just yet.
Diffstat (limited to 'src/emu/machine/i2cmemdev.h')
-rw-r--r--src/emu/machine/i2cmemdev.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/emu/machine/i2cmemdev.h b/src/emu/machine/i2cmemdev.h
new file mode 100644
index 00000000000..bf8939f883a
--- /dev/null
+++ b/src/emu/machine/i2cmemdev.h
@@ -0,0 +1,46 @@
+/*
+ * I2C Memory
+ *
+ */
+
+#if !defined( I2CMEMDEV_H )
+#define I2CMEMDEV_H ( 1 )
+
+#define I2CMEM_E0 ( 1 )
+#define I2CMEM_E1 ( 2 )
+#define I2CMEM_E2 ( 3 )
+#define I2CMEM_SDA ( 5 )
+#define I2CMEM_SCL ( 6 )
+#define I2CMEM_WC ( 7 )
+
+#define I2CMEM_SLAVE_ADDRESS ( 0xa0 )
+#define I2CMEM_SLAVE_ADDRESS_ALT ( 0xb0 )
+
+typedef struct _i2cmem_config i2cmem_config;
+struct _i2cmem_config
+{
+ const int slave_address;
+ const int page_size;
+ const int data_size;
+ const char *data;
+};
+
+#define I2CMEM DEVICE_GET_INFO_NAME(i2cmem)
+DEVICE_GET_INFO(i2cmem);
+
+#define MDRV_I2CMEM_ADD(_tag, _slave_address, _page_size, _data_size, _data) \
+ MDRV_DEVICE_ADD(_tag, I2CMEM, 0) \
+ MDRV_DEVICE_CONFIG_DATA32(i2cmem_config, slave_address, _slave_address) \
+ MDRV_DEVICE_CONFIG_DATA32(i2cmem_config, page_size, _page_size) \
+ MDRV_DEVICE_CONFIG_DATA32(i2cmem_config, data_size, _data_size) \
+ MDRV_DEVICE_CONFIG_DATAPTR(i2cmem_config, data, _data)
+
+#define MDRV_I2CMEM_REMOVE(_tag) \
+ MDRV_DEVICE_REMOVE(_tag, I2CMEM)
+
+
+void i2cmemdev_write( const device_config *device, int line, int data );
+int i2cmemdev_read( const device_config *device, int line );
+void i2cmemdev_set_read_mode( const device_config *device, int mode );
+
+#endif