avr: added initial module to handle reed contacts.

Detects and reports opening and closing of a window/door.
Nexts step is to allow for external configuration (e.g. standard mode
with one reed contact versus multi-contact mode to detect tilting of a
window/door).
This commit is contained in:
Martin Preuss
2023-05-12 21:41:39 +02:00
parent c6e013fdcf
commit 84403d07f6
6 changed files with 424 additions and 4 deletions

View File

@@ -12,6 +12,7 @@
.equ AQHOME_VALUETYPE_UNKNOWN = 0
.equ AQHOME_VALUETYPE_TEMP = 1
.equ AQHOME_VALUETYPE_HUMIDITY = 2
.equ AQHOME_VALUETYPE_DOOR = 3
; module type ids for firmware header
@@ -23,6 +24,7 @@
.equ AQHOME_FW_MODULE_SI7021 = 6
.equ AQHOME_FW_MODULE_STATS = 7
.equ AQHOME_FW_MODULE_CNY70 = 8
.equ AQHOME_FW_MODULE_REED = 9
.equ AQHOME_FW_TYPE_ATT84_BASE = 0
@@ -37,8 +39,10 @@
; EEPROM positions
.equ EEPROM_OFFS_UUID = 0 ; 4 bytes (occupy total of 8 bytes for extensibility)
.equ EEPROM_OFFS_COMADDR = 8 ; 1 byte
.equ EEPROM_OFFS_SEED = 10 ; 2 bytes
.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_REED_CONF = 12 ; 1 byte (plus one byte reserved)
; next is 14