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

#ifndef AQH_AVR_DEVICES_ALL_MODULES_INCLUDE_ASM
#define AQH_AVR_DEVICES_ALL_MODULES_INCLUDE_ASM



; ***************************************************************************
; code

.cseg



#ifdef MODULES_XRAM
.include "modules/xram/main.asm"
#endif

#ifdef MODULES_HEAP
  .include "modules/heap/main.asm"
#endif

#ifdef MODULES_NETWORK
MODULE_BEGIN_NETWORK:
.include "common/crc8.asm"
.include "common/m_fixedbuffers.asm"
.include "common/m_ringbuffer_y.asm"
.include "common/ringbuffer_y.asm"
.include "modules/network/defs.asm"
.include "modules/network/data.asm"
.include "modules/network/iface.asm"
.include "modules/network/main.asm"
.include "modules/network/buffer.asm"
.include "modules/network/msg/defs.asm"
.include "modules/network/msg/common.asm"
.include "modules/network/msg/crc.asm"
.include "modules/network/msg/value-w.asm"
.include "modules/network/msg/value-r.asm"
.include "modules/network/msg/addr-r.asm"
.include "modules/network/msg/addr-w.asm"
MODULE_END_NETWORK:
.equ MODULE_SIZE_NETWORK = MODULE_END_NETWORK-MODULE_BEGIN_NETWORK

#endif

#ifdef MODULES_UART_BITBANG
.include "modules/uart_bitbang2/defs.asm"
.include "modules/uart_bitbang2/iface.asm"
.include "modules/uart_bitbang2/bytelevel.asm"
.include "modules/uart_bitbang2/msglevel.asm"
#endif

#ifdef MODULES_UART_HW
.include "modules/uart_hw/defs.asm"
.include "modules/uart_hw/lowlevel.asm"
.include "modules/uart_hw/uart.asm"
.include "modules/uart_hw/attn.asm"
.include "modules/uart_hw/net_uart.asm"
#endif

#ifdef MODULES_COMONUART0
;.include "modules/uart_hw/defs.asm"
;.include "modules/uart_hw/lowlevel.asm"
;.include "modules/uart_hw/m_lowlevel_uart.asm"
;.include "modules/uart_hw/comonuart0.asm"
.include "modules/uart_hw2/defs.asm"
.include "modules/uart_hw2/comonuart0.asm"
#endif

#ifdef MODULES_COMONUART1
;.include "modules/uart_hw/defs.asm"
;.include "modules/uart_hw/lowlevel.asm"
;.include "modules/uart_hw/m_lowlevel_uart.asm"
;.include "modules/uart_hw/comonuart1.asm"
.include "modules/uart_hw2/defs.asm"
.include "modules/uart_hw2/comonuart1.asm"
#endif

#ifdef MODULES_TTYONUART1
.include "modules/uart_hw/defs.asm"
.include "modules/uart_hw/lowlevel.asm"
.include "modules/uart_hw/m_lowlevel_uart.asm"
.include "modules/uart_hw/ttyonuart1.asm"
;.include "modules/uart_hw2/defs.asm"
;.include "modules/uart_hw2/ttyonuart1.asm"
#endif

#ifdef MODULES_COM2W
MODULE_BEGIN_COM2W:
.include "modules/com2w/defs.asm"
.include "modules/com2w/com2w.asm"
MODULE_END_COM2W:
.equ MODULE_SIZE_COM2W = MODULE_END_COM2W-MODULE_BEGIN_COM2W
#endif

#ifdef MODULES_COM2W2
MODULE_BEGIN_COM2W2:
.include "modules/com2w2/defs.asm"
.include "modules/com2w2/macros.asm"
.include "modules/com2w2/io.asm"
.include "modules/com2w2/byteread.asm"
.include "modules/com2w2/bytewrite.asm"
.include "modules/com2w2/msgread.asm"
.include "modules/com2w2/msgwrite.asm"
.include "modules/com2w2/main.asm"
.include "modules/com2w2/data.asm"
MODULE_END_COM2W2:
.equ MODULE_SIZE_COM2W2 = MODULE_END_COM2W2-MODULE_BEGIN_COM2W2
#endif


#ifdef MODULES_COM2W0
.include "modules/com2w/defs.asm"
.include "modules/com2w/common.asm"
.include "modules/com2w/com2w0.asm"
#endif

#ifdef MODULES_COM2W1
.include "modules/com2w/defs.asm"
.include "modules/com2w/common.asm"
.include "modules/com2w/com2w1.asm"
#endif

#ifdef MODULES_COM2WN
.include "modules/com2w/defs.asm"
.include "modules/com2w/com2wn_init.asm"
.include "modules/com2w/com2wn_io.asm"
.include "modules/com2w/com2wn_irq.asm"
.include "modules/com2w/com2wn_recv.asm"
.include "modules/com2w/com2wn_run.asm"
.include "modules/com2w/com2wn_send.asm"
.include "modules/com2w/com2wn_wait.asm"
.include "modules/com2w/com2wn_data.asm"
#endif

#ifdef MODULES_COM2WI
.include "modules/com2w/com2wi2.asm"
#endif

#ifdef MODULES_UARTFD0
.include "modules/uart_fd/defs.asm"
.include "modules/uart_fd/macros.asm"
.include "modules/uart_fd/uartfd0.asm"
#endif

