; ***************************************************************************
; copyright   : (C) 2024 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.   *
; ***************************************************************************



.dseg

uartIrqDataIface2:    .byte UART_IRQ_IFACE_SIZE



.cseg


UART_Irq_InitIface2:
  ldi yl, LOW(uartIrqDataIface2)
  ldi yh, HIGH(uartIrqDataIface2)
  rcall UART_Irq_InitIface
  ; setup pins and interrupts
  cbi COM_DATA2_DDR, COM_DATA2_PIN          ; set DATA port as input
  cbi COM_DATA2_OUTPUT, COM_DATA2_PIN       ; disable internal pullup for TXD

  cbi COM_ATTN2_DDR, COM_ATTN2_PIN          ; set ATTN port as input
  cbi COM_ATTN2_OUTPUT, COM_ATTN2_PIN       ; disable internal pullup for ATTN


UART_Irq_Iface2_HandleTick:
  m_uart_irq_handle_tick \
    COM_DATA2_DDR, COM_DATA2_INPUT, COM_DATA2_OUTPUT, COM_DATA2_PIN, \
    COM_ATTN2_DDR, COM_ATTN2_INPUT, COM_ATTN2_OUTPUT, COM_ATTN2_PIN, \
    uartIrqDataIface2


