diff --git a/avr/common/0BUILD b/avr/common/0BUILD index 4d18df1..26bb9eb 100644 --- a/avr/common/0BUILD +++ b/avr/common/0BUILD @@ -17,6 +17,7 @@ utils_copy_from_flash.asm utils_copy_sdram.asm utils_initial_wait.asm + utils_io.asm utils_wait.asm utils_wait_fixed.asm utils_wait_pin.asm diff --git a/avr/common/utils_io.asm b/avr/common/utils_io.asm new file mode 100644 index 0000000..8309a1e --- /dev/null +++ b/avr/common/utils_io.asm @@ -0,0 +1,29 @@ +; *************************************************************************** +; copyright : (C) 2023 by Martin Preuss +; email : martin@libchipcard.de +; +; *************************************************************************** +; * This file is part of the project "AqHome". * +; * Please see toplevel file COPYING of that project for license details. * +; *************************************************************************** + + +; M_IO_READ DEST, SRC +.macro M_IO_READ +.if @1 < 64 + in @0, @1 +.else + lds @0, @1 +.endif +.endmacro + + + +; M_IO_WRITE DEST, SRC +.macro M_IO_WRITE +.if @0 < 64 + out @0, @1 +.else + sts @0, @1 +.endif +.endmacro