avr: added brightness sensor

This commit is contained in:
Martin Preuss
2025-06-23 19:21:49 +02:00
parent 409155f0d0
commit 9ea722607f
12 changed files with 229 additions and 12 deletions

View File

@@ -195,6 +195,14 @@
#endif
#ifdef MODULES_BRIGHTNESS
.include "modules/brightness/main.asm"
#ifdef MODULES_NETWORK
.include "modules/brightness/send.asm"
#endif
#endif
#ifdef APPS_MOTION
.include "modules/f_keepup/main.asm"
.include "modules/valsched/main.asm"

View File

@@ -112,6 +112,11 @@ onSystemTimerTick:
#endif
#ifdef MODULES_BRIGHTNESS
bigcall Brightness_Every100ms
#endif
#ifdef APPS_NETWORK
ldi yl, LOW(netInterfaceData)
ldi yh, HIGH(netInterfaceData)
@@ -145,6 +150,11 @@ sysOnEverySecond:
#ifdef APPS_REPORTSENSORS
bigcall AppReportSensors_OnEverySecond
#endif
#ifdef MODULES_SGP30
bigcall SGP30_EverySecond
#endif
bigjmp onEverySecond
; @end

View File

@@ -148,6 +148,10 @@ initModules:
bigcall ILI9341_Init
#endif
#ifdef MODULES_BRIGHTNESS
bigcall Brightness_Init
#endif
; done
ret

View File

@@ -146,3 +146,14 @@
; ---------------------------------------------------------------------------
; Brightness
.equ BRIGHTNESS_ADC_PORT = PORTA ; adc0
.equ BRIGHTNESS_ADC_DDR = DDRA
.equ BRIGHTNESS_ADC_PIN = PORTA0
.equ BRIGHTNESS_ADC_MUX = 0

View File

@@ -73,6 +73,7 @@
;#define MODULES_DS18B20
#define MODULES_MOTION
;#define MODULES_CCS811
#define MODULES_BRIGHTNESS
#define APPS_NETWORK
#define APPS_MOTION
@@ -96,6 +97,8 @@
.equ VALUE_ID_SGP30_TVOC = 0x09
.equ VALUE_ID_SGP30_CO2 = 0x0a
.equ VALUE_ID_BRIGHTNESS = 0x0b
;.equ VALUE_ID_REED_CONF = 0x81
.equ VALUE_ID_DEBUG = 0x7f

View File

@@ -13,7 +13,7 @@
; AtTiny84
; --------
; VCC 1 14 GND
; PB0 2 13 PA0
; PB0 2 13 PA0 Brightness
; PB1 3 12 PA1 COM-DATA
; /RESET PB3 4 11 PA2
; PB2 5 10 PA3 LED
@@ -96,3 +96,4 @@