; *************************************************************************** ; copyright : (C) 2026 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. * ; *************************************************************************** ; *************************************************************************** ; defs .equ DS3231_FLAGS_PRESENT_BIT = 7 .equ DS3231_FLAGS_VALID_BIT = 6 ; *************************************************************************** ; data .dseg ds3231DataBegin: ds3231Flags: .byte 1 ds3231RecvBuffer: .byte 7 ds3231DataEnd: ; *************************************************************************** ; code .cseg ; --------------------------------------------------------------------------- ; @routine Ds3231_Init @global ; ; @return CFLAG set if okay, cleared on error ; @clobbers Ds3231_Init: ldi xh, HIGH(ds3231DataBegin) ldi xl, LOW(ds3231DataBegin) clr r16 ldi r17, (ds3231DataEnd-ds3231DataBegin) rcall Utils_FillSram rcall ds3231CheckPresence brcc Ds3231_Init_ret ldi r16, (1<