diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 7 | ||||
-rw-r--r-- | include/getopt-min.h | 12 | ||||
-rw-r--r-- | include/pin.h | 17 | ||||
-rw-r--r-- | include/print-utils.h | 2 | ||||
-rw-r--r-- | include/z80-if.h | 2 |
5 files changed, 38 insertions, 2 deletions
diff --git a/include/config.h b/include/config.h index 4093a67..c0777a8 100644 --- a/include/config.h +++ b/include/config.h @@ -1,6 +1,13 @@ #ifndef CONFIG_H #define CONFIG_H +/* Environment variables */ + +#define ENV_BAUDRATE "baudrate" +#define ENV_BOOTDELAY "bootdelay" +#define ENV_BOOTCMD "bootcmd" +#define ENV_PINALIAS "pin_alias" + #define CONFIG_ENV_SIZE 1600 #define CONFIG_ENV_OFFSET 0 #define CONFIG_ENVVAR_MAX 20 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..5b37587 --- /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 {NONE, 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/print-utils.h b/include/print-utils.h new file mode 100644 index 0000000..bcd9505 --- /dev/null +++ b/include/print-utils.h @@ -0,0 +1,2 @@ +void print_blanks(uint_fast8_t count); + 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); |