main: added tests for twi module. COM: added COM_EnqueueI2cBusMember

This commit is contained in:
Martin Preuss
2023-01-28 00:11:03 +01:00
parent d80c0299a3
commit 4cbcfd6c01
2 changed files with 76 additions and 1 deletions

View File

@@ -36,6 +36,21 @@
; ---------------------------------------------------------------------------
; TWI master module
.equ TWI_DDR_SCL = DDRA
.equ TWI_PORT_SCL = PORTA
.equ TWI_PIN_SCL = PINA
.equ TWI_PINNUM_SCL = PORTA4
.equ TWI_DDR_SDA = DDRA
.equ TWI_PORT_SDA = PORTA
.equ TWI_PIN_SDA = PINA
.equ TWI_PINNUM_SDA = PORTA6
; ***************************************************************************
; code segment
@@ -75,6 +90,7 @@
.include "timer.asm"
.include "led.asm"
.include "com.asm"
.include "twimaster.asm"
@@ -129,6 +145,9 @@ main:
ldi yh, HIGH(ledA3Sram)
rcall Led_SetPattern
ldi r16, 1
sts twiMasterScanEnabled, r16
main_loop:
rcall runModulesUntilIdle
; sbi DDRA, PORTA2 ; debug
@@ -170,6 +189,7 @@ initModules:
rcall Led_Init
rcall Com_Init
rcall TWI_Master_Init
ret
@@ -243,6 +263,9 @@ onEvery100ms:
; USED: depending on called routines
onEverySecond:
sbi DDRA, PORTA2 ; debug
sbi PINA, PORTA2 ; debug (toggle)
rcall TWI_Master_ScanNext
ret