50 lines
1.4 KiB
NASM
50 lines
1.4 KiB
NASM
; ***************************************************************************
|
|
; 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. *
|
|
; ***************************************************************************
|
|
|
|
|
|
|
|
|
|
; ***************************************************************************
|
|
; code
|
|
|
|
.cseg
|
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
; Write a ComSendStats packet.
|
|
;
|
|
; IN:
|
|
; - R16: destination address
|
|
; - X : buffer to write to
|
|
; OUT:
|
|
; - nothing
|
|
; REGS: R3, R4, R16, R17, R18, X (R19, R20, R21)
|
|
|
|
CPRO_WriteComSendStats:
|
|
ldi r17, COM2_PAYLOAD_FLAGS_UID | (6<<COM2_PAYLOAD_FLAGS_SHIFT_NUM) ; UID + 6 bytes payload
|
|
ldi r18, CPRO_CMD_COMSENDSTATS
|
|
push xh
|
|
push xl
|
|
rcall COM2_BeginMsgWithVariablePayload ; (R3, R4, R16, R17, R18, R19, R20, R21, X)
|
|
push yh
|
|
push yl
|
|
ldi yh, HIGH(com2SendStatsBegin)
|
|
ldi yl, LOW(com2SendStatsBegin)
|
|
ldi r18, 6
|
|
rcall Utils_Copy_SDRAM ; (R17, R18, X, Y)
|
|
pop yl
|
|
pop yh
|
|
pop xl
|
|
pop xh
|
|
rcall com2CalcAndAddChecksumByte ; (R16, R17, R18, R19, X)
|
|
ret
|
|
|
|
|
|
|