Initial commit

Dependencies:   FastPWM

Committer:
lypinator
Date:
Wed Sep 16 01:11:49 2020 +0000
Revision:
0:bb348c97df44
Added PWM

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lypinator 0:bb348c97df44 1 /*
lypinator 0:bb348c97df44 2 * Copyright (c) 2015-2015, ARM Limited, All Rights Reserved
lypinator 0:bb348c97df44 3 * SPDX-License-Identifier: Apache-2.0
lypinator 0:bb348c97df44 4 *
lypinator 0:bb348c97df44 5 * Licensed under the Apache License, Version 2.0 (the "License"); you may
lypinator 0:bb348c97df44 6 * not use this file except in compliance with the License.
lypinator 0:bb348c97df44 7 * You may obtain a copy of the License at
lypinator 0:bb348c97df44 8 *
lypinator 0:bb348c97df44 9 * http://www.apache.org/licenses/LICENSE-2.0
lypinator 0:bb348c97df44 10 *
lypinator 0:bb348c97df44 11 * Unless required by applicable law or agreed to in writing, software
lypinator 0:bb348c97df44 12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
lypinator 0:bb348c97df44 13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
lypinator 0:bb348c97df44 14 * See the License for the specific language governing permissions and
lypinator 0:bb348c97df44 15 * limitations under the License.
lypinator 0:bb348c97df44 16 */
lypinator 0:bb348c97df44 17 #include "stm32f4xx.h"
lypinator 0:bb348c97df44 18 #include "nvic_addr.h"
lypinator 0:bb348c97df44 19
lypinator 0:bb348c97df44 20 /*!< Uncomment the following line if you need to relocate your vector Table in
lypinator 0:bb348c97df44 21 Internal SRAM. */
lypinator 0:bb348c97df44 22 /* note: if uVisor is present the definition must go in system_init_pre.c */
lypinator 0:bb348c97df44 23 /* #define VECT_TAB_SRAM */
lypinator 0:bb348c97df44 24 #define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field.
lypinator 0:bb348c97df44 25 This value must be a multiple of 0x200. */
lypinator 0:bb348c97df44 26
lypinator 0:bb348c97df44 27 /* this function is needed to peform hardware initialization that must happen
lypinator 0:bb348c97df44 28 * before the uVisor; the whole SystemInit function for the STM32F4 cannot be
lypinator 0:bb348c97df44 29 * put here as it depends on some APIs that need uVisor to be enabled */
lypinator 0:bb348c97df44 30 void SystemInitPre(void)
lypinator 0:bb348c97df44 31 {
lypinator 0:bb348c97df44 32 /* FPU settings ------------------------------------------------------------*/
lypinator 0:bb348c97df44 33 #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
lypinator 0:bb348c97df44 34 SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */
lypinator 0:bb348c97df44 35 #endif
lypinator 0:bb348c97df44 36
lypinator 0:bb348c97df44 37 /* Configure the Vector Table location add offset address ------------------*/
lypinator 0:bb348c97df44 38 #ifdef VECT_TAB_SRAM
lypinator 0:bb348c97df44 39 SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
lypinator 0:bb348c97df44 40 #else
lypinator 0:bb348c97df44 41 SCB->VTOR = NVIC_FLASH_VECTOR_ADDRESS; /* Vector Table Relocation in Internal FLASH */
lypinator 0:bb348c97df44 42 #endif
lypinator 0:bb348c97df44 43 }