avr: move ds18b20 screen code into module file.
This commit is contained in:
67
avr/modules/ds18b20/screen.asm
Normal file
67
avr/modules/ds18b20/screen.asm
Normal file
@@ -0,0 +1,67 @@
|
||||
; ***************************************************************************
|
||||
; copyright : (C) 2024 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. *
|
||||
; ***************************************************************************
|
||||
|
||||
|
||||
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
; This file contains timer handlers for the address protocol
|
||||
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
;
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; code
|
||||
|
||||
.cseg
|
||||
|
||||
|
||||
DS18B20_Screen:
|
||||
in r15, SREG
|
||||
push r15
|
||||
cli
|
||||
|
||||
ldi r16, 0
|
||||
rcall LCD_Fill
|
||||
|
||||
ldi r18, 0
|
||||
ldi r19, 0
|
||||
rcall LCD_SetCursor
|
||||
ldi zl, LOW(ds18b20ScreenText_title)
|
||||
ldi zh, HIGH(ds18b20ScreenText_title)
|
||||
rcall LCD_PrintFromFlash
|
||||
|
||||
ldi r18, 0
|
||||
ldi r19, 2
|
||||
rcall LCD_SetCursor
|
||||
|
||||
ldi zl, LOW(ds18b20ScreenText_buffer)
|
||||
ldi zh, HIGH(ds18b20ScreenText_buffer)
|
||||
rcall LCD_PrintFromFlash
|
||||
|
||||
ldi xl, LOW(ds18b20DataBuffer)
|
||||
ldi xh, HIGH(ds18b20DataBuffer)
|
||||
ldi r23, 9
|
||||
DS18B20_Screen_loop1:
|
||||
ld r16, X+
|
||||
rcall LCD_PrintHexByte
|
||||
|
||||
ldi r16, 32
|
||||
rcall LCD_PrintChar
|
||||
dec r23
|
||||
brne DS18B20_Screen_loop1
|
||||
pop r15
|
||||
out SREG, r15
|
||||
ret
|
||||
|
||||
|
||||
|
||||
ds18b20ScreenText_title: .db "DS18B20", 0
|
||||
ds18b20ScreenText_buffer: .db "Rec: ", 0
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user