@GNU AS
@.CharSet=CP1251 (Cyrillic)
@.desc type=module
@ +------------------------------------------------------------------+
@ |                     Базовые константы WWDG                       |
@ +------------------------------------------------------------------+
@.enddesc

.include   "/src/inc/base.inc"

@.item     APB1PERIPH_BASE
.equ  WWDG_BASE          , APB1PERIPH_BASE + 0x2C00
.equ  WWDG               , PERIPH_BASE + WWDG_BASE


@.item    WWDG_BASE
.EQU  WWDG_CR            , 0x00          @ WWDG Control register
.EQU  WWDG_CFR           , 0x04          @ WWDG Configuration register
.EQU  WWDG_SR            , 0x08          @ WWDG Status register
@.END

@.item     WWDG_CR
.EQU  WWDG_CR_WDGA       , 1 << 7        @Bit 7 WDGA: Activation bit
.EQU  WWDG_CR_T          , 0x7F          @Bits 6:0 T[6:0]: 7-bit counter (MSB to LSB)
.EQU  WWDG_CR_T0         , 0x01          @Bit 0
.EQU  WWDG_CR_T1         , 0x02          @Bit 1
.EQU  WWDG_CR_T2         , 0x04          @Bit 2
.EQU  WWDG_CR_T3         , 0x08          @Bit 3
.EQU  WWDG_CR_T4         , 1 << 4        @Bit 4
.EQU  WWDG_CR_T5         , 1 << 5        @Bit 5
.EQU  WWDG_CR_T6         , 1 << 6        @Bit 6
@.END

@.item     WWDG_CFR
.EQU  WWDG_CFR_EWI       , 0x0200        @Bit 9 EWI: Early wakeup interrupt
.EQU  WWDG_CFR_WDGTB     , 0x0180        @Bits 8:7 WDGTB[1:0]: Timer base
.EQU  WWDG_CFR_WDGTB_N   , 7
.EQU  WWDG_CFR_WDGTB1    , 1 << 8        @Bit 1
.EQU  WWDG_CFR_WDGTB0    , 1 << 7        @Bit 0
.EQU  WWDG_CFR_W         , 0x7F          @Bits 6:0 W[6:0]: 7-bit window value
.EQU  WWDG_CFR_W6        , 1 << 6        @Bit 6
.EQU  WWDG_CFR_W5        , 1 << 5        @Bit 5
.EQU  WWDG_CFR_W4        , 1 << 4        @Bit 4
.EQU  WWDG_CFR_W3        , 0x0008        @Bit 3
.EQU  WWDG_CFR_W1        , 0x0002        @Bit 1
.EQU  WWDG_CFR_W0        , 0x0001        @Bit 0
@.END

@.item     WWDG_SR
.EQU  WWDG_SR_EWIF       , 0x01          @Bit 0 EWIF: Early wakeup interrupt flag
@.END
