@.CHARSET CP1251

@ +--------------------------------------------------+
@ |                   Определения CRC                |
@ |                     STM32F0xxx                   |
@ +--------------------------------------------------+

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

@.ITEM     AHB1PERIPH_BASE
.EQU  CRC_BASE      , AHB1PERIPH_BASE + 0x3000
.EQU  CRC           , PERIPH_BASE + CRC_BASE
@.END

@.ITEM     CRC_BASE 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)
@.end

@.item CRC_DR
.equ CRC_DR_RST_VAL, 0xFFFFFFFF @ Reset Value
@.end.

@.item CRC_IDR
.equ CRC_IDR_M, 0x000000FF  @ Bits 7:0 IDR[7:0]: General-purpose 8-bit data register bits
                            @ These bits can be used as a temporary storage location for one byte.
                            @ This register is not affected by CRC resets generated by the RESET bit in the CRC_CR register
@.end

@.item CRC_CR
.equ CRC_CR_REV_OUT, 1<<7 @ Bit 7 REV_OUT: Reverse output data
                          @ This bit controls the reversal of the bit order of the output data.
                          @ 0: Bit order not affected
                          @ 1: Bit-reversed output format
.equ CRC_CR_REV_IN_N, 5   @ Bits 6:5 REV_IN[1:0]: Reverse input data
                          @ These bits control the reversal of the bit order of the input data
.equ CRC_CR_REV_IN_NA, 0    @ 00: Bit order not affected
.equ CRC_CR_REV_IN_BB, 1<<5 @ 01: Bit reversal done by byte
.equ CRC_CR_REV_IN_HW, 2<<5 @ 10: Bit reversal done by half-word
.equ CRC_CR_REV_IN_BW, 3<<5 @ Bit reversal done by word
.equ CRC_CR_RESET, 1      @ Bit 0 RESET: RESET bit
                          @ This bit is set by software to reset the CRC calculation unit and set the data register to the value
                          @ stored in the CRC_INIT register. This bit can only be set, it is automatically cleared by hardware
@.end


