@GNU AS
@.CHARSET =CP1251 ( Cyrillic )

@.DESC     type=module
@ +------------------------------------------------------------------+
@ |               Определения  SYSTICK (раздел 4.4 PM215)            |
@ |                   STM32F030xxx \ STM32F070xxx                    |
@ +------------------------------------------------------------------+
@.ENDDESC

.INCLUDE            "/src/inc/base.inc"

@.ITEM     CORE
.EQU  STK           , CORE_BASE + 0xE000
@.end

@.ITEM     STK
.EQU  STK_CSR       , 0x10       @ SysTick control and status register (STK_CSR)
.EQU  STK_RVR       , 0X14       @ SysTick reload value register (STK_RVR)
.EQU  STK_CVR       , 0x18       @ SysTick current value register (STK_CVR)
.EQU  STK_CALIB     , 0x1C       @ SysTick calibration value register (STK_CALIB)
@.END

@.ITEM     STK_CSR
.EQU STK_CSR_COUNTFLAG, 1<<16    @ Bit 16 COUNTFLAG:
                                 @ Returns 1 if timer counted to 0 since last time this was read.
.EQU  STK_CSR_CLKSOURCE, 1 << 2  @ Bit 2 CLKSOURCE: Clock source selection
                                 @ Selects the timer clock source.
                                 @ 0: External reference clock
                                 @ 1: Processor clock
.EQU  STK_CSR_TICKINT, 1 << 1    @ Bit 1 TICKINT: SysTick exception request enable
                                 @ 0: Counting down to zero does not assert the SysTick exception request
                                 @ 1: Counting down to zero to asserts the SysTick exception request.
.EQU  STK_CSR_ENABLE, 1          @ Bit 0 ENABLE: Counter enable
                                 @ Enables the counter. When ENABLE is set to 1, the counter starts counting down. On reaching
                                 @ 0, it sets the COUNTFLAG to 1 and optionally asserts the SysTick depending on the value of
                                 @ TICKINT. It then loads the RELOAD value again, and begins counting.
                                 @ 0: Counter disabled
                                 @ 1: Counter enabled
@.END



