; ***************************************************************************
; 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

uartIrqDataIface1:    .byte UART_IRQ_IFACE_SIZE



.cseg


UART_Irq_InitIface1:
  ldi yl, LOW(uartIrqDataIface1)
  ldi yh, HIGH(uartIrqDataIface1)
  rcall UART_Irq_InitIface
  ; setup pins and interrupts
  cbi COM_DATA_DDR, COM_DATA_PIN          ; set DATA port as input
  cbi COM_DATA_OUTPUT, COM_DATA_PIN       ; disable internal pullup for TXD

  cbi COM_ATTN_DDR, COM_ATTN_PIN          ; set ATTN port as input
  cbi COM_ATTN_OUTPUT, COM_ATTN_PIN       ; disable internal pullup for ATTN
  ret




UART_Irq_Iface1_HandleTick:
  m_uart_irq_handle_tick \
    COM_DATA_DDR, COM_DATA_INPUT, COM_DATA_OUTPUT, COM_DATA_PIN, \
    COM_ATTN_DDR, COM_ATTN_INPUT, COM_ATTN_OUTPUT, COM_ATTN_PIN, \
    uartIrqDataIface1



