summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/cop452.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/cop452.h')
-rw-r--r--src/devices/machine/cop452.h47
1 files changed, 24 insertions, 23 deletions
diff --git a/src/devices/machine/cop452.h b/src/devices/machine/cop452.h
index f4981be72f3..7aaaa668b4c 100644
--- a/src/devices/machine/cop452.h
+++ b/src/devices/machine/cop452.h
@@ -29,27 +29,28 @@ public:
cop452_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
// SPI I/O
- DECLARE_WRITE_LINE_MEMBER(cs_w);
- DECLARE_WRITE_LINE_MEMBER(sk_w);
- DECLARE_WRITE_LINE_MEMBER(di_w);
- DECLARE_READ_LINE_MEMBER(do_r);
+ void cs_w(int state);
+ void sk_w(int state);
+ void di_w(int state);
+ int do_r();
// Signal outputs
- auto oa_w() { return m_out_handlers[ 0 ].bind(); }
- auto ob_w() { return m_out_handlers[ 1 ].bind(); }
+ auto oa_w() { return m_out_handlers[0].bind(); }
+ auto ob_w() { return m_out_handlers[1].bind(); }
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
+ TIMER_CALLBACK_MEMBER(timer_tick);
private:
// Index 0 is for "A" side, 1 is for "B" side
devcb_write_line::array<2> m_out_handlers;
// Timers
- emu_timer *m_timers[ 2 ];
+ emu_timer *m_timers[2];
// State
uint8_t m_mode;
@@ -57,10 +58,10 @@ private:
bool m_cs;
bool m_sk;
bool m_di;
- bool m_out[ 2 ];
+ bool m_out[2];
bool m_regA_b16;
- uint16_t m_reg[ 2 ];
- uint16_t m_cnt[ 2 ];
+ uint16_t m_reg[2];
+ uint16_t m_cnt[2];
// 0 : idle
// 1..5 : shifting instruction in
// 6..21: shifting register in
@@ -70,22 +71,22 @@ private:
// Operating modes
enum : uint8_t {
- MODE_DUAL_FREQ, // 0000 Dual frequency
- MODE_TRIG_PULSE, // 0001 Triggered pulse
- MODE_NUMBER_PULSES, // 0010 Number of pulses
- MODE_DUTY_CYCLE, // 0011 Duty cycle
- MODE_FREQ_COUNT, // 0100 Frequency and count
- MODE_DUAL_COUNT, // 0101 Dual count
- MODE_WAVE_MEAS, // 0110 Waveform measurement
- MODE_TRIG_COUNT, // 0111 Triggered pulse and count
- MODE_WHITE_NOISE, // 1000 White noise & frequency
- MODE_GATED_WHITE, // 1001 Gated white noise
- MODE_RESET = 15 // 1111 Reset
+ MODE_DUAL_FREQ, // 0000 Dual frequency
+ MODE_TRIG_PULSE, // 0001 Triggered pulse
+ MODE_NUMBER_PULSES, // 0010 Number of pulses
+ MODE_DUTY_CYCLE, // 0011 Duty cycle
+ MODE_FREQ_COUNT, // 0100 Frequency and count
+ MODE_DUAL_COUNT, // 0101 Dual count
+ MODE_WAVE_MEAS, // 0110 Waveform measurement
+ MODE_TRIG_COUNT, // 0111 Triggered pulse and count
+ MODE_WHITE_NOISE, // 1000 White noise & frequency
+ MODE_GATED_WHITE, // 1001 Gated white noise
+ MODE_RESET = 15 // 1111 Reset
};
attotime counts_to_attotime(unsigned counts) const;
void set_timer(unsigned idx);
- void set_output(unsigned idx , bool state);
+ void set_output(unsigned idx, bool state);
void toggle_output(unsigned idx);
void toggle_n_reload(unsigned idx);
};