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




.equ UART_IRQ_STATE_IDLE            = 0
.equ UART_IRQ_STATE_WAITFORATTNHIGH = 1
.equ UART_IRQ_STATE_WAITFORSTARTBIT = 2
.equ UART_IRQ_STATE_WAITFORDATABIT  = 3
.equ UART_IRQ_STATE_WAITFORSTOPBIT  = 4
.equ UART_IRQ_STATE_SENDINGATTN     = 5
.equ UART_IRQ_STATE_SENDINGSTARTBIT = 6
.equ UART_IRQ_STATE_SENDINGDATABIT  = 7
.equ UART_IRQ_STATE_SENDINGSTOPBIT  = 8
.equ UART_IRQ_STATE_COUNT           = 9


.equ UART_IRQ_IFACE_OFFS_STATE          = 0
.equ UART_IRQ_IFACE_OFFS_TICKCOUNTER    = 1
.equ UART_IRQ_IFACE_OFFS_STATECOUNTER   = 2
.equ UART_IRQ_IFACE_OFFS_STATEDATA      = 3
.equ UART_IRQ_IFACE_OFFS_READBUF_USED   = 4
.equ UART_IRQ_IFACE_OFFS_READBUF_RDPOS  = 5
.equ UART_IRQ_IFACE_OFFS_READBUF_WRPOS  = 6
.equ UART_IRQ_IFACE_OFFS_READBUF_BUF    = 7  ; 8 bytes
.equ UART_IRQ_IFACE_OFFS_WRITEBUF_USED  = 15
.equ UART_IRQ_IFACE_OFFS_WRITEBUF_RDPOS = 16
.equ UART_IRQ_IFACE_OFFS_WRITEBUF_WRPOS = 17
.equ UART_IRQ_IFACE_OFFS_WRITEBUF_BUF   = 18  ; 8 bytes
.equ UART_IRQ_IFACE_SIZE                = 26



.equ UART_IRQ_IFACE_READBUF_SIZE     = 8
.equ UART_IRQ_IFACE_WRITEBUF_SIZE    = 8

.equ UART_IRQ_IFACE_PINFN_READDATA    = 0
.equ UART_IRQ_IFACE_PINFN_READATTN    = 1
.equ UART_IRQ_IFACE_PINFN_WRITEDATA   = 2
.equ UART_IRQ_IFACE_PINFN_WRITEATTN   = 3

.equ UART_IRQ_TIME_BITTIME1   = 4
.equ UART_IRQ_TIME_BITTIME1_5 = 6
.equ UART_IRQ_TIME_BITTIME2   = 8
.equ UART_IRQ_TIME_BITTIME10  = 40

;.equ UART_IRQ_TIME_BITTIME1   = 2
;.equ UART_IRQ_TIME_BITTIME1_5 = 3
;.equ UART_IRQ_TIME_BITTIME2   = 4
;.equ UART_IRQ_TIME_BITTIME10  = 20

;.equ UART_IRQ_TIME_BITTIME1   = 8
;.equ UART_IRQ_TIME_BITTIME1_5 = 12
;.equ UART_IRQ_TIME_BITTIME2   = 16
;.equ UART_IRQ_TIME_BITTIME10  = 80






  