; ***************************************************************************
; copyright   : (C) 2025 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.   *
; ***************************************************************************



.equ FLASH_ERROR_NONE       = 0
.equ FLASH_ERROR_MSGERROR   = 1

.equ FLASH_RECVBUFFER_MAXLEN        = 32
.equ FLASH_CMD_FLASH_RSP            = 74


.equ FLASH_MSG_OFFS_DESTADDR        = 0
.equ FLASH_MSG_OFFS_MSGLEN          = 1
.equ FLASH_MSG_OFFS_MSGDATA         = 2
.equ FLASH_MSG_OFFS_CMD             = 2 ; first at COM2_MSG_OFFS_MSGDATA
.equ FLASH_MSG_OFFS_SRCADDR         = 3
.equ FLASH_MSG_OFFS_PAYLOAD         = 4 ; payload for the cmd follows here


.equ FLASH_PACKET_DATA_OFFS_ADDR    = FLASH_MSG_OFFS_PAYLOAD+0 ; 4 bytes
.equ FLASH_PACKET_DATA_OFFS_DATA    = FLASH_MSG_OFFS_PAYLOAD+4 ; n bytes

.equ FLASH_PACKET_START_OFFS_UID    = FLASH_MSG_OFFS_PAYLOAD+0 ; 4 bytes

.equ FLASH_WAITFORDATA_TRIES        = 254
.equ FLASH_WAITFORSTART_TRIES       = 5

