summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeo C2014-10-14 12:53:48 +0200
committerLeo C2014-10-14 12:53:48 +0200
commit41d36f28612cb6c49cf0260236f3b834549883be (patch)
treea9c8c4e81d1cff76a8473498d2a9a71c76216450 /include
parent04a63b0d5660f1c0c0b7e8123e4f56d188e52a5d (diff)
downloadz180-stamp-41d36f28612cb6c49cf0260236f3b834549883be.zip
pin command, add user configurable i/o pins
Diffstat (limited to 'include')
-rw-r--r--include/getopt-min.h12
-rw-r--r--include/pin.h17
-rw-r--r--include/z80-if.h2
3 files changed, 29 insertions, 2 deletions
diff --git a/include/getopt-min.h b/include/getopt-min.h
new file mode 100644
index 0000000..9f7729e
--- /dev/null
+++ b/include/getopt-min.h
@@ -0,0 +1,12 @@
+#ifndef GETOPT_MIN_H
+#define GETOPT_MIN_H
+
+int getopt( /* returns letter, '?', EOF */
+ int argc, /* argument count from main */
+ char *const argv[], /* argument vector from main */
+ const FLASH char * optstring ); /* allowed args, e.g. "ab:c" */
+
+extern int optind;
+
+#endif /* GETOPT_MIN_H */
+
diff --git a/include/pin.h b/include/pin.h
new file mode 100644
index 0000000..e673b56
--- /dev/null
+++ b/include/pin.h
@@ -0,0 +1,17 @@
+#ifndef PIN_H
+#define PIN_H
+
+/* Number of user configurable I/O pins */
+#define PIN_MAX 11
+
+typedef enum {INPUT, INPUT_PULLUP, OUTPUT, OUTPUT_TIMER} pinmode_t;
+
+int pin_config(int pin, pinmode_t mode);
+pinmode_t pin_config_get(int pin);
+int pin_read(int pin);
+void pin_write(int pin, uint8_t val);
+int pin_clockdiv_set(int pin, unsigned long divider);
+long pin_clockdiv_get(int pin);
+
+#endif /* PIN_H */
+
diff --git a/include/z80-if.h b/include/z80-if.h
index 5153f37..6f6f6fa 100644
--- a/include/z80-if.h
+++ b/include/z80-if.h
@@ -26,8 +26,6 @@ void z80_setup_bus(void);
int z80_stat_reset(void);
//void z80_busreq(level_t level);
int z80_stat_halt(void);
-uint32_t z80_clock_get(void);
-int z80_clock_set(unsigned long freq);
void z80_write(uint32_t addr, uint8_t data);