blob: 60166999897356ddbc76a22a4a8dbcc8b0b6d9da (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
// license:BSD-3-Clause
// copyright-holders:smf
#ifndef MAME_MACHINE_ZNMCU_H
#define MAME_MACHINE_ZNMCU_H
#pragma once
DECLARE_DEVICE_TYPE(ZNMCU, znmcu_device)
class znmcu_device : public device_t
{
public:
znmcu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration helpers
auto dsw_handler() { return m_dsw_handler.bind(); }
auto analog1_handler() { return m_analog1_handler.bind(); }
auto analog2_handler() { return m_analog2_handler.bind(); }
auto dataout_handler() { return m_dataout_handler.bind(); }
auto dsr_handler() { return m_dsr_handler.bind(); }
WRITE_LINE_MEMBER(write_select);
WRITE_LINE_MEMBER(write_clock);
protected:
// device-level overrides
virtual void device_start() override;
TIMER_CALLBACK_MEMBER(mcu_tick);
private:
devcb_read8 m_dsw_handler;
devcb_read8 m_analog1_handler;
devcb_read8 m_analog2_handler;
devcb_write_line m_dataout_handler;
devcb_write_line m_dsr_handler;
static const int MaxBytes = 3;
int m_select;
int m_clk;
int m_bit;
int m_byte;
int m_databytes;
uint8_t m_send[MaxBytes];
emu_timer *m_mcu_timer;
};
#endif // MAME_MACHINE_ZNMCU_H
|