@.CharSet=CP1251 (Cyrillic)
@GNU AS
@.desc type=module
@ +------------------------------------------------------------------+
@ |                              Константы CRC                       |
@ |                              для STM32F303                       |
@ +------------------------------------------------------------------+
@.enddesc


.include "/src/inc/base.inc"
@.item AHB1PERIPH_BASE
.equ CRC            , (AHB1PERIPH_BASE + 0x3000)

@.item CRC
.EQU  CRC_DR             , 0x00          @ Data register (CRC_DR)
.EQU  CRC_IDR            , 0x04          @ Independent data register (CRC_IDR)
.EQU  CRC_CR             , 0x08          @ Control register (CRC_CR)
.EQU  CRC_INIT           , 0x10          @ Initial CRC value (CRC_INIT)
.EQU  CRC_POL            , 0x14          @ CRC polynomial (CRC_POL)
@.end

@.item CRC_IDR
.EQU  CRC_IDR_IDR_M      , 0x000000FF    @ General-purpose 8-bit data register bits
@.end

@.item CRC_CR
.EQU  CRC_CR_RESET_N     , 0             @ Bit 0 RESET: RESET bit
.EQU  CRC_CR_RESET       , 1             @ Resets the CRC calculation unit and sets the data register to 0xFFFF FFFF
.EQU  CRC_CR_POLYSIZE_N  , 3             @ Bits 4:3 POLYSIZE[1:0]: Polynomial size
.EQU  CRC_CR_POLYSIZE_0  , 0<<3          @ 32 bit polynomial
.EQU  CRC_CR_POLYSIZE_1  , 1<<3          @ 16 bit polynomial
.EQU  CRC_CR_POLYSIZE_2  , 2<<3          @ 8 bit polynomial
.EQU  CRC_CR_POLYSIZE_3  , 3<<3          @ 7 bit polynomial
.EQU  CRC_CR_REV_IN_N    , 5             @ Bits 6:5 REV_IN[1:0]: Reverse input data
.EQU  CRC_CR_REV_IN_0    , 0<<5          @ Bit order not affected
.EQU  CRC_CR_REV_IN_1    , 1<<5          @ Bit reversal done by byte
.EQU  CRC_CR_REV_IN_2    , 2<<5          @ Bit reversal done by half-word
.EQU  CRC_CR_REV_IN_3    , 3<<5          @ Bit reversal done by word
.EQU  CRC_CR_REV_OUT_N   , 7             @ Bit 7 REV_OUT: Reverse output data
.EQU  CRC_CR_REV_OUT     , 1<<7          @ Bit-reversed output format
@.end

@.ITEM CRC_INIT
.EQU CRC_INIT_RST_VAL    , 0xFFFFFFFF    @ RESET value
@.END

@.ITEM CRC_POL
.EQU CRC_POL_RST_VAL     , 0x04C11DB7    @ Reset value
@.END


