; ***************************************************************************
; 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.   *
; ***************************************************************************

; ---------------------------------------------------------------------------
; Value types

.equ AQHOME_VALUETYPE_UNKNOWN   = 0
.equ AQHOME_VALUETYPE_TEMP      = 1
.equ AQHOME_VALUETYPE_HUMIDITY  = 2
.equ AQHOME_VALUETYPE_DOOR      = 3
.equ AQHOME_VALUETYPE_RGB       = 4
.equ AQHOME_VALUETYPE_RGBW      = 5
.equ AQHOME_VALUETYPE_MOTION    = 6
.equ AQHOME_VALUETYPE_CO2       = 7
.equ AQHOME_VALUETYPE_TVOC      = 8
.equ AQHOME_VALUETYPE_STATS     = 9
.equ AQHOME_VALUETYPE_LIGHT     = 10
.equ AQHOME_VALUETYPE_ONOFF     = 11
.equ AQHOME_VALUETYPE_ONOFFAUTO = 12
.equ AQHOME_VALUETYPE_RPM       = 13


; Value Ids

.equ AQHOME_VALUEID_STATS_PACKETS_IN      = 0xe0
.equ AQHOME_VALUEID_STATS_PACKETS_OUT     = 0xe1
.equ AQHOME_VALUEID_STATS_ERRS_CONTENT    = 0xe2
.equ AQHOME_VALUEID_STATS_ERRS_IO         = 0xe3
.equ AQHOME_VALUEID_STATS_ERRS_NOBUF      = 0xe4
.equ AQHOME_VALUEID_STATS_ERRS_COLLISIONS = 0xe5
.equ AQHOME_VALUEID_STATS_ERRS_BUSY       = 0xe6
.equ AQHOME_VALUEID_STATS_ERRS_MSGSIZE    = 0xe7
.equ AQHOME_VALUEID_STATS_ERRS_MISSED     = 0xe8

.equ AQHOME_VALUEID_STATS_PACKETS_IN2      = 0xe9
.equ AQHOME_VALUEID_STATS_PACKETS_OUT2     = 0xea
.equ AQHOME_VALUEID_STATS_ERRS_CONTENT2    = 0xeb
.equ AQHOME_VALUEID_STATS_ERRS_IO2         = 0xec
.equ AQHOME_VALUEID_STATS_ERRS_NOBUF2      = 0xed
.equ AQHOME_VALUEID_STATS_ERRS_COLLISIONS2 = 0xee
.equ AQHOME_VALUEID_STATS_ERRS_BUSY2       = 0xef
.equ AQHOME_VALUEID_STATS_ERRS_MSGSIZE2    = 0xf0
.equ AQHOME_VALUEID_STATS_ERRS_MISSED2     = 0xf1

.equ AQHOME_VALUEID_STATS_HEAP_USED        = 0xf2
.equ AQHOME_VALUEID_STATS_HEAP_FREE        = 0xf3


; ---------------------------------------------------------------------------
; Firmware types (deprecated)

;.equ AQHOME_FW_TYPE_ATT84_BASE  = 0
;.equ AQHOME_FW_TYPE_ATT84_TEMP1 = 1



.equ TLV_OFFS_LEN   = 0
.equ TLV_OFFS_TYPE  = 1
.equ TLV_OFFS_VALUE = 2



; ---------------------------------------------------------------------------
; EEPROM positions


.equ EEPROM_OFFS_UUID                  = 0    ; 4 bytes (occupy total of 8 bytes for extensibility)
.equ EEPROM_OFFS_COMADDR               = 8    ; 1 byte (plus one byte reserved)

.equ EEPROM_OFFS_SEED                  = 10   ; 2 bytes

.equ EEPROM_OFFS_OSCCAL_SLOW           = 12   ; 1 byte
.equ EEPROM_OFFS_OSCCAL_FAST           = 13   ; 1 byte

.equ EEPROM_OFFS_MAL_CONF              = 14 ; 10 bytes

.equ EEPROM_OFFS_ROUTER_RANGE_BEGIN    = 24 ; 1 byte
.equ EEPROM_OFFS_ROUTER_RANGE_END      = 25 ; 1 byte
; next is 26


.equ EEPROM_OFFS_TLV                   = 32 ; begin TLV area here




.equ EEPROM_TLV_ROUTER_RANGE           = 0x10   ; 2 bytes (range begin, range end)




