summaryrefslogtreecommitdiff
path: root/floppyMusic/floppy.h
diff options
context:
space:
mode:
Diffstat (limited to 'floppyMusic/floppy.h')
-rw-r--r--floppyMusic/floppy.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/floppyMusic/floppy.h b/floppyMusic/floppy.h
index cc069c0..b0a45cb 100644
--- a/floppyMusic/floppy.h
+++ b/floppyMusic/floppy.h
@@ -10,7 +10,7 @@
#define FLOPPY_H_
#ifndef F_CPU
-#define F_CPU 16000000UL
+#error F_CPU not defined for floppy.h
#endif
#include <avr/io.h>
@@ -22,15 +22,32 @@ uint8_t floppy_frequencies[8];
uint8_t floppy_nextrun[8];
uint8_t floppy_head_return_counter[8];
-char *fPORT, *fDDR, *dPORT, *dDDR; //Ports for floppy and Direction of Heads
-
-void floppy_setup(char *_pulse_port, char *_pulse_ddr, char *_direction_port, char *_direction_ddr);
+unsigned char *fPORT, *fDDR, *dPORT, *dDDR; //Ports for floppy and Direction of Heads
+void floppy_setup(unsigned char *_pulse_port, unsigned char *_pulse_ddr, unsigned char *_direction_port, unsigned char *_direction_ddr);
+/*
+* *_pulse_port : port where stepper is connected, eg &PORTA
+* *_pulse_ddr : its direction register, eg &DDRA
+* *_direction_port : Port where direction pins are connected, eg &PORTB
+* *_direction_ddr : its direction register, eg &DDRB
+*/
void floppy_set_frequency(uint8_t _floppy_id, uint8_t _freq);
+/*
+* _floppy_id : [0-7] channel select
+* _freq : [0-255] numerical value representing frequency. use floppy_calc_freq() to calculate from frequency in Hz
+*/
void floppy_pulse(uint8_t _floppy_id);
+/*
+* pulses FDD, keeps track of when to apply head-reverse signal
+* _floppy_id : [0-7] channel select
+*/
uint8_t floppy_calc_freq(uint32_t _f_hz);
+/*
+* Converts frequency in Hz into value used by floppy_set_frequency()
+* _f_hz : Frequency in Hz
+*/
#endif /* FLOPPY_H_ */ \ No newline at end of file