mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
AnnaBridge
Date:
Wed Jun 21 17:31:38 2017 +0100
Revision:
145:64910690c574
Parent:
132:9baf128c2fab
Child:
153:b484a57bc302
Release 145 of the mbed library.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 128:9bcdf88f62b0 1 /**
<> 128:9bcdf88f62b0 2 ******************************************************************************
<> 128:9bcdf88f62b0 3 * @file hal_tick.h
<> 128:9bcdf88f62b0 4 * @author MCD Application Team
<> 128:9bcdf88f62b0 5 * @brief Initialization of HAL tick
<> 128:9bcdf88f62b0 6 ******************************************************************************
<> 128:9bcdf88f62b0 7 * @attention
<> 128:9bcdf88f62b0 8 *
<> 128:9bcdf88f62b0 9 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
<> 128:9bcdf88f62b0 10 *
<> 128:9bcdf88f62b0 11 * Redistribution and use in source and binary forms, with or without modification,
<> 128:9bcdf88f62b0 12 * are permitted provided that the following conditions are met:
<> 128:9bcdf88f62b0 13 * 1. Redistributions of source code must retain the above copyright notice,
<> 128:9bcdf88f62b0 14 * this list of conditions and the following disclaimer.
<> 128:9bcdf88f62b0 15 * 2. Redistributions in binary form must reproduce the above copyright notice,
<> 128:9bcdf88f62b0 16 * this list of conditions and the following disclaimer in the documentation
<> 128:9bcdf88f62b0 17 * and/or other materials provided with the distribution.
<> 128:9bcdf88f62b0 18 * 3. Neither the name of STMicroelectronics nor the names of its contributors
<> 128:9bcdf88f62b0 19 * may be used to endorse or promote products derived from this software
<> 128:9bcdf88f62b0 20 * without specific prior written permission.
<> 128:9bcdf88f62b0 21 *
<> 128:9bcdf88f62b0 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
<> 128:9bcdf88f62b0 23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
<> 128:9bcdf88f62b0 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
<> 128:9bcdf88f62b0 25 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
<> 128:9bcdf88f62b0 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
<> 128:9bcdf88f62b0 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
<> 128:9bcdf88f62b0 28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
<> 128:9bcdf88f62b0 29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
<> 128:9bcdf88f62b0 30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
<> 128:9bcdf88f62b0 31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<> 128:9bcdf88f62b0 32 *
<> 128:9bcdf88f62b0 33 ******************************************************************************
<> 128:9bcdf88f62b0 34 */
<> 128:9bcdf88f62b0 35 #ifndef __HAL_TICK_H
<> 128:9bcdf88f62b0 36 #define __HAL_TICK_H
<> 128:9bcdf88f62b0 37
<> 128:9bcdf88f62b0 38 #ifdef __cplusplus
<> 128:9bcdf88f62b0 39 extern "C" {
<> 128:9bcdf88f62b0 40 #endif
<> 128:9bcdf88f62b0 41
<> 128:9bcdf88f62b0 42 #include "stm32f0xx.h"
AnnaBridge 145:64910690c574 43 #include "stm32f0xx_ll_tim.h"
<> 128:9bcdf88f62b0 44 #include "cmsis_nvic.h"
<> 128:9bcdf88f62b0 45
<> 128:9bcdf88f62b0 46 #define TIM_MST TIM1
<> 128:9bcdf88f62b0 47 #define TIM_MST_UP_IRQ TIM1_BRK_UP_TRG_COM_IRQn
<> 128:9bcdf88f62b0 48 #define TIM_MST_OC_IRQ TIM1_CC_IRQn
<> 128:9bcdf88f62b0 49 #define TIM_MST_RCC __TIM1_CLK_ENABLE()
<> 128:9bcdf88f62b0 50
<> 128:9bcdf88f62b0 51 #define TIM_MST_RESET_ON __TIM1_FORCE_RESET()
<> 128:9bcdf88f62b0 52 #define TIM_MST_RESET_OFF __TIM1_RELEASE_RESET()
<> 128:9bcdf88f62b0 53
<> 132:9baf128c2fab 54 #define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer
<> 132:9baf128c2fab 55
<> 132:9baf128c2fab 56 #define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2)
<> 132:9baf128c2fab 57
<> 128:9bcdf88f62b0 58 #define HAL_TICK_DELAY (1000) // 1 ms
<> 128:9bcdf88f62b0 59
<> 128:9bcdf88f62b0 60 #ifdef __cplusplus
<> 128:9bcdf88f62b0 61 }
<> 128:9bcdf88f62b0 62 #endif
<> 128:9bcdf88f62b0 63
<> 128:9bcdf88f62b0 64 #endif // __HAL_TICK_H
<> 128:9bcdf88f62b0 65
<> 128:9bcdf88f62b0 66 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/