diff options
Diffstat (limited to 'src/mess/machine/upd7002.c')
-rw-r--r-- | src/mess/machine/upd7002.c | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/src/mess/machine/upd7002.c b/src/mess/machine/upd7002.c index 67e27571853..84770daa1cf 100644 --- a/src/mess/machine/upd7002.c +++ b/src/mess/machine/upd7002.c @@ -18,24 +18,24 @@ struct uPD7002_t const uPD7002_interface *intf; /* Status Register - D0 and D1 define the currently selected input channel - D2 flag output - D3 0 = 8 bit mode 1 = 12 bit mode - D4 2nd MSB of conversion - D5 MSB of conversion - D6 0 = busy, 1 = not busy (~busy) - D7 0 = conversion completed, 1 = conversion not completed (~EOC) - */ + D0 and D1 define the currently selected input channel + D2 flag output + D3 0 = 8 bit mode 1 = 12 bit mode + D4 2nd MSB of conversion + D5 MSB of conversion + D6 0 = busy, 1 = not busy (~busy) + D7 0 = conversion completed, 1 = conversion not completed (~EOC) + */ int status; /* High data byte - This byte contains the 8 most significant bits of the analogue to digital conversion. */ + This byte contains the 8 most significant bits of the analogue to digital conversion. */ int data1; /* Low data byte - In 12 bit mode: Bits 7 to 4 define the four low order bits of the conversion. - In 8 bit mode. All bits 7 to 4 are inaccurate. - Bits 3 to 0 are always set to low. */ + In 12 bit mode: Bits 7 to 4 define the four low order bits of the conversion. + In 8 bit mode. All bits 7 to 4 are inaccurate. + Bits 3 to 0 are always set to low. */ int data0; @@ -43,9 +43,9 @@ struct uPD7002_t int digitalvalue; /* this counter is used to check a full end of conversion has been reached - if the uPD7002 is half way through one conversion and a new conversion is requested - the counter at the end of the first conversion will not match and not be processed - only then at the end of the second conversion will the conversion complete function run */ + if the uPD7002 is half way through one conversion and a new conversion is requested + the counter at the end of the first conversion will not match and not be processed + only then at the end of the second conversion will the conversion complete function run */ int conversion_counter; }; @@ -121,17 +121,17 @@ WRITE8_DEVICE_HANDLER ( uPD7002_w ) { case 0: /* - Data Latch/AD start - D0 and D1 together define which one of the four input channels is selected - D2 flag input, normally set to 0???? - D3 defines whether an 8 (0) or 12 (1) bit resolution conversion should occur - D4 to D7 not used. + Data Latch/AD start + D0 and D1 together define which one of the four input channels is selected + D2 flag input, normally set to 0???? + D3 defines whether an 8 (0) or 12 (1) bit resolution conversion should occur + D4 to D7 not used. - an 8 bit conversion typically takes 4ms - an 12 bit conversion typically takes 10ms + an 8 bit conversion typically takes 4ms + an 12 bit conversion typically takes 10ms - writing to this register will initiate a conversion. - */ + writing to this register will initiate a conversion. + */ /* set D6=0 busy ,D7=1 conversion not complete */ uPD7002->status=(data & 0x0f) | 0x80; @@ -141,7 +141,7 @@ WRITE8_DEVICE_HANDLER ( uPD7002_w ) if (uPD7002->intf->EOC_func) uPD7002->intf->EOC_func(device, 1); /* the uPD7002 works by sampling the analogue value at the start of the conversion - so it is read hear and stored until the end of the A to D conversion */ + so it is read hear and stored until the end of the A to D conversion */ // this function should return a 16 bit value. uPD7002->digitalvalue = uPD7002->intf->get_analogue_func(device, uPD7002->status & 0x03); @@ -165,9 +165,9 @@ WRITE8_DEVICE_HANDLER ( uPD7002_w ) case 3: /* Test Mode: Used for inspecting the device, The data input-output terminals assume an input - state and are connected to the A/D counter. Therefore, the A/D conversion data - read out after this is meaningless. - */ + state and are connected to the A/D counter. Therefore, the A/D conversion data + read out after this is meaningless. + */ break; } } @@ -243,5 +243,3 @@ void uPD7002_device::device_reset() { DEVICE_RESET_NAME( uPD7002 )(this); } - - |