#ifdef MODULES_UARTFD1
.include "modules/uart_fd/defs.asm"
.include "modules/uart_fd/macros.asm"
.include "modules/uart_fd/uartfd1.asm"
#endif

#ifdef MODULES_CLOCK
.include "modules/clock/main.asm"
#endif

; unconditionally include led defs (doesn't occupy ram or flash)
.include "modules/led/defs.asm"

#ifdef MODULES_LED1
.include "modules/led/led1.asm"
#endif

#ifdef MODULES_LED2
.include "modules/led/led2.asm"
#endif

#ifdef MODULES_LED3
.include "modules/led/led3.asm"
#endif


#ifdef MODULES_BEEPER_SIMPLE
.include "modules/beeper_simple/main.asm"
#endif

#ifdef MODULES_TWI_MASTER
.include "modules/twimaster/main.asm"
#endif

#ifdef MODULES_SI7021
.include "modules/si7021/main2.asm"
  #ifdef MODULES_NETWORK
  .include "modules/si7021/send.asm"
  #endif
.include "common/multiply.asm"
#endif

#ifdef MODULES_SGP30
.include "modules/sgp30/main.asm"
  #ifdef MODULES_NETWORK
  .include "modules/sgp30/send.asm"
  #endif
#endif

#ifdef MODULES_SGP40
.include "modules/sgp40/main.asm"
  #ifdef MODULES_NETWORK
  .include "modules/sgp40/send.asm"
  #endif
#endif

#ifdef MODULES_OWI_MASTER
.include "modules/owimaster/main.asm"
#endif

#ifdef MODULES_SPI_HW
.include "modules/spi_hw/main.asm"
#endif


#ifdef MODULES_SPI_SW
.include "modules/spi_sw/main.asm"
#endif

#ifdef MODULES_RAM_23LC512
.include "modules/ram/23LC512/main.asm"
#endif

#ifdef MODULES_EE_25LC256
.include "modules/eeprom/25LC256/main.asm"
#endif

#ifdef MODULES_DS18B20
.include "modules/ds18b20/main3.asm"
  #ifdef MODULES_NETWORK
    .include "modules/ds18b20/send.asm"
  #endif
#endif

#ifdef MODULES_DS3231
.include "modules/rtc/ds3231/main.asm"
  #ifdef MODULES_NETWORK
    .include "modules/network/msg/time-d.asm"
    .include "modules/network/msg/time-r.asm"
    .include "modules/network/msg/time-w.asm"
    .include "modules/rtc/ds3231/recv.asm"
    .include "modules/rtc/ds3231/send.asm"
  #endif
#endif

#ifdef MODULES_DS1307
.include "modules/rtc/ds1307/main.asm"
  #ifdef MODULES_NETWORK
    .include "modules/network/msg/time-d.asm"
    .include "modules/network/msg/time-r.asm"
    .include "modules/network/msg/time-w.asm"
    .include "modules/rtc/ds1307/recv.asm"
    .include "modules/rtc/ds1307/send.asm"
  #endif
#endif

#ifdef MODULES_MOTION
.include "modules/motion/main2.asm"
#endif

#ifdef MODULES_CCS811
  .include "modules/ccs811/main.asm"
  #ifdef MODULES_NETWORK
    .include "modules/ccs811/send.asm"
  #endif
#endif

#ifdef MODULES_TCRT1000
  .include "modules/tcrt1000/main2.asm"
#endif

#ifdef MODULES_SK6812
  .include "modules/sk6812/main.asm"
  .include "modules/sk6812/io0.asm"
#endif

#ifdef MODULES_LCD
  .include "modules/lcd/main.asm"
#endif

#ifdef MODULES_ILI9341
.include "modules/lcd2/ili9341/defs.asm"
.include "modules/lcd2/ili9341/colors.asm"
.include "modules/lcd2/ili9341/images.asm"
.include "modules/lcd2/ili9341/main.asm"
.include "modules/lcd2/ili9341/io_spi.asm"
.include "modules/lcd2/ili9341/graphops.asm"
.include "modules/lcd2/ili9341/text.asm"
#endif

#ifdef MODULES_XPT2046
.include "modules/lcd2/xpt2046/main.asm"
#endif

#ifdef MODULES_FONT
.include "modules/lcd2/font/defs.asm"
.include "modules/lcd2/font/main.asm"
#endif

#ifdef MODULES_FONT_8X8
.include "modules/lcd2/font/defs.asm"
.include "modules/lcd2/font/font8x8.asm"
#endif

#ifdef MODULES_FONT_6X8
.include "modules/lcd2/font/defs.asm"
.include "modules/lcd2/font/font6x8.asm"
#endif

#ifdef MODULES_BRIGHTNESS
.include "modules/brightness/main.asm"
  #ifdef MODULES_NETWORK
    .include "modules/brightness/send.asm"
  #endif
#endif


#ifdef MODULES_MULTIFAN
.include "modules/multifan/main.asm"
  #ifdef MODULES_NETWORK
  .include "modules/multifan/recv.asm"
  .include "modules/multifan/send.asm"
  .include "devices/all/handlevaluemsg.asm"
  #endif
#endif



#endif

