from __future__ import annotations

from .cli import build_arg_parser, discover_rom_path, load_rom, main
from .constants import (
    HEARTBEAT_FRAME,
    FRT_TCR_OCIEA,
    FRT_TCSR_CCLRA,
    FRT_TCSR_OCFA,
    FRT1_FRC_H,
    FRT1_FRC_L,
    FRT1_OCRA_H,
    FRT1_OCRA_L,
    FRT1_TCR,
    FRT1_TCSR,
    FRT2_FRC_H,
    FRT2_FRC_L,
    FRT2_OCRA_H,
    FRT2_OCRA_L,
    FRT2_TCR,
    FRT2_TCSR,
    IPRA,
    IPRC,
    IPRE,
    ON_CHIP_RAM_END,
    ON_CHIP_RAM_START,
    P7DDR,
    P7DR,
    P9DDR,
    P9DR,
    RAMCR,
    REGISTER_FIELD_END,
    REGISTER_FIELD_START,
    SCI_SCR_RE,
    SCI_SCR_RIE,
    SCI_SCR_TE,
    SCI_SCR_TIE,
    SCI_SSR_FER,
    SCI_SSR_ORER,
    SCI_SSR_PER,
    SCI_SSR_RDRF,
    SCI_SSR_TDRE,
    SCI1_BRR,
    SCI1_RDR,
    SCI1_SCR,
    SCI1_SMR,
    SCI1_SSR,
    SCI1_TDR,
    VECTOR_FRT1_OCIA,
    VECTOR_INTERVAL_TIMER,
    VECTOR_FRT2_OCIA,
    VECTOR_SCI1_ERI,
    VECTOR_SCI1_RXI,
    VECTOR_SCI1_TXI,
    WDT_TCSR_R,
)
from .cpu import CPUState
from .errors import EmulatorError, UnsupportedInstruction
from .fast_paths import P9FastPath, P9FastPathConfig, P9FastPathEvent
from .memory import MemoryAccess, MemoryMap, describe_regions
from .peripherals import LCD, P9TraceEvent, X24164Bus, X24164Device, X24164TraceEvent, factory_default_words_from_rom
from .runner import H8536Emulator, RunReport
from .sci import SCI1, SciTxEvent
from .uart import UartTiming

__all__ = [
    "CPUState",
    "EmulatorError",
    "FRT1_TCR",
    "FRT1_TCSR",
    "FRT1_FRC_H",
    "FRT1_FRC_L",
    "FRT1_OCRA_H",
    "FRT1_OCRA_L",
    "FRT2_TCR",
    "FRT2_TCSR",
    "FRT2_FRC_H",
    "FRT2_FRC_L",
    "FRT2_OCRA_H",
    "FRT2_OCRA_L",
    "FRT_TCR_OCIEA",
    "FRT_TCSR_CCLRA",
    "FRT_TCSR_OCFA",
    "HEARTBEAT_FRAME",
    "H8536Emulator",
    "IPRA",
    "IPRC",
    "IPRE",
    "LCD",
    "MemoryAccess",
    "MemoryMap",
    "ON_CHIP_RAM_END",
    "ON_CHIP_RAM_START",
    "P7DDR",
    "P7DR",
    "P9DDR",
    "P9DR",
    "P9FastPath",
    "P9FastPathConfig",
    "P9FastPathEvent",
    "P9TraceEvent",
    "RAMCR",
    "REGISTER_FIELD_END",
    "REGISTER_FIELD_START",
    "RunReport",
    "SCI1",
    "SCI1_BRR",
    "SCI1_RDR",
    "SCI1_SCR",
    "SCI1_SMR",
    "SCI1_SSR",
    "SCI1_TDR",
    "SCI_SCR_RE",
    "SCI_SCR_RIE",
    "SCI_SCR_TE",
    "SCI_SCR_TIE",
    "SCI_SSR_FER",
    "SCI_SSR_ORER",
    "SCI_SSR_PER",
    "SCI_SSR_RDRF",
    "SCI_SSR_TDRE",
    "SciTxEvent",
    "UnsupportedInstruction",
    "UartTiming",
    "VECTOR_FRT1_OCIA",
    "VECTOR_INTERVAL_TIMER",
    "VECTOR_FRT2_OCIA",
    "VECTOR_SCI1_ERI",
    "VECTOR_SCI1_RXI",
    "VECTOR_SCI1_TXI",
    "WDT_TCSR_R",
    "X24164Bus",
    "X24164Device",
    "X24164TraceEvent",
    "build_arg_parser",
    "describe_regions",
    "discover_rom_path",
    "factory_default_words_from_rom",
    "load_rom",
    "main",
]
