avr: added new version of driver for si7021.

This commit is contained in:
Martin Preuss
2025-04-29 00:37:01 +02:00
parent c1a67a36ef
commit fa65bc53b5
3 changed files with 51 additions and 7 deletions

View File

@@ -0,0 +1,43 @@
; ***************************************************************************
; 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. *
; ***************************************************************************
.cseg
; ---------------------------------------------------------------------------
; @routine SI7021_SendTemperature
SI7021_SendTemperature:
ldi r16, SI7021_VALUE_TEMP
rcall SI7021_GetValue
brcc SI7021_SendTemperature_end
ldi r17, VALUE_ID_SI7021_TEMP ; VALUE ID
ldi r22, AQHOME_VALUETYPE_TEMP ; VALUE TYPE
rcall Main_SendValue
SI7021_SendTemperature_end:
ret
; @end
; ---------------------------------------------------------------------------
; @routine SI7021_SendHumidity
SI7021_SendHumidity:
ldi r16, SI7021_VALUE_HUMIDITY
rcall SI7021_GetValue
brcc SI7021_SendHumidity_end
ldi r17, VALUE_ID_SI7021_HUM ; VALUE ID
ldi r22, AQHOME_VALUETYPE_HUMIDITY ; VALUE TYPE
rcall Main_SendValue
SI7021_SendHumidity_end:
ret
; @end