inport from local
Dependents: Hobbyking_Cheetah_0511
targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F446xE/device/hal_tick.h@0:85b3fd62ea1a, 2020-03-16 (annotated)
- Committer:
- NYX
- Date:
- Mon Mar 16 06:35:48 2020 +0000
- Revision:
- 0:85b3fd62ea1a
reinport to mbed;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
NYX | 0:85b3fd62ea1a | 1 | /** |
NYX | 0:85b3fd62ea1a | 2 | ****************************************************************************** |
NYX | 0:85b3fd62ea1a | 3 | * @file hal_tick.h |
NYX | 0:85b3fd62ea1a | 4 | * @author MCD Application Team |
NYX | 0:85b3fd62ea1a | 5 | * @brief Initialization of HAL tick |
NYX | 0:85b3fd62ea1a | 6 | ****************************************************************************** |
NYX | 0:85b3fd62ea1a | 7 | * @attention |
NYX | 0:85b3fd62ea1a | 8 | * |
NYX | 0:85b3fd62ea1a | 9 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
NYX | 0:85b3fd62ea1a | 10 | * |
NYX | 0:85b3fd62ea1a | 11 | * Redistribution and use in source and binary forms, with or without modification, |
NYX | 0:85b3fd62ea1a | 12 | * are permitted provided that the following conditions are met: |
NYX | 0:85b3fd62ea1a | 13 | * 1. Redistributions of source code must retain the above copyright notice, |
NYX | 0:85b3fd62ea1a | 14 | * this list of conditions and the following disclaimer. |
NYX | 0:85b3fd62ea1a | 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
NYX | 0:85b3fd62ea1a | 16 | * this list of conditions and the following disclaimer in the documentation |
NYX | 0:85b3fd62ea1a | 17 | * and/or other materials provided with the distribution. |
NYX | 0:85b3fd62ea1a | 18 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
NYX | 0:85b3fd62ea1a | 19 | * may be used to endorse or promote products derived from this software |
NYX | 0:85b3fd62ea1a | 20 | * without specific prior written permission. |
NYX | 0:85b3fd62ea1a | 21 | * |
NYX | 0:85b3fd62ea1a | 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
NYX | 0:85b3fd62ea1a | 23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
NYX | 0:85b3fd62ea1a | 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
NYX | 0:85b3fd62ea1a | 25 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
NYX | 0:85b3fd62ea1a | 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
NYX | 0:85b3fd62ea1a | 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
NYX | 0:85b3fd62ea1a | 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
NYX | 0:85b3fd62ea1a | 29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
NYX | 0:85b3fd62ea1a | 30 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
NYX | 0:85b3fd62ea1a | 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
NYX | 0:85b3fd62ea1a | 32 | * |
NYX | 0:85b3fd62ea1a | 33 | ****************************************************************************** |
NYX | 0:85b3fd62ea1a | 34 | */ |
NYX | 0:85b3fd62ea1a | 35 | #ifndef __HAL_TICK_H |
NYX | 0:85b3fd62ea1a | 36 | #define __HAL_TICK_H |
NYX | 0:85b3fd62ea1a | 37 | |
NYX | 0:85b3fd62ea1a | 38 | #ifdef __cplusplus |
NYX | 0:85b3fd62ea1a | 39 | extern "C" { |
NYX | 0:85b3fd62ea1a | 40 | #endif |
NYX | 0:85b3fd62ea1a | 41 | |
NYX | 0:85b3fd62ea1a | 42 | #include "stm32f4xx.h" |
NYX | 0:85b3fd62ea1a | 43 | #include "stm32f4xx_ll_tim.h" |
NYX | 0:85b3fd62ea1a | 44 | #include "cmsis_nvic.h" |
NYX | 0:85b3fd62ea1a | 45 | |
NYX | 0:85b3fd62ea1a | 46 | #define TIM_MST TIM5 |
NYX | 0:85b3fd62ea1a | 47 | #define TIM_MST_IRQ TIM5_IRQn |
NYX | 0:85b3fd62ea1a | 48 | #define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() |
NYX | 0:85b3fd62ea1a | 49 | #define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() |
NYX | 0:85b3fd62ea1a | 50 | |
NYX | 0:85b3fd62ea1a | 51 | #define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() |
NYX | 0:85b3fd62ea1a | 52 | #define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() |
NYX | 0:85b3fd62ea1a | 53 | |
NYX | 0:85b3fd62ea1a | 54 | #define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer |
NYX | 0:85b3fd62ea1a | 55 | |
NYX | 0:85b3fd62ea1a | 56 | #define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) |
NYX | 0:85b3fd62ea1a | 57 | |
NYX | 0:85b3fd62ea1a | 58 | #define HAL_TICK_DELAY (1000) // 1 ms |
NYX | 0:85b3fd62ea1a | 59 | |
NYX | 0:85b3fd62ea1a | 60 | #ifdef __cplusplus |
NYX | 0:85b3fd62ea1a | 61 | } |
NYX | 0:85b3fd62ea1a | 62 | #endif |
NYX | 0:85b3fd62ea1a | 63 | |
NYX | 0:85b3fd62ea1a | 64 | #endif // __HAL_TICK_H |
NYX | 0:85b3fd62ea1a | 65 | |
NYX | 0:85b3fd62ea1a | 66 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |