diff --git a/sw/io.c b/sw/io.c new file mode 100644 index 0000000..685a771 --- /dev/null +++ b/sw/io.c @@ -0,0 +1,6 @@ +#include + +int io_remap(int region) { + *(unsigned char*)IO_REMAP = region; + return (*(unsigned char*)IO_REMAP == region); +} diff --git a/sw/io.h b/sw/io.h index c46ae2c..798c026 100644 --- a/sw/io.h +++ b/sw/io.h @@ -1,6 +1,15 @@ #ifndef _IO_H #define IO_H -#define IO_REMAP *(unsigned char*)0x7f00 + +#define IO_REMAP 0x7f00 + + +enum io_regions { + io_region_de10lite = 0, +}; + + +int io_remap(int region); #endif diff --git a/sw/main.c b/sw/main.c index 0125093..296b1c6 100644 --- a/sw/main.c +++ b/sw/main.c @@ -1,5 +1,6 @@ #include int main() { - IO_REMAP = 1; + io_remap(io_region_de10lite); + return 0; }