src/mess/machine/e0516.c
| r5670 | r5671 | |
| 101 | 101 | e0516_dio_r - data out |
| 102 | 102 | -------------------------------------------------*/ |
| 103 | 103 | |
| 104 | | int e0516_dio_r(const device_config *device) |
| 104 | READ_LINE_DEVICE_HANDLER( e0516_dio_r ) |
| 105 | 105 | { |
| 106 | 106 | e0516_t *e0516 = get_safe_token(device); |
| 107 | 107 | |
| r5670 | r5671 | |
| 112 | 112 | e0516_dio_w - data in |
| 113 | 113 | -------------------------------------------------*/ |
| 114 | 114 | |
| 115 | | void e0516_dio_w(const device_config *device, int level) |
| 115 | WRITE_LINE_DEVICE_HANDLER( e0516_dio_w ) |
| 116 | 116 | { |
| 117 | 117 | e0516_t *e0516 = get_safe_token(device); |
| 118 | 118 | |
| 119 | | e0516->dio = level; |
| 119 | e0516->dio = state; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /*------------------------------------------------- |
| 123 | 123 | e0516_clk_w - clock in |
| 124 | 124 | -------------------------------------------------*/ |
| 125 | 125 | |
| 126 | | void e0516_clk_w(const device_config *device, int level) |
| 126 | WRITE_LINE_DEVICE_HANDLER( e0516_clk_w ) |
| 127 | 127 | { |
| 128 | 128 | e0516_t *e0516 = get_safe_token(device); |
| 129 | 129 | |
| 130 | 130 | if (e0516->cs == 1) return; |
| 131 | 131 | |
| 132 | | if (level == 0) |
| 132 | if (state == 0) |
| 133 | 133 | { |
| 134 | 134 | e0516->bits++; |
| 135 | 135 | |
| r5670 | r5671 | |
| 190 | 190 | e0516_clk_w - chip select |
| 191 | 191 | -------------------------------------------------*/ |
| 192 | 192 | |
| 193 | | void e0516_cs_w(const device_config *device, int level) |
| 193 | WRITE_LINE_DEVICE_HANDLER( e0516_cs_w ) |
| 194 | 194 | { |
| 195 | 195 | e0516_t *e0516 = get_safe_token(device); |
| 196 | 196 | |
| 197 | | e0516->cs = level; |
| 197 | e0516->cs = state; |
| 198 | 198 | |
| 199 | | if (level == 1) |
| 199 | if (state == 1) |
| 200 | 200 | { |
| 201 | 201 | e0516->data_latch = 0; |
| 202 | 202 | e0516->reg_latch = 0; |
src/mess/machine/e0516.h
| r5670 | r5671 | |
| 1 | 1 | #ifndef __E0516__ |
| 2 | 2 | #define __E0516__ |
| 3 | 3 | |
| 4 | #include "devcb.h" |
| 5 | |
| 4 | 6 | /*************************************************************************** |
| 5 | 7 | MACROS / CONSTANTS |
| 6 | 8 | ***************************************************************************/ |
| r5670 | r5671 | |
| 18 | 20 | DEVICE_GET_INFO( e0516 ); |
| 19 | 21 | |
| 20 | 22 | /* serial data input/output */ |
| 21 | | int e0516_dio_r(const device_config *device); |
| 22 | | void e0516_dio_w(const device_config *device, int level); |
| 23 | READ_LINE_DEVICE_HANDLER( e0516_dio_r ); |
| 24 | WRITE_LINE_DEVICE_HANDLER( e0516_dio_w ); |
| 23 | 25 | |
| 24 | 26 | /* clock */ |
| 25 | | void e0516_clk_w(const device_config *device, int level); |
| 27 | WRITE_LINE_DEVICE_HANDLER( e0516_clk_w ); |
| 26 | 28 | |
| 27 | 29 | /* chip select */ |
| 28 | | void e0516_cs_w(const device_config *device, int level); |
| 30 | WRITE_LINE_DEVICE_HANDLER( e0516_cs_w ); |
| 29 | 31 | |
| 30 | 32 | #endif |