add macros for reading/writing IO regs regardless of their position (i.e. < or >=0x40).
This commit is contained in:
@@ -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
|
||||
|
||||
29
avr/common/utils_io.asm
Normal file
29
avr/common/utils_io.asm
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user