parent
2ba25d0f98
commit
0812f21fae
@ -0,0 +1,103 @@ |
||||
;********************************************************************************
|
||||
; SOUBOR : INI_BASE.S
|
||||
; AUTOR : Ondrej Hruska
|
||||
; DATUM : 10/2015
|
||||
; POPIS : Zakladni soubor knihovny. Musi byt includovat pred vsemi ostatnimi.
|
||||
; Soubor definuje rozdeleni adresniho prostoru a adresy periferii.
|
||||
;
|
||||
; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT.
|
||||
;********************************************************************************
|
||||
|
||||
|
||||
FLASH_BASE EQU 0x08000000 ; FLASH base address in the alias region
|
||||
SRAM_BASE EQU 0x20000000 ; SRAM base address in the alias region
|
||||
PERIPH_BASE EQU 0x40000000 ; Peripheral base address in the alias region
|
||||
|
||||
SRAM_BB_BASE EQU (SRAM_BASE + 0x02000000) ; SRAM base address in the bit-band region
|
||||
PERIPH_BB_BASE EQU (PERIPH_BASE + 0x02000000) ; Peripheral base address in the bit-band region
|
||||
|
||||
|
||||
; ------------------------- System Config Blocks -----------------------------
|
||||
|
||||
_SCS_BASE EQU 0xE000E000 ; System Control Space base
|
||||
_SCB EQU (_SCS_BASE + 0x0D00) ; System Control Block base
|
||||
_NVIC EQU (_SCS_BASE + 0x0100) ; Nested Interrupt Vector Controller base
|
||||
_OB EQU 0x1FF80000 ; FLASH Option Bytes base address
|
||||
_AES EQU 0x50060000 ; Encryption module
|
||||
_FSMC EQU 0xA0000000 ; External Memory Control base
|
||||
_DBGMCU EQU 0xE0042000 ; Debug MCU registers base address
|
||||
|
||||
|
||||
; ----------------------------- Peripherals ----------------------------------
|
||||
|
||||
; *** Peripheral bus bases ***
|
||||
_APB1 EQU PERIPH_BASE ; Advanced Peripheral Bus 1 base
|
||||
_APB2 EQU (PERIPH_BASE + 0x10000) ; Advanced Peripheral Bus 2 base
|
||||
_AHB EQU (PERIPH_BASE + 0x20000) ; Advanced High-speed Bus base
|
||||
|
||||
; *** Peripheral Bus 1 devices ***
|
||||
|
||||
_TIM2 EQU (_APB1 + 0x0000) ; Timer bases
|
||||
_TIM3 EQU (_APB1 + 0x0400) |
||||
_TIM4 EQU (_APB1 + 0x0800) |
||||
_TIM5 EQU (_APB1 + 0x0C00) |
||||
_TIM6 EQU (_APB1 + 0x1000) |
||||
_TIM7 EQU (_APB1 + 0x1400) |
||||
|
||||
_LCD EQU (_APB1 + 0x2400) ; LCD controller base
|
||||
_RTC EQU (_APB1 + 0x2800) ; RTC base
|
||||
|
||||
_WWDG EQU (_APB1 + 0x2C00) ; Window Watchdog base
|
||||
_IWDG EQU (_APB1 + 0x3000) ; Independent Watchdog base
|
||||
|
||||
_SPI2 EQU (_APB1 + 0x3800) ; SPI base
|
||||
_SPI3 EQU (_APB1 + 0x3C00) |
||||
|
||||
_USART2 EQU (_APB1 + 0x4400) ; USART base
|
||||
_USART3 EQU (_APB1 + 0x4800) |
||||
|
||||
_UART4 EQU (_APB1 + 0x4C00) ; UART base (?)
|
||||
_UART5 EQU (_APB1 + 0x5000) |
||||
|
||||
_I2C1 EQU (_APB1 + 0x5400) ; I2C base
|
||||
_I2C2 EQU (_APB1 + 0x5800) |
||||
|
||||
_PWR EQU (_APB1 + 0x7000) ; Power Control block base
|
||||
_DAC EQU (_APB1 + 0x7400) ; D/A config base
|
||||
_COMP EQU (_APB1 + 0x7C00) ; Analog Comparator base
|
||||
_RI EQU (_APB1 + 0x7C04) ; Routing Interface base (analog pin connections)
|
||||
_OPAMP EQU (_APB1 + 0x7C5C) ; OpAmp config base
|
||||
|
||||
|
||||
; *** Peripheral Bus 2 devices ***
|
||||
|
||||
_TIM9 EQU (_APB2 + 0x0800) ; Timer base
|
||||
_TIM10 EQU (_APB2 + 0x0C00) |
||||
_TIM11 EQU (_APB2 + 0x1000) |
||||
|
||||
_SYSCFG EQU (_APB2 + 0x0000) ; System config block base
|
||||
_EXTI EQU (_APB2 + 0x0400) ; External interrupt settings base
|
||||
|
||||
_ADC1 EQU (_APB2 + 0x2400) ; A/D 1
|
||||
_ADCC EQU (_APB2 + 0x2700) ; common A/D registers base
|
||||
|
||||
_SDIO EQU (_APB2 + 0x2C00) ; SD host
|
||||
_SPI1 EQU (_APB2 + 0x3000) ; SPI
|
||||
_USART1 EQU (_APB2 + 0x3800) |
||||
|
||||
|
||||
|
||||
; *** High Speed Bus devices ***
|
||||
|
||||
_GPIO EQU (_AHB + 0x0000) ; GPIO block base
|
||||
|
||||
_CRC EQU (_AHB + 0x3000) ; CRC module base
|
||||
_RCC EQU (_AHB + 0x3800) ; Reset and Clock Config base
|
||||
|
||||
_DMA1 EQU (_AHB + 0x6000) ; DMA control base
|
||||
_DMA2 EQU (_AHB + 0x6400) |
||||
|
||||
_FLASH EQU (_AHB + 0x3C00) ; FLASH control base
|
||||
|
||||
|
||||
END |
@ -1,240 +0,0 @@ |
||||
;********************************************************************************
|
||||
; SOUBOR : INI_BITS_GPIO.S
|
||||
; AUTOR : Petr Dousa, Ondrej Hruska
|
||||
; DATUM : 10/2015
|
||||
; POPIS : Bitove masky ridicich registru pro GPIO (I/O brany)
|
||||
;
|
||||
; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT.
|
||||
;********************************************************************************
|
||||
|
||||
|
||||
;****************************************************************************
|
||||
;
|
||||
; General Purpose IOs (GPIO)
|
||||
;
|
||||
;****************************************************************************
|
||||
|
||||
; Short pin masks. Valid for OTYPER, IDR and ODR.
|
||||
GPIO0 EQU 0x00000001 |
||||
GPIO1 EQU 0x00000002 |
||||
GPIO2 EQU 0x00000004 |
||||
GPIO3 EQU 0x00000008 |
||||
GPIO4 EQU 0x00000010 |
||||
GPIO5 EQU 0x00000020 |
||||
GPIO6 EQU 0x00000040 |
||||
GPIO7 EQU 0x00000080 |
||||
GPIO8 EQU 0x00000100 |
||||
GPIO9 EQU 0x00000200 |
||||
GPIO10 EQU 0x00000400 |
||||
GPIO11 EQU 0x00000800 |
||||
GPIO12 EQU 0x00001000 |
||||
GPIO13 EQU 0x00002000 |
||||
GPIO14 EQU 0x00004000 |
||||
GPIO15 EQU 0x00008000 |
||||
|
||||
; OTYPER pattern masks - use as (GPIO_OTYPER_6 & GPIO_OTYPER_OD)
|
||||
GPIO_OTYPER_PP EQU 0x00000000 |
||||
GPIO_OTYPER_OD EQU 0xFFFFFFFF |
||||
|
||||
; For completenes, aliases also for OTYPER, ODR and IDR
|
||||
GPIO_OTYPER_0 EQU 0x00000001 |
||||
GPIO_OTYPER_1 EQU 0x00000002 |
||||
GPIO_OTYPER_2 EQU 0x00000004 |
||||
GPIO_OTYPER_3 EQU 0x00000008 |
||||
GPIO_OTYPER_4 EQU 0x00000010 |
||||
GPIO_OTYPER_5 EQU 0x00000020 |
||||
GPIO_OTYPER_6 EQU 0x00000040 |
||||
GPIO_OTYPER_7 EQU 0x00000080 |
||||
GPIO_OTYPER_8 EQU 0x00000100 |
||||
GPIO_OTYPER_9 EQU 0x00000200 |
||||
GPIO_OTYPER_10 EQU 0x00000400 |
||||
GPIO_OTYPER_11 EQU 0x00000800 |
||||
GPIO_OTYPER_12 EQU 0x00001000 |
||||
GPIO_OTYPER_13 EQU 0x00002000 |
||||
GPIO_OTYPER_14 EQU 0x00004000 |
||||
GPIO_OTYPER_15 EQU 0x00008000 |
||||
|
||||
GPIO_ODR_0 EQU 0x00000001 |
||||
GPIO_ODR_1 EQU 0x00000002 |
||||
GPIO_ODR_2 EQU 0x00000004 |
||||
GPIO_ODR_3 EQU 0x00000008 |
||||
GPIO_ODR_4 EQU 0x00000010 |
||||
GPIO_ODR_5 EQU 0x00000020 |
||||
GPIO_ODR_6 EQU 0x00000040 |
||||
GPIO_ODR_7 EQU 0x00000080 |
||||
GPIO_ODR_8 EQU 0x00000100 |
||||
GPIO_ODR_9 EQU 0x00000200 |
||||
GPIO_ODR_10 EQU 0x00000400 |
||||
GPIO_ODR_11 EQU 0x00000800 |
||||
GPIO_ODR_12 EQU 0x00001000 |
||||
GPIO_ODR_13 EQU 0x00002000 |
||||
GPIO_ODR_14 EQU 0x00004000 |
||||
GPIO_ODR_15 EQU 0x00008000 |
||||
|
||||
GPIO_IDR_0 EQU 0x00000001 |
||||
GPIO_IDR_1 EQU 0x00000002 |
||||
GPIO_IDR_2 EQU 0x00000004 |
||||
GPIO_IDR_3 EQU 0x00000008 |
||||
GPIO_IDR_4 EQU 0x00000010 |
||||
GPIO_IDR_5 EQU 0x00000020 |
||||
GPIO_IDR_6 EQU 0x00000040 |
||||
GPIO_IDR_7 EQU 0x00000080 |
||||
GPIO_IDR_8 EQU 0x00000100 |
||||
GPIO_IDR_9 EQU 0x00000200 |
||||
GPIO_IDR_10 EQU 0x00000400 |
||||
GPIO_IDR_11 EQU 0x00000800 |
||||
GPIO_IDR_12 EQU 0x00001000 |
||||
GPIO_IDR_13 EQU 0x00002000 |
||||
GPIO_IDR_14 EQU 0x00004000 |
||||
GPIO_IDR_15 EQU 0x00008000 |
||||
|
||||
;****************** Bit definition for GPIO_MODER register ****************
|
||||
|
||||
; pattern masks. Use as: (GPIO_MODER_0 & GPIO_MODER_OUTPUT)
|
||||
GPIO_MODER_INPUT EQU 0x00000000 |
||||
GPIO_MODER_OUTPUT EQU 0x55555555 |
||||
GPIO_MODER_AF EQU 0xAAAAAAAA |
||||
GPIO_MODER_ANALOG EQU 0xFFFFFFFF |
||||
|
||||
GPIO_MODER_0 EQU 0x00000003 |
||||
GPIO_MODER_1 EQU 0x0000000C |
||||
GPIO_MODER_2 EQU 0x00000030 |
||||
GPIO_MODER_3 EQU 0x000000C0 |
||||
GPIO_MODER_4 EQU 0x00000300 |
||||
GPIO_MODER_5 EQU 0x00000C00 |
||||
GPIO_MODER_6 EQU 0x00003000 |
||||
GPIO_MODER_7 EQU 0x0000C000 |
||||
GPIO_MODER_8 EQU 0x00030000 |
||||
GPIO_MODER_9 EQU 0x000C0000 |
||||
GPIO_MODER_10 EQU 0x00300000 |
||||
GPIO_MODER_11 EQU 0x00C00000 |
||||
GPIO_MODER_12 EQU 0x03000000 |
||||
GPIO_MODER_13 EQU 0x0C000000 |
||||
GPIO_MODER_14 EQU 0x30000000 |
||||
GPIO_MODER_15 EQU 0xC0000000 |
||||
|
||||
|
||||
;****************** Bit definition for GPIO_OSPEEDR register **************
|
||||
|
||||
; pattern masks. Use as: (GPIO_OSPEEDR_2 & GPIO_OSPEEDR_LOW)
|
||||
GPIO_OSPEEDR_LOW EQU 0x00000000 |
||||
GPIO_OSPEEDR_MEDIUM EQU 0x55555555 |
||||
GPIO_OSPEEDR_HIGH EQU 0xFFFFFFFF |
||||
|
||||
GPIO_OSPEEDR_0 EQU (0x00000003) |
||||
GPIO_OSPEEDR_1 EQU (0x0000000C) |
||||
GPIO_OSPEEDR_2 EQU (0x00000030) |
||||
GPIO_OSPEEDR_3 EQU (0x000000C0) |
||||
GPIO_OSPEEDR_4 EQU (0x00000300) |
||||
GPIO_OSPEEDR_5 EQU (0x00000C00) |
||||
GPIO_OSPEEDR_6 EQU (0x00003000) |
||||
GPIO_OSPEEDR_7 EQU (0x0000C000) |
||||
GPIO_OSPEEDR_8 EQU (0x00030000) |
||||
GPIO_OSPEEDR_9 EQU (0x000C0000) |
||||
GPIO_OSPEEDR_10 EQU (0x00300000) |
||||
GPIO_OSPEEDR_11 EQU (0x00C00000) |
||||
GPIO_OSPEEDR_12 EQU (0x03000000) |
||||
GPIO_OSPEEDR_13 EQU (0x0C000000) |
||||
GPIO_OSPEEDR_14 EQU (0x30000000) |
||||
GPIO_OSPEEDR_15 EQU (0xC0000000) |
||||
|
||||
;****************** Bit definition for GPIO_PUPDR register ****************
|
||||
|
||||
; pattern masks. Use as: (GPIO_PUPDR_6 & GPIO_PUPDR_UP)
|
||||
GPIO_PUPDR_NONE EQU 0x00000000 |
||||
GPIO_PUPDR_UP EQU 0x55555555 |
||||
GPIO_PUPDR_DOWN EQU 0xAAAAAAAA |
||||
|
||||
GPIO_PUPDR_0 EQU (0x00000003) |
||||
GPIO_PUPDR_1 EQU (0x0000000C) |
||||
GPIO_PUPDR_2 EQU (0x00000030) |
||||
GPIO_PUPDR_3 EQU (0x000000C0) |
||||
GPIO_PUPDR_4 EQU (0x00000300) |
||||
GPIO_PUPDR_5 EQU (0x00000C00) |
||||
GPIO_PUPDR_6 EQU (0x00003000) |
||||
GPIO_PUPDR_7 EQU (0x0000C000) |
||||
GPIO_PUPDR_8 EQU (0x00030000) |
||||
GPIO_PUPDR_9 EQU (0x000C0000) |
||||
GPIO_PUPDR_10 EQU (0x00300000) |
||||
GPIO_PUPDR_11 EQU (0x00C00000) |
||||
GPIO_PUPDR_12 EQU (0x03000000) |
||||
GPIO_PUPDR_13 EQU (0x0C000000) |
||||
GPIO_PUPDR_14 EQU (0x30000000) |
||||
GPIO_PUPDR_15 EQU (0xC0000000) |
||||
|
||||
|
||||
;****************** Bit definition for GPIO_BSRR register *****************
|
||||
GPIO_BSRR_BS_0 EQU (0x00000001) |
||||
GPIO_BSRR_BS_1 EQU (0x00000002) |
||||
GPIO_BSRR_BS_2 EQU (0x00000004) |
||||
GPIO_BSRR_BS_3 EQU (0x00000008) |
||||
GPIO_BSRR_BS_4 EQU (0x00000010) |
||||
GPIO_BSRR_BS_5 EQU (0x00000020) |
||||
GPIO_BSRR_BS_6 EQU (0x00000040) |
||||
GPIO_BSRR_BS_7 EQU (0x00000080) |
||||
GPIO_BSRR_BS_8 EQU (0x00000100) |
||||
GPIO_BSRR_BS_9 EQU (0x00000200) |
||||
GPIO_BSRR_BS_10 EQU (0x00000400) |
||||
GPIO_BSRR_BS_11 EQU (0x00000800) |
||||
GPIO_BSRR_BS_12 EQU (0x00001000) |
||||
GPIO_BSRR_BS_13 EQU (0x00002000) |
||||
GPIO_BSRR_BS_14 EQU (0x00004000) |
||||
GPIO_BSRR_BS_15 EQU (0x00008000) |
||||
|
||||
GPIO_BSRR_BR_0 EQU (0x00010000) |
||||
GPIO_BSRR_BR_1 EQU (0x00020000) |
||||
GPIO_BSRR_BR_2 EQU (0x00040000) |
||||
GPIO_BSRR_BR_3 EQU (0x00080000) |
||||
GPIO_BSRR_BR_4 EQU (0x00100000) |
||||
GPIO_BSRR_BR_5 EQU (0x00200000) |
||||
GPIO_BSRR_BR_6 EQU (0x00400000) |
||||
GPIO_BSRR_BR_7 EQU (0x00800000) |
||||
GPIO_BSRR_BR_8 EQU (0x01000000) |
||||
GPIO_BSRR_BR_9 EQU (0x02000000) |
||||
GPIO_BSRR_BR_10 EQU (0x04000000) |
||||
GPIO_BSRR_BR_11 EQU (0x08000000) |
||||
GPIO_BSRR_BR_12 EQU (0x10000000) |
||||
GPIO_BSRR_BR_13 EQU (0x20000000) |
||||
GPIO_BSRR_BR_14 EQU (0x40000000) |
||||
GPIO_BSRR_BR_15 EQU (0x80000000) |
||||
|
||||
;****************** Bit definition for GPIO_LCKR register *****************
|
||||
GPIO_LCKR_0 EQU (0x00000001) |
||||
GPIO_LCKR_1 EQU (0x00000002) |
||||
GPIO_LCKR_2 EQU (0x00000004) |
||||
GPIO_LCKR_3 EQU (0x00000008) |
||||
GPIO_LCKR_4 EQU (0x00000010) |
||||
GPIO_LCKR_5 EQU (0x00000020) |
||||
GPIO_LCKR_6 EQU (0x00000040) |
||||
GPIO_LCKR_7 EQU (0x00000080) |
||||
GPIO_LCKR_8 EQU (0x00000100) |
||||
GPIO_LCKR_9 EQU (0x00000200) |
||||
GPIO_LCKR_10 EQU (0x00000400) |
||||
GPIO_LCKR_11 EQU (0x00000800) |
||||
GPIO_LCKR_12 EQU (0x00001000) |
||||
GPIO_LCKR_13 EQU (0x00002000) |
||||
GPIO_LCKR_14 EQU (0x00004000) |
||||
GPIO_LCKR_15 EQU (0x00008000) |
||||
GPIO_LCKR_K EQU (0x00010000) |
||||
|
||||
;****************** Bit definition for GPIO_AFRL register *****************
|
||||
GPIO_AFRL_0 EQU (0x0000000F) |
||||
GPIO_AFRL_1 EQU (0x000000F0) |
||||
GPIO_AFRL_2 EQU (0x00000F00) |
||||
GPIO_AFRL_3 EQU (0x0000F000) |
||||
GPIO_AFRL_4 EQU (0x000F0000) |
||||
GPIO_AFRL_5 EQU (0x00F00000) |
||||
GPIO_AFRL_6 EQU (0x0F000000) |
||||
GPIO_AFRL_7 EQU (0xF0000000) |
||||
|
||||
;****************** Bit definition for GPIO_AFRH register *****************
|
||||
GPIO_AFRH_8 EQU (0x0000000F) |
||||
GPIO_AFRH_9 EQU (0x000000F0) |
||||
GPIO_AFRH_10 EQU (0x00000F00) |
||||
GPIO_AFRH_11 EQU (0x0000F000) |
||||
GPIO_AFRH_12 EQU (0x000F0000) |
||||
GPIO_AFRH_13 EQU (0x00F00000) |
||||
GPIO_AFRH_14 EQU (0x0F000000) |
||||
GPIO_AFRH_15 EQU (0xF0000000) |
||||
|
||||
END |
@ -1,142 +0,0 @@ |
||||
;********************************************************************************
|
||||
; SOUBOR : INI_BITS_SCB.S
|
||||
; AUTOR : Petr Dousa, Ondrej Hruska
|
||||
; DATUM : 10/2015
|
||||
; POPIS : Bitove masky ridicich registru pro SCB (ovladani systemu + hw info)
|
||||
;
|
||||
; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT.
|
||||
;********************************************************************************
|
||||
|
||||
|
||||
;****************************************************************************
|
||||
;
|
||||
; System Control Block (SCB)
|
||||
;
|
||||
;****************************************************************************
|
||||
|
||||
;***************** Bit definition for SCB_CPUID register ******************
|
||||
SCB_CPUID_REVISION EQU 0x0000000F ; Implementation defined revision number
|
||||
SCB_CPUID_PARTNO EQU 0x0000FFF0 ; Number of processor within family
|
||||
SCB_CPUID_Constant EQU 0x000F0000 ; Reads as 0x0F
|
||||
SCB_CPUID_VARIANT EQU 0x00F00000 ; Implementation defined variant number
|
||||
SCB_CPUID_IMPLEMENTER EQU 0xFF000000 ; Implementer code. ARM is 0x41
|
||||
|
||||
;****************** Bit definition for SCB_ICSR register ******************
|
||||
SCB_ICSR_VECTACTIVE EQU 0x000001FF ; Active ISR number field
|
||||
SCB_ICSR_RETTOBASE EQU 0x00000800 ; All active exceptions minus the IPSR_current_exception yields the empty set
|
||||
SCB_ICSR_VECTPENDING EQU 0x003FF000 ; Pending ISR number field
|
||||
SCB_ICSR_ISRPENDING EQU 0x00400000 ; Interrupt pending flag
|
||||
SCB_ICSR_ISRPREEMPT EQU 0x00800000 ; It indicates that a pending interrupt becomes active in the next running cycle
|
||||
SCB_ICSR_PENDSTCLR EQU 0x02000000 ; Clear pending SysTick bit
|
||||
SCB_ICSR_PENDSTSET EQU 0x04000000 ; Set pending SysTick bit
|
||||
SCB_ICSR_PENDSVCLR EQU 0x08000000 ; Clear pending pendSV bit
|
||||
SCB_ICSR_PENDSVSET EQU 0x10000000 ; Set pending pendSV bit
|
||||
SCB_ICSR_NMIPENDSET EQU 0x80000000 ; Set pending NMI bit
|
||||
|
||||
;****************** Bit definition for SCB_VTOR register ******************
|
||||
SCB_VTOR_TBLOFF EQU 0x1FFFFF80 ; Vector table base offset field
|
||||
SCB_VTOR_TBLBASE EQU 0x20000000 ; Table base in code(0) or RAM(1)
|
||||
|
||||
; ***************** Bit definition for SCB_AIRCR register ******************
|
||||
SCB_AIRCR_VECTKEY EQU 0x05FA0000 ; Value required to enable write to this register
|
||||
SCB_AIRCR_VECTRESET EQU 0x00000001 ; System Reset bit
|
||||
SCB_AIRCR_VECTCLRACTIVE EQU 0x00000002 ; Clear active vector bit
|
||||
SCB_AIRCR_SYSRESETREQ EQU 0x00000004 ; Requests chip control logic to generate a reset
|
||||
|
||||
SCB_AIRCR_PRIGROUP EQU 0x00000700 ; PRIGROUP[2:0] bits (Priority group)
|
||||
SCB_AIRCR_PRIGROUP_0 EQU 0x00000100 ; Bit 0
|
||||
SCB_AIRCR_PRIGROUP_1 EQU 0x00000200 ; Bit 1
|
||||
SCB_AIRCR_PRIGROUP_2 EQU 0x00000400 ; Bit 2
|
||||
|
||||
; prority group configuration
|
||||
SCB_AIRCR_PRIGROUP0 EQU 0x00000000 ; Priority group=0 (7 bits of pre-emption priority, 1 bit of subpriority)
|
||||
SCB_AIRCR_PRIGROUP1 EQU 0x00000100 ; Priority group=1 (6 bits of pre-emption priority, 2 bits of subpriority)
|
||||
SCB_AIRCR_PRIGROUP2 EQU 0x00000200 ; Priority group=2 (5 bits of pre-emption priority, 3 bits of subpriority)
|
||||
SCB_AIRCR_PRIGROUP3 EQU 0x00000300 ; Priority group=3 (4 bits of pre-emption priority, 4 bits of subpriority)
|
||||
SCB_AIRCR_PRIGROUP4 EQU 0x00000400 ; Priority group=4 (3 bits of pre-emption priority, 5 bits of subpriority)
|
||||
SCB_AIRCR_PRIGROUP5 EQU 0x00000500 ; Priority group=5 (2 bits of pre-emption priority, 6 bits of subpriority)
|
||||
SCB_AIRCR_PRIGROUP6 EQU 0x00000600 ; Priority group=6 (1 bit of pre-emption priority, 7 bits of subpriority)
|
||||
SCB_AIRCR_PRIGROUP7 EQU 0x00000700 ; Priority group=7 (no pre-emption priority, 8 bits of subpriority)
|
||||
|
||||
SCB_AIRCR_ENDIANESS EQU 0x00008000 ; Data endianness bit
|
||||
SCB_AIRCR_VECTKEY EQU 0xFFFF0000 ; Register key (VECTKEY) - Reads as 0xFA05 (VECTKEYSTAT)
|
||||
|
||||
;****************** Bit definition for SCB_SCR register *******************
|
||||
SCB_SCR_SLEEPONEXIT EQU 0x02 ; Sleep on exit bit
|
||||
SCB_SCR_SLEEPDEEP EQU 0x04 ; Sleep deep bit
|
||||
SCB_SCR_SEVONPEND EQU 0x10 ; Wake up from WFE
|
||||
|
||||
;******************* Bit definition for SCB_CCR register ******************
|
||||
SCB_CCR_NONBASETHRDENA EQU 0x0001 ; Thread mode can be entered from any level in Handler mode by controlled return value
|
||||
SCB_CCR_USERSETMPEND EQU 0x0002 ; Enables user code to write the Software Trigger Interrupt register to trigger (pend) a Main exception
|
||||
SCB_CCR_UNALIGN_TRP EQU 0x0008 ; Trap for unaligned access
|
||||
SCB_CCR_DIV_0_TRP EQU 0x0010 ; Trap on Divide by 0
|
||||
SCB_CCR_BFHFNMIGN EQU 0x0100 ; Handlers running at priority -1 and -2
|
||||
SCB_CCR_STKALIGN EQU 0x0200 ; On exception entry, the SP used prior to the exception is adjusted to be 8-byte aligned
|
||||
|
||||
;****************** Bit definition for SCB_SHPR register *******************
|
||||
SCB_SHPR_PRI_N EQU 0x000000FF ; Priority of system handler 4,8, and 12. Mem Manage, reserved and Debug Monitor
|
||||
SCB_SHPR_PRI_N1 EQU 0x0000FF00 ; Priority of system handler 5,9, and 13. Bus Fault, reserved and reserved
|
||||
SCB_SHPR_PRI_N2 EQU 0x00FF0000 ; Priority of system handler 6,10, and 14. Usage Fault, reserved and PendSV
|
||||
SCB_SHPR_PRI_N3 EQU 0xFF000000 ; Priority of system handler 7,11, and 15. Reserved, SVCall and SysTick
|
||||
|
||||
;***************** Bit definition for SCB_SHCSR register ******************
|
||||
SCB_SHCSR_MEMFAULTACT EQU 0x00000001 ; MemManage is active
|
||||
SCB_SHCSR_BUSFAULTACT EQU 0x00000002 ; BusFault is active
|
||||
SCB_SHCSR_USGFAULTACT EQU 0x00000008 ; UsageFault is active
|
||||
SCB_SHCSR_SVCALLACT EQU 0x00000080 ; SVCall is active
|
||||
SCB_SHCSR_MONITORACT EQU 0x00000100 ; Monitor is active
|
||||
SCB_SHCSR_PENDSVACT EQU 0x00000400 ; PendSV is active
|
||||
SCB_SHCSR_SYSTICKACT EQU 0x00000800 ; SysTick is active
|
||||
SCB_SHCSR_USGFAULTPENDED EQU 0x00001000 ; Usage Fault is pended
|
||||
SCB_SHCSR_MEMFAULTPENDED EQU 0x00002000 ; MemManage is pended
|
||||
SCB_SHCSR_BUSFAULTPENDED EQU 0x00004000 ; Bus Fault is pended
|
||||
SCB_SHCSR_SVCALLPENDED EQU 0x00008000 ; SVCall is pended
|
||||
SCB_SHCSR_MEMFAULTENA EQU 0x00010000 ; MemManage enable
|
||||
SCB_SHCSR_BUSFAULTENA EQU 0x00020000 ; Bus Fault enable
|
||||
SCB_SHCSR_USGFAULTENA EQU 0x00040000 ; UsageFault enable
|
||||
|
||||
;****************** Bit definition for SCB_CFSR register ******************
|
||||
; MFSR
|
||||
SCB_CFSR_IACCVIOL EQU 0x00000001 ; Instruction access violation
|
||||
SCB_CFSR_DACCVIOL EQU 0x00000002 ; Data access violation
|
||||
SCB_CFSR_MUNSTKERR EQU 0x00000008 ; Unstacking error
|
||||
SCB_CFSR_MSTKERR EQU 0x00000010 ; Stacking error
|
||||
SCB_CFSR_MMARVALID EQU 0x00000080 ; Memory Manage Address Register address valid flag
|
||||
; BFSR
|
||||
SCB_CFSR_IBUSERR EQU 0x00000100 ; Instruction bus error flag
|
||||
SCB_CFSR_PRECISERR EQU 0x00000200 ; Precise data bus error
|
||||
SCB_CFSR_IMPRECISERR EQU 0x00000400 ; Imprecise data bus error
|
||||
SCB_CFSR_UNSTKERR EQU 0x00000800 ; Unstacking error
|
||||
SCB_CFSR_STKERR EQU 0x00001000 ; Stacking error
|
||||
SCB_CFSR_BFARVALID EQU 0x00008000 ; Bus Fault Address Register address valid flag
|
||||
; UFSR
|
||||
SCB_CFSR_UNDEFINSTR EQU 0x00010000 ; The processor attempt to excecute an undefined instruction
|
||||
SCB_CFSR_INVSTATE EQU 0x00020000 ; Invalid combination of EPSR and instruction
|
||||
SCB_CFSR_INVPC EQU 0x00040000 ; Attempt to load EXC_RETURN into pc illegally
|
||||
SCB_CFSR_NOCP EQU 0x00080000 ; Attempt to use a coprocessor instruction
|
||||
SCB_CFSR_UNALIGNED EQU 0x01000000 ; Fault occurs when there is an attempt to make an unaligned memory access
|
||||
SCB_CFSR_DIVBYZERO EQU 0x02000000 ; Fault occurs when SDIV or DIV instruction is used with a divisor of 0
|
||||
|
||||
;****************** Bit definition for SCB_HFSR register ******************
|
||||
SCB_HFSR_VECTTBL EQU 0x00000002 ; Fault occures because of vector table read on exception processing
|
||||
SCB_HFSR_FORCED EQU 0x40000000 ; Hard Fault activated when a configurable Fault was received and cannot activate
|
||||
SCB_HFSR_DEBUGEVT EQU 0x80000000 ; Fault related to debug
|
||||
|
||||
;****************** Bit definition for SCB_DFSR register ******************
|
||||
SCB_DFSR_HALTED EQU 0x01 ; Halt request flag
|
||||
SCB_DFSR_BKPT EQU 0x02 ; BKPT flag
|
||||
SCB_DFSR_DWTTRAP EQU 0x04 ; Data Watchpoint and Trace (DWT) flag
|
||||
SCB_DFSR_VCATCH EQU 0x08 ; Vector catch flag
|
||||
SCB_DFSR_EXTERNAL EQU 0x10 ; External debug request flag
|
||||
|
||||
;****************** Bit definition for SCB_MMFAR register *****************
|
||||
SCB_MMFAR_ADDRESS EQU 0xFFFFFFFF ; Mem Manage fault address field
|
||||
|
||||
;****************** Bit definition for SCB_BFAR register ******************
|
||||
SCB_BFAR_ADDRESS EQU 0xFFFFFFFF ; Bus fault address field
|
||||
|
||||
;****************** Bit definition for SCB_afsr register ******************
|
||||
SCB_AFSR_IMPDEF EQU 0xFFFFFFFF ; Implementation defined
|
||||
|
||||
END |
@ -1,38 +0,0 @@ |
||||
;********************************************************************************
|
||||
; SOUBOR : INI_BITS_SYSTICK.S
|
||||
; AUTOR : Petr Dousa, Ondrej Hruska
|
||||
; DATUM : 10/2015
|
||||
; POPIS : Bitove masky ridicich registru pro SYSTICK (casovac pro RTOS)
|
||||
;
|
||||
; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT.
|
||||
;********************************************************************************
|
||||
|
||||
|
||||
;****************************************************************************
|
||||
;
|
||||
; SystemTick (SysTick)
|
||||
;
|
||||
;****************************************************************************
|
||||
|
||||
;**************** Bit definition for SysTick_CSR register ****************
|
||||
SysTick_CSR_ENABLE EQU 0x00000001 ; Counter enable
|
||||
SysTick_CSR_TICKINT EQU 0x00000002 ; Enable interrupt when counter reaches zero
|
||||
SysTick_CSR_CLKSOURCE EQU 0x00000004 ; Clock source (0 - external, 1 - core clock)
|
||||
|
||||
SysTick_CSR_CLKSOURCE_CORE EQU 0x00000004 ; Clock source - core clock
|
||||
SysTick_CSR_CLKSOURCE_DIV8 EQU 0x00000000 ; Clock source - core clock / 8
|
||||
|
||||
SysTick_CSR_COUNTFLAG EQU 0x00010000 ; Count Flag (only if interrupt is disabled)
|
||||
|
||||
;**************** Bit definition for SysTick_LOAD register ****************
|
||||
SysTick_RELOAD_MASK EQU 0x00FFFFFF ; Value to load into the SysTick Current Value Register when the counter reaches 0
|
||||
|
||||
;**************** Bit definition for SysTick_VAL register *****************
|
||||
SysTick_VAL_MASK EQU 0x00FFFFFF ; Current value at the time the register is accessed
|
||||
|
||||
;**************** Bit definition for SysTick_CALIB register ***************
|
||||
SysTick_CALIB_TENMS EQU 0x00FFFFFF ; Reload value to use for 10ms timing
|
||||
SysTick_CALIB_SKEW EQU 0x40000000 ; Calibration value is not exactly 10 ms
|
||||
SysTick_CALIB_NOREF EQU 0x80000000 ; The reference clock is not provided
|
||||
|
||||
END |
@ -0,0 +1,199 @@ |
||||
;****************************************************************************
|
||||
; SOUBOR : INI_SCB.S
|
||||
; AUTOR : Petr Dousa, Ondrej Hruska
|
||||
; DATUM : 10/2015
|
||||
|
||||
; System Control Block (SCB)
|
||||
;
|
||||
; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT.
|
||||
;****************************************************************************
|
||||
|
||||
|
||||
;****************************************************************************
|
||||
;*
|
||||
;* REGISTERS
|
||||
;*
|
||||
;****************************************************************************
|
||||
|
||||
|
||||
SCB_CPUID EQU (_SCB + 0x000) ; (R/ ) CPUID Base Register
|
||||
SCB_ICSR EQU (_SCB + 0x004) ; (R/W) Interrupt Control and State Register
|
||||
SCB_VTOR EQU (_SCB + 0x008) ; (R/W) Vector Table Offset Register
|
||||
SCB_AIRCR EQU (_SCB + 0x00C) ; (R/W) Application Interrupt and Reset Control Register
|
||||
SCB_SCR EQU (_SCB + 0x010) ; (R/W) System Control Register
|
||||
SCB_CCR EQU (_SCB + 0x014) ; (R/W) Configuration Control Register
|
||||
SCB_SHPR1 EQU (_SCB + 0x018) ; (R/W) System Handler Priority Register 1 (4-7)
|
||||
SCB_SHPR2 EQU (_SCB + 0x01C) ; (R/W) System Handler Priority Register 2 (8-11)
|
||||
SCB_SHPR3 EQU (_SCB + 0x020) ; (R/W) System Handler Priority Register 3 (12-15)
|
||||
SCB_SHCSR EQU (_SCB + 0x024) ; (R/W) System Handler Control and State Register
|
||||
SCB_CFSR EQU (_SCB + 0x028) ; (R/W) Configurable Fault Status Register
|
||||
SCB_HFSR EQU (_SCB + 0x02C) ; (R/W) HardFault Status Register
|
||||
SCB_DFSR EQU (_SCB + 0x030) ; (R/W) Debug Fault Status Register
|
||||
SCB_MMFAR EQU (_SCB + 0x034) ; (R/W) MemManage Fault Address Register
|
||||
SCB_BFAR EQU (_SCB + 0x038) ; (R/W) BusFault Address Register
|
||||
SCB_AFSR EQU (_SCB + 0x03C) ; (R/W) Auxiliary Fault Status Register
|
||||
; skipped Feature Registers
|
||||
SCB_CPACR EQU (_SCB + 0x088) ; (R/W) Coprocessor Access Control Register
|
||||
|
||||
|
||||
|
||||
;****************************************************************************
|
||||
;*
|
||||
;* BIT MASKS AND DEFINITIONS
|
||||
;*
|
||||
;****************************************************************************
|
||||
|
||||
|
||||
;***************** Bit definition for SCB_CPUID register ******************
|
||||
|
||||
SCB_CPUID_REVISION EQU 0x0000000F ; Implementation defined revision number
|
||||
SCB_CPUID_PARTNO EQU 0x0000FFF0 ; Number of processor within family
|
||||
SCB_CPUID_Constant EQU 0x000F0000 ; Reads as 0x0F
|
||||
SCB_CPUID_VARIANT EQU 0x00F00000 ; Implementation defined variant number
|
||||
SCB_CPUID_IMPLEMENTER EQU 0xFF000000 ; Implementer code. ARM is 0x41
|
||||
|
||||
|
||||
;****************** Bit definition for SCB_ICSR register ******************
|
||||
|
||||
SCB_ICSR_VECTACTIVE EQU 0x000001FF ; Active ISR number field
|
||||
SCB_ICSR_RETTOBASE EQU 0x00000800 ; All active exceptions minus the IPSR_current_exception yields the empty set
|
||||
SCB_ICSR_VECTPENDING EQU 0x003FF000 ; Pending ISR number field
|
||||
SCB_ICSR_ISRPENDING EQU 0x00400000 ; Interrupt pending flag
|
||||
SCB_ICSR_ISRPREEMPT EQU 0x00800000 ; It indicates that a pending interrupt becomes active in the next running cycle
|
||||
SCB_ICSR_PENDSTCLR EQU 0x02000000 ; Clear pending SysTick bit
|
||||
SCB_ICSR_PENDSTSET EQU 0x04000000 ; Set pending SysTick bit
|
||||
SCB_ICSR_PENDSVCLR EQU 0x08000000 ; Clear pending pendSV bit
|
||||
SCB_ICSR_PENDSVSET EQU 0x10000000 ; Set pending pendSV bit
|
||||
SCB_ICSR_NMIPENDSET EQU 0x80000000 ; Set pending NMI bit
|
||||
|
||||
|
||||
;****************** Bit definition for SCB_VTOR register ******************
|
||||
|
||||
SCB_VTOR_TBLOFF EQU 0x1FFFFF80 ; Vector table base offset field
|
||||
SCB_VTOR_TBLBASE EQU 0x20000000 ; Table base in code(0) or RAM(1)
|
||||
|
||||
|
||||
; ***************** Bit definition for SCB_AIRCR register ******************
|
||||
|
||||
SCB_AIRCR_VECTKEY EQU 0x05FA0000 ; Value required to enable write to this register
|
||||
SCB_AIRCR_VECTRESET EQU 0x00000001 ; System Reset bit
|
||||
SCB_AIRCR_VECTCLRACTIVE EQU 0x00000002 ; Clear active vector bit
|
||||
SCB_AIRCR_SYSRESETREQ EQU 0x00000004 ; Requests chip control logic to generate a reset
|
||||
|
||||
SCB_AIRCR_PRIGROUP EQU 0x00000700 ; PRIGROUP[2:0] bits (Priority group)
|
||||
SCB_AIRCR_PRIGROUP_0 EQU 0x00000100 ; Bit 0
|
||||
SCB_AIRCR_PRIGROUP_1 EQU 0x00000200 ; Bit 1
|
||||
SCB_AIRCR_PRIGROUP_2 EQU 0x00000400 ; Bit 2
|
||||
|
||||
; prority group configuration
|
||||
SCB_AIRCR_PRIGROUP0 EQU 0x00000000 ; Priority group=0 (7 bits of pre-emption priority, 1 bit of subpriority)
|
||||
SCB_AIRCR_PRIGROUP1 EQU 0x00000100 ; Priority group=1 (6 bits of pre-emption priority, 2 bits of subpriority)
|
||||
SCB_AIRCR_PRIGROUP2 EQU 0x00000200 ; Priority group=2 (5 bits of pre-emption priority, 3 bits of subpriority)
|
||||
SCB_AIRCR_PRIGROUP3 EQU 0x00000300 ; Priority group=3 (4 bits of pre-emption priority, 4 bits of subpriority)
|
||||
SCB_AIRCR_PRIGROUP4 EQU 0x00000400 ; Priority group=4 (3 bits of pre-emption priority, 5 bits of subpriority)
|
||||
SCB_AIRCR_PRIGROUP5 EQU 0x00000500 ; Priority group=5 (2 bits of pre-emption priority, 6 bits of subpriority)
|
||||
SCB_AIRCR_PRIGROUP6 EQU 0x00000600 ; Priority group=6 (1 bit of pre-emption priority, 7 bits of subpriority)
|
||||
SCB_AIRCR_PRIGROUP7 EQU 0x00000700 ; Priority group=7 (no pre-emption priority, 8 bits of subpriority)
|
||||
|
||||
SCB_AIRCR_ENDIANESS EQU 0x00008000 ; Data endianness bit
|
||||
SCB_AIRCR_VECTKEY EQU 0xFFFF0000 ; Register key (VECTKEY) - Reads as 0xFA05 (VECTKEYSTAT)
|
||||
|
||||
|
||||
;****************** Bit definition for SCB_SCR register *******************
|
||||
|
||||
SCB_SCR_SLEEPONEXIT EQU 0x02 ; Sleep on exit bit
|
||||
SCB_SCR_SLEEPDEEP EQU 0x04 ; Sleep deep bit
|
||||
SCB_SCR_SEVONPEND EQU 0x10 ; Wake up from WFE
|
||||
|
||||
|
||||
;******************* Bit definition for SCB_CCR register ******************
|
||||
|
||||
SCB_CCR_NONBASETHRDENA EQU 0x0001 ; Thread mode can be entered from any level in Handler mode by controlled return value
|
||||
SCB_CCR_USERSETMPEND EQU 0x0002 ; Enables user code to write the Software Trigger Interrupt register to trigger (pend) a Main exception
|
||||
SCB_CCR_UNALIGN_TRP EQU 0x0008 ; Trap for unaligned access
|
||||
SCB_CCR_DIV_0_TRP EQU 0x0010 ; Trap on Divide by 0
|
||||
SCB_CCR_BFHFNMIGN EQU 0x0100 ; Handlers running at priority -1 and -2
|
||||
SCB_CCR_STKALIGN EQU 0x0200 ; On exception entry, the SP used prior to the exception is adjusted to be 8-byte aligned
|
||||
|
||||
|
||||
;****************** Bit definition for SCB_SHPR register *******************
|
||||
|
||||
SCB_SHPR_PRI_N EQU 0x000000FF ; Priority of system handler 4,8, and 12. Mem Manage, reserved and Debug Monitor
|
||||
SCB_SHPR_PRI_N1 EQU 0x0000FF00 ; Priority of system handler 5,9, and 13. Bus Fault, reserved and reserved
|
||||
SCB_SHPR_PRI_N2 EQU 0x00FF0000 ; Priority of system handler 6,10, and 14. Usage Fault, reserved and PendSV
|
||||
SCB_SHPR_PRI_N3 EQU 0xFF000000 ; Priority of system handler 7,11, and 15. Reserved, SVCall and SysTick
|
||||
|
||||
|
||||
;***************** Bit definition for SCB_SHCSR register ******************
|
||||
|
||||
SCB_SHCSR_MEMFAULTACT EQU 0x00000001 ; MemManage is active
|
||||
SCB_SHCSR_BUSFAULTACT EQU 0x00000002 ; BusFault is active
|
||||
SCB_SHCSR_USGFAULTACT EQU 0x00000008 ; UsageFault is active
|
||||
SCB_SHCSR_SVCALLACT EQU 0x00000080 ; SVCall is active
|
||||
SCB_SHCSR_MONITORACT EQU 0x00000100 ; Monitor is active
|
||||
SCB_SHCSR_PENDSVACT EQU 0x00000400 ; PendSV is active
|
||||
SCB_SHCSR_SYSTICKACT EQU 0x00000800 ; SysTick is active
|
||||
SCB_SHCSR_USGFAULTPENDED EQU 0x00001000 ; Usage Fault is pended
|
||||
SCB_SHCSR_MEMFAULTPENDED EQU 0x00002000 ; MemManage is pended
|
||||
SCB_SHCSR_BUSFAULTPENDED EQU 0x00004000 ; Bus Fault is pended
|
||||
SCB_SHCSR_SVCALLPENDED EQU 0x00008000 ; SVCall is pended
|
||||
SCB_SHCSR_MEMFAULTENA EQU 0x00010000 ; MemManage enable
|
||||
SCB_SHCSR_BUSFAULTENA EQU 0x00020000 ; Bus Fault enable
|
||||
SCB_SHCSR_USGFAULTENA EQU 0x00040000 ; UsageFault enable
|
||||
|
||||
|
||||
;****************** Bit definition for SCB_CFSR register ******************
|
||||
|
||||
; MFSR
|
||||
SCB_CFSR_IACCVIOL EQU 0x00000001 ; Instruction access violation
|
||||
SCB_CFSR_DACCVIOL EQU 0x00000002 ; Data access violation
|
||||
SCB_CFSR_MUNSTKERR EQU 0x00000008 ; Unstacking error
|
||||
SCB_CFSR_MSTKERR EQU 0x00000010 ; Stacking error
|
||||
SCB_CFSR_MMARVALID EQU 0x00000080 ; Memory Manage Address Register address valid flag
|
||||
; BFSR
|
||||
SCB_CFSR_IBUSERR EQU 0x00000100 ; Instruction bus error flag
|
||||
SCB_CFSR_PRECISERR EQU 0x00000200 ; Precise data bus error
|
||||
SCB_CFSR_IMPRECISERR EQU 0x00000400 ; Imprecise data bus error
|
||||
SCB_CFSR_UNSTKERR EQU 0x00000800 ; Unstacking error
|
||||
SCB_CFSR_STKERR EQU 0x00001000 ; Stacking error
|
||||
SCB_CFSR_BFARVALID EQU 0x00008000 ; Bus Fault Address Register address valid flag
|
||||
; UFSR
|
||||
SCB_CFSR_UNDEFINSTR EQU 0x00010000 ; The processor attempt to excecute an undefined instruction
|
||||
SCB_CFSR_INVSTATE EQU 0x00020000 ; Invalid combination of EPSR and instruction
|
||||
SCB_CFSR_INVPC EQU 0x00040000 ; Attempt to load EXC_RETURN into pc illegally
|
||||
SCB_CFSR_NOCP EQU 0x00080000 ; Attempt to use a coprocessor instruction
|
||||
SCB_CFSR_UNALIGNED EQU 0x01000000 ; Fault occurs when there is an attempt to make an unaligned memory access
|
||||
SCB_CFSR_DIVBYZERO EQU 0x02000000 ; Fault occurs when SDIV or DIV instruction is used with a divisor of 0
|
||||
|
||||
|
||||
;****************** Bit definition for SCB_HFSR register ******************
|
||||
|
||||
SCB_HFSR_VECTTBL EQU 0x00000002 ; Fault occures because of vector table read on exception processing
|
||||
SCB_HFSR_FORCED EQU 0x40000000 ; Hard Fault activated when a configurable Fault was received and cannot activate
|
||||
SCB_HFSR_DEBUGEVT EQU 0x80000000 ; Fault related to debug
|
||||
|
||||
|
||||
;****************** Bit definition for SCB_DFSR register ******************
|
||||
|
||||
SCB_DFSR_HALTED EQU 0x01 ; Halt request flag
|
||||
SCB_DFSR_BKPT EQU 0x02 ; BKPT flag
|
||||
SCB_DFSR_DWTTRAP EQU 0x04 ; Data Watchpoint and Trace (DWT) flag
|
||||
SCB_DFSR_VCATCH EQU 0x08 ; Vector catch flag
|
||||
SCB_DFSR_EXTERNAL EQU 0x10 ; External debug request flag
|
||||
|
||||
|
||||
;****************** Bit definition for SCB_MMFAR register *****************
|
||||
|
||||
SCB_MMFAR_ADDRESS EQU 0xFFFFFFFF ; Mem Manage fault address field
|
||||
|
||||
|
||||
;****************** Bit definition for SCB_BFAR register ******************
|
||||
|
||||
SCB_BFAR_ADDRESS EQU 0xFFFFFFFF ; Bus fault address field
|
||||
|
||||
|
||||
;****************** Bit definition for SCB_afsr register ******************
|
||||
|
||||
SCB_AFSR_IMPDEF EQU 0xFFFFFFFF ; Implementation defined
|
||||
|
||||
END |
@ -0,0 +1,61 @@ |
||||
;****************************************************************************
|
||||
; SOUBOR : INI_SYSTICK.S
|
||||
; AUTOR : Petr Dousa, Ondrej Hruska
|
||||
; DATUM : 10/2015
|
||||
;
|
||||
; System Timer (SysTick)
|
||||
;
|
||||
; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT.
|
||||
;****************************************************************************
|
||||
|
||||
|
||||
;****************************************************************************
|
||||
;*
|
||||
;* REGISTERS
|
||||
;*
|
||||
;****************************************************************************
|
||||
|
||||
|
||||
SysTick_CSR EQU (_SCS_BASE + 0x010) ; (R/W) SysTick Control and Status Register
|
||||
SysTick_RELOAD EQU (_SCS_BASE + 0x014) ; (R/W) SysTick Reload Value Register
|
||||
SysTick_VAL EQU (_SCS_BASE + 0x018) ; (R/W) SysTick Current Value Register
|
||||
SysTick_CALIB EQU (_SCS_BASE + 0x01C) ; (R/ ) SysTick Calibration Value Register
|
||||
|
||||
|
||||
|
||||
;****************************************************************************
|
||||
;*
|
||||
;* BIT MASKS AND DEFINITIONS
|
||||
;*
|
||||
;****************************************************************************
|
||||
|
||||
|
||||
;**************** Bit definition for SysTick_CSR register ****************
|
||||
|
||||
SysTick_CSR_ENABLE EQU 0x00000001 ; Counter enable
|
||||
SysTick_CSR_TICKINT EQU 0x00000002 ; Enable interrupt when counter reaches zero
|
||||
SysTick_CSR_CLKSOURCE EQU 0x00000004 ; Clock source (0 - external, 1 - core clock)
|
||||
|
||||
SysTick_CSR_CLKSOURCE_CORE EQU 0x00000004 ; Clock source - core clock
|
||||
SysTick_CSR_CLKSOURCE_DIV8 EQU 0x00000000 ; Clock source - core clock / 8
|
||||
|
||||
SysTick_CSR_COUNTFLAG EQU 0x00010000 ; Count Flag (only if interrupt is disabled)
|
||||
|
||||
|
||||
;**************** Bit definition for SysTick_LOAD register ****************
|
||||
|
||||
SysTick_RELOAD_MASK EQU 0x00FFFFFF ; Reload value used when the counter reaches 0
|
||||
|
||||
|
||||
;**************** Bit definition for SysTick_VAL register *****************
|
||||
|
||||
SysTick_VAL_MASK EQU 0x00FFFFFF ; Current value at the time the register is accessed
|
||||
|
||||
|
||||
;**************** Bit definition for SysTick_CALIB register ***************
|
||||
|
||||
SysTick_CALIB_TENMS EQU 0x00FFFFFF ; Reload value to use for 10ms timing
|
||||
SysTick_CALIB_SKEW EQU 0x40000000 ; Calibration value is not exactly 10 ms
|
||||
SysTick_CALIB_NOREF EQU 0x80000000 ; The reference clock is not provided
|
||||
|
||||
END |
Loading…
Reference in new issue