diff --git a/LICENSE b/LICENSE index 6941a3c..a80d7d8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,27 +1,10 @@ -The MIT License (MIT) -Contributors: +Copyright (c) 2010 Michal Tomáš - part of the example program +Copyright (c) 2015 Petr Douša - conversion of CMSIS defintions to assembler +Copyright (c) 2015 Ondřej Hruška - library cleanup, bit-banding & missing definitions -Copyright (c) 2010 Michal Tomáš - část vzorového programu -Copyright (c) 2015 Petr Douša - základ knihovny dle CMSIS -Copyright (c) 2015 Ondřej Hruška - doplnění knihovny, Makefile - - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The library can be freely used for educational and non-commercial purposes, +provided the copyright notices and header comments are retained. +Since a substantial portion of the library is derived from STM32 CMSIS, the original +license conditions should be respected. diff --git a/lib/INI_ADC.s b/lib/INI_ADC.s index b48bdc8..f061619 100644 --- a/lib/INI_ADC.s +++ b/lib/INI_ADC.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_ADC.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro ADC +; FILE : INI_ADC.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro ADC ; ; Analog to Digital Converter (ADC) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_AES.s b/lib/INI_AES.s index 75e4ab8..eca9da2 100644 --- a/lib/INI_AES.s +++ b/lib/INI_AES.s @@ -1,13 +1,15 @@ ;******************************************************************************** -; SOUBOR : INI_AES.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro AES (crypto); +; FILE : INI_AES.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro AES (crypto); ; ! Modul je pouze v STM32L162 ! ; ; Advanced Encryption Standard (AES) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_BASE.s b/lib/INI_BASE.s index 984bfc0..3d5be38 100644 --- a/lib/INI_BASE.s +++ b/lib/INI_BASE.s @@ -1,11 +1,13 @@ ;******************************************************************************** -; SOUBOR : INI_BASE.S -; AUTOR : Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Zakladni soubor knihovny. Musi byt includovat pred vsemi ostatnimi. +; FILE : INI_BASE.S +; AUTHOR : Ondrej Hruska +; DATE : 10/2015 +; DESCR : 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. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_COMP.s b/lib/INI_COMP.s index bdcffc4..f579eb3 100644 --- a/lib/INI_COMP.s +++ b/lib/INI_COMP.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_COMP.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro COMP (analogovy komparator) +; FILE : INI_COMP.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro COMP (analogovy komparator) ; ; Analog Comparators (COMP) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_CRC.s b/lib/INI_CRC.s index 1758e77..12dfb54 100644 --- a/lib/INI_CRC.s +++ b/lib/INI_CRC.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_CRC.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro CRC (checksum generator) +; FILE : INI_CRC.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro CRC (checksum generator) ; ; CRC calculation unit (CRC) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_DAC.s b/lib/INI_DAC.s index fec017c..99a4427 100644 --- a/lib/INI_DAC.s +++ b/lib/INI_DAC.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_DAC.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro DAC (digitalne-analogovy prevodnik) +; FILE : INI_DAC.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro DAC (digitalne-analogovy prevodnik) ; ; Digital to Analog Converter (DAC) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_DBGMCU.s b/lib/INI_DBGMCU.s index ad633fb..aeaf0f3 100644 --- a/lib/INI_DBGMCU.s +++ b/lib/INI_DBGMCU.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_DBGMCU.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro DBGMCU (Debug MCU control) +; FILE : INI_DBGMCU.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro DBGMCU (Debug MCU control) ; ; Debug MCU (DBGMCU) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_DMA.s b/lib/INI_DMA.s index 217b5da..b7c5923 100644 --- a/lib/INI_DMA.s +++ b/lib/INI_DMA.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_DMA.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro DMA (Direct memory access) +; FILE : INI_DMA.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro DMA (Direct memory access) ; ; DMA Controller (DMA) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_EXTI.s b/lib/INI_EXTI.s index c98b43f..431ec18 100644 --- a/lib/INI_EXTI.s +++ b/lib/INI_EXTI.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_EXTI.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro EXTI (ext. interrupt) +; FILE : INI_EXTI.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro EXTI (ext. interrupt) ; ; External Interrupt/Event Controller (EXTI) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** ;**************************************************************************** diff --git a/lib/INI_FLASH.s b/lib/INI_FLASH.s index 10decb3..47b2d8f 100644 --- a/lib/INI_FLASH.s +++ b/lib/INI_FLASH.s @@ -1,13 +1,15 @@ ;******************************************************************************** -; SOUBOR : INI_FLASH.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro FLASH +; FILE : INI_FLASH.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro FLASH ; ; FLASH, DATA EEPROM and Option Bytes Registers ; (FLASH, DATA_EEPROM, OB) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_FSMC.s b/lib/INI_FSMC.s index 6f992cc..ec118dc 100644 --- a/lib/INI_FSMC.s +++ b/lib/INI_FSMC.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_FSMC.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro FSMC (ext. memory communication) +; FILE : INI_FSMC.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro FSMC (ext. memory communication) ; ; Flexible Static Memory Controller ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_GPIO.s b/lib/INI_GPIO.s index 513a59a..d9bbd09 100644 --- a/lib/INI_GPIO.s +++ b/lib/INI_GPIO.s @@ -1,11 +1,13 @@ ;**************************************************************************** -; SOUBOR : INI_GPIO.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 +; FILE : INI_GPIO.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 ; ; General Purpose IOs (GPIO) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;**************************************************************************** diff --git a/lib/INI_I2C.s b/lib/INI_I2C.s index f0a7333..14671d8 100644 --- a/lib/INI_I2C.s +++ b/lib/INI_I2C.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_I2C.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro I2C +; FILE : INI_I2C.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro I2C ; ; Inter-integrated Circuit Interface (I2C) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_LCD.s b/lib/INI_LCD.s index 57d6fda..ae885eb 100644 --- a/lib/INI_LCD.s +++ b/lib/INI_LCD.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_LCD.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro LCD +; FILE : INI_LCD.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro LCD ; ; LCD Controller (LCD) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_NVIC.s b/lib/INI_NVIC.s index 45e043f..ed4fa7e 100644 --- a/lib/INI_NVIC.s +++ b/lib/INI_NVIC.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_NVIC.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro NVIC (system preruseni) +; FILE : INI_NVIC.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro NVIC (system preruseni) ; ; Nested Vectored Interrupt Controller (NVIC) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_OPAMP.s b/lib/INI_OPAMP.s index 07c839a..12b971c 100644 --- a/lib/INI_OPAMP.s +++ b/lib/INI_OPAMP.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_OPAMP.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro OPAMP +; FILE : INI_OPAMP.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro OPAMP ; ; Operational Amplifier (OPAMP) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_PWR.s b/lib/INI_PWR.s index edd7938..8dcbcd4 100644 --- a/lib/INI_PWR.s +++ b/lib/INI_PWR.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_PWR.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro PWR (napajeni, sleep...) +; FILE : INI_PWR.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro PWR (napajeni, sleep...) ; ; Power Control (PWR) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_RCC.s b/lib/INI_RCC.s index 1df3c8b..c49d83c 100644 --- a/lib/INI_RCC.s +++ b/lib/INI_RCC.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_RCC.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro RCC (nastaveni hodin) +; FILE : INI_RCC.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro RCC (nastaveni hodin) ; ; Reset and Clock Control (RCC) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** ;**************************************************************************** diff --git a/lib/INI_RI.s b/lib/INI_RI.s index e7a7610..89237ec 100644 --- a/lib/INI_RI.s +++ b/lib/INI_RI.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_RI.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro RI (analogove propojky) +; FILE : INI_RI.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro RI (analogove propojky) ; ; Routing Interface (RI) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_RTC.s b/lib/INI_RTC.s index 9f7e300..c6cca46 100644 --- a/lib/INI_RTC.s +++ b/lib/INI_RTC.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_RTC.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro RTC (obvod realneho casu) +; FILE : INI_RTC.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro RTC (obvod realneho casu) ; ; Real-Time Clock (RTC) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_SCB.s b/lib/INI_SCB.s index e0e80a5..d0c1865 100644 --- a/lib/INI_SCB.s +++ b/lib/INI_SCB.s @@ -1,11 +1,13 @@ ;**************************************************************************** -; SOUBOR : INI_SCB.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 +; FILE : INI_SCB.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 ; System Control Block (SCB) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;**************************************************************************** diff --git a/lib/INI_SDIO.s b/lib/INI_SDIO.s index d9ea393..42f7435 100644 --- a/lib/INI_SDIO.s +++ b/lib/INI_SDIO.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_SDIO.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro SDIO +; FILE : INI_SDIO.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro SDIO ; ; SD host Interface ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_SPI.s b/lib/INI_SPI.s index a046237..c04aebd 100644 --- a/lib/INI_SPI.s +++ b/lib/INI_SPI.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_SPI.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro SPI +; FILE : INI_SPI.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro SPI ; ; Serial Peripheral Interface (SPI) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_SYSCFG.s b/lib/INI_SYSCFG.s index d946e5a..cc7b0e2 100644 --- a/lib/INI_SYSCFG.s +++ b/lib/INI_SYSCFG.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_SYSCFG.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro SYSCFG (EXTI routing atd.) +; FILE : INI_SYSCFG.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro SYSCFG (EXTI routing atd.) ; ; System Configuration (SYSCFG) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_SYSTICK.s b/lib/INI_SYSTICK.s index 334e96d..2165dab 100644 --- a/lib/INI_SYSTICK.s +++ b/lib/INI_SYSTICK.s @@ -1,11 +1,13 @@ ;**************************************************************************** -; SOUBOR : INI_SYSTICK.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 +; FILE : INI_SYSTICK.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 ; ; System Timer (SysTick) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;**************************************************************************** diff --git a/lib/INI_TIM.s b/lib/INI_TIM.s index 313f5a1..453f39e 100644 --- a/lib/INI_TIM.s +++ b/lib/INI_TIM.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_TIM.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro TIM (casovace) +; FILE : INI_TIM.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro TIM (casovace) ; ; Timers (TIM) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_USART.s b/lib/INI_USART.s index 2c86002..a82e7c2 100644 --- a/lib/INI_USART.s +++ b/lib/INI_USART.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_USART.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro USART +; FILE : INI_USART.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro USART ; ; Universal Synchronous Asynchronous Receiver Transmitter (USART) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_USB.s b/lib/INI_USB.s index 7a48631..6d91d03 100644 --- a/lib/INI_USB.s +++ b/lib/INI_USB.s @@ -1,12 +1,14 @@ ;******************************************************************************** -; SOUBOR : INI_USB.S -; AUTOR : Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro USB +; FILE : INI_USB.S +; AUTHOR : Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro USB ; ; Universal Serial Bus (USB) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/lib/INI_WDG.s b/lib/INI_WDG.s index 58af638..3d4b53d 100644 --- a/lib/INI_WDG.s +++ b/lib/INI_WDG.s @@ -1,14 +1,16 @@ ;******************************************************************************** -; SOUBOR : INI_WWDG.S -; AUTOR : Petr Dousa, Ondrej Hruska -; DATUM : 10/2015 -; POPIS : Bitove masky ridicich registru pro WWDG +; FILE : INI_WWDG.S +; AUTHOR : Petr Dousa, Ondrej Hruska +; DATE : 10/2015 +; DESCR : Bitove masky ridicich registru pro WWDG ; ; Window WATCHDOG (WWDG) ; ; Independent WATCHDOG (IWDG) ; -; Toto je soucast knihovny pro STM32L100 vyvijene na Katedre mereni FEL CVUT. +; Part of an assembler library for STM32L100, based on the STM32 CMSIS. +; Developed for educational purposes at the Department of Measure of CTU in Prague. +; See the LICENSE file for detailed terms of use. ;******************************************************************************** diff --git a/main.asm b/main.asm index 9bca06b..09df457 100644 --- a/main.asm +++ b/main.asm @@ -1,11 +1,10 @@ ;*************************************************************************************************** ;* -;* Misto : CVUT FEL, Katedra Mereni -;* Prednasejici : Doc. Ing. Jan Fischer,CSc. -;* Predmet : A4M38AVS, A4B38NVS -;* Vyvojovy Kit : STM32L100 DISCOVERY (STM32L100RC) -;* Datum : 12/2010, 10/2015 -;* Autor : Michal TOMAS (2010), Ondrej Hruska (2015) +;* Place : CVUT FEL, Katedra Mereni +;* Lecturer : Doc. Ing. Jan Fischer,CSc. +;* Subject : A4M38AVS, A4B38NVS +;* Development kit : STM32L100 DISCOVERY (STM32L100RC) +;* Authors : Michal TOMAS (2010), Ondrej Hruska (2015) ;* ;*************************************************************************************************** @@ -14,25 +13,25 @@ ;* Include library files ;*************************************************************************************************** - ; Base library file - GET lib/INI_BASE.s + ; Base library file + GET lib/INI_BASE.s - ; Peripheral modules - GET lib/INI_GPIO.s - GET lib/INI_SYSTICK.s - GET lib/INI_RCC.s - GET lib/INI_FLASH.s + ; Peripheral modules + GET lib/INI_GPIO.s + GET lib/INI_SYSTICK.s + GET lib/INI_RCC.s + GET lib/INI_FLASH.s ;*************************************************************************************************** ;* Start program AREA and pass compiler flags to the startup script... ;*************************************************************************************************** - AREA MAIN, CODE, READONLY + AREA MAIN, CODE, READONLY ; This is a compiler flag imported by the startup script. __use_two_region_memory - EXPORT __use_two_region_memory + EXPORT __use_two_region_memory ;*************************************************************************************************** @@ -41,13 +40,14 @@ __use_two_region_memory ;* Called by the startup script before calling __main ;*************************************************************************************************** -SystemInit - EXPORT SystemInit ; Export the address to startup script +SystemInit PROC + EXPORT SystemInit ; Export the address to startup script PUSH {LR} - BL RCC_CNF ; Configure clock sources - BL GPIO_CNF ; Configure GPIO power and pin settings - BL SYSTICK_CNF ; Configure SysTick timer + BL RCC_CNF ; Configure clock sources + BL GPIO_CNF ; Configure GPIO power and pin settings + BL SYSTICK_CNF ; Configure SysTick timer POP {PC} + ENDP @@ -55,8 +55,8 @@ SystemInit ;* Interrupt handlers... ;*************************************************************************************************** -SysTick_Handler - EXPORT SysTick_Handler ; Export the address to startup script (replaces a WEAK stub) +SysTick_Handler PROC + EXPORT SysTick_Handler ; Export the address to startup script (replaces a WEAK stub) PUSH {LR} ; Toggle the PC8 LED (bit-banding access) @@ -72,6 +72,7 @@ SysTick_Handler ; STR R1, [R0] POP {PC} + ENDP @@ -82,14 +83,11 @@ SysTick_Handler ;* __main is called only once, and does not return! ;*************************************************************************************************** -__main - EXPORT __main ; Export the address to startup script - ENTRY ; Marks the program entry point (shouldnt be here) - - -LOOP ; Main loop +__main PROC + EXPORT __main ; Export the address to startup script +LOOP ; Main loop ; turn LED on - LDR R0, =BB_GPIOC_ODR_8 ; bit-banding address + LDR R0, =BB_GPIOC_ODR_8 ; bit-banding address MOV R1, #1 STR R1, [R0] @@ -107,6 +105,7 @@ LOOP ; Main loop BL DELAY B LOOP + ENDP @@ -116,11 +115,11 @@ LOOP ; Main loop ;* Sets PC08 and PC09 as outputs, PA0 as input. ;************************************************************************************************** -GPIO_CNF +GPIO_CNF PROC PUSH {R0,R1,LR} ; Enable GPIO peripheral timing - LDR R0, =RCC_AHBENR ; Advanced High-speed Bus ENable Register + LDR R0, =RCC_AHBENR ; Advanced High-speed Bus ENable Register LDR R1, [R0] LDR R2, =(RCC_AHBENR_GPIOAEN :OR: RCC_AHBENR_GPIOCEN) ORR R1, R1, R2 @@ -129,9 +128,9 @@ GPIO_CNF ; Output pins C8, C9 LDR R0, =GPIOC_MODER LDR R1, [R0] - ; Clear the area we'll write to + ; Clear the area we'll write to BIC R1,R1, #(GPIO_MODER_8 :OR: GPIO_MODER_9) - ; Write "OUTPUT" pattern (0x5555...) masked to the two bits + ; Write "OUTPUT" pattern (0x5555...) masked to the two bits ORR R1,R1, #(GPIO_MODER_8 :OR: GPIO_MODER_9) & GPIO_MODER_OUTPUT STR R1, [R0] @@ -139,10 +138,12 @@ GPIO_CNF LDR R0, =GPIOA_MODER LDR R1, [R0] BIC R1,R1, #GPIO_MODER_0 - ORR R1,R1, #(GPIO_MODER_0 & GPIO_MODER_INPUT); Write the "input" pattern into the bit config area + ; Write the "input" pattern into the bit config area + ORR R1,R1, #(GPIO_MODER_0 & GPIO_MODER_INPUT) STR R1, [R0] POP {R0,R1,PC} + ENDP @@ -152,7 +153,7 @@ GPIO_CNF ;* Configures SysTick to fire a SysTick interrupt at 1 Hz ;************************************************************************************************** -SYSTICK_CNF +SYSTICK_CNF PROC PUSH {R0, R1, LR} ; Use the core clock (undivided) @@ -176,6 +177,7 @@ SYSTICK_CNF STR R1, [R0] POP {R0, R1, PC} + ENDP @@ -185,30 +187,31 @@ SYSTICK_CNF ;* Inputs: R0 = number of loop cycles ;************************************************************************************************** -DELAY - PUSH {R2, LR} ; Push the changed registers & link register +DELAY PROC + PUSH {R2, LR} ; Push the changed registers & link register WAIT_OUTER ; Outer loop - LDR R2, =40000 ; Length of inner loop + LDR R2, =40000 ; Length of inner loop ; Inner loop -WAIT_INNER SUBS R2, R2, #1 ; Decrement INNER loop counter - BNE WAIT_INNER ; Continue the loop if not done +WAIT_INNER SUBS R2, R2, #1 ; Decrement INNER loop counter + BNE WAIT_INNER ; Continue the loop if not done - SUBS R0, R0, #1 ; Decrement OUTER loop counter - BNE WAIT_OUTER ; Continue the loop if not done + SUBS R0, R0, #1 ; Decrement OUTER loop counter + BNE WAIT_OUTER ; Continue the loop if not done - POP {R2, PC} ; Pop & return + POP {R2, PC} ; Pop & return + ENDP ;*************************************************************************************************** -;* Konfigurace systemovych hodin a hodin periferii +;* Clock configuration ;* -;* Nastavi hodiny na HSI 16 MHz +;* Set clock speed to 16 MHz ;************************************************************************************************** -RCC_CNF +RCC_CNF PROC PUSH {R0, R1, LR} ; Flash timing configuration @@ -221,26 +224,14 @@ RCC_CNF ORR R1, R1, #(FLASH_ACR_PRFTEN :OR: FLASH_ACR_LATENCY) STR R1, [R0] - ; Nastavit hodinove vstupy - LDR R0, =RCC_CR - - ; Additional RCC_CR config -; LDR R1, [R0] -; LDR R2, =RCC_CR_RTCPRE ; clear RTC prescaler -; BIC R1, R1, R2 -; ; HseByp allows to use external clock source with HSEON -; LDR R2, =(RCC_CR_RTCPRE_DIV2 :OR: RCC_CR_HSEBYP) -; ORR R1, R1, R2 -; STR R1, [R0] - ; Power on HSI (runs from MSI on start) + LDR R0, =RCC_CR LDR R1, [R0] ORR R1, R1, #RCC_CR_HSION STR R1, [R0] ; Wait for HSIRDY - ALIGN NO_HSI_RDY LDR R1, [R0] TST R1, #RCC_CR_HSIRDY BEQ NO_HSI_RDY @@ -254,9 +245,10 @@ NO_HSI_RDY LDR R1, [R0] STR R1, [R0] POP {R0, R1, PC} + ENDP ;************************************************************************************************** - ALIGN ; Adds NOP if needed to complete a 32-bit word + ALIGN ; Adds NOP if needed to complete a 32-bit word END