; *************************************************************************** ; 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. * ; *************************************************************************** #ifndef UART_BITBANG_IFACE_H #define UART_BITBANG_IFACE_H ; *************************************************************************** ; includes .include "modules/uart_bitbang2/defs.asm" .include "modules/uart_bitbang2/lowlevel.asm" .include "modules/network/iface.asm" ; *************************************************************************** ; data .dseg uart_bitbang_iface: .byte NET_IFACE_SIZE ; *************************************************************************** ; code .cseg ; --------------------------------------------------------------------------- ; @routine UART_BitBang_Init @global ; ; @return CFLAG set if okay, clear on error ; @clobbers R16, R17, X, Y UART_BitBang_Init: ldi yl, LOW(uart_bitbang_iface) ldi yh, HIGH(uart_bitbang_iface) rcall NET_Interface_Init ; (R16, R17, X) ; init hw sbi COM_IRQ_ADDR_ATTN, COM_IRQ_BIT_ATTN ; enable pin change irq for ATTN line in r16, GIMSK ; enable pin change irq PCIE0 or PCIE1 ori r16, (1<