1 // license:BSD-3-Clause
2 // copyright-holders:Olivier Galibert
3 #ifndef MAME_MACHINE_FDC_PLL_H
4 #define MAME_MACHINE_FDC_PLL_H
5 
6 #pragma once
7 
8 /*
9  * Generic pll class for floppy controllers with analog plls
10  */
11 
12 class floppy_image_device;
13 
14 class fdc_pll_t {
15 public:
16 	attotime ctime, period, min_period, max_period, period_adjust_base, phase_adjust;
17 
18 	attotime write_start_time;
19 	attotime write_buffer[32];
20 	int write_position;
21 	int freq_hist;
22 
23 	void set_clock(const attotime &period);
24 	void reset(const attotime &when);
25 	void read_reset(const attotime &when);
26 	int get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit);
27 	int feed_read_data(attotime &tm, const attotime& edge, const attotime &limit);
28 	bool write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit);
29 	void start_writing(const attotime &tm);
30 	void commit(floppy_image_device *floppy, const attotime &tm);
31 	void stop_writing(floppy_image_device *floppy, const attotime &tm);
32 
33 	std::string tts(attotime tm);
34 };
35 
36 #endif // MAME_MACHINE_FDC_PLL_H
37