Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
bogdanm
Date:
Thu Nov 27 13:33:22 2014 +0000
Revision:
92:4fc01daae5a5
Parent:
89:552587b429a1
Child:
99:dbbf35b96557
Release 92 of the mbed libray

Main changes:

- nRF51822: fixed pin assignment issues
- ST targets moving to the STM32Cube driver
- LPC1439: fixed serial interrupt issue
- first Cortex-A platform supported in mbed (RZ_A1H)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 89:552587b429a1 1 /**
bogdanm 89:552587b429a1 2 ******************************************************************************
bogdanm 89:552587b429a1 3 * @file stm32f4xx_hal_tim_ex.h
bogdanm 89:552587b429a1 4 * @author MCD Application Team
bogdanm 92:4fc01daae5a5 5 * @version V1.1.0
bogdanm 92:4fc01daae5a5 6 * @date 19-June-2014
bogdanm 89:552587b429a1 7 * @brief Header file of TIM HAL Extension module.
bogdanm 89:552587b429a1 8 ******************************************************************************
bogdanm 89:552587b429a1 9 * @attention
bogdanm 89:552587b429a1 10 *
bogdanm 89:552587b429a1 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
bogdanm 89:552587b429a1 12 *
bogdanm 89:552587b429a1 13 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 89:552587b429a1 14 * are permitted provided that the following conditions are met:
bogdanm 89:552587b429a1 15 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 89:552587b429a1 16 * this list of conditions and the following disclaimer.
bogdanm 89:552587b429a1 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 89:552587b429a1 18 * this list of conditions and the following disclaimer in the documentation
bogdanm 89:552587b429a1 19 * and/or other materials provided with the distribution.
bogdanm 89:552587b429a1 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 89:552587b429a1 21 * may be used to endorse or promote products derived from this software
bogdanm 89:552587b429a1 22 * without specific prior written permission.
bogdanm 89:552587b429a1 23 *
bogdanm 89:552587b429a1 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 89:552587b429a1 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 89:552587b429a1 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 89:552587b429a1 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 89:552587b429a1 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 89:552587b429a1 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 89:552587b429a1 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 89:552587b429a1 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 89:552587b429a1 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 89:552587b429a1 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 89:552587b429a1 34 *
bogdanm 89:552587b429a1 35 ******************************************************************************
bogdanm 89:552587b429a1 36 */
bogdanm 89:552587b429a1 37
bogdanm 89:552587b429a1 38 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 89:552587b429a1 39 #ifndef __STM32F4xx_HAL_TIM_EX_H
bogdanm 89:552587b429a1 40 #define __STM32F4xx_HAL_TIM_EX_H
bogdanm 89:552587b429a1 41
bogdanm 89:552587b429a1 42 #ifdef __cplusplus
bogdanm 89:552587b429a1 43 extern "C" {
bogdanm 89:552587b429a1 44 #endif
bogdanm 89:552587b429a1 45
bogdanm 89:552587b429a1 46 /* Includes ------------------------------------------------------------------*/
bogdanm 89:552587b429a1 47 #include "stm32f4xx_hal_def.h"
bogdanm 89:552587b429a1 48
bogdanm 89:552587b429a1 49 /** @addtogroup STM32F4xx_HAL
bogdanm 89:552587b429a1 50 * @{
bogdanm 89:552587b429a1 51 */
bogdanm 89:552587b429a1 52
bogdanm 89:552587b429a1 53 /** @addtogroup TIMEx
bogdanm 89:552587b429a1 54 * @{
bogdanm 89:552587b429a1 55 */
bogdanm 89:552587b429a1 56
bogdanm 89:552587b429a1 57 /* Exported types ------------------------------------------------------------*/
bogdanm 89:552587b429a1 58
bogdanm 89:552587b429a1 59 /**
bogdanm 89:552587b429a1 60 * @brief TIM Hall sensor Configuration Structure definition
bogdanm 89:552587b429a1 61 */
bogdanm 89:552587b429a1 62
bogdanm 89:552587b429a1 63 typedef struct
bogdanm 89:552587b429a1 64 {
bogdanm 89:552587b429a1 65
bogdanm 89:552587b429a1 66 uint32_t IC1Polarity; /*!< Specifies the active edge of the input signal.
bogdanm 89:552587b429a1 67 This parameter can be a value of @ref TIM_Input_Capture_Polarity */
bogdanm 89:552587b429a1 68
bogdanm 89:552587b429a1 69 uint32_t IC1Prescaler; /*!< Specifies the Input Capture Prescaler.
bogdanm 89:552587b429a1 70 This parameter can be a value of @ref TIM_Input_Capture_Prescaler */
bogdanm 89:552587b429a1 71
bogdanm 89:552587b429a1 72 uint32_t IC1Filter; /*!< Specifies the input capture filter.
bogdanm 89:552587b429a1 73 This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
bogdanm 89:552587b429a1 74 uint32_t Commutation_Delay; /*!< Specifies the pulse value to be loaded into the Capture Compare Register.
bogdanm 89:552587b429a1 75 This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */
bogdanm 89:552587b429a1 76 } TIM_HallSensor_InitTypeDef;
bogdanm 89:552587b429a1 77
bogdanm 89:552587b429a1 78 /**
bogdanm 89:552587b429a1 79 * @brief TIM Master configuration Structure definition
bogdanm 89:552587b429a1 80 */
bogdanm 89:552587b429a1 81 typedef struct {
bogdanm 89:552587b429a1 82 uint32_t MasterOutputTrigger; /*!< Trigger output (TRGO) selection.
bogdanm 92:4fc01daae5a5 83 This parameter can be a value of @ref TIM_Master_Mode_Selection */
bogdanm 89:552587b429a1 84 uint32_t MasterSlaveMode; /*!< Master/slave mode selection.
bogdanm 92:4fc01daae5a5 85 This parameter can be a value of @ref TIM_Master_Slave_Mode */
bogdanm 89:552587b429a1 86 }TIM_MasterConfigTypeDef;
bogdanm 89:552587b429a1 87
bogdanm 89:552587b429a1 88 /**
bogdanm 89:552587b429a1 89 * @brief TIM Break and Dead time configuration Structure definition
bogdanm 89:552587b429a1 90 */
bogdanm 89:552587b429a1 91 typedef struct
bogdanm 89:552587b429a1 92 {
bogdanm 89:552587b429a1 93 uint32_t OffStateRunMode; /*!< TIM off state in run mode.
bogdanm 92:4fc01daae5a5 94 This parameter can be a value of @ref TIM_OSSR_Off_State_Selection_for_Run_mode_state */
bogdanm 89:552587b429a1 95 uint32_t OffStateIDLEMode; /*!< TIM off state in IDLE mode.
bogdanm 92:4fc01daae5a5 96 This parameter can be a value of @ref TIM_OSSI_Off_State_Selection_for_Idle_mode_state */
bogdanm 89:552587b429a1 97 uint32_t LockLevel; /*!< TIM Lock level.
bogdanm 92:4fc01daae5a5 98 This parameter can be a value of @ref TIM_Lock_level */
bogdanm 89:552587b429a1 99 uint32_t DeadTime; /*!< TIM dead Time.
bogdanm 89:552587b429a1 100 This parameter can be a number between Min_Data = 0x00 and Max_Data = 0xFF */
bogdanm 89:552587b429a1 101 uint32_t BreakState; /*!< TIM Break State.
bogdanm 92:4fc01daae5a5 102 This parameter can be a value of @ref TIM_Break_Input_enable_disable */
bogdanm 89:552587b429a1 103 uint32_t BreakPolarity; /*!< TIM Break input polarity.
bogdanm 92:4fc01daae5a5 104 This parameter can be a value of @ref TIM_Break_Polarity */
bogdanm 89:552587b429a1 105 uint32_t AutomaticOutput; /*!< TIM Automatic Output Enable state.
bogdanm 92:4fc01daae5a5 106 This parameter can be a value of @ref TIM_AOE_Bit_Set_Reset */
bogdanm 89:552587b429a1 107 }TIM_BreakDeadTimeConfigTypeDef;
bogdanm 89:552587b429a1 108
bogdanm 89:552587b429a1 109 /* Exported constants --------------------------------------------------------*/
bogdanm 89:552587b429a1 110 /** @defgroup TIMEx_Exported_Constants
bogdanm 89:552587b429a1 111 * @{
bogdanm 89:552587b429a1 112 */
bogdanm 89:552587b429a1 113
bogdanm 89:552587b429a1 114 /** @defgroup TIMEx_Remap
bogdanm 89:552587b429a1 115 * @{
bogdanm 89:552587b429a1 116 */
bogdanm 89:552587b429a1 117
bogdanm 89:552587b429a1 118 #define TIM_TIM2_TIM8_TRGO (0x00000000)
bogdanm 89:552587b429a1 119 #define TIM_TIM2_ETH_PTP (0x00000400)
bogdanm 89:552587b429a1 120 #define TIM_TIM2_USBFS_SOF (0x00000800)
bogdanm 89:552587b429a1 121 #define TIM_TIM2_USBHS_SOF (0x00000C00)
bogdanm 89:552587b429a1 122 #define TIM_TIM5_GPIO (0x00000000)
bogdanm 89:552587b429a1 123 #define TIM_TIM5_LSI (0x00000040)
bogdanm 89:552587b429a1 124 #define TIM_TIM5_LSE (0x00000080)
bogdanm 89:552587b429a1 125 #define TIM_TIM5_RTC (0x000000C0)
bogdanm 89:552587b429a1 126 #define TIM_TIM11_GPIO (0x00000000)
bogdanm 89:552587b429a1 127 #define TIM_TIM11_HSE (0x00000002)
bogdanm 89:552587b429a1 128
bogdanm 89:552587b429a1 129 #define IS_TIM_REMAP(TIM_REMAP) (((TIM_REMAP) == TIM_TIM2_TIM8_TRGO)||\
bogdanm 89:552587b429a1 130 ((TIM_REMAP) == TIM_TIM2_ETH_PTP)||\
bogdanm 89:552587b429a1 131 ((TIM_REMAP) == TIM_TIM2_USBFS_SOF)||\
bogdanm 89:552587b429a1 132 ((TIM_REMAP) == TIM_TIM2_USBHS_SOF)||\
bogdanm 89:552587b429a1 133 ((TIM_REMAP) == TIM_TIM5_GPIO)||\
bogdanm 89:552587b429a1 134 ((TIM_REMAP) == TIM_TIM5_LSI)||\
bogdanm 89:552587b429a1 135 ((TIM_REMAP) == TIM_TIM5_LSE)||\
bogdanm 89:552587b429a1 136 ((TIM_REMAP) == TIM_TIM5_RTC)||\
bogdanm 89:552587b429a1 137 ((TIM_REMAP) == TIM_TIM11_GPIO)||\
bogdanm 89:552587b429a1 138 ((TIM_REMAP) == TIM_TIM11_HSE))
bogdanm 89:552587b429a1 139
bogdanm 89:552587b429a1 140 /**
bogdanm 89:552587b429a1 141 * @}
bogdanm 89:552587b429a1 142 */
bogdanm 89:552587b429a1 143
bogdanm 89:552587b429a1 144 /**
bogdanm 89:552587b429a1 145 * @}
bogdanm 89:552587b429a1 146 */
bogdanm 89:552587b429a1 147
bogdanm 89:552587b429a1 148 /* Exported macro ------------------------------------------------------------*/
bogdanm 89:552587b429a1 149
bogdanm 89:552587b429a1 150 /* Exported functions --------------------------------------------------------*/
bogdanm 89:552587b429a1 151
bogdanm 89:552587b429a1 152 /* Timer Hall Sensor functions **********************************************/
bogdanm 89:552587b429a1 153 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Init(TIM_HandleTypeDef* htim, TIM_HallSensor_InitTypeDef* sConfig);
bogdanm 89:552587b429a1 154 HAL_StatusTypeDef HAL_TIMEx_HallSensor_DeInit(TIM_HandleTypeDef* htim);
bogdanm 89:552587b429a1 155
bogdanm 89:552587b429a1 156 void HAL_TIMEx_HallSensor_MspInit(TIM_HandleTypeDef* htim);
bogdanm 89:552587b429a1 157 void HAL_TIMEx_HallSensor_MspDeInit(TIM_HandleTypeDef* htim);
bogdanm 89:552587b429a1 158
bogdanm 89:552587b429a1 159 /* Blocking mode: Polling */
bogdanm 89:552587b429a1 160 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start(TIM_HandleTypeDef* htim);
bogdanm 89:552587b429a1 161 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop(TIM_HandleTypeDef* htim);
bogdanm 89:552587b429a1 162 /* Non-Blocking mode: Interrupt */
bogdanm 89:552587b429a1 163 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_IT(TIM_HandleTypeDef* htim);
bogdanm 89:552587b429a1 164 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_IT(TIM_HandleTypeDef* htim);
bogdanm 89:552587b429a1 165 /* Non-Blocking mode: DMA */
bogdanm 89:552587b429a1 166 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef* htim, uint32_t *pData, uint16_t Length);
bogdanm 89:552587b429a1 167 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef* htim);
bogdanm 89:552587b429a1 168
bogdanm 89:552587b429a1 169 /* Timer Complementary Output Compare functions *****************************/
bogdanm 89:552587b429a1 170 /* Blocking mode: Polling */
bogdanm 89:552587b429a1 171 HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 89:552587b429a1 172 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 89:552587b429a1 173
bogdanm 89:552587b429a1 174 /* Non-Blocking mode: Interrupt */
bogdanm 89:552587b429a1 175 HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 89:552587b429a1 176 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 89:552587b429a1 177
bogdanm 89:552587b429a1 178 /* Non-Blocking mode: DMA */
bogdanm 89:552587b429a1 179 HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef* htim, uint32_t Channel, uint32_t *pData, uint16_t Length);
bogdanm 89:552587b429a1 180 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 89:552587b429a1 181
bogdanm 89:552587b429a1 182 /* Timer Complementary PWM functions ****************************************/
bogdanm 89:552587b429a1 183 /* Blocking mode: Polling */
bogdanm 89:552587b429a1 184 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 89:552587b429a1 185 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 89:552587b429a1 186
bogdanm 89:552587b429a1 187 /* Non-Blocking mode: Interrupt */
bogdanm 89:552587b429a1 188 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 89:552587b429a1 189 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 89:552587b429a1 190 /* Non-Blocking mode: DMA */
bogdanm 89:552587b429a1 191 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef* htim, uint32_t Channel, uint32_t *pData, uint16_t Length);
bogdanm 89:552587b429a1 192 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 89:552587b429a1 193
bogdanm 89:552587b429a1 194 /* Timer Complementary One Pulse functions **********************************/
bogdanm 89:552587b429a1 195 /* Blocking mode: Polling */
bogdanm 89:552587b429a1 196 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef* htim, uint32_t OutputChannel);
bogdanm 89:552587b429a1 197 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef* htim, uint32_t OutputChannel);
bogdanm 89:552587b429a1 198
bogdanm 89:552587b429a1 199 /* Non-Blocking mode: Interrupt */
bogdanm 89:552587b429a1 200 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef* htim, uint32_t OutputChannel);
bogdanm 89:552587b429a1 201 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t OutputChannel);
bogdanm 89:552587b429a1 202
bogdanm 89:552587b429a1 203 /* Extnsion Control functions ************************************************/
bogdanm 89:552587b429a1 204 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource);
bogdanm 89:552587b429a1 205 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_IT(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource);
bogdanm 89:552587b429a1 206 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_DMA(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource);
bogdanm 89:552587b429a1 207 HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef* htim, TIM_MasterConfigTypeDef * sMasterConfig);
bogdanm 89:552587b429a1 208 HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef* htim, TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig);
bogdanm 89:552587b429a1 209 HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef* htim, uint32_t Remap);
bogdanm 89:552587b429a1 210
bogdanm 89:552587b429a1 211 /* Extension Callback *********************************************************/
bogdanm 89:552587b429a1 212 void HAL_TIMEx_CommutationCallback(TIM_HandleTypeDef* htim);
bogdanm 89:552587b429a1 213 void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef* htim);
bogdanm 89:552587b429a1 214 void HAL_TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma);
bogdanm 89:552587b429a1 215
bogdanm 89:552587b429a1 216 /* Extension Peripheral State functions **************************************/
bogdanm 89:552587b429a1 217 HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(TIM_HandleTypeDef* htim);
bogdanm 89:552587b429a1 218
bogdanm 89:552587b429a1 219 /**
bogdanm 89:552587b429a1 220 * @}
bogdanm 89:552587b429a1 221 */
bogdanm 89:552587b429a1 222
bogdanm 89:552587b429a1 223 /**
bogdanm 89:552587b429a1 224 * @}
bogdanm 89:552587b429a1 225 */
bogdanm 89:552587b429a1 226
bogdanm 89:552587b429a1 227 #ifdef __cplusplus
bogdanm 89:552587b429a1 228 }
bogdanm 89:552587b429a1 229 #endif
bogdanm 89:552587b429a1 230
bogdanm 89:552587b429a1 231 #endif /* __STM32F4xx_HAL_TIM_EX_H */
bogdanm 89:552587b429a1 232
bogdanm 89:552587b429a1 233 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